Depends system refuses to use custom toolchain for x86 #7033

issue laanwj opened this issue on November 16, 2015
  1. laanwj commented at 4:24 PM on November 16, 2015: member

    I have created a custom x86 toolchain using crosstool-ng, however I don't know how to use it with depends. E.g. this doesn't work:

    export PATH=$PATH:$HOME/x-tools/x86_64-unknown-linux-gnu
    # contains x86_64-unknown-linux-gnu-gcc, g++ etc
    make HOST=x86_64-unknown-linux-gnu
    

    However when looking at the output of e.g. OpenSSL build it is using the system-wide gcc:

    ...
    gcc -m64 -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -DOPENSSL_THREADS -D_REENTRANT -pipe -O2 -I/home/user/bitcoin-x86_64/depends/x86_64-unknown-linux-gnu/include -fPIC -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM   -c -o randfile.o randfile.c
    

    Is there any specific trick I need to use, or an option I can override? (I guess I can trick it by removing the prefix from my toolchain so that it names them gcc etc, but I'd be afraid it mixes with the system compiler/bintools)

  2. laanwj added the label Build system on Nov 16, 2015
  3. laanwj renamed this:
    Depends system refuses to use custom toolchain
    Depends system refuses to use custom toolchain for x86
    on Nov 16, 2015
  4. josephbisch commented at 12:54 AM on November 17, 2015: none

    See this line of funcs.mk. It sets $(package)_type to x86_64_linux in the case of your example, the same as if you left out the unknown from the HOST. So you want to look for what depends is setting x86_64_linux_CC to.

    See depends/hosts/linux.mk. Assuming 86 is found in $(build_arch), then x86_64_linux_CC is just set to gcc -m64. It is only if you are building on a system without 86 somewhere in the arch (like arm) that the prefix is added to gcc.

    I'm not sure what the solution is, but as depends works currently, it would seem like you would need to do the prefix removal to use that toolchain without modifying depends.

  5. laanwj commented at 9:10 AM on November 17, 2015: member

    Thanks for trying to look it up @josephbisch Didn't find anything better than 'rename your compilers' either.

    I do think we need such a mechanism in depends, to be able to use a 'blessed toolchain' instead of a VM/chroot for determinism.

  6. MarcoFalke commented at 10:50 PM on July 18, 2018: member

    @laanwj Is this issue still relevant?

  7. MarcoFalke closed this on Aug 7, 2019

  8. MarcoFalke commented at 8:35 PM on August 7, 2019: member

    Closing. No response in 1 year.

  9. laanwj commented at 7:22 AM on August 8, 2019: member

    I think it's still an issue, but no longer for me as I'm no longer working on whatever I was back then, so I'm fine with leaving this closed.

    (github e-mail is very unreliable for me, if you want to bring something to my attention preferably use IRC)

  10. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me