Skip to content

bootstrap not working on alpine (musl) or voidlinux (glibc) #238

@rhizoome

Description

@rhizoome

This is not very important for me: I bootstrap on debian-sid now. But I wanted to report it, so people who have the same problem can find the report. I build with: ./build x86_64-linux-musl x86_64_v3. I run podman on alpine linux to get the different distros.

I did the following combinations:

  • alpine gcc 14/15: oom
  • alpine clang 20: ELF_COMPRESSED
  • voidlinux gcc 14: oom? [1]
  • voidlinux clang 20: ELF_COMPRESSED
  • debian-sid gcc 14: works

[1] I did not anticipate that I am going to report this, so I am sure that it failed with gcc on voidlinux, but not completely sure that it failed with oom. I also tried 0.14.1 and 0.15.1, but not on every distro and I am not sure where I tried 0.14.1. But I tried 0.15.1 on all of them. Also with 0.14.1 it oom failed on building zig2.c not compiler_rt.c. I also checked that podman has access to the full system RAM. Also it fails before x86_64_v3 is set, so that seems not to be related.

  • alpine has musl. I ran the alpine builds on the host and podman.
  • with voidlinux I used the glibc version of void (ghcr.io/void-linux/void-glibc), because I thought musl might be the problem

Failure types:

  • oom: I have 64GB of RAM and no swap. It also takes forever with gcc (many hours). Error below.
  • ELF_COMPRESSED: Unfortunately I did not copy the exact error message, but the message says that clang generated compressed sections and the dynamic linker on the system cannot handle them. It fails after the first llvm-build, so I think it fails when using that build. (build-llvm-host)

I think the elf compression problem is based on how voidlinux and alpine configure the dynamic linker. oom is puzzling me, something seems very broken. If there is interest I can repeat the build, but it takes very long to get to the crash. I can try suggestions or run some instrumentation.

[ 68%] Linking C executable zig1
[ 68%] Built target zig1
[ 73%] Running zig1.wasm to produce /home/buildozer/git/zig-bootstrap-0.15.1/out/build-zig-host/zig2.c
[ 78%] Running zig1.wasm to produce /home/buildozer/git/zig-bootstrap-0.15.1/out/build-zig-host/compiler_rt.c
[ 84%] Building C object CMakeFiles/zig2.dir/zig2.c.o
[ 89%] Building C object CMakeFiles/zig2.dir/compiler_rt.c.o
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
gmake[2]: *** [CMakeFiles/zig2.dir/build.make:961: CMakeFiles/zig2.dir/zig2.c.o] Aborted
gmake[1]: *** [CMakeFiles/Makefile2:196: CMakeFiles/zig2.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions