<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 20, 2017 at 12:44 PM, Sean Silva <span dir="ltr"><<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Fri, Jan 20, 2017 at 8:35 AM, George Rimar via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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">Hi Dmitry,<br>
<br>
thanls for sharing. Few comments/questions below:<br>
<span class="gmail-m_8496879369467403052gmail-"><br>
>Here is the list of modifications I had to do in order to link the kernel (I have used llvmlinux with clang and mainline with gcc, the >results are similar):<br>
><br>
>1. LLD patches:<br>
 > - D28094 (Implemented support for R_386_PC8/R_386_8 relocations)<br>
<br>
</span>Do you remember where it was used ?<br>
<span class="gmail-m_8496879369467403052gmail-"><br>
>5. In arch/x86/kernel/vmlinux.lds.S commented out the "CONSTRUCTORS", because LLD doesn't support it.<br>
<br>
</span>It is <a href="https://reviews.llvm.org/D28951" rel="noreferrer" target="_blank">https://reviews.llvm.org/D2895<wbr>1</a>. CONSTRUCTORS can be just removed, they do nothing for ELF.<br>
<span class="gmail-m_8496879369467403052gmail-"><br>
>6. In arch/x86/boot/setup.ld replaced 5*512 with precalculated value of 2560 because it doesn't seem that LLD supports math inside >ASSERT in linker scripts.<br>
<br>
</span>It is actually not relative with ASSERT. LLD does not support "symbol = 5*6", but accepts "symbol = 5 * 6" currently.<br>
Not sure what is easy fix here.<br></blockquote><div><br></div></span><div>I'm not sure if it is easy, but I think that it's clear that the linkerscript lexer needs to be improved. I think that is the source of the problems with `*(.apicdrivers);` as well.</div></div></div></div></blockquote><div><br></div><div>Actually, quickly staring at the code, the `*(.apicdrivers);` seems like it will be lexed  correctly.</div><div><br></div><div>-- Sean Silva</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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> This is not the first bug related to lexing that we have run into (e.g. lexing `.=` as a single token is the cause of <a href="https://llvm.org/bugs/show_bug.cgi?id=31128" target="_blank">https://llvm.org/bugs/show_<wbr>bug.cgi?id=31128</a> ).</div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div><div>-- Sean Silva</div></font></span><span class="gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_8496879369467403052gmail-"><br>
>Finally the kernel was built and it obviously didn't run (only printed out "No setup signature found..." but this is some result as well). >Probably, the result could be better if the --emit-relocs option didn't fail and CONSTRUCTORS were supported. I really don't know what >to do about the assertion that I have commented out.<br>
<br>
</span>I updated patch for --emit-relocs, now they do not fail: <a href="https://reviews.llvm.org/D28612" rel="noreferrer" target="_blank">https://reviews.llvm.org/D2861<wbr>2</a><br>
It looks to be important feature for self relocations, so it is not surprising it did not run without :)<br>
<br>
George.<br>
<div class="gmail-m_8496879369467403052gmail-HOEnZb"><div class="gmail-m_8496879369467403052gmail-h5">______________________________<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>
</div></div></blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>