Comment # 4 on bug 1204587 from
I modified the extensions Makefile to look at the cwd and for the presence of
defs.h after the link_defs rule shown in comment #3. It indicates the
extensions are built with a cwd of /home/abuild/rpmbuild/BUILD/<crash
base>/extensions/ and the defs.h hardlink is created with permissions usable to
the compiler and from the correct file in <crash base>, the parent directory of
extensions/.

It's the dependency that's failing in the make rule, not the compiler reporting
file not found during compilation. Or to put it another way, attacking
something like the compiler include path won't matter, the compiler was never
started. make finds the source file in extensions, uses a rule to create a
hardlink of defs.h file and at the next rule make reports the defs.h file not
found in the current directory.

Two illustrations:

1. In the crash extensions Makefile at the rule for <extension>.so dependent on
<extension>.c and defs.h I removed defs.h from the dependencies and the package
builds
2. Restored <extension>.so dependent on <extension>.c and defs.h BUT added a
rule for defs.h that uses the rule to hardlink defs.h and the package builds

Item 2 is better since it doesn't reduce dependencies, the whole Makefile with
patch line looks like this (see +defs.h). It will be Tuesday US time when I can
submit this:

#
# Makefile for building crash shared object extensions
#...

CONTRIB_SO := $(patsubst %.c,%.so,$(wildcard *.c))

all: link_defs $(CONTRIB_SO)

link_defs:
    @rm -f defs.h
    @ln ../defs.h

+defs.h: link_defs

$(CONTRIB_SO): %.so: %.c defs.h
    @if [ -f $*.mk ]; then \
        make -f $*.mk; \
    else \
        grep '((constructor))' $*.c > .constructor; \
        if [ -s .constructor ]; then \
            echo "gcc -Wall -g -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET)
$(TARGET_CFLAGS) $(GDB_FLAGS)"; \
            gcc -Wall -g -shared -rdynamic -o $@ $*.c -fPIC -D$(TARGET)
$(TARGET_CFLAGS) $(GDB_FLAGS); \
        fi; \
        if [ ! -s .constructor ]; then \
            echo "gcc -Wall -g -nostartfiles -shared -rdynamic -o $@ $*.c -fPIC
-D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS)"; \
            gcc -Wall -g -nostartfiles -shared -rdynamic -o $@ $*.c -fPIC
-D$(TARGET) $(TARGET_CFLAGS) $(GDB_FLAGS); \
        fi; \
        rm -f .constructor; \
    fi

clean:
    rm -f $(CONTRIB_SO)
    @for MAKEFILE in `grep -sl "^clean:" *.mk`; \
      do make --no-print-directory -f $$MAKEFILE clean; \
    done


You are receiving this mail because: