www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Cannot make LDC use LTO when called via DUB

reply =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
I've added

buildType "release" {
          buildOptions "releaseMode" "optimize" "inline"
          dflags-posix-ldc "-flto=thin" "-Xcc=-fuse-ld=gold"
}

to my dub.sdl and built (on Linux) as

     /usr/bin/dub -v run --compiler=ldc2 --build=release

but neither the flag "-flto=thin" nor "-Xcc=-fuse-ld=gold" is 
propagated to the ldc2 call (at least no printed on stdout).

What's missing?
Sep 23 2017
parent reply =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Saturday, 23 September 2017 at 15:19:09 UTC, Nordlöw wrote:
 I've added

 buildType "release" {
          buildOptions "releaseMode" "optimize" "inline"
          dflags-posix-ldc "-flto=thin" "-Xcc=-fuse-ld=gold"
 }

 to my dub.sdl and built (on Linux) as

     /usr/bin/dub -v run --compiler=ldc2 --build=release

 but neither the flag "-flto=thin" nor "-Xcc=-fuse-ld=gold" is 
 propagated to the ldc2 call (at least no printed on stdout).

 What's missing?
Neither dflags-dmd "-xxx" dflags-posix-dmd "-xxx" dflags-linux-dmd "-xxx" has any effect on my build (in dub.sdl).
Sep 23 2017
parent reply Sebastiaan Koppe <mail skoppe.eu> writes:
 Neither

 dflags-dmd "-xxx"
 dflags-posix-dmd "-xxx"
 dflags-linux-dmd "-xxx"

 has any effect on my build (in dub.sdl).
I didn't know dflags-* was a thing, and I can't find it in docs either. Maybe you are looking for dflags "..." platform="..."
Sep 25 2017
next sibling parent Jacob Carlborg <doob me.com> writes:
On 2017-09-25 09:47, Sebastiaan Koppe wrote:

 I didn't know dflags-* was a thing, and I can't find it in docs either.
That's how it works in the JSON package description file. -- /Jacob Carlborg
Sep 25 2017
prev sibling parent =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
On Monday, 25 September 2017 at 07:47:28 UTC, Sebastiaan Koppe 
wrote:
 Maybe you are looking for

 dflags "..." platform="..."
Ahh, you're right. Thanks!
Sep 25 2017