Skip to content

Commit df57979

Browse files
committedApr 9, 2019
hwasan: Enable -hwasan-allow-ifunc by default.
It's been on in Android for a while without causing problems, so it's time to make it the default and remove the flag. Differential Revision: https://reviews.llvm.org/D60355 llvm-svn: 357960
1 parent 6c11a31 commit df57979

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed
 

‎compiler-rt/test/hwasan/lit.cfg

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ config.test_source_root = os.path.dirname(__file__)
1111
# Setup default compiler flags used with -fsanitize=memory option.
1212
clang_cflags = [config.target_cflags] + config.debug_info_flags
1313
clang_cxxflags = config.cxx_mode_flags + clang_cflags
14-
clang_hwasan_cflags = ["-fsanitize=hwaddress", "-mllvm", "-hwasan-generate-tags-with-calls",
15-
"-mllvm", "-hwasan-allow-ifunc"] + clang_cflags
14+
clang_hwasan_cflags = ["-fsanitize=hwaddress", "-mllvm", "-hwasan-generate-tags-with-calls"] + clang_cflags
1615
clang_hwasan_cxxflags = config.cxx_mode_flags + clang_hwasan_cflags
1716

1817
def build_invocation(compile_flags):

‎llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ static cl::opt<bool> ClInlineAllChecks("hwasan-inline-all-checks",
160160
cl::desc("inline all checks"),
161161
cl::Hidden, cl::init(false));
162162

163-
static cl::opt<bool> ClAllowIfunc("hwasan-allow-ifunc",
164-
cl::desc("allow the use of ifunc"),
165-
cl::Hidden, cl::init(false));
166-
167163
namespace {
168164

169165
/// An instrumentation pass implementing detection of addressability bugs
@@ -836,7 +832,7 @@ Value *HWAddressSanitizer::emitPrologue(IRBuilder<> &IRB,
836832
if (!Mapping.InTls)
837833
return getDynamicShadowNonTls(IRB);
838834

839-
if (ClAllowIfunc && !WithFrameRecord && TargetTriple.isAndroid())
835+
if (!WithFrameRecord && TargetTriple.isAndroid())
840836
return getDynamicShadowIfunc(IRB);
841837

842838
Value *SlotPtr = getHwasanThreadSlotPtr(IRB, IntptrTy);

‎llvm/test/Instrumentation/HWAddressSanitizer/lazy-thread-init.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt -S -hwasan -hwasan-allow-ifunc < %s | FileCheck %s
1+
; RUN: opt -S -hwasan < %s | FileCheck %s
22

33
target triple = "aarch64--linux-android"
44

‎llvm/test/Instrumentation/HWAddressSanitizer/prologue.ll

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
; Test -hwasan-with-ifunc flag.
22
;
3-
; RUN: opt -hwasan -hwasan-allow-ifunc -S < %s | \
3+
; RUN: opt -hwasan -S < %s | \
44
; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-NOGLOBAL,CHECK-TLS,CHECK-HISTORY
5-
; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=1 < %s | \
5+
; RUN: opt -hwasan -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=1 < %s | \
66
; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-NOGLOBAL,CHECK-TLS,CHECK-HISTORY
7-
; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=0 < %s | \
7+
; RUN: opt -hwasan -S -hwasan-with-ifunc=0 -hwasan-with-tls=1 -hwasan-record-stack-history=0 < %s | \
88
; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-NOGLOBAL,CHECK-IFUNC,CHECK-NOHISTORY
9-
; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=0 -hwasan-with-tls=0 < %s | \
9+
; RUN: opt -hwasan -S -hwasan-with-ifunc=0 -hwasan-with-tls=0 < %s | \
1010
; RUN: FileCheck %s --check-prefixes=CHECK,CHECK-GLOBAL,CHECK-NOHISTORY
11-
; RUN: opt -hwasan -hwasan-allow-ifunc -S -hwasan-with-ifunc=1 -hwasan-with-tls=0 < %s | \
11+
; RUN: opt -hwasan -S -hwasan-with-ifunc=1 -hwasan-with-tls=0 < %s | \
1212
; RUN: FileCheck %s --check-prefixes=CHECK,CHECk-NOGLOBAL,CHECK-IFUNC,CHECK-NOHISTORY
1313

1414
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"

0 commit comments

Comments
 (0)
Please sign in to comment.