On Tue, Sep 25, 2012 at 10:56 PM, Daniel Dunbar <span dir="ltr"><<a href="mailto:daniel@zuster.org" target="_blank">daniel@zuster.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Alexey,<div><br></div><div>The problem with this is that not all Linux platforms are going to have multi arch support installed. To get this to work you will need to also add some configure checks to make sure that that can be used, I think?</div>
</blockquote><div><br></div><div>I see the following lines already present in //compiler-rt/make/platforms/<a href="http://clang_linux.mk">clang_linux.mk</a></div><div><br></div><div><div># Configuration for profile runtime.</div>
<div>ifeq ($(call contains,i386 x86_64,$(CompilerTargetArch)),true)</div><div>Configs += profile-i386 profile-x86_64</div><div>Arch.profile-i386 := i386</div><div>Arch.profile-x86_64 := x86_64</div><div>endif</div></div><div>
<br></div><div>As I can see, this means that on Linux x86_64 we compile profile library for both archs, but copy only one of them to the Clang resource directory:</div><div><br></div><div>  COMPILE:   clang_linux/profile-i386/i386: /home/samsonov/llvm-project/llvm2/projects/compiler-rt/lib/profile/GCDAProfiling.c</div>
<div><div>  COMPILE:   clang_linux/profile-x86_64/x86_64: /home/samsonov/llvm-project/llvm2/projects/compiler-rt/lib/profile/GCDAProfiling.c</div></div><div><...></div><div><div>  FINAL-ARCHIVE: clang_linux/profile-i386: /home/samsonov/llvm-project/llvm2/build/tools/clang/runtime/compiler-rt/clang_linux/profile-i386/libcompiler_rt.a</div>
<div>  FINAL-ARCHIVE: clang_linux/profile-x86_64: /home/samsonov/llvm-project/llvm2/build/tools/clang/runtime/compiler-rt/clang_linux/profile-x86_64/libcompiler_rt.a</div></div><div><...></div><div><div>llvm[4]: Copying runtime library linux/profile-x86_64 to build dir</div>
</div><div><br></div><div>The only problem I see with my patches is that the build may fail on 64-bit Linux systems, which won't be able to compile ASan runtime with "clang++ -m32" (note that we don't have to link</div>
<div>with 32-bit libs, as ASan runtime is an archive). But it may fail to compile other compiler-rt libraries as well then... :(</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br></div><div>FWIW, I tend to ascribe complete ownership for what happens on Linux to you guys, so I don't necessarily think you need my review on such patches. I'm not generally up to speed with what the state of the Linux world is.</div>
</blockquote><div><br></div><div>I can't say we're quire happy with the news, but thanks for informing...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888">
<div><br></div></font></span><div><span class="HOEnZb"><font color="#888888"> - Daniel</font></span><div><div class="h5"><br><br>On Monday, September 24, 2012, Alexander Potapenko  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+Nico FHI<br>
<br>
On Fri, Sep 21, 2012 at 8:26 PM, Alexey Samsonov <<a>samsonov@google.com</a>> wrote:<br>
> Hi Daniel,<br>
><br>
> These two patches allow building i386 ASan runtime if target arch is x86_64.<br>
> Typically we want both runtimes to reside<br>
> in lib/clang/3.2/lib/linux/ so that "clang++ -faddress-sanitizer" could work<br>
> with both -m64 and -m32. Is it ok to commit?<br>
><br>
> --<br>
> Alexey Samsonov, MSK<br>
><br>
<br>
<br>
<br>
--<br>
Alexander Potapenko<br>
Software Engineer<br>
Google Moscow<br>
</blockquote></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div><br>