Bug 18145 – Phobos makefile incorrectly sets --dip1000 for DMD when BUILD=debug

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-12-30T01:10:14Z
Last change time
2019-05-27T07:57:49Z
Keywords
safe
Assigned to
No Owner
Creator
Jack Stouffer

Comments

Comment #0 by jack — 2017-12-30T01:10:14Z
DMD can't be built with DIP1000 and neither can Phobos. DIP1000 shouldn't be set in either case $ make -j16 -f posix.mak BUILD=debug std/algorithm/iteration.test /Library/Developer/CommandLineTools/usr/bin/make -C ../druntime -f posix.mak MODEL=64 DMD=../dmd/generated/osx/debug/64/dmd OS=osx BUILD=debug make -C ../dmd/src -f posix.mak BUILD=debug OS=osx MODEL=64 no cpu specified, assuming X86 CC="c++" dmd -lib -of../generated/osx/debug/64/lexer.a -m64 -J../generated/osx/debug/64 -L-lstdc++ -version=MARS -fPIC -w -de -g -debug dmd/console.d dmd/entity.d dmd/errors.d dmd/globals.d dmd/id.d dmd/identifier.d dmd/lexer.d dmd/tokens.d dmd/utf.d dmd/root/array.d dmd/root/ctfloat.d dmd/root/file.d dmd/root/filename.d dmd/root/outbuffer.d dmd/root/port.d dmd/root/rmem.d dmd/root/rootobject.d dmd/root/stringtable.d dmd/root/hash.d dmd/root/stringtable.d(48): Error: returning cast(char*)(&this + 16L) escapes a reference to parameter this, perhaps annotate with return dmd/root/stringtable.d(58): Error: returning cast(const(char)*)(&this + 16L) escapes a reference to parameter this, perhaps annotate with return make[2]: *** [../generated/osx/debug/64/lexer.a] Error 1 make[1]: *** [../dmd/generated/osx/debug/64/dmd] Error 2 make: *** [../druntime/generated/osx/debug/64/libdruntime.a] Error 2
Comment #1 by greensunny12 — 2017-12-30T01:53:03Z
This is pretty weird. Dip1000 is only used in DRuntime: > posix.mak 80:UDFLAGS:=-conf= -Isrc -Iimport -w -dip1000 $(MODEL_FLAG) $(PIC) $(OPTIONAL_COVERAGE) Looking at your log I can't see -dip1000 set either. `-conf=` isn't called for `dmd` in the lexer build, maybe that's the culprit? I.e. you have some local config or DFLAGS.
Comment #2 by greensunny12 — 2017-12-30T01:53:41Z
(For reference, I can't reproduce this on Linux with Make 4.2.1)
Comment #3 by ag0aep6g — 2017-12-31T17:34:32Z
*** Issue 18144 has been marked as a duplicate of this issue. ***
Comment #4 by greeenify — 2019-05-14T23:06:24Z
https://github.com/dlang/phobos/pull/6931 will fix this as it activated -dip1000 for all build types.