> On 2023-03-01, anonymous <invalid.nore...@gnu.org> wrote: >> This might be the desired use case, but when cross compiling with >> systems like buildroot one might have the same architecture on >> --build and --host. >> >> Example: Compile on Apple silicon (aarch64-unknown-linux-gnu) for a Cortex >> A75 based system (aarch64-unknown-linux-gnu). Cross compiling isn't >> automatically detected. > > By setting --host and --build to the same value, this explicitly forces > non-cross-compilation mode in configure. > > If you specify --host without also specifying --build, then configure will > run the auto-detection which I expect will work properly for you.
Looking into configure setting --host without --build will trigger a test where an executable is run to determine whether or not cross compiling is happening. Which in this case may or may not fail. The manual states: "Therefore, whenever you specify --host, be sure to specify --build too." > > Probably the "vendor" field of the host triplet should have been set to > something different for these different systems, but I digress... Buildroot adds itself as the vendor (aarch64-buildroot-linux-gnu) but libgpg-error uses the host triplet to lookup a matching syscfg. Therefore the it has to be changed to aarch64-unknown-linux-gnu. > >> And there seems to be no way to force it if we know that we are cross >> compiling. > > Nevertheless, you can always force cross compilation mode by explicitly > setting cross_compiling=yes, for example: > > % ./configure cross_compiling=yes Thanks for the tip. I tried --cross_compiling=yes which wasn't registered leading me to believe that there is no way to force it. > > Hope that helps, > Nick Regards Daniel