how to disable inlining of ldc2 when 'dub build --build=release'?

lixiaozi via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 20 01:02:26 PDT 2017


Hi,guys!
I recently use ldc2 to compile my project.
When using 'dub build --build=release --compiler=ldc2 ',it 
crashed in a try catch block.
After a few tries, I noticed it's the inline optimization in ldc2 
that caused the crash. So i manually changed the call of ldc2 to 
'ldc2 -release -disable-inlining -Hkeep-all-bodies -O3 -w -oq 
...' and it worked and doesn't crash any more.

Now, I try to disable inlining in "dub.json" like
==
"dflags":[
                 "-disable-inlining"
         ],
==
  but it doesn't work, because then dub calls ldc2 like this:
'ldc2   -disable-inlining  -release  -enable-inlining 
-Hkeep-all-bodies -O3 -w -oq' and inlining in ldc2 will still be 
enabled.

so, what should i do to disable inlining of ldc2 in release build?

Thanks in advance.


More information about the Digitalmars-d-learn mailing list