With official DMD v2.094.2 on Ubuntu 20.04:
$ ~/dlang/dmd-2.094.2/linux/bin32/dustmite --version
Segmentation fault (core dumped)
$ ~/dlang/dmd-2.094.2/linux/bin32/rdmd --version
Segmentation fault (core dumped)
$ ~/dlang/dmd-2.094.2/linux/bin32/ddemangle
Segmentation fault (core dumped)
32-bit dmd and dub executables work (presumably built by LDC), as do obviously all 64-bit ones.
Comment #1 by ibuclaw — 2021-07-01T21:59:22Z
Seems like it's just a bootstrap issue with the druntime/phobos library.
---
$ cat reduce.d
extern(C) int main()
{
static int* x = null;
if (x is null)
return 1;
else
return 0;
}
$ ./dmd2/linux/bin64/dmd -m32 -betterC reduce.d
$ ./reduce
Segmentation fault (core dumped)
$ ./dmd2/linux/bin64/dmd -m32 -betterC reduce.d -fPIC
$ ./reduce
$
---
If all object files were compiled with -fPIC, then it's fine.
Comment #2 by dlang-bot — 2021-07-01T22:05:25Z
@ibuclaw created dlang/phobos pull request #8154 "Issue 21488 - Always compile phobos library with -fPIC on POSIX targets" mentioning this issue:
- Issue 21488 - Always compile phobos library with -fPIC on POSIX targets
https://github.com/dlang/phobos/pull/8154
Comment #3 by dlang-bot — 2021-07-01T22:11:17Z
@ibuclaw created dlang/druntime pull request #3505 "Issue 21488 - Always compile phobos library with -fPIC on POSIX targets" mentioning this issue:
- Issue 21488 - Always compile phobos library with -fPIC on POSIX targets
https://github.com/dlang/druntime/pull/3505
Comment #4 by dlang-bot — 2021-07-01T22:17:23Z
@ibuclaw created dlang/dmd pull request #12798 "Issue 21488 - Always compile dmd with -fPIC on POSIX targets" mentioning this issue:
- Issue 21488 - Always compile dmd with -fPIC on POSIX targets
https://github.com/dlang/dmd/pull/12798
Comment #5 by dlang-bot — 2021-07-02T02:07:13Z
dlang/druntime pull request #3505 "Issue 21488 - Always compile druntime library with -fPIC on POSIX targets" was merged into stable:
- 8b6e885c5577fcc347a9f21d3251ba1f6aa80fe6 by Iain Buclaw:
Issue 21488 - Always compile druntime library with -fPIC on POSIX targets
https://github.com/dlang/druntime/pull/3505
Comment #6 by dlang-bot — 2021-07-02T02:07:35Z
dlang/phobos pull request #8154 "Issue 21488 - Always compile phobos library with -fPIC on POSIX targets" was merged into stable:
- bf234a1bfa99ce209c95366ce6e7547e9c2d631e by Iain Buclaw:
Issue 21488 - Always compile phobos library with -fPIC on POSIX targets
https://github.com/dlang/phobos/pull/8154
Comment #7 by dlang-bot — 2021-07-13T10:24:14Z
@MartinNowak created dlang/druntime pull request #3515 "merge stable" mentioning this issue:
- Issue 21488 - Always compile druntime library with -fPIC on POSIX targets
https://github.com/dlang/druntime/pull/3515
Comment #8 by dlang-bot — 2021-07-13T10:24:26Z
@MartinNowak created dlang/phobos pull request #8165 "merge stable" mentioning this issue:
- Issue 21488 - Always compile phobos library with -fPIC on POSIX targets (#8154)
https://github.com/dlang/phobos/pull/8165
Comment #9 by dlang-bot — 2021-07-13T15:57:43Z
dlang/phobos pull request #8165 "merge stable" was merged into master:
- 09c6e53f407759ef4d4b5167ab38b0e25abeaae2 by Iain Buclaw:
Issue 21488 - Always compile phobos library with -fPIC on POSIX targets (#8154)
https://github.com/dlang/phobos/pull/8165
Comment #10 by dlang-bot — 2021-07-24T17:57:07Z
dlang/druntime pull request #3515 "merge stable" was merged into master:
- 6b0de2de32c4746b95f08457d451e023173af985 by Iain Buclaw:
Issue 21488 - Always compile druntime library with -fPIC on POSIX targets
- 56017e1315adacc4c0e1d9472f390fb788126be4 by Iain Buclaw:
Issue 21488 - Always compile druntime library with -fPIC on POSIX targets
https://github.com/dlang/druntime/pull/3515
Comment #11 by dlang-bot — 2021-08-06T05:57:42Z
dlang/dmd pull request #12798 "Issue 21488 - Always compile dmd with -fPIC on POSIX targets" was merged into stable:
- 0410fc9c5d572577f9e7fcf7737a56c12b06446e by Iain Buclaw:
Issue 21488 - Always compile dmd with -fPIC on POSIX targets
https://github.com/dlang/dmd/pull/12798
Comment #12 by dlang-bot — 2021-08-09T20:39:45Z
@MartinNowak created dlang/dmd pull request #12967 "merge stable" mentioning this issue:
- Issue 21488 - Always compile dmd with -fPIC on POSIX targets
https://github.com/dlang/dmd/pull/12967
Comment #13 by dlang-bot — 2021-08-09T23:10:46Z
dlang/dmd pull request #12967 "merge stable" was merged into master:
- ffcc851a899a269cd853b63faa8725bbd59ec86a by Iain Buclaw:
Issue 21488 - Always compile dmd with -fPIC on POSIX targets
https://github.com/dlang/dmd/pull/12967
Comment #14 by dlang-bot — 2021-08-13T09:30:39Z
@ibuclaw created dlang/installer pull request #485 "fix Issue 21488 - Bundled 32-bit dlang tools (ddemangle, dustmite, rdmd) segfault on startup" fixing this issue:
- fix Issue 21488 - Bundled 32-bit dlang tools (ddemangle, dustmite, rdmd) segfault on startup
https://github.com/dlang/installer/pull/485
Comment #15 by dlang-bot — 2021-08-19T20:36:41Z
dlang/installer pull request #485 "fix Issue 21488 - Bundled 32-bit dlang tools (ddemangle, dustmite, rdmd) segfault on startup" was merged into stable:
- 3b1344f9526875c1c9b27f7317c07ec5453eb4a8 by Iain Buclaw:
fix Issue 21488 - Bundled 32-bit dlang tools (ddemangle, dustmite, rdmd) segfault on startup
https://github.com/dlang/installer/pull/485