Building application with LDC and -flto=thin fails in link stage

Johan Engelen j at j.nl
Tue Mar 27 22:00:42 UTC 2018


On Tuesday, 27 March 2018 at 13:28:08 UTC, kinke wrote:
> On Monday, 26 March 2018 at 23:32:59 UTC, Nordlöw wrote:
>> forwarded as `-L-flto=thin` but still errors as
>
> Which is wrong, it's not a ld command-line option (i.e., the 
> `-L` prefix is wrong).

Indeed.
Please try to manually link first (without dub) by modifying the 
command on which dub errors:

```
ldmd2 -flto=thin 
-of.dub/build/application-release-nobounds-lto-linux.posix-x86_64-ldc_2078-F2904BE3C4DA237C077E5C2B0B23442E/knetquery .dub/build/application-release-nobounds-lto-linux.posix-x86_64-ldc_2078-F2904BE3C4DA237C077E5C2B0B23442E/knetquery.o ../../.dub/packages/gmp-d-master/gmp-d/.dub/build/library-release-nobounds-lto-linux.posix-x86_64-ldc_2078-B287F67CE5FF6145BC229790CFB09607/libgmp-d.a phobos-next/.dub/build/library-release-nobounds-lto-linux.posix-x86_64-ldc_2078-F0F2FDB01B8401C04D657BCC145D46A5/libknet_phobos-next.a -L--no-as-needed -L-lzstd -L-lgmp -L-lc -L-lreadline -L-lz -L-lbz2
```

-Johan


More information about the Digitalmars-d-learn mailing list