[Issue 19243] [REG 2.081] Can no longer override pragma(lib) with -L switch

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 13 19:30:23 UTC 2018


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

Remi Thebault <remi.thebault at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |remi.thebault at gmail.com

--- Comment #1 from Remi Thebault <remi.thebault at gmail.com> ---
Here is linker command line of your test with 2.080.1:

cc test.o -o /tmp/dmd_run0nNQYZ -g -m64 -Xlinker /usr/lib/libssl.so.1.0.0
-Xlinker /usr/lib/libcrypto.so.1.0.0
-L/home/remi/dev/dlang/dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64
-Xlinker --export-dynamic -lssl -lcrypto -Xlinker -Bstatic -lphobos2 -Xlinker
-Bdynamic -lpthread -lm -lrt -ldl

with 2.081.2:

cc test.o -o /tmp/dmd_runHMkjB3 -g -m64 -lssl -lcrypto -Xlinker
/usr/lib/libssl.so.1.0.0 -Xlinker /usr/lib/libcrypto.so.1.0.0
-L/home/remi/dev/dlang/dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64
-Xlinker --export-dynamic -Xlinker -Bstatic -lphobos2 -Xlinker -Bdynamic
-lpthread -lm -lrt -ldl

(pragmas are pushed at the beginning)

On my system, neither will link succesfully without the additional .so on
command line, but both will link succesfully with.
However I have a runtime exception with 2.081.2 that I don't have with 2.080.2.

My PR indeed seems to break this, but the PR wouldn't be needed if dmd didn't
already shuffle arguments. What I did is shuffling them in a different way to
solve another situation.

I guess what is needed is the following order:
  - command line linker args in preserved order
  - pragma libs
  - standard library

--


More information about the Digitalmars-d-bugs mailing list