[llvm-branch-commits] [clang] 0c01bbf - Revert "Disable rosegment for old Android versions."

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 15 19:19:46 PST 2021


Author: Nico Weber
Date: 2021-02-15T19:19:19-08:00
New Revision: 0c01bbf4e9d517f4c6422647e6d7c362b621ea42

URL: https://github.com/llvm/llvm-project/commit/0c01bbf4e9d517f4c6422647e6d7c362b621ea42
DIFF: https://github.com/llvm/llvm-project/commit/0c01bbf4e9d517f4c6422647e6d7c362b621ea42.diff

LOG: Revert "Disable rosegment for old Android versions."

This reverts commit fae16fc0eed7cf60207901818cfe040116f2ef00.
Breaks building compiler-rt android runtimes with trunk clang
but older NDK, see discussion on https://reviews.llvm.org/D95166

(cherry picked from commit 1608ba09462d877111230e9461b895f696f8fcb1)

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Linux.cpp
    clang/test/Driver/linux-ld.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index e17a6bd4bdd2..9663a7390ada 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -236,15 +236,6 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
     ExtraOpts.push_back("relro");
   }
 
-  if (Triple.isAndroid() && Triple.isAndroidVersionLT(29)) {
-    // https://github.com/android/ndk/issues/1196
-    // The unwinder used by the crash handler on versions of Android prior to
-    // API 29 did not correctly handle binaries built with rosegment, which is
-    // enabled by default for LLD. Android only supports LLD, so it's not an
-    // issue that this flag is not accepted by other linkers.
-    ExtraOpts.push_back("--no-rosegment");
-  }
-
   // Android ARM/AArch64 use max-page-size=4096 to reduce VMA usage. Note, lld
   // from 11 onwards default max-page-size to 65536 for both ARM and AArch64.
   if ((Triple.isARM() || Triple.isAArch64()) && Triple.isAndroid()) {

diff  --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c
index 0b788ffcb852..24d3c78643f8 100644
--- a/clang/test/Driver/linux-ld.c
+++ b/clang/test/Driver/linux-ld.c
@@ -1089,20 +1089,6 @@
 // CHECK-ANDROID-HASH-STYLE-M: "{{.*}}ld{{(.exe)?}}"
 // CHECK-ANDROID-HASH-STYLE-M: "--hash-style=gnu"
 
-// Check that we pass --no-rosegment for pre-29 Android versions and do not for
-// 29+.
-// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN:     --target=armv7-linux-android28 \
-// RUN:   | FileCheck --check-prefix=CHECK-ANDROID-ROSEGMENT-28 %s
-// CHECK-ANDROID-ROSEGMENT-28: "{{.*}}ld{{(.exe)?}}"
-// CHECK-ANDROID-ROSEGMENT-28: "--no-rosegment"
-//
-// RUN: %clang %s -### -o %t.o 2>&1 \
-// RUN:     --target=armv7-linux-android29 \
-// RUN:   | FileCheck --check-prefix=CHECK-ANDROID-ROSEGMENT-29 %s
-// CHECK-ANDROID-ROSEGMENT-29: "{{.*}}ld{{(.exe)?}}"
-// CHECK-ANDROID-ROSEGMENT-29-NOT: "--no-rosegment"
-
 // RUN: %clang %s -### -o %t.o 2>&1 \
 // RUN:     --target=armv7-linux-android21 \
 // RUN:   | FileCheck --check-prefix=CHECK-ANDROID-NOEXECSTACK %s


        


More information about the llvm-branch-commits mailing list