Bug 14961 – v2.067 fails to build with musl libc (on alpine linux)

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-08-25T10:19:02Z
Last change time
2018-03-24T04:50:54Z
Keywords
patch
Assigned to
No Owner
Creator
krishna

Attachments

IDFilenameSummaryContent-TypeSize
1545dmd-musl-fixes.patchsmall patch to fix compilation under musl libc.text/plain1308

Comments

Comment #0 by v.krishnakumar — 2015-08-25T10:19:02Z
Created attachment 1545 small patch to fix compilation under musl libc. when building 2.0.67.1 with g++ version 4.9.2/musl libc (on alpine linux 3.2 stable), compilation fails in root/port.c -- seems to be using glibc specific headers. the error message is: root/port.c:586:22: fatal error: bits/nan.h: No such file or directory #include <bits/nan.h> ^ compilation terminated. posix.mak:391: recipe for target 'port.o' failed make: *** [port.o] Error 1 the attached patch "fixes" these errors but not sure if it is the correct way to go about it. It does produce a working dmd executable that prints the help message.
Comment #1 by dlang-bugzilla — 2015-09-01T10:51:00Z
(In reply to krishna from comment #0) > the attached patch "fixes" these errors but not sure if it is the correct > way to go about it. It does produce a working dmd executable that prints the > help message. You could try running the test suite: http://wiki.dlang.org/Building_DMD#Running_the_test_suite If it succeeds, you can submit the patch as a pull request: http://wiki.dlang.org/Pull_Requests
Comment #2 by greensunny12 — 2018-03-24T04:50:54Z
FYI since 2.079 a few patches have landed in DMD and LDC that make it possible to compile on Alpine with musl libc. The port: https://github.com/dlang/druntime/pulls?q=is%3Apr+author%3Ayshui+is%3Aclosed The last one is: https://github.com/dlang/dmd/pull/8020 This also gives a good overview of the status quo, in short it should be possible to use DMD and LDC on Alpine with Musl now. If not, please open a new bug report.