<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">FWIW, I build baremetal newlib for arm-eabi using clang, and it works. I had to patch a few of the __attribute__((naked)) functions because they were using pre-UAL asm syntax, but for the most part it "just works".<br></blockquote></blockquote><div><br></div><div>I build the baremetal newlib using arm-none-eabi-gcc as well, but after linking with the hello world program, it failed to run on both qemu-arm and gem5.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br><br>
</blockquote></span>
Have you considered trying musl? It's supposed to be a full replacement for glibc.</blockquote><div><br></div><div>It looks like a nice alternative, I'll certainly look into it right away.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
</blockquote></span>
Have you run it in a debugger to figure out *why* it is segfaulting? Have you tried building it without your special pass?<br>
<br></blockquote><div>Well, I didn't try clang, I use arm-none-eabi-gcc to build the newlib and the hello world program. The arm-none-eabi-gdb says "Don't know how to run.  Try "help target"."</div></div><br></div></div>