<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 27, 2016 at 8:49 AM, Teresa Johnson <span dir="ltr"><<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.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"><div><div class="gmail-h5">On Tue, Dec 27, 2016 at 8:30 AM, Carsten Mattner <span dir="ltr"><<a href="mailto:carstenmattner@gmail.com" target="_blank">carstenmattner@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"><span class="gmail-m_-5064748096713712880gmail-m_-4086577410851125295gmail-">On Tue, Dec 27, 2016 at 4:13 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>> wrote:<br>
><br>
> On Tue, Dec 27, 2016 at 5:23 AM, Carsten Mattner <<a href="mailto:carstenmattner@gmail.com" target="_blank">carstenmattner@gmail.com</a>> wrote:<br>
>><br>
>> After figuring out the fault in the configuration step and rebuilding,<br>
>> and then rebuilding again by forcing it with `ninja -k 16`, I managed to<br>
>> build everything but 12 ninja targets.<br>
>><br>
>> I have to sift through them before I can report more, and I don't<br>
>> don't know if it's small enough to post here, but some of the more<br>
>> interesting errors are:<br>
>><br>
>> llvm/projects/compiler-rt/lib/<wbr>tsan/dd/dd_interceptors.cc:226<wbr>:20:<br>
>> error: redefinition of 'realpath'<br>
>> INTERCEPTOR(char*, realpath, const char *path, char *resolved_path) {<br>
>> ^<br>
>> /usr/include/bits/stdlib.h:37:<wbr>8: note: previous definition is here<br>
>> __NTH (realpath (const char *__restrict __name, char *__restrict __resolved))<br>
><br>
><br>
> I've never seen this before. Looks like bits/stdlib.h gets pulled in only<br>
> when _FORTIFY_SOURCE is enabled (which causes<br>
> __USE_FORTIFY_LEVEL > 0). Do you have _FORTIFY_SOURCE<br>
> set somewhere?<br>
<br>
</span>I do, it's by default a part of hardening flags on most Linux distros,<br>
and I'm just following what the distro packages are built with.<br>
<span class="gmail-m_-5064748096713712880gmail-m_-4086577410851125295gmail-"><br>
> Can you try with that not set?<br>
<br>
</span>I can try, but I would prefer not to since it's a wide-spread default<br>
in Linux distro<br>
as part of stack-protector use. I would use SafeStack but that's limited in<br>
applicability right now. If I did we would still have the libomp<br>
duplicate symbol<br>
error.<br></blockquote><div><br></div></div></div><div>Confirmed that when I build dd_interceptors.cc at head it normally builds fine, but when I add -D_FORTIFY_SOURCE=2 I get the same error. I poked around a little and saw that the sanitizers are not supported with FORTIFY_SOURCE (although the reasons given are different): <a href="https://sourceware.org/bugzilla/show_bug.cgi?id=20422" target="_blank">https://sourceware<wbr>.org/bugzilla/show_bug.cgi?id=<wbr>20422</a>. Looks like there was a patch proposed to emit a warning when they are both on (not sure if it went in).</div><div><br></div><div>So possibly building the tsan library itself is not tested/supported with FORTIFY_SOURCE. <a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a> is probably the best person to ask, added him.</div></div></div></div></blockquote><div><br></div><div>mixing -D_FORTIFY_SOURCE=2 with the sanitizers may be confusing as mentioned above. </div><div>building the sanitizers themselves with -D_FORTIFY_SOURCE=2 is not expected to work at all. </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"><span class="gmail-HOEnZb"><font color="#888888"><div><br></div><div>Teresa</div></font></span><span class="gmail-"><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">
<br>
Since 3.9.0 built fine with that macro, I'd blame either gcc or glibc headers or<br>
compiler-rt 3.9.1.<br>
<br>
Arch Linux's 3.9.1 recipe applies the following patch:<br>
<br>
<a href="https://git.archlinux.org/svntogit/packages.git/tree/trunk/msan-prevent-initialization-failure-with-newer-glibc.patch?h=packages/llvm" rel="noreferrer" target="_blank">https://git.archlinux.org/svnt<wbr>ogit/packages.git/tree/trunk/m<wbr>san-prevent-initialization-fai<wbr>lure-with-newer-glibc.patch?h=<wbr>packages/llvm</a><br>
<br>
all the files<br>
<a href="https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/llvm&id=a7dd5d50ec82d6a35a99f9bf92b074d4aeab1f50" rel="noreferrer" target="_blank">https://git.archlinux.org/svnt<wbr>ogit/packages.git/tree/trunk?h<wbr>=packages/llvm&id=a7dd5d50ec82<wbr>d6a35a99f9bf92b074d4aeab1f50</a><br>
</blockquote></span></div><br><br clear="all"><span class="gmail-"><div><br></div>-- <br><div class="gmail-m_-5064748096713712880gmail-m_-4086577410851125295gmail_signature"><span style="font-family:times;font-size:medium"><table cellspacing="0" cellpadding="0"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top:2px solid rgb(213,15,37)">Teresa Johnson |</td><td nowrap style="border-top:2px solid rgb(51,105,232)"> Software Engineer |</td><td nowrap style="border-top:2px solid rgb(0,153,57)"> <a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a> |</td><td nowrap style="border-top:2px solid rgb(238,178,17)"> <a href="tel:(408)%20460-2413" value="+14084602413" target="_blank">408-460-2413</a></td></tr></tbody></table></span></div>
</span></div></div>
</blockquote></div><br></div></div>