<div dir="ltr">I created <a href="https://bugs.llvm.org/show_bug.cgi?id=36991">https://bugs.llvm.org/show_bug.cgi?id=36991</a><br><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 2, 2018 at 3:04 PM, Andrew Kelley <span dir="ltr"><<a href="mailto:superjoe30@gmail.com" target="_blank">superjoe30@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><a href="https://superjoe.s3.amazonaws.com/temp/repro.tar.xz" target="_blank">https://superjoe.s3.amazonaws.<wbr>com/temp/repro.tar.xz</a><div><div class="gmail-h5"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 2, 2018 at 1:26 PM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Can you add `--reproduce=repro` to lld command line? That generates repro.tar in your current directory which contains all input files. And then please compress and upload it somewhere so that we can take a look.</div><br><br><div class="gmail_quote"><div><div class="gmail-m_7571716692207003231gmail-h5"><div dir="ltr">On Mon, Apr 2, 2018 at 9:18 AM Andrew Kelley via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-m_7571716692207003231gmail-h5"><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" target="_blank">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-lin<wbr>ux-musl/6.4.0/../../../../lib/<wbr>Scrt1.o /usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0/../../../../lib/<wbr>crti.o /usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0/crtbegin.o -L /usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0/../../../../lib -L /usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0 -dynamic-linker /lib/../lib/ld-musl-x86_64.so.<wbr>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-lin<wbr>ux-musl/6.4.0/crtend.o /usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0/../../../../lib/<wbr>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-lin<wbr>ux-musl/6.4.0/../../../../lib/<wbr>Scrt1.o
/usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0/../../../../lib/<wbr>crti.o
/usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0/crtbegin.o -L
/usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0/../../../../lib -L
/usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0 -dynamic-linker
/lib/../lib/ld-musl-x86_64.so.<wbr>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-lin<wbr>ux-musl/6.4.0/crtend.o
/usr/lib/gcc/x86_64-alpine-lin<wbr>ux-musl/6.4.0/../../../../lib/<wbr>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></div></div>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div>