<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2016-11-24 21:41 GMT+01:00 Arnout Vandecappelle <span dir="ltr"><<a target="_blank" href="mailto:arnout@mind.be">arnout@mind.be</a>></span>:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div class="gmail-m_3450807250436023527gmail-a3s gmail-m_3450807250436023527gmail-aXjCH gmail-m_3450807250436023527gmail-m15898138158b3883" id="gmail-m_3450807250436023527gmail-:1bc"> I haven't followed this in detail, but is there any reason why<br>
CC="$(TARGET_CC) -ffreestanding" doesn't work?</div></blockquote></div><br></div><div class="gmail_extra">Hi Arnout,<br><br></div><div class="gmail_extra">In the end I've managed to get this thing to build and it's working now on the platform.<br><br></div><div class="gmail_extra">The reason why that won't work with this codebase is because the BSP over which the<br>bootloader is built requires some newlib files. Specifically, it requires the set of crt*.S files,<br>which seem to have been semi-split from newlib into libgloss.<br><br>I've copied files from here and patched crtinit.S to add __init and __fini sections<br></div><div class="gmail_extra"><br><a target="_blank" href="https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=tree;f=libgloss/microblaze;h=d713445523e8a7cd84cc3e4dadf12d06a8a3daa6;hb=HEAD">https://sourceware.org/git/<wbr>gitweb.cgi?p=newlib-cygwin.<wbr>git;a=tree;f=libgloss/<wbr>microblaze;h=<wbr>d713445523e8a7cd84cc3e4dadf12d<wbr>06a8a3daa6;hb=HEAD</a><br><br></div><div class="gmail_extra">I also found this document<br><a target="_blank" href="https://forums.xilinx.com/xlnx/attachments/xlnx/zaps/13261/1/%28Guidance%20Note%29%20Zynq%20-%20Using%20a%20Custom%20BareMetal%20GCC%20Toolchain%20in%20XSDK%20%28Cross%20GCC%29%20r05.docx">https://forums.xilinx.com/<wbr>xlnx/attachments/xlnx/zaps/<wbr>13261/1/(Guidance%20Note)%<wbr>20Zynq%20-%20Using%20a%<wbr>20Custom%20BareMetal%20GCC%<wbr>20Toolchain%20in%20XSDK%20(<wbr>Cross%20GCC)%20r05.docx</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">which helped me create a Xilinx.spec file to pass over to gcc<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">In the end it's been an almost 18 hours journey that has been fruitful: I've learned<br></div><div class="gmail_extra">lots of things I didn't know and I've managed to do what I needed: bulding standalone<br></div><div class="gmail_extra">applications for microblaze using buildroot.<br></div><div class="gmail_extra"><br>However, I don't know if I can generalize this work to improve buildroot and make this<br>available for anyone. Should newlib exist as a package for buildroot? Maybe only libgloss?<br></div><div class="gmail_extra">I don't mind working on this, but I'd need some guidance, as I don't have everything clear<br></div><div class="gmail_extra">yet. What could be a nice starting point?<br><br></div><div class="gmail_extra">I see on the list there was a patch from March "toolchain: add support for the newlib library"<br></div><div class="gmail_extra">but as far as I know it hasn't been comitted. Maybe improving that patch to fix the issues<br></div><div class="gmail_extra">it had could be the first step.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Best regards!<br></div><br><div class="gmail_extra">-- <br><div class="gmail-m_3450807250436023527gmail_signature">Álvaro Gámez Machado<br></div>
</div></div>