You're right that ASAN+gold in our build system is wonky. It works but
clang actually calls out to ld rather than gold. I think this is purely
because we pass -Wl,-fuse-ld=gold instead of -fuse-ld=gold.

I confirmed that clang can call out to gold correctly if you give it the
right option:

$IMPALA_TOOLCHAIN/llvm-3.8.0-p1/bin/clang -v
-B $IMPALA_TOOLCHAIN/binutils-2.26-p1/bin/ -Wall -fuse-ld=gold
-fsanitize=address helloworld.c -o helloworld && ./helloworld

The last lines of output are:
 "/opt/Impala-Toolchain/binutils-2.26-p1/bin/" -z relro
--hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ -o helloworld
-L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu
-L/opt/Impala-Toolchain/llvm-3.8.0-p1/bin/../lib -L/lib -L/usr/lib
/tmp/helloworld-eb4915.o --no-as-needed -lpthread -lrt -lm -ldl -lgcc
--as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5.4.0/crtend.o
Hello world

On Thu, Oct 13, 2016 at 8:28 AM, Jim Apple <> wrote:

> I think clang doesn't have a CLI option to use gold. Does -asan
> interact well with gold?
> On Thu, Oct 13, 2016 at 8:25 AM, Tim Armstrong <>
> wrote:
> > The gold linker is much faster for building static binaries so will be
> much
> > friendlier for new developers.
> >
> > I don't think I've seen a problem attributable to gold since it was
> added ~
> > 6 months ago. I've been using it since then and we've been using it for
> > some Impala test jobs as well for at least a couple of months. I feel
> > confident that any major problems have been shaken out.
> >
> > Does anyone have any objections?
> >
> > - Tim
> >

Reply via email to