<div dir="ltr"><div><div><div>Hello,<br><br></div>thank you very much for investigating that problem. Take your time.<br><br></div>Kind regards<br></div>Stefan Fürst<br><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">2015-08-25 12:41 GMT+02:00 Vinicius Tinti <span dir="ltr"><<a href="mailto:viniciustinti@gmail.com" target="_blank">viniciustinti@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Tue, Aug 25, 2015 at 6:22 AM, Fürst Stefan <span dir="ltr"><<a href="mailto:dieb.stefan.96@gmail.com" target="_blank">dieb.stefan.96@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"><div><div><div>Thank you guys for your answers,<br><br></div>Where can i find that fix for eabi-arm.patch ? <br></div>Here not <a href="http://lists.linuxfoundation.org/pipermail/llvmlinux/2015-August/thread.html#start" target="_blank">http://lists.linuxfoundation.org/pipermail/llvmlinux/2015-August/thread.html#start</a><br></div>Was it an internal discussion ? <br><div><div><br>-fno-builtin is already in the makefile but it does not seem to solve my errors.<br><br></div><div>As a hobby developer this seems to be to difficult for me because my coding skills aren't that good yet. There must be an easier way to do that.<br><br></div><div><span><div>"1. Implement this builtin in kernel </div><div>2. Alter the code in question so that compiler does not generate the call to builtin"<br></div></span></div></div></div></blockquote><div><br></div></span><div>Hi Fûrst,<br><br></div><div>I am working on fixing aeabi issue. So far what I found is that LLVM/Clang does not check the flags mention by Jan-Simon when it is generating the code. It will instead check the triple and see if it satisfy the instruction and if it does it is emited. Moreover, I am not sure of that part, the linker does not seem to recognize __aeabi_memcpy, __aeabi_memmove, __aeabi_memset.<br><br></div><div>Regarding the solutions:<span><br><div><br>1. Implement this builtin in kernel<br></div></span><div><br> I don't believe that is the best place for fixing it. It is not kernel's fault.<br><br></div><span><div>2. Alter the code in question so that compiler does not generate the call to builtin<br><br></div></span><div> I don't think we have such control. If you check the below above you will se that there is no reference for memcpy and yet the compiler add it.<br><br> // clang -target arm-none-gnueabihf -O2 -S -o foo.s foo.c<br> struct my_s {<br> unsigned long a[18];<br> };<br><br> void foo(unsigned long *t) {<br> *(struct my_s *)t = *((struct my_s *)(1UL));<br> }</div><span><div><br></div><div>3. Add -fno-builtin-<value> to compiler flags to disable compiler from emitting it</div><br></span></div><div> That is what I am doing. I have added a hidden flag on LLVM side "-arm-memcpy". If you set "-arm-memcpy=false" it will not emit them. I will add something like on clang as well. Probably as you suggested and some other sources "-no-builtin-memcpy" and so.<br><br></div><div>Regards,<br></div><div>Vinicius<br></div><div> <br></div><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"><div><div><span></span></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div><div><span><div></div></span><div>Kind regards,<br></div><div>Stefan<br></div><br><br></div></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-25 10:31 GMT+02:00 Jan-Simon Möller <span dir="ltr"><<a href="mailto:dl9pf@gmx.de" target="_blank">dl9pf@gmx.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">See the archives (end of thread "Ugly test fix for eabi-arm.patch") , we just<br>
in the last 2 weeks discussed the case that LLVM/clang is wrongly adding the<br>
references for these and not<br>
obeys the -nostdic / -freestanding flags passed by the kernel's makefiles.<br>
<span><font color="#888888"><br>
--<br>
<br>
Dipl.-Ing.<br>
Jan-Simon Möller<br>
<br>
<a href="mailto:jansimon.moeller@gmx.de" target="_blank">jansimon.moeller@gmx.de</a><br>
</font></span><div><div>On Monday 24 August 2015 23:58:35 Khem Raj wrote:<br>
> > On Aug 24, 2015, at 6:14 AM, Fürst Stefan <<a href="mailto:dieb.stefan.96@gmail.com" target="_blank">dieb.stefan.96@gmail.com</a>><br>
> > wrote:<br>
> ><br>
> > drivers/built-in.o: In function `__video_do_ioctl':<br>
> > /home/stefan/llvmlinux/targets/nexus5/src/android_kernel_nexus5/drivers/me<br>
> > dia/video/v4l2-ioctl.c:1604: undefined reference to `__aeabi_memclr4'<br>
> > make[1]: *** [.tmp_vmlinux1] Error 1<br>
> > make: *** [sub-make] Error 2<br>
><br>
> This means that compiler is finding a place where it can rely on builtins<br>
> function implemented in compiler runtime which is compiler-rt or libgcc<br>
> depending upon which runtime you use. if it was a user application, then<br>
> simply linking with compiler-rt would have been sufficient but in kernel it<br>
> does not require any C runtime and whatever is needed is implemented in<br>
> kernel itself. So kernel has a small helper library which implements some<br>
> of these builtins, you have two options,<br>
><br>
> 1. Implement this builtin in kernel<br>
> 2. Alter the code in question so that compiler does not generate the call to<br>
> builtin 3. Add -fno-builtin-<value> to compiler flags to disable compiler<br>
> from emitting it<br>
><br>
> Thanks<br>
> -Khem<br>
<br>
</div></div></blockquote></div><br></div>
</div></div><br></div></div><span>_______________________________________________<br>
LLVMLinux mailing list<br>
<a href="mailto:LLVMLinux@lists.linuxfoundation.org" target="_blank">LLVMLinux@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/llvmlinux</a><br></span></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br><div><div dir="ltr">Simplicity is the ultimate sophistication<br></div></div>
</font></span></div></div>
</blockquote></div><br></div></div></div></div>