HomePhabricator

[test] Fix asan/TestCases/Posix/lto-constmerge-odr.cpp when 'binutils_lto' is…

Authored by MaskRay on Dec 6 2020, 10:31 AM.

Description

[test] Fix asan/TestCases/Posix/lto-constmerge-odr.cpp when 'binutils_lto' is avaiable

If COMPILER_RT_TEST_USE_LLD is not set, config.use_lld will be False.
However, if feature 'binutils_lto' is available, lto_supported can still be True,
but config.target_cflags will not get -fuse-ld=lld from config.lto_flags

As a result, we may use clang -flto with system 'ld' which may not support the bitcode file, e.g.

ld: error: /tmp/lto-constmerge-odr-44a1ee.o: Unknown attribute kind (70) (Producer: 'LLVM12.0.0git' Reader: 'LLVM 12.0.0git')
// The system ld+LLVMgold.so do not support ATTR_KIND_MUSTPROGRESS (70).

Just require lld-available and add -fuse-ld=lld.

Details

Committed
MaskRayDec 6 2020, 10:31 AM
Parents
rGddb002d7c74c: [InstCombine] Remove replacePointer (NFC)
Branches
Unknown
Tags
Unknown