<div dir="ltr"><div>Hi Rafael,</div><div><br></div>Before clang parses -Wl options there is some logic based on PIE, e.g. crt object name selection.<div>One possible solution is to move -Wl options before crt objects.<br><div>
But I am not sure if such reordering of linker arguments is possible<font face="arial, sans-serif">.</font></div></div><div><span style="font-family:arial,sans-serif;font-size:13px">Another solution is to parse -Wl option value directly before it is passed to CmdArgs.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">Do you have any other ideas?</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">--Alexey</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-14 20:54 GMT+04:00 Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 14 February 2014 11:45, Alexey Volkov <<a href="mailto:avolkov.intel@gmail.com">avolkov.intel@gmail.com</a>> wrote:<br>

><br>
>   Unfortunately my last patch cannot work with -Wl compiler option.<br>
>   E.g. passing -Wl,-shared will not set OPT_shared variable and so -shared and -pie both passed to linker.<br>
>   Linker will complain about incompatible options.<br>
>   I am not sure if parsing -Wl option value for shared, static, etc is acceptable here.<br>
>   In my first patch addition of new gold plugin option does not have such problems.<br>
<br>
</div></div>It has stranger ones. The gold plugin and the linker should be in<br>
agreement as to the type of output they are working to produce.<br>
<br>
Clang has to parse -Wl options, so maybe the logic in the current<br>
patch should be moved down a bit and work directly on the flags the<br>
driver already has for passing to the linker?<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Alexey Volkov<div>Intel Corporation</div></div>
</div>