Thread overview |
---|
October 05, 2020 Pass parameter to gcc linker | ||||
---|---|---|---|---|
| ||||
Hello I need to pass parameter to gcc then cross build D code for ARM. In my case I have some missversions (I think) in cross compile tool stack: sysroot builded with unknown (for me) compiler, I use compiler with exact glibc version but with other build flags, and may be something else. Problem: then I try to build my D code I get this kinds of errors: /arm-gcc/bin/../lib/gcc/arm-linux-gnueabihf/8.2.1/../../../../arm-linux-gnueabihf/bin/ld.gold: error: /arm-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/8.2.1/liblto_plugin.so: not configured to support 64-bit little-endian object /arm-gcc/bin/../lib/gcc/arm-linux-gnueabihf/8.2.1/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot find -lugin /arm-gcc/bin/../lib/gcc/arm-linux-gnueabihf/8.2.1/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot find -lugin-opt=/arm-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/8.2.1/lto-wrapper /arm-gcc/bin/../lib/gcc/arm-linux-gnueabihf/8.2.1/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot find -lugin-opt=-fresolution=/tmp/cc89QFF3.res ... I found only one resolution of problem: in ldc2.conf I select custom script for `-gcc` switch instead of direct compiler name custom script disable lto for gcc call: #!/bin/bash arm-linux-gnueabihf-gcc -fno-lto $@ how to pass `-fno-lto` to gcc without "custom-script-hacking"? As I know ldc used gcc only for linkage, but `-L-fno-lto` don't has effect. gcc from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads ldc 1.22.0 from github |
October 05, 2020 Re: Pass parameter to gcc linker | ||||
---|---|---|---|---|
| ||||
Posted in reply to Oleg B | Use -Xcc for linker driver flags (cc), not -L (for the actual linker, ld). |
Copyright © 1999-2021 by the D Language Foundation