[clang] Pack relocations for Android API >= 28 (PR #117624)

Mike Hommey via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 16:34:23 PST 2025


================
@@ -256,6 +256,24 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
       ExtraOpts.push_back("-z");
       ExtraOpts.push_back("max-page-size=16384");
     }
+    if (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
----------------
glandium wrote:

The NDK only provides LLD, but one can still use another linker via -fuse-ld, and this breaks that use case. And yes, there are people doing that.

https://github.com/llvm/llvm-project/pull/117624


More information about the cfe-commits mailing list