no-no-rosegment.patch (941B)
1 Avoid adding the --no-rosegment flag when using BFD ld on Android, because versions 2 prior to binutils 2.43 don't support it. 3 4 diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp 5 index 0767fe6c5879..ced4fbf072a4 100644 6 --- a/clang/lib/Driver/ToolChains/Linux.cpp 7 +++ b/clang/lib/Driver/ToolChains/Linux.cpp 8 @@ -247,7 +247,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) 9 ExtraOpts.push_back("-z"); 10 ExtraOpts.push_back("max-page-size=16384"); 11 } 12 - if (Triple.isAndroidVersionLT(29)) { 13 + if (Triple.isAndroidVersionLT(29) && 14 + !Args.getLastArgValue(options::OPT_fuse_ld_EQ) 15 + .starts_with_insensitive("bfd")) { 16 // https://github.com/android/ndk/issues/1196 17 // The unwinder used by the crash handler on versions of Android prior to 18 // API 29 did not correctly handle binaries built with rosegment, which is