<div dir="ltr">Hi all,<div>I often meet the problem cause by Link::ConstructJob does not pass </div><div>driver level flags relevant to LTO code generation down to the plugin.</div><div>So when I compile program like:<br></div>
<div><div><span style="color:rgb(0,0,0);font-family:Tahoma;text-align:-webkit-auto;font-size:medium">clang -c a.c -o a.o -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3 -flto</span><br style="color:rgb(0,0,0);font-family:Tahoma;text-align:-webkit-auto;font-size:medium">
<span style="color:rgb(0,0,0);font-family:Tahoma;text-align:-webkit-auto;font-size:medium">clang -c main.c -o main.o  -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3</span><br style="color:rgb(0,0,0);font-family:Tahoma;text-align:-webkit-auto;font-size:medium">
<span style="color:rgb(0,0,0);font-family:Tahoma;text-align:-webkit-auto;font-size:medium">clang a.o main.o -o main -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3 -flto</span></div><br>I will got error like:<br><div><span style="color:rgb(0,0,0);font-family:Tahoma;text-align:-webkit-auto;font-size:medium">ld: error: lto-llvm.o-SchABH uses VFP register arguments, output does not<br>
</span><font color="#000000" face="Tahoma" size="3"><br></font></div><div>So I need to modify Link::ConstructJob to pass "-plugin-opt=-float-abi=hard" and vfpv3 feature to the plugin.<span style="color:rgb(0,0,0);font-family:Tahoma;text-align:-webkit-auto;font-size:medium"><br>
</span></div><div>It's tedious because some option may be missed in LTO code generation.<br></div><div>For example when I add a new option to llc, and add the same one in clang, <br></div><div>I also need to modify Link::ConstructJob to pass this option to plugin...</div>
<div>Is there a more general solution?  <br></div><div><br></div><div>Thanks.</div><div>-- <br></div>Best regards,<br>Kuan-Hsu Chen<br><br><br>
</div></div>