<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">&lt;<a href="mailto:viniciustinti@gmail.com" target="_blank">viniciustinti@gmail.com</a>&gt;</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">&lt;<a href="mailto:dieb.stefan.96@gmail.com" target="_blank">dieb.stefan.96@gmail.com</a>&gt;</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&#39;t that good yet. There must be an easier way to do that.<br><br></div><div><span><div>&quot;1. Implement this builtin in kernel </div><div>2. Alter the code in question so that compiler does not generate the call to builtin&quot;<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&#39;t believe that is the best place for fixing it. It is not kernel&#39;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&#39;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-&lt;value&gt; 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 &quot;-arm-memcpy&quot;. If you set &quot;-arm-memcpy=false&quot; it will not emit them. I will add something like on clang as well. Probably as you suggested and some other sources &quot;-no-builtin-memcpy&quot; 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">&lt;<a href="mailto:dl9pf@gmx.de" target="_blank">dl9pf@gmx.de</a>&gt;</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 &quot;Ugly test fix for eabi-arm.patch&quot;) , 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&#39;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>
&gt; &gt; On Aug 24, 2015, at 6:14 AM, Fürst Stefan &lt;<a href="mailto:dieb.stefan.96@gmail.com" target="_blank">dieb.stefan.96@gmail.com</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; drivers/built-in.o: In function `__video_do_ioctl&#39;:<br>
&gt; &gt; /home/stefan/llvmlinux/targets/nexus5/src/android_kernel_nexus5/drivers/me<br>
&gt; &gt; dia/video/v4l2-ioctl.c:1604: undefined reference to `__aeabi_memclr4&#39;<br>
&gt; &gt; make[1]: *** [.tmp_vmlinux1] Error 1<br>
&gt; &gt; make: *** [sub-make] Error 2<br>
&gt;<br>
&gt; This means that compiler is finding a place where it can rely on builtins<br>
&gt; function implemented in compiler runtime which is compiler-rt or libgcc<br>
&gt; depending upon which runtime you use. if it was a user application, then<br>
&gt; simply linking with compiler-rt would have been sufficient but in kernel it<br>
&gt; does not require any C runtime and whatever is needed is implemented in<br>
&gt; kernel itself. So kernel has a small helper library which implements some<br>
&gt; of these builtins, you have two options,<br>
&gt;<br>
&gt; 1. Implement this builtin in kernel<br>
&gt; 2. Alter the code in question so that compiler does not generate the call to<br>
&gt; builtin 3. Add -fno-builtin-&lt;value&gt; to compiler flags to disable compiler<br>
&gt; from emitting it<br>
&gt;<br>
&gt; Thanks<br>
&gt; -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>