D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17833 - compiling dmd on x86 linux fails
Summary: compiling dmd on x86 linux fails
Status: RESOLVED DUPLICATE of issue 19116
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2017-09-17 15:19 UTC by deep42thought
Modified: 2020-03-21 03:56 UTC (History)
5 users (show)

See Also:


Attachments
log of build on i686 (29.09 KB, text/plain)
2017-09-17 15:19 UTC, deep42thought
Details
installed packages (3.62 KB, text/plain)
2018-07-03 06:24 UTC, deep42thought
Details

Note You need to log in before you can comment on or make changes to this issue.
Description deep42thought 2017-09-17 15:19:36 UTC
Created attachment 1658 [details]
log of build on i686

following the steps here: https://wiki.dlang.org/Building_under_Posix
The build of dmd fails with a segfault at:
> cd "$srcdir/druntime"
> make -f posix.mak

The full log is attached.

The steps are:
> git clones/checkouts
> cd "$srcdir/dmd"
> make -f posix.mak AUTO_BOOTSTRAP=1 MODEL=32
> cd "$srcdir/phobos"
> make -f posix.mak MODEL=32
Comment 1 Andreas Baumann 2017-10-13 06:54:17 UTC
See also https://bbs.archlinux32.org/viewtopic.php?id=65
Comment 2 Thomas Mader 2017-11-11 23:26:10 UTC
I am having the same problem when trying to build dmd 2.075.1 with the dmd-cxx branch version at commit 7f7dd837f1cf92e3fd51fabbb95868b4b297ad37 as bootstrap dmd.

The error message is: gmake[2]: *** [posix.mak:147: import/core/sync/barrier.di] Segmentation fault

Switching back to 2.067.1 as bootstrap compiler makes it work again.

@ibuclaw: Do you happen to know what the problem might be?
Comment 3 Tyler Dence 2018-04-15 13:51:44 UTC
Bumping this issue, since this is triggering the removal of this package from the archlinux32 repos.
Comment 4 Seb 2018-07-02 21:49:42 UTC
Hmm building DMD on Linux 32 works on our CIs (e.g. https://auto-tester.puremagic.com/platform-history.ghtml?projectid=1&os=Linux_32), so I'm not sure what this is related to.

The dmd-cxx branch was just an experiment, but it was never fully finished.
Do you still get a segfault when using AUTO_BOOTSTRAP=1?

(since 2.081 at least 2.074 is required to build DMD)
Comment 5 deep42thought 2018-07-03 06:24:19 UTC
Created attachment 1708 [details]
installed packages
Comment 6 deep42thought 2018-07-03 06:25:54 UTC
still fails for me. I ran:
> mkdir dlang
> cd ~/dlang/
> git clone https://github.com/dlang/dmd
> git clone https://github.com/dlang/druntime
> git clone https://github.com/dlang/phobos
> git clone https://github.com/dlang/tools
> cd ~/dlang/dmd
> make -f posix.mak -j8 AUTO_BOOTSTRAP=1
> cd ~/dlang/phobos
> make -f posix.mak -j8

inside an archlinux32 virtual box. See above for a list of installed packages on that box.
Comment 7 deep42thought 2018-07-03 07:13:17 UTC
We have an archlinux32 image for vagrant which you can use to reproduce the issue. The commands are:

> mkdir arch32-builder
> cd arch32-builder
> vagrant init archlinux32/archlinux32
> vagrant up
> ssh vagrant@127.0.0.1 -p 2222 -o StrictHostKeyChecking=Off -o IdentityFile=.vag$
>> sudo pacman -Syu base-devel curl git make libcurl-gnutls
>> sudo reboot
> ssh vagrant@127.0.0.1 -p 2222 -o StrictHostKeyChecking=Off -o IdentityFile=.vag$
>> mkdir dlang
>> cd dlang/
>> git clone https://github.com/dlang/dmd
>> git clone https://github.com/dlang/druntime
>> git clone https://github.com/dlang/phobos
>> git clone https://github.com/dlang/tools
>> cd ~/dlang/dmd
>> make -f posix.mak -j8 AUTO_BOOTSTRAP=1
>> cd ~/dlang/phobos
>> make -f posix.mak -j8
(fails with segfault)
Comment 8 Seb 2018-07-03 07:45:52 UTC
Thanks that works in reproducing the segfault :/

Command Line: ../dmd/generated/linux/release/32/dmd -conf= -c -o- -Isrc -Iimport -Hfimport/core/sync/barrier.di src/core/sync/barrier.d

(gdb) bt full
#0  0x00861f61 in _d_dso_registry ()
No symbol table info available.
#1  0x007b53cf in ?? ()
No symbol table info available.
#2  0x0087d97b in __libc_csu_init ()
No symbol table info available.
#3  0xb7aecfd3 in __libc_start_main () from /usr/lib/libc.so.6
No symbol table info available.
#4  0x0065d601 in _start ()
No symbol table info available.

However, there's a workaround:

Instead of using AUTO_BOOTSTRAP=1, you can use make -f posix.mak -j8 HOST_DMD=ldmd
 to compile dmd. With this druntime and phobos compile fine.
So I guess it's just an issue that the release binaries aren't fully working with 32-bit anymore?
Comment 9 deep42thought 2018-07-03 08:00:07 UTC
thanks for your prompt reply - the workaround works :-)
Comment 10 basile-z 2019-03-02 14:11:44 UTC
Still ?
Comment 11 anonymous4 2019-08-05 08:39:18 UTC

*** This issue has been marked as a duplicate of issue 19116 ***