midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

cb3653 Remove incorrect --host=${DEFAULT_TARGET} when building host tools/libraries

Authored and Committed by Martin Storsjö 5 years ago
    Remove incorrect --host=${DEFAULT_TARGET} when building host tools/libraries
    
    When passing --host to autoconf build systems, it means that one
    wants to build code that is going to run on this specific target.
    
    When building host tools/libraries, we're building code that is
    going to run on the current host system, not ${DEFAULT_TARGET}.
    
    Building with the incorrect --host parameter has appeared to work
    despite this, due to other fallbacks in autoconf. When building with
    --host=<triple>, autoconf first looks for <triple>-gcc, but if this
    isn't found, then proceeds to use gcc and assumes this is what the
    caller meant.
    
    When building GMP, its configure script wants to inspect symbol
    names, and uses a name listing tool (normally nm) for this purpose.
    When building gmp_host, with the incorrect --host parameter, it
    first looks for <triple>-nm, which doesn't exist. As the previously
    set incorrect triple is for a Windows OS (x86_64-nt64-midipix), it
    then looks for other windows type name listing tools, <triple>-dumpbin,
    then unprefixed dumpbin. If dumpbin is found (I happen to have it
    around, as a wine wrapper around MSVC tools, for convenience), it
    is used, but then fails to inspect the ELF object files that the
    compiler has used.
    
    By removing the incorrect --host parameter, the host toolchain
    deps build succeeds by not relying on autoconf implicitly doing
    the right thing despite the incorrect parameter.
    
    Also remove --target from HOST_TOOLCHAIN_DEPS_CONFIGURE_ARGS.
    Adding --target when building host tools generally is correct, when
    configuring tools that generate code (like binutils and gcc). For
    other projects that don't generate code, --target normally has no effect.
    GMP explicitly errors out if --target is set to a different value than
    host (as GMP's configure script thinks the caller has made a mistake).
    
        
file modified
+6 -6