<br><br><div class="gmail_quote">On Wed, Dec 7, 2011 at 3:26 PM, Daniel Dunbar <span dir="ltr"><<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Should work out of the box as of r146094, please let me know if you<br>
see problems.<br></blockquote><div><br></div><div>Yes, it works for the host platform now. Good! </div><div>What additional make command would you recommend to build the secondary platform (i386 in my case)? </div><div><br>
</div><div>--kcc </div><div><br></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"><br>
- Daniel<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Wed, Dec 7, 2011 at 2:18 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
><br>
><br>
> On Wed, Dec 7, 2011 at 1:49 PM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> I'm trying to use ASan on linux. I checked out compiler-rt into<br>
>> llvm/projects, ran `make`, and now I'm trying to compile a test file:<br>
>><br>
>> $ Release+Asserts/bin/clang -faddress-sanitizer ~/test/test.c<br>
>> /usr/bin/ld:<br>
>> /usr/local/google/chrome/src/third_party/llvm-build/Release+Asserts/lib/clang/linux/x86_64/libclang_rt.asan.a:<br>
>> No such file: No such file or directory<br>
>> clang: error: linker command failed with exit code 1 (use -v to see<br>
>> invocation)<br>
>><br>
>> That library does exist, but at a slightly different path:<br>
>> $ ls Release+Asserts/lib/clang/3.1/lib/linux/libclang_rt.asan-x86_64.a<br>
>><br>
>> third_party/llvm-build/Release+Asserts/lib/clang/3.1/lib/linux/libclang_rt.asan-x86_64.a<br>
>><br>
>> Is that user error, or are not all paths quite right yet?<br>
><br>
><br>
> Yes, we need a patch to tools/clang/lib/Driver/Tools.cpp, see above.<br>
><br>
><br>
>><br>
>> Thanks,<br>
>> Nico<br>
>><br>
>> On Wed, Dec 7, 2011 at 1:30 PM, Daniel Dunbar <<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>> wrote:<br>
>> > On Wed, Dec 7, 2011 at 1:16 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >><br>
>> >> On Wed, Dec 7, 2011 at 1:07 PM, Daniel Dunbar <<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>><br>
>> >> wrote:<br>
>> >>><br>
>> >>> On Wed, Dec 7, 2011 at 1:01 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>><br>
>> >>> wrote:<br>
>> >>> > Thanks!<br>
>> >>> ><br>
>> >>> > Question:<br>
>> >>> > There seem to be no way to build 32- and 64-bit linux libraries with<br>
>> >>> > a<br>
>> >>> > single make command.<br>
>> >>> > Am I right?<br>
>> >>><br>
>> >>> Yes.<br>
>> >>><br>
>> >>> > Do you plan to change this?<br>
>> >>><br>
>> >>> I would like to, but it's a tad tricky with the current level of build<br>
>> >>> support we have. This is also a cumbersome area to test because it<br>
>> >>> really varies quite a lot based on the host Linux system, and there is<br>
>> >>> so much diversity amongst distributions. I really wish we had a good<br>
>> >>> farm of different common Linux distros available.<br>
>> >><br>
>> >><br>
>> >> Can we build the secondary arch using a separate make command inside<br>
>> >> compiler-rt (so that we don't need to re-build the hole llvm/clang)?<br>
>> ><br>
>> > Yes, that is no problem. The difficulty is in knowing whether or not<br>
>> > we will successfully be able to build the alternate arch (-m64 on i386<br>
>> > or -m32 on x86_64), i.e. does the user have whatever multi arch<br>
>> > support is required installed. I'll see what I can do...<br>
>> ><br>
>> > - Daniel<br>
>> ><br>
>> >>><br>
>> >>><br>
>> >>> > This change requires to fix the asan driver<br>
>> >>> > in tools/clang/lib/Driver/Tools.cpp, I'll prepare a patch unless you<br>
>> >>> > have it<br>
>> >>> > ready.<br>
>> >>><br>
>> >>> I'll fix it, I'm in the area.<br>
>> >><br>
>> >><br>
>> >> Thanks!<br>
>> >><br>
>> >>><br>
>> >>><br>
>> >>> > Evgeniy, could you please prepare a similar patch for linux/arm<br>
>> >>> > (take<br>
>> >>> > r146051 and r145950 as an example)<br>
>> >>><br>
>> >>> This is going to be hard. Unless I am mistaken, there is little to no<br>
>> >>> standard for how to find the ARM toolchain to use to cross compile. Am<br>
>> >>> I mistaken?<br>
>> >>><br>
>> >>> My long term plan for fixing this is to make it blocked on good cross<br>
>> >>> compilation support in Clang, but I understand that is not ideal if<br>
>> >>> you want ASAN/ARM available in Clang ASAP.<br>
>> >><br>
>> >><br>
>> >> Let's see what Evgeniy has to say (he has been porting asan to ARM).<br>
>> >><br>
>> >> --kcc<br>
>> >><br>
>> >>><br>
>> >>><br>
>> >>> - Daniel<br>
>> >>><br>
>> >>> ><br>
>> >>> > --kcc<br>
>> >>> ><br>
>> >>> ><br>
>> >>> ><br>
>> >>> > On Wed, Dec 7, 2011 at 11:35 AM, Daniel Dunbar <<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>><br>
>> >>> > wrote:<br>
>> >>> >><br>
>> >>> >> Author: ddunbar<br>
>> >>> >> Date: Wed Dec 7 13:35:10 2011<br>
>> >>> >> New Revision: 146051<br>
>> >>> >><br>
>> >>> >> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=146051&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=146051&view=rev</a><br>
>> >>> >> Log:<br>
>> >>> >> runtime/Linux: Include the profile and ASAN libs on x86.<br>
>> >>> >><br>
>> >>> >> Modified:<br>
>> >>> >> cfe/trunk/runtime/compiler-rt/Makefile<br>
>> >>> >><br>
>> >>> >> Modified: cfe/trunk/runtime/compiler-rt/Makefile<br>
>> >>> >> URL:<br>
>> >>> >><br>
>> >>> >><br>
>> >>> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/runtime/compiler-rt/Makefile?rev=146051&r1=146050&r2=146051&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/runtime/compiler-rt/Makefile?rev=146051&r1=146050&r2=146051&view=diff</a><br>
>> >>> >><br>
>> >>> >><br>
>> >>> >><br>
>> >>> >> ==============================================================================<br>
>> >>> >> --- cfe/trunk/runtime/compiler-rt/Makefile (original)<br>
>> >>> >> +++ cfe/trunk/runtime/compiler-rt/Makefile Wed Dec 7 13:35:10 2011<br>
>> >>> >> @@ -93,10 +93,12 @@<br>
>> >>> >><br>
>> >>> >> # We currently only try to generate runtime libraries on x86.<br>
>> >>> >> ifeq ($(ARCH),x86)<br>
>> >>> >> -RuntimeLibrary.linux.Configs += full-i386<br>
>> >>> >> +RuntimeLibrary.linux.Configs += \<br>
>> >>> >> + full-i386 profile-i386 asan-i386<br>
>> >>> >> endif<br>
>> >>> >> ifeq ($(ARCH),x86_64)<br>
>> >>> >> -RuntimeLibrary.linux.Configs += full-x86_64<br>
>> >>> >> +RuntimeLibrary.linux.Configs += \<br>
>> >>> >> + full-x86_64 profile-x86_64 asan-x86_64<br>
>> >>> >> endif<br>
>> >>> >><br>
>> >>> >> endif<br>
>> >>> >><br>
>> >>> >><br>
>> >>> >> _______________________________________________<br>
>> >>> >> cfe-commits mailing list<br>
>> >>> >> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
>> >>> >> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
>> >>> ><br>
>> >>> ><br>
>> >><br>
>> >><br>
>> ><br>
>> > _______________________________________________<br>
>> > cfe-commits mailing list<br>
>> > <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
>> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
><br>
</div></div></blockquote></div><br>