Windows ASan build fail due to multiply defined _recalloc

RESOLVED FIXED

Status

Firefox Build System
General
RESOLVED FIXED
2 years ago
4 months ago

People

(Reporter: dmajor, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
With the pre-built 3.9.0 Win32 LLVM binaries, configure aborts:

 0:24.08 DEBUG: configure:5208: d:/tools/llvm-active/bin/clang-cl.EXE -Xclang -std=gnu99 -fms-compatibility-version=19.00.23918 -fallback -o conftest -fsanitize=address  -TC -nologo -wd4091 -D_HAS_EXCEPTIONS=0 -Qunused-arguments  -fsanitize=address  conftest.c  1>&5
 0:24.08 DEBUG: libucrt.lib(recalloc.obj) : error LNK2005: __recalloc already defined in clang_rt.asan-i386.lib(asan_malloc_win.cc.obj)

$ cat $MOZCONFIG
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj/asan
ac_add_options --enable-address-sanitizer
export CC=clang-cl
export CXX=clang-cl
(Reporter)

Comment 2

2 years ago
Yeah, I get the same failure if I try to build compiler-rt trunk with Visual Studio 2015. Doesn't happen with VS2013. I suspect this is related to the CRT refactoring that occurred in VS2015 (I don't recall "libucrt" existing in previous Visual Studios).

Comment 3

2 years ago
It may be a good idea to check with the Google ASan team to see if they have started the work to support MSVC 2015.  As you suspected, I'm fairly certain that some work would be needed to hook into the new runtime libraries in 2015.
(Reporter)

Comment 4

2 years ago
This was fixed by https://llvm.org/bugs/show_bug.cgi?id=30329#c14
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED

Updated

4 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.