rhboot / efivar

Tools and libraries to work with EFI variables
GNU Lesser General Public License v2.1
240 stars 105 forks source link

Cross compile support doesn't work if host and target compilers are different #130

Open rossburton opened 5 years ago

rossburton commented 5 years ago

If the native compiler is e.g. gcc 6.3 but the cross compiler is gcc 9, then using the target CFLAGS when building the native makeguids binary could fail if gcc9-specific options were being used.

rossburton commented 5 years ago

The usual technique is to carry on the FOR_BUILD idiom, and respect CFLAGS_FOR_BUILD etc. Maybe it's time to use something like Meson which does this for you?

dtor commented 5 years ago

I also observe similar breakage with makeguids crashing with invalid opcode because our build scripts compile for particular target architecture which is not supported by the host where makeguids is being executed.

asheplyakov commented 1 year ago

The problem is that util.o is linked both into makeguids binary (which should run on the build machine) and target libraries/binaries. Depending on luck either the $build util.o gets linked into target libraries/binaries, or the target util.o is linked into makeguids.

asheplyakov commented 1 year ago

The problem is that util.o is linked both into makeguids binary (which should run on the build machine) and target libraries/binaries. Depending on luck either the $build util.o gets linked into target libraries/binaries, or the target util.o is linked into makeguids.

This has been solved by ca48d3964d26f5e3b38d73655f19b1836b16bd2d