Index: compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc =================================================================== --- compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc +++ compiler-rt/test/asan/TestCases/Darwin/odr-lto.cc @@ -1,10 +1,10 @@ -// Check that -asan-use-private-alias and use_odr_indicator=1 silence the false +// Check that -asan-use-odr-indicator and use_odr_indicator=1 silence the false // positive ODR violation on Darwin with LTO. // REQUIRES: lto -// RUN: %clangxx_asan -DPART=0 -c %s -o %t-1.o -flto -mllvm -asan-use-private-alias -// RUN: %clangxx_asan -DPART=1 -c %s -o %t-2.o -flto -mllvm -asan-use-private-alias +// RUN: %clangxx_asan -DPART=0 -c %s -o %t-1.o -flto -mllvm -asan-use-odr-indicator +// RUN: %clangxx_asan -DPART=1 -c %s -o %t-2.o -flto -mllvm -asan-use-odr-indicator // RUN: %clangxx_asan %t-1.o %t-2.o -o %t -flto // RUN: %env_asan_opts=use_odr_indicator=1 %run %t 2>&1 | FileCheck %s Index: compiler-rt/test/asan/TestCases/Linux/local_alias.cc =================================================================== --- compiler-rt/test/asan/TestCases/Linux/local_alias.cc +++ compiler-rt/test/asan/TestCases/Linux/local_alias.cc @@ -7,9 +7,9 @@ // FIXME: https://github.com/google/sanitizers/issues/316 // XFAIL: android // -// RUN: %clangxx_asan -DBUILD_INSTRUMENTED_DSO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %t-INSTRUMENTED-SO.so +// RUN: %clangxx_asan -DBUILD_INSTRUMENTED_DSO=1 -fPIC -shared -mllvm -asan-use-odr-indicator %s -o %t-INSTRUMENTED-SO.so // RUN: %clangxx -DBUILD_UNINSTRUMENTED_DSO=1 -fPIC -shared %s -o %t-UNINSTRUMENTED-SO.so -// RUN: %clangxx %s -c -mllvm -asan-use-private-alias -o %t.o +// RUN: %clangxx %s -c -mllvm -asan-use-odr-indicator -o %t.o // RUN: %clangxx_asan %t.o %t-UNINSTRUMENTED-SO.so %t-INSTRUMENTED-SO.so -o %t-EXE // RUN: %env_asan_opts=use_odr_indicator=true %run %t-EXE Index: compiler-rt/test/asan/TestCases/Linux/odr-violation.cc =================================================================== --- compiler-rt/test/asan/TestCases/Linux/odr-violation.cc +++ compiler-rt/test/asan/TestCases/Linux/odr-violation.cc @@ -24,8 +24,8 @@ // RUN: rm -f %t.supp // // Use private aliases for global variables: use indicator symbol to detect ODR violation. -// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-private-alias %s -o %t-ODR-SO.so -DSZ=100 -// RUN: %clangxx_asan -mllvm -asan-use-private-alias %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE +// RUN: %clangxx_asan -DBUILD_SO=1 -fPIC -shared -mllvm -asan-use-odr-indicator %s -o %t-ODR-SO.so -DSZ=100 +// RUN: %clangxx_asan -mllvm -asan-use-odr-indicator %s %t-ODR-SO.so -Wl,-R. -o %t-ODR-EXE // RUN: %env_asan_opts=fast_unwind_on_malloc=0 %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: %env_asan_opts=fast_unwind_on_malloc=0:use_odr_indicator=false %run %t-ODR-EXE 2>&1 | FileCheck %s --check-prefix=DISABLED // RUN: %env_asan_opts=fast_unwind_on_malloc=0:use_odr_indicator=true not %run %t-ODR-EXE 2>&1 | FileCheck %s Index: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp =================================================================== --- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -343,11 +343,10 @@ cl::desc("Force optimization experiment (for testing)"), cl::Hidden, cl::init(0)); -static cl::opt - ClUsePrivateAliasForGlobals("asan-use-private-alias", - cl::desc("Use private aliases for global" - " variables"), - cl::Hidden, cl::init(false)); +static cl::opt ClUseOdrIndicator("asan-use-odr-indicator", + cl::desc("Use private aliases for global" + " variables"), + cl::Hidden, cl::init(false)); static cl::opt ClUseGlobalsGC("asan-globals-live-support", @@ -2173,7 +2172,7 @@ bool CanUsePrivateAliases = TargetTriple.isOSBinFormatELF() || TargetTriple.isOSBinFormatMachO() || TargetTriple.isOSBinFormatWasm(); - if (CanUsePrivateAliases && ClUsePrivateAliasForGlobals) { + if (CanUsePrivateAliases && ClUseOdrIndicator) { // Create local alias for NewGlobal to avoid crash on ODR between // instrumented and non-instrumented libraries. auto *GA = Index: llvm/test/Instrumentation/AddressSanitizer/local_alias.ll =================================================================== --- llvm/test/Instrumentation/AddressSanitizer/local_alias.ll +++ llvm/test/Instrumentation/AddressSanitizer/local_alias.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -asan -asan-module -asan-use-private-alias=1 -S | FileCheck %s +; RUN: opt < %s -asan -asan-module -asan-use-odr-indicator=1 -S | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu"