rhboot / fwupdate

System firmware update support for UEFI machines
99 stars 47 forks source link

fwupdate-11 has parallel make issues #105

Closed Polynomial-C closed 6 years ago

Polynomial-C commented 6 years ago
sed -e "s,@@FWUP_VERSION@@,11,g" \
        -e "s,@@FWUP_MAJOR_VERSION@@,,g" \
        -e "s,@@FWUP_MINOR_VERSION@@,,g" \
        -e "s,@@PREFIX@@,/usr,g" \
        -e "s,@@EXEC_PREFIX@@,/usr,g" \
        -e "s,@@SHAREDSTATEDIR@@,/var/lib,g" \
        -e "s,@@ESPMOUNTPOINT@@,"/boot/efi",g" \
        -e "s,@@EFIDIR@@,gentoo,g" \
        -e "s,@@LIBDIR@@,/usr/lib64,g" \
        -e "s,@@LIBEXECDIR@@,/usr/libexec,g" \
        -e "s,@@INCLUDEDIR@@,/usr/include,g" \
        include/fwup-version.h.in > include/fwup-version.h
In file included from fwupdate.c:23:0:
include/fwup.h:21:10: fatal error: fwup-version.h: No such file or directory
 #include <fwup-version.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [/var/tmp/portage/sys-apps/fwupdate-11/work/fwupdate-11/linux/Makefile:91: fwupdate.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/var/tmp/portage/sys-apps/fwupdate-11/work/fwupdate-11/linux'
make: *** [Makefile:16: all] Error 2

This is with make -j16 on a machine with 16 CPU cores (no hyperthreading). Running make -j1 and the error is gone. fwupdate-10 does not have this issue.

Xiami2012 commented 6 years ago

After digging into it, it seems lacking fwupdate.c : | include/fwup.h causes this.

-> means depends

fwupdate -> libfwup.so fwupdate.o(by %: %.o)

libfwup.so -> libfwup.so.1 -> libfwup.so.1.11 -> libfwup.o
libfwup.o -> libfwup.c -> include/fwup.h -> include/fwup-version.h -> include/fwup-version.h.in

fwupdate.o -> fwupdate.c

We can see there's nothing telling fwupdate.o to build after include/fwup-version.h. Therefore, under make -j16, recipies for fwupdate.o and include/fwup-version.h are in parallel execution. If include/fwup-version.h is made before gcc reads it, everything is fine. Otherwise, fwupdate.o will fail and errmsg above shows.

superm1 commented 6 years ago

Closed by 987109b