Skip to content

Commit 7b18bfd

Browse files
committed
[Android] Drop workarounds for older Android API levels
Drop workarounds for Android API levels pre 9, 17, 21 and 23.
1 parent 79d1524 commit 7b18bfd

File tree

11 files changed

+12
-77
lines changed

11 files changed

+12
-77
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7870,7 +7870,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
78707870

78717871
if (Triple.isAArch64() &&
78727872
(Args.hasArg(options::OPT_mno_fmv) ||
7873-
(Triple.isAndroid() && Triple.isAndroidVersionLT(23)) ||
78747873
getToolChain().GetRuntimeLibType(Args) != ToolChain::RLT_CompilerRT)) {
78757874
// Disable Function Multiversioning on AArch64 target.
78767875
CmdArgs.push_back("-target-feature");

clang/lib/Driver/ToolChains/Linux.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,10 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
300300
// and the MIPS ABI require .dynsym to be sorted in different ways.
301301
// .gnu.hash needs symbols to be grouped by hash code whereas the MIPS
302302
// ABI requires a mapping between the GOT and the symbol table.
303-
// Android loader does not support .gnu.hash until API 23.
304303
// Hexagon linker/loader does not support .gnu.hash
305304
if (!IsMips && !IsHexagon) {
306305
if (Distro.IsOpenSUSE() || Distro == Distro::UbuntuLucid ||
307-
Distro == Distro::UbuntuJaunty || Distro == Distro::UbuntuKarmic ||
308-
(IsAndroid && Triple.isAndroidVersionLT(23)))
306+
Distro == Distro::UbuntuJaunty || Distro == Distro::UbuntuKarmic)
309307
ExtraOpts.push_back("--hash-style=both");
310308
else
311309
ExtraOpts.push_back("--hash-style=gnu");

clang/test/Driver/aarch64-features.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@
88
// CHECK: fno-signed-char
99

1010
// Check Function Multi Versioning option and rtlib dependency.
11-
// RUN: %clang --target=aarch64-linux-android23 -rtlib=compiler-rt \
12-
// RUN: -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FMV %s
1311
// RUN: %clang --target=aarch64-linux-android -rtlib=compiler-rt \
14-
// RUN: -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FMV-OFF %s
12+
// RUN: -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FMV %s
1513
// RUN: %clang --target=aarch64-linux-android -rtlib=compiler-rt -mno-fmv \
1614
// RUN: -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FMV-OFF %s
17-
// RUN: %clang --target=aarch64-linux-android22 -rtlib=compiler-rt \
18-
// RUN: -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FMV-OFF %s
1915

2016
// RUN: %clang --target=aarch64-linux-gnu -rtlib=libgcc \
2117
// RUN: -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-FMV-OFF %s

clang/test/Driver/aarch64-fmv.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
// Test which driver flags enable/disable Function Multiversioning on aarch64.
22

3-
// FMV is enabled for non-android aarch64 targets:
3+
// FMV is enabled with compiler-rt:
44
// RUN: %clang --target=aarch64 --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s
55
// RUN: %clang --target=aarch64-linux-gnu --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s
6+
// RUN: %clang --target=aarch64-linux-android --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s
67
// RUN: %clang --target=arm64-apple-ios --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s
78
// RUN: %clang --target=arm64-apple-macosx --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s
89

9-
// android23 defaults to --rtlib=compiler-rt:
10-
// RUN: %clang --target=aarch64-linux-android23 -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s
11-
// RUN: %clang --target=aarch64-linux-android23 --rtlib=compiler-rt -### -c %s 2>&1 | FileCheck -check-prefix=FMV-ENABLED %s
12-
1310
// FMV is disabled without compiler-rt:
1411
// RUN: %clang --rtlib=libgcc --target=aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s
1512
// RUN: %clang --rtlib=libgcc --target=aarch64-linux-gnu -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s
1613

17-
// Disabled for older android versions:
18-
// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s
19-
// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android22 -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s
20-
// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android22 -mno-fmv -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s
21-
2214
// Disabled explicitly:
2315
// RUN: %clang --rtlib=compiler-rt --target=aarch64 -mno-fmv -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s
2416
// RUN: %clang --rtlib=compiler-rt --target=aarch64-linux-android23 -mno-fmv -### -c %s 2>&1 | FileCheck -check-prefix=FMV-DISABLED %s

clang/test/Driver/linux-ld.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -926,16 +926,9 @@
926926
// CHECK-MIPS64EL-REDHAT-NOT: "-dynamic-linker" "{{.*}}/lib{{(64)?}}/ld-musl-mipsel.so.1"
927927
// CHECK-MIPS64EL-REDHAT-NOT: "--hash-style={{gnu|both}}"
928928

929-
// Check that we pass --hash-style=both for pre-M Android versions and
930-
// --hash-style=gnu for newer Android versions.
929+
// Check that we pass for Android.
931930
// RUN: %clang -### %s -no-pie 2>&1 \
932-
// RUN: --target=armv7-linux-android21 \
933-
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-HASH-STYLE-L %s
934-
// CHECK-ANDROID-HASH-STYLE-L: "{{.*}}ld{{(.exe)?}}"
935-
// CHECK-ANDROID-HASH-STYLE-L: "--hash-style=both"
936-
//
937-
// RUN: %clang -### %s -no-pie 2>&1 \
938-
// RUN: --target=armv7-linux-android23 \
931+
// RUN: --target=armv7-linux-android \
939932
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-HASH-STYLE-M %s
940933
// CHECK-ANDROID-HASH-STYLE-M: "{{.*}}ld{{(.exe)?}}"
941934
// CHECK-ANDROID-HASH-STYLE-M: "--hash-style=gnu"

llvm/include/llvm/IR/RuntimeLibcalls.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ struct RuntimeLibcallsInfo {
225225

226226
/// Return true if the target has sincosf/sincos/sincosl functions
227227
static bool hasSinCos(const Triple &TT) {
228-
return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
229-
(TT.isAndroid() && !TT.isAndroidVersionLT(9));
228+
return TT.isGNUEnvironment() || TT.isOSFuchsia() || TT.isAndroid();
230229
}
231230

232231
static bool hasSinCos_f32_f64(const Triple &TT) {

llvm/lib/Target/X86/X86ISelLoweringCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ unsigned X86TargetLowering::getAddressSpace() const {
547547

548548
static bool hasStackGuardSlotTLS(const Triple &TargetTriple) {
549549
return TargetTriple.isOSGlibc() || TargetTriple.isOSFuchsia() ||
550-
(TargetTriple.isAndroid() && !TargetTriple.isAndroidVersionLT(17));
550+
TargetTriple.isAndroid();
551551
}
552552

553553
static Constant* SegmentOffset(IRBuilderBase &IRB,

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,7 @@ static ShadowMapping getShadowMapping(const Triple &TargetTriple, int LongSize,
600600
!IsRISCV64 && !IsLoongArch64 &&
601601
!(Mapping.Offset & (Mapping.Offset - 1)) &&
602602
Mapping.Offset != kDynamicShadowSentinel;
603-
bool IsAndroidWithIfuncSupport =
604-
IsAndroid && !TargetTriple.isAndroidVersionLT(21);
605-
Mapping.InGlobal = ClWithIfunc && IsAndroidWithIfuncSupport && IsArmOrThumb;
603+
Mapping.InGlobal = ClWithIfunc && IsAndroid && IsArmOrThumb;
606604

607605
return Mapping;
608606
}

llvm/test/CodeGen/ARM/sincos.ll

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
; RUN: llc < %s -mtriple=armv7-apple-ios7 -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS
33
; RUN: llc < %s -mtriple=armv7-linux-gnu -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS-GNU
44
; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS-GNU
5-
; RUN: llc < %s -mtriple=armv7-linux-android -mcpu=cortex-a8 | FileCheck %s --check-prefix=NOOPT-ANDROID
6-
; RUN: llc < %s -mtriple=armv7-linux-android9 -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS-GNU
5+
; RUN: llc < %s -mtriple=armv7-linux-android -mcpu=cortex-a8 | FileCheck %s --check-prefix=SINCOS-GNU
76

87
; Combine sin / cos into a single call unless they may write errno (as
98
; captured by readnone attrbiute, controlled by clang -fmath-errno
@@ -22,10 +21,6 @@ entry:
2221
; NOOPT: bl _sinf
2322
; NOOPT: bl _cosf
2423

25-
; NOOPT-ANDROID-LABEL: test1:
26-
; NOOPT-ANDROID: bl sinf
27-
; NOOPT-ANDROID: bl cosf
28-
2924
%call = tail call float @sinf(float %x) readnone
3025
%call1 = tail call float @cosf(float %x) readnone
3126
%add = fadd float %call, %call1
@@ -44,10 +39,6 @@ entry:
4439
; NOOPT: bl _sinf
4540
; NOOPT: bl _cosf
4641

47-
; NOOPT-ANDROID-LABEL: test1_fast:
48-
; NOOPT-ANDROID: bl sinf
49-
; NOOPT-ANDROID: bl cosf
50-
5142
%call = tail call fast float @sinf(float %x) readnone
5243
%call1 = tail call fast float @cosf(float %x) readnone
5344
%add = fadd float %call, %call1
@@ -68,10 +59,6 @@ entry:
6859
; NOOPT: bl _sinf
6960
; NOOPT: bl _cosf
7061

71-
; NOOPT-ANDROID-LABEL: test1_errno:
72-
; NOOPT-ANDROID: bl sinf
73-
; NOOPT-ANDROID: bl cosf
74-
7562
%call = tail call float @sinf(float %x)
7663
%call1 = tail call float @cosf(float %x)
7764
%add = fadd float %call, %call1
@@ -90,10 +77,6 @@ entry:
9077
; NOOPT: bl _sin
9178
; NOOPT: bl _cos
9279

93-
; NOOPT-ANDROID-LABEL: test2:
94-
; NOOPT-ANDROID: bl sin
95-
; NOOPT-ANDROID: bl cos
96-
9780
%call = tail call double @sin(double %x) readnone
9881
%call1 = tail call double @cos(double %x) readnone
9982
%add = fadd double %call, %call1
@@ -112,10 +95,6 @@ entry:
11295
; NOOPT: bl _sin
11396
; NOOPT: bl _cos
11497

115-
; NOOPT-ANDROID-LABEL: test2_fast:
116-
; NOOPT-ANDROID: bl sin
117-
; NOOPT-ANDROID: bl cos
118-
11998
%call = tail call fast double @sin(double %x) readnone
12099
%call1 = tail call fast double @cos(double %x) readnone
121100
%add = fadd double %call, %call1
@@ -136,10 +115,6 @@ entry:
136115
; NOOPT: bl _sin
137116
; NOOPT: bl _cos
138117

139-
; NOOPT-ANDROID-LABEL: test2_errno:
140-
; NOOPT-ANDROID: bl sin
141-
; NOOPT-ANDROID: bl cos
142-
143118
%call = tail call double @sin(double %x)
144119
%call1 = tail call double @cos(double %x)
145120
%add = fadd double %call, %call1

llvm/test/CodeGen/X86/stack-protector-target.ll

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
; RUN: llc -mtriple=i386-linux < %s -o - | FileCheck --check-prefix=I386-TLS %s
33
; RUN: llc -mtriple=x86_64-linux < %s -o - | FileCheck --check-prefix=X64-TLS %s
44

5-
; RUN: llc -mtriple=i386-linux-android < %s -o - | FileCheck --check-prefix=I386 %s
6-
; RUN: llc -mtriple=i386-linux-android16 < %s -o - | FileCheck --check-prefix=I386 %s
7-
; RUN: llc -mtriple=i386-linux-android17 < %s -o - | FileCheck --check-prefix=I386-TLS %s
8-
; RUN: llc -mtriple=i386-linux-android24 < %s -o - | FileCheck --check-prefix=I386-TLS %s
5+
; RUN: llc -mtriple=i386-linux-android < %s -o - | FileCheck --check-prefix=I386-TLS %s
96
; RUN: llc -mtriple=x86_64-linux-android < %s -o - | FileCheck --check-prefix=X64-TLS %s
10-
; RUN: llc -mtriple=x86_64-linux-android17 < %s -o - | FileCheck --check-prefix=X64-TLS %s
11-
; RUN: llc -mtriple=x86_64-linux-android24 < %s -o - | FileCheck --check-prefix=X64-TLS %s
127

138
; RUN: llc -mtriple=i386-kfreebsd < %s -o - | FileCheck --check-prefix=I386-TLS %s
149
; RUN: llc -mtriple=x86_64-kfreebsd < %s -o - | FileCheck --check-prefix=X64-TLS %s
@@ -27,11 +22,6 @@ declare void @_Z7CapturePi(ptr)
2722
; X64-TLS: movq %fs:40, %[[C:.*]]
2823
; X64-TLS: cmpq 16(%rsp), %[[C]]
2924

30-
; I386: movl __stack_chk_guard, %[[B:.*]]
31-
; I386: movl %[[B]], 8(%esp)
32-
; I386: movl __stack_chk_guard, %[[C:.*]]
33-
; I386: cmpl 8(%esp), %[[C]]
34-
3525
; I386-TLS: movl %gs:20, %[[B:.*]]
3626
; I386-TLS: movl %[[B]], 8(%esp)
3727
; I386-TLS: movl %gs:20, %[[C:.*]]

0 commit comments

Comments
 (0)