Pass parameter to gcc linker
Oleg B
code.viator at gmail.com
Mon Oct 5 19:10:08 UTC 2020
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
More information about the digitalmars-d-ldc
mailing list