www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17726] New: Older DMD versions segfault when building

https://issues.dlang.org/show_bug.cgi?id=17726

          Issue ID: 17726
           Summary: Older DMD versions segfault when building Druntime
                    with GCC 7.1
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dlang-bugzilla thecybershadow.net

Although the issue doesn't occur with the latest DMD versions, building older
versions is still important for bootstrapping, so I'm opening this issue to
track the problem.

On Arch Linux, attempting to build D versions from 2015 or earlier will result
in a segmentation fault while building Druntime, e.g.:

path/to/dmd -lib -oflib/libdruntime-linux64.a -Xfdruntime.json -m64 -O -release
-inline -w -Isrc -Iimport  src/object_.d src/core/atomic.d ...
make: *** [posix.mak:172: lib/libdruntime-linux64so.a] Segmentation fault (core
dumped)
make: *** Waiting for unfinished jobs....
make: *** [posix.mak:178: lib/libdruntime-linux64.a] Segmentation fault (core
dumped)

On Arch Linux, the build succeeds with the packages:
- gcc-libs-multilib
- gcc-multilib
- lib32-gcc-libs
are at version 6.3.1-2, but fails at version 7.1.1-3.

Arch Linux pushed GCC 7.1 to the multilib repo on 2017-05-30.

D versions since https://github.com/dlang/dmd/pull/4924 build OK with any GCC
version. I suspect that the behaviour changed due to the change in default
optimization flags. This is possibly an optimizer regression in GCC 7.x.

--
Aug 06