[all-commits] [llvm/llvm-project] dc0786: [clang][Driver] Pass /INFERASANLIBS:NO to link.exe...

aeubanks via All-commits all-commits at lists.llvm.org
Fri Feb 24 09:35:10 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dc07867dc9991c982bd3441da19d6fcc16ea54d6
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/MSVC.cpp
    M clang/test/Driver/cl-link.c

  Log Message:
  [clang][Driver] Pass /INFERASANLIBS:NO to link.exe under -fsanitize=address

With recent MSVC releases, STL headers will add /INFERASANLIBS to the drectve section of object files that are compiled with clang. With this flag, link.exe will automatically attempt to look for asan libs.

When using clang as the driver to invoke the linker, we want to disable this feature because we explicitly pass the proper asan libraries, otherwise we get symbols defined multiple times.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D144684

More information about the All-commits mailing list