<div dir="ltr"><div>Alpine linux is a distribution that uses musl libc instead glibc. Here are my steps to reproduce:<br><br></div><div>On Alpine linux, download LLVM, Clang, LLD 6.0.0 from <a href="http://releases.llvm.org">releases.llvm.org</a>, and build them from source.<br><br></div><div>$ clang -c hello_world.c<br>$ ld.lld  --gc-sections -m elf_x86_64 -o hello_world /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../lib/Scrt1.o /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../lib/crti.o /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/crtbegin.o -L /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../lib -L /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0 -dynamic-linker /lib/../lib/ld-musl-x86_64.so.1 hello_world.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lm -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/crtend.o /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../lib/crtn.o<br></div><div>$ ./hello_world<br>Segmentation fault (core dumped)<br><br></div><div>Now try with binutils:<br>$ ld  --gc-sections -m elf_x86_64 -o hello_world 
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../lib/Scrt1.o 
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../lib/crti.o 
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/crtbegin.o -L 
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../lib -L 
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0 -dynamic-linker 
/lib/../lib/ld-musl-x86_64.so.1 hello_world.o -lgcc --as-needed -lgcc_s 
--no-as-needed -lc -lm -lgcc --as-needed -lgcc_s --no-as-needed 
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/crtend.o 
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../lib/crtn.o<br></div><div>$ ./hello_world<br></div><div>Hello, World!<br><br><br></div><div>Does the linker line look ok? Should I file a bug?<br></div></div>