[all-commits] [llvm/llvm-project] dde44f: [test] Fix asan/TestCases/Posix/lto-constmerge-odr...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Dec 6 10:31:56 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: dde44f488c454b71d77ac022642b8711a8c340ca
      https://github.com/llvm/llvm-project/commit/dde44f488c454b71d77ac022642b8711a8c340ca
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-12-06 (Sun, 06 Dec 2020)

  Changed paths:
    M compiler-rt/test/asan/TestCases/Posix/lto-constmerge-odr.cpp

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list