[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 26 03:10:02 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20244

--- Comment #1 from Alan.W.Irwin1234 at gmail.com ---
Further investigation showed this peculiar result

software at merlin> /home/software/dmd/install/linux/bin64/dmd -preview=noXlinker
main.d -L-Xlinker -L-Iwhatever -v |& tail -3
gcc main.o -o main -m64 -Iwhatever -Iwhatever --export-dynamic
-L/home/software/dmd/install/linux/bin64/../lib64 -Xlinker -Bstatic -lphobos2
-Xlinker -Bdynamic -lpthread -lm -lrt -ldl 
gcc: error: unrecognized command line option ‘--export-dynamic’; did you mean
‘-export-dynamic’?
Error: linker exited with status 1

Why does the gcc command generated by dmd have two -Iwhatever options rather
than what I expected which was -Xlinker -Iwhatever (which obviously would have
generated its own error by passing -Iwhatever to ld, but that is not the point
of this additional test).

--


More information about the Digitalmars-d-bugs mailing list