opendlang / opend

Boost Software License 1.0
76 stars 17 forks source link

Alpine-musl: Druntime fixes #66

Closed kassane closed 3 months ago

kassane commented 3 months ago

My environment test: https://github.com/kassane/alpine-ldc2-docker

Building opend-ldc:

core/internal/backtrace/handler.d(70): Deprecation: pointer arithmetic not allowed in @safe functions
core/sys/posix/sys/socket.d(201): Deprecation: pointer arithmetic not allowed in @safe functions
core/sys/posix/sys/socket.d(206): Deprecation: pointer arithmetic not allowed in @safe functions
ninja: subcommands failed

and (same error in D upstream [master]):

~/opend/ldc $ ./build/bin/ldmd2 -run ../../hellod-sample.d 
/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /app/opend/ldc/build/lib/libdruntime-ldc.a(fiber.o): in function `_D4core6thread5fiber5Fiber10allocStackMFNbmmZv':
fiber.d:(.text._D4core6thread5fiber5Fiber10allocStackMFNbmmZv+0x75): undefined reference to `mmap64'
/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /app/opend/ldc/build/lib/libdruntime-ldc.a(osmemory.o): in function `_D2rt3sys5posix8osmemory10os_mem_mapFNbNimbZPv':
osmemory.d:(.text._D2rt3sys5posix8osmemory10os_mem_mapFNbNimbZPv+0x21): undefined reference to `mmap64'
/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /app/opend/ldc/build/lib/libdruntime-ldc.a(io.o): in function `_D4core8internal3elf2io__T5ElfIOTSQBg3sysQz10Elf64_EhdrTSQCdQxQBu10Elf64_ShdrVhi2Z7ElfFile4openFNbNiPxaJSQDzQDxQDrQDq__TQDqTQDnTQCuVhi2ZQCcZb':
io.d:(.text._D4core8internal3elf2io__T5ElfIOTSQBg3sysQz10Elf64_EhdrTSQCdQxQBu10Elf64_ShdrVhi2Z7ElfFile4openFNbNiPxaJSQDzQDxQDrQDq__TQDqTQDnTQCuVhi2ZQCcZb+0xa6): undefined reference to `mmap64'
/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /app/opend/ldc/build/lib/libdruntime-ldc.a(io.o): in function `_D4core8internal3elf2io__T5ElfIOTSQBg3sysQz10Elf64_EhdrTSQCdQxQBu10Elf64_ShdrVhi2Z13NamedSections7opApplyMFNbNiMDFNbNimAxaSQErQEpQEjQEi__TQEiTQEfTQDmVhi2Z16ElfSectionHeaderZiZi':
io.d:(.text._D4core8internal3elf2io__T5ElfIOTSQBg3sysQz10Elf64_EhdrTSQCdQxQBu10Elf64_ShdrVhi2Z13NamedSections7opApplyMFNbNiMDFNbNimAxaSQErQEpQEjQEi__TQEiTQEfTQDmVhi2Z16ElfSectionHeaderZiZi+0xaf): undefined reference to `mmap64'
/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: io.d:(.text._D4core8internal3elf2io__T5ElfIOTSQBg3sysQz10Elf64_EhdrTSQCdQxQBu10Elf64_ShdrVhi2Z13NamedSections7opApplyMFNbNiMDFNbNimAxaSQErQEpQEjQEi__TQEiTQEfTQDmVhi2Z16ElfSectionHeaderZiZi+0x16a): undefined reference to `mmap64'
/usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /app/opend/ldc/build/lib/libdruntime-ldc.a(io.o):io.d:(.text._D4core8internal3elf2io__T5ElfIOTSQBg3sysQz10Elf64_EhdrTSQCdQxQBu10Elf64_ShdrVhi2Z13NamedSections7opApplyMFNbNiMDFNbNimAxaSQErQEpQEjQEi__TQEiTQEfTQDmVhi2Z16ElfSectionHeaderZiZi+0x2a5): more undefined references to `mmap64' follow
collect2: error: ld returned 1 exit status
Error: /usr/bin/cc failed with status: 1

cc: @adamdruppe

adamdruppe commented 3 months ago

thx yeah i couldn't test all the builds but they tend to be easy fixes once we find it