Today I noticed that I would get an “invalid ELF header” error if I compile a library with -Dtarget=x86_64-linux. Using the flag -Dtarget=x86_64-native creates the correct result.
The “native” ELF file has an extra section .gnu.version. I guess that’s required on certain Linux distros. In a cross-compiling scenario, how does one ensure that a library would work on popular distros like Debian?