You are not logged in.

#1 2017-09-16 10:35:40

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 823
Website

community/dmd

The package seems to be broken for 32-bit, as I can also see
from the FreeBSD ports at https://www.mail-archive.com/freebsd-pk … 02402.html:

gmake[2]: *** [posix.mak:147: import/core/sync/barrier.di] Segmentation fault 
(core dumped)

I get the same segfault when trying to build the very first D artifact:

/build/dmd/src/dmd/src/dmd -conf= -c -o- -Isrc -Iimport -Hfimport/core/sync/barrier.di src/core/sync/barrier.d
make: *** [posix.mak:154: import/core/sync/barrier.di] Segmentation fault (core dumped)

So the constructed dmd compiler is broken.

I'm not really good with compiler stuff, because this could be anything from funny flags when compiling
dmd, but:

c++ -c -o../generated/linux/release/32/go.o -Wno-deprecated -Wstrict-aliasing -fno-exceptions -fno-rtti -D__pascal= -DMARS=1 -DTARGET_LINUX=1 -DDM_TARGET_CPU_X86=1 -m32 -std=gnu++98 -O2 -Iddmd/root -Iddmd/tk -Iddmd/backend -I../generated/linux/release/32 -Iddmd -DDMDV2=1 -MMD -MF ../generated/linux/release/32/go.deps ddmd/backend/go.c

doesn't sound too special to me.

Offline

#2 2017-09-16 11:03:02

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 823
Website

Re: community/dmd

The supplied precompiled binary seems to work (from wget 'http://downloads.dlang.org/releases/2.x … nux.tar.xz').
So, the question is, how do they compile the compiler..

Offline

#3 2017-09-16 11:24:01

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 823
Website

Re: community/dmd

We should see at the breaking point in the upstream Arch git repo, there I see when i686 got dropped:

-[[ $CARCH == "x86_64" ]] && _archbits="64"
-[[ $CARCH == "i686" ]] && _archbits="32"
-
 build() {
     cd $srcdir/dmd/src
     echo $pkgver > ../VERSION
-    make -f posix.mak MODEL=$_archbits RELEASE=1
+    make -f posix.mak AUTO_BOOTSTRAP=1 RELEASE=1 PIC=1
 
     cd $srcdir/druntime
-    make -f posix.mak MODEL=$_archbits DMD=$srcdir/dmd/src/dmd RELEASE=1
+    make -f posix.mak DMD="$srcdir"/dmd/src/dmd RELEASE=1 PIC=1 
 
     cd $srcdir/phobos
-    make -f posix.mak MODEL=$_archbits DMD=$srcdir/dmd/src/dmd RELEASE=1
+    make -f posix.mak DMD="$srcdir"/dmd/src/dmd RELEASE=1 PIC=1
 }

I'll try to backport and build again..

Offline

#4 2017-09-16 11:28:38

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 823
Website

Re: community/dmd

MODEL=32 for the druntime and phobos would be helpful, I think.
But the segfault happens before, I tried all combinations of DEBUG=1, RELEASE=1, PIC=0, PIC=1, AUTO_BOOSTRAP=1 or not..

Last edited by andreas_baumann (2017-09-16 11:31:58)

Offline

#5 2017-09-16 12:03:37

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 823
Website

Re: community/dmd

So, the new PKGBUILD builds the new dmd compiler with the existing one (installed as makedepends dmd).
AUTO_BOOSTRAP=1 is IMHO the safer option, though compilation time suffers a bit. Nevertheless,
the dmd v2.074.0 just works find.
Trying to build a 2.074.0 yields:

CC=c++ /tmp/.host_dmd-2.072.2/dmd2/linux/bin32/dmd -conf=/tmp/.host_dmd-2.072.2/dmd2/linux/bin32/dmd.conf -of../generated/linux/release/32/idgen ddmd/idgen.d
../generated/linux/release/32/idgen
make[1]: *** [posix.mak:438: ../generated/linux/release/32/idgen] Segmentation fault (core dumped)
make[1]: *** Deleting file '../generated/linux/release/32/idgen'

So, I start to suspect a change in the environemt (makepkg build flags etc.) causing the trouble. One obvious
source of trouble on a 32-bit machine is stack smash protection.. I'll check that one..

Offline

#6 2017-09-16 12:10:18

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 823
Website

Re: community/dmd

Oh. Lovely: AUTO_BOOSTRAP=1 causes the pre-compiled DMD compiler to be downloaded:

curl -fsSL http://downloads.dlang.org/releases/2.x/2.072.2/dmd.2.072.2.linux.tar.xz | tar -C /tmp/.host_dmd-2.072.2 -Jxf - || rm -rf /tmp/.host_dmd-2.072.2

This is even worse than having to download the binary package as part of 'source', so no AUTO_BOOSTRAP. :-)

Last edited by andreas_baumann (2017-09-16 12:10:36)

Offline

#7 2017-09-16 16:11:44

andreas_baumann
Administrator
From: Zurich, Switzerland
Registered: 2017-08-10
Posts: 823
Website

Re: community/dmd

brk(NULL)                               = 0x56f04000
brk(0x56f25000)                         = 0x56f25000
brk(0x56f26000)                         = 0x56f26000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x4dfd60} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault

Also clueless..

Offline

#8 2017-09-19 14:14:42

deep42thought
Administrator
From: Jena, Germany
Registered: 2017-06-17
Posts: 608

Re: community/dmd

Since even the simple instructions in the wiki fail, I opened an upstream bugreport -- officially they should support i686.

Offline

#9 2017-10-27 13:02:32

deep42thought
Administrator
From: Jena, Germany
Registered: 2017-06-17
Posts: 608

Re: community/dmd

I'll blacklist dmd (again) - once upstream fixes the build (or at least talks to us), we can reintroduce it again.

Offline

Board footer

Powered by FluxBB