llvm-project/lld/test/COFF/inferasanlibs-drectve.s
Alvin Wong 8fa0cfeb61 [LLD][COFF] Add /inferasanlibs to lld-link as ignored flag
MSVC link.exe added this flag and MS STL started using this flag in
.drectve [1] when compiling with Clang with asan enabled, as reported
on https://github.com/llvm/llvm-project/issues/56300. This causes issues
with lld-link because it rejects any unknown flags in .drective sections.

As dc07867dc9991c982bd3441da19d6fcc16ea54d6 noted that, when using Clang
as the driver it explicitly passes the proper asan libraries. Therefore
it should be acceptable to ignore this flag in lld-link to at least
unbreak building with clang-cl and linking with lld-link.

[1]: faaf094ee1/stl/inc/__msvc_sanitizer_annotate_container.hpp (L35)

Differential Revision: https://reviews.llvm.org/D149023
2023-04-24 22:06:34 +08:00

17 lines
396 B
ArmAsm

# REQUIRES: x86
# RUN: llvm-mc -triple=x86_64-windows %s -filetype=obj -o %t.obj
# RUN: lld-link -dll -out:%t.dll -entry:entry %t.obj -subsystem:console 2>&1 | FileCheck --allow-empty --ignore-case %s
# CHECK-NOT: ignoring unknown argument
# CHECK-NOT: inferasanlibs
# CHECK-NOT: is not allowed in .drectve
.global entry
.text
entry:
ret
.section .drectve
.ascii " /INFERASANLIBS "