[llvm-commits] PATCH: Build both 32-bit and 64-bit ASan runtime on x86_64 (in configure+make build)

Alexey Samsonov samsonov at google.com
Wed Sep 26 02:07:42 PDT 2012


On Tue, Sep 25, 2012 at 10:56 PM, Daniel Dunbar <daniel at zuster.org> wrote:

> Hi Alexey,
>
> 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?
>

I see the following lines already present in //compiler-rt/make/platforms/
clang_linux.mk

# Configuration for profile runtime.
ifeq ($(call contains,i386 x86_64,$(CompilerTargetArch)),true)
Configs += profile-i386 profile-x86_64
Arch.profile-i386 := i386
Arch.profile-x86_64 := x86_64
endif

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:

  COMPILE:   clang_linux/profile-i386/i386:
/home/samsonov/llvm-project/llvm2/projects/compiler-rt/lib/profile/GCDAProfiling.c
  COMPILE:   clang_linux/profile-x86_64/x86_64:
/home/samsonov/llvm-project/llvm2/projects/compiler-rt/lib/profile/GCDAProfiling.c
<...>
  FINAL-ARCHIVE: clang_linux/profile-i386:
/home/samsonov/llvm-project/llvm2/build/tools/clang/runtime/compiler-rt/clang_linux/profile-i386/libcompiler_rt.a
  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
<...>
llvm[4]: Copying runtime library linux/profile-x86_64 to build dir

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
with 32-bit libs, as ASan runtime is an archive). But it may fail to
compile other compiler-rt libraries as well then... :(


>
> 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.
>

I can't say we're quire happy with the news, but thanks for informing...


>
>  - Daniel
>
>
> On Monday, September 24, 2012, Alexander Potapenko wrote:
>
>> +Nico FHI
>>
>> On Fri, Sep 21, 2012 at 8:26 PM, Alexey Samsonov <samsonov at google.com>
>> wrote:
>> > Hi Daniel,
>> >
>> > These two patches allow building i386 ASan runtime if target arch is
>> x86_64.
>> > Typically we want both runtimes to reside
>> > in lib/clang/3.2/lib/linux/ so that "clang++ -faddress-sanitizer" could
>> work
>> > with both -m64 and -m32. Is it ok to commit?
>> >
>> > --
>> > Alexey Samsonov, MSK
>> >
>>
>>
>>
>> --
>> Alexander Potapenko
>> Software Engineer
>> Google Moscow
>>
>


-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120926/ecb9a10e/attachment.html>


More information about the llvm-commits mailing list