[Dlang-internal] What's up with dmd-cxx?

Joakim via Dlang-internal dlang-internal at puremagic.com
Mon Jul 17 08:56:07 PDT 2017


Someone enquired in the general forum about bootstrapping the 
last C++ version of dmd for OpenBSD, so I tried it myself on 
linux/x64.  Unfortunately, both the origin/2.067 branch and 
v2.067.1 tag of dmd no longer build with the latest gcc 7.1.1 and 
clang 4.0.1:

g++ -m64 -c -Wno-deprecated -Wstrict-aliasing -fno-exceptions 
-fno-rtti -D__pascal= -DMARS=1 -DTARGET_LINUX=1 
-DDM_TARGET_CPU_X86=1 -DDMDV2=1  -O2 -DDMDV2=1 -Iroot -MMD -MF 
port.deps root/port.c                                             
  In file included from root/port.c:587:0:                         
                /usr/include/bits/mathdef.h:19:3: error: #error 
"Never use <bits/mathdef.h> directly; include <complex.h> 
instead"                                               # error 
"Never use <bits/mathdef.h> directly; include <complex.h> 
instead"        ^~~~~

OK, I know that one, I removed it from ldc sometime back:

https://github.com/ldc-developers/ldc/pull/1447#r60186297

Just remove that linux ifdef and its contents and I get to the 
backend:

g++ -m64 -c -Wno-deprecated -Wstrict-aliasing -fno-exceptions 
-fno-rtti -D__pascal= -DMARS=1 -DTARGET_LINUX=1 
-DDM_TARGET_CPU_X86=1 -DDMDV2=1  -O2 -DDMDV2=1 -Iroot -Itk 
-Ibackend -I. -MMD -MF gdag.deps backend/gdag.c                   
      backend/go.c: In function 'int go_flag(char*)':              
                    backend/go.c:82:5: error: narrowing conversion 
of '-1' from 'int' to 'mftype {aka unsigned int}' inside { } 
[-Wnarrowing]                                            };       
                                                                   
      ^

It appears that nobody is building the last C++ version of dmd 
and keeping it up to date, which is needed for porting to new 
platforms. Ldc has a ltsmaster branch, which uses dmdfe 2.068.2 
with idgen.d reverted to idgen.c, that's kept up to date and 
integrated with CI:

https://github.com/ldc-developers/ldc/commits/ltsmaster

Perhaps dmd needs to do the same?  Ian talked of adding a dmd-cxx 
branch sometime back, looks like dmd needs one:

http://forum.dlang.org/thread/CABOHX+ckJbL1yGyZBz-Lqq1kVWX=XDy50CT_H9=BNvuquP_Mmg@mail.gmail.com

Otherwise, we'll have to tell all porters to use ldc ltsmaster 
instead, which could be a viable alternative too, since it 
supports a lot more platforms than dmd.


More information about the Dlang-internal mailing list