Troubleshooting DUB invocations

kinke kinke at gmx.net
Tue Nov 12 18:32:32 UTC 2019


On Tuesday, 12 November 2019 at 16:44:06 UTC, Dukc wrote:
> When trying to compile a project including newest Spasm (DUB 
> package) using the newest LDC via DUB, the result is:
> ```
> lld: error: unknown argument: --no-as-needed
> ```
>
> I then ran DUB with -v switch and it turned out the invocation 
> contained `-L--no-as-needed` as first of all the -L arguments. 
> The trouble is, how do I know what causes DUB to add that 
> argument to the invocation? I could find no reason in 
> `dub.<json/sdl>` files of either my package, Spasm or any 
> package in Spasm dependency tree.

Dub is open-source, so you can grep the source. - Dub uses it for 
all 3 compilers (e.g., 
https://github.com/dlang/dub/blob/f87302dd206b0e5871b39704e694b2194e294aa5/source/dub/compilers/ldc.d#L249), and I'm not sure it's really needed. Anyway, you can also use another linker that supports this flag (e.g., via `-linker=gold`).


More information about the Digitalmars-d-learn mailing list