This issue has been resolved with the `-preview=noXlinker` switch:  https://dlang.org/changelog/pending.html#noxlinker

It will allow users to pass options directly to the linker driver without DMD trying to be clever.

It should arrive in the next release.

See also https://issues.dlang.org/show_bug.cgi?id=6952

On Wednesday, September 25, 2019, 12:17:42 PM GMT+9, Alan W. Irwin via dmd-internals <dmd-internals@puremagic.com> wrote:


To dmd developers:

I have found a number of bug reports (e.g.,
<https://issues.dlang.org/show_bug.cgi?id=7678> and
<https://issues.dlang.org/show_bug.cgi?id=17390>) concerning the issue
of implementing for the dmd compiler the equivalent of the existing
ldc2 -Xcc option to allow communicating options directly to the C
compiler that is actually used by dmd (according to its -v option) for
linking.

I would like to add my opinion that it would be good to get this
requested -Xcc option implemented for dmd because of the following use
case concerning -pthread (a common linking option used by many
compilers to help arrange all the details correctly for linking the
thread library).

That use case is the PLplot project CMake-based build system for the
static PLplot libraries case necessarily links its D plotting examples
by linking a mixture of C-compiled code from the static plplot core C
library, D-compiled code from the static plplotdmd library that
implements the D binding for that C library, and the D-compiled code
from the D example.  This all works well for our CMake-based build
system except for a fairly common configuration of our C library where
the C code of that library must be linked with the -pthread compiler
option when that C compiler is *used for linking*.  So this all works
well for the gdc compiler when it is used to link the D examples
because it understands that -pthread option.  And it also works well
for ldc2 if the -Xcc-pthread option is used to inform the underlying C
compiler used for linking of that -pthread option.

However, that -Xcc option is currently not available for dmd (as far
as I can tell from the above bug reports and from my attempts to use
that option with a dmd compiler that I built myself on Linux) so I am
pretty much stuck for this use case and dmd until the -Xcc option
becomes available for the dmd case as well.

Anyhow, thanks for listening to my request to implement the -Xcc
option for the dmd compiler, and best wishes for your on-going
development of dmd.

Alan
__________________________
Alan W. Irwin

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.org); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
_______________________________________________
dmd-internals mailing list
dmd-internals@puremagic.com
http://lists.puremagic.com/mailman/listinfo/dmd-internals