<div dir="ltr">This should be fixed by r212064. Sorry for delay, and thanks for the report!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 7, 2014 at 12:42 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks for the report!</div><div><br></div>I am not a sanitizer expert, but here's what I think is happening.<div>
<br></div><div>The ubsan runtime is linked statically into all DSOs in the user's program, but the other sanitizer runtimes are only linked statically into the main executable.  Because the other sanitizers are only present in the main executable, they can use a more efficient TLS access model.  It looks like some of this TLS leaked into the common sanitizer runtime code, and got linked into the ubsan runtime, which doesn't work.</div>

</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 2, 2014 at 5:04 AM, Prof Brian Ripley <span dir="ltr"><<a href="mailto:ripley@stats.ox.ac.uk" target="_blank">ripley@stats.ox.ac.uk</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It is not clear to me which list covers use of this flag, but as it appears to this user as a compiler bug, I am posting here.  Please tell me where is the correct place if this is not it.<br>


<br>
We use clang to run UBSAN over code for the R project, which makes extensive use of DSOs to dynamically load extensions.  This works fine with 3.4, but not with the trunk.<br>
<br>
For an empty file test.c, trunk gives<br>
<br>
clang -fsanitize=undefined -fpic -g -O2 -mtune=native -c test.c -o test.o<br>
clang -fsanitize=undefined -shared -o test.so test.o<br>
/usr/bin/ld: /usr/local/clang3.5t/bin/../<u></u>lib/clang/3.5.0/lib/linux/<u></u>libclang_rt.san-x86_64.a(<u></u>sanitizer_tls_get_addr.o): relocation R_X86_64_TPOFF32 against `_ZN11__sanitizerL4dtlsE' can not be used when making a shared object; recompile with -fPIC<br>


/usr/local/clang3.5t/bin/../<u></u>lib/clang/3.5.0/lib/linux/<u></u>libclang_rt.san-x86_64.a(<u></u>sanitizer_tls_get_addr.o): could not read symbols: Bad value<br>
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br>
<br>
whereas 3.4 successfully compiled test.so.<br>
<br>
This is x86_64 Linux, specifically Fedora 20, and trunk compiled starting with clang 3.4. I first saw this around early Feb 2014, and some bisection shows that r200062 was the last version I tried that worked.<span><font color="#888888"><br>


<br>
-- <br>
Brian D. Ripley,                  <a href="mailto:ripley@stats.ox.ac.uk" target="_blank">ripley@stats.ox.ac.uk</a><br>
Professor of Applied Statistics,  <a href="http://www.stats.ox.ac.uk/~ripley/" target="_blank">http://www.stats.ox.ac.uk/~<u></u>ripley/</a><br>
University of Oxford,             Tel:  <a href="tel:%2B44%201865%20272861" value="+441865272861" target="_blank">+44 1865 272861</a> (self)<br>
1 South Parks Road,                     <a href="tel:%2B44%201865%20272866" value="+441865272866" target="_blank">+44 1865 272866</a> (PA)<br>
Oxford OX1 3TG, UK                Fax:  <a href="tel:%2B44%201865%20272595" value="+441865272595" target="_blank">+44 1865 272595</a><br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Alexey Samsonov, Mountain View, CA</div></div>
</div>