diff --git a/clang/include/clang/Driver/ToolChain.h b/clang/include/clang/Driver/ToolChain.h index abd87685f7c5..dad861d586cb 100644 --- a/clang/include/clang/Driver/ToolChain.h +++ b/clang/include/clang/Driver/ToolChain.h @@ -487,9 +487,6 @@ public: /// Test whether this toolchain defaults to PIE. virtual bool isPIEDefault(const llvm::opt::ArgList &Args) const = 0; - /// Test whether this toolchaind defaults to non-executable stacks. - virtual bool isNoExecStackDefault() const; - /// Tests whether this toolchain forces its default for PIC, PIE or /// non-PIC. If this returns true, any PIC related flags should be ignored /// and instead the results of \c isPICDefault() and \c isPIEDefault(const diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index d9fcff73213b..6588cdf9fecd 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -110,10 +110,6 @@ bool ToolChain::useRelaxRelocations() const { return ENABLE_X86_RELAX_RELOCATIONS; } -bool ToolChain::isNoExecStackDefault() const { - return false; -} - SanitizerArgs ToolChain::getSanitizerArgs(const llvm::opt::ArgList &JobArgs) const { SanitizerArgs SanArgs(*this, JobArgs, !SanitizerArgsChecked); diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index bcf3d41b585f..88e1764a9dad 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -2439,7 +2439,7 @@ static void CollectArgsForIntegratedAssembler(Compilation &C, bool TakeNextArg = false; bool UseRelaxRelocations = C.getDefaultToolChain().useRelaxRelocations(); - bool UseNoExecStack = C.getDefaultToolChain().isNoExecStackDefault(); + bool UseNoExecStack = false; const char *MipsTargetFeature = nullptr; StringRef ImplicitIt; for (const Arg *A : diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp index de74334f0166..7aeadd84dfee 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp @@ -429,11 +429,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("text"); } - if (ToolChain.isNoExecStackDefault()) { - CmdArgs.push_back("-z"); - CmdArgs.push_back("noexecstack"); - } - if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); @@ -707,10 +702,6 @@ void tools::gnutools::Assembler::ConstructJob(Compilation &C, } } - if (getToolChain().isNoExecStackDefault()) { - CmdArgs.push_back("--noexecstack"); - } - switch (getToolChain().getArch()) { default: break; diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp index 83b1e2b1df97..0224383e63a1 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -680,10 +680,6 @@ bool Linux::IsAArch64OutlineAtomicsDefault(const ArgList &Args) const { return true; } -bool Linux::isNoExecStackDefault() const { - return getTriple().isAndroid(); -} - bool Linux::IsMathErrnoDefault() const { if (getTriple().isAndroid()) return false; diff --git a/clang/lib/Driver/ToolChains/Linux.h b/clang/lib/Driver/ToolChains/Linux.h index 0f11b1a7faaf..a5ec33bd44f1 100644 --- a/clang/lib/Driver/ToolChains/Linux.h +++ b/clang/lib/Driver/ToolChains/Linux.h @@ -44,7 +44,6 @@ public: bool IsAArch64OutlineAtomicsDefault(const llvm::opt::ArgList &Args) const override; bool isPIEDefault(const llvm::opt::ArgList &Args) const override; - bool isNoExecStackDefault() const override; bool IsMathErrnoDefault() const override; SanitizerMask getSupportedSanitizers() const override; void addProfileRTLibs(const llvm::opt::ArgList &Args, diff --git a/clang/test/Driver/integrated-as.c b/clang/test/Driver/integrated-as.c index 170515579b1a..dfd669a626bd 100644 --- a/clang/test/Driver/integrated-as.c +++ b/clang/test/Driver/integrated-as.c @@ -14,8 +14,3 @@ // NOFIAS: -cc1 // NOFIAS: "-fno-verbose-asm" // NOFIAS: -no-integrated-as - -// RUN: %clang -target arm-linux-androideabi -### \ -// RUN: -integrated-as -c %s 2>&1 \ -// RUN: | FileCheck -check-prefix=CHECK-ARM-ANDROID %s -// CHECK-ARM-ANDROID: "-mnoexecstack" diff --git a/clang/test/Driver/linux-as.c b/clang/test/Driver/linux-as.c index 0959bd7ba0a1..8da1dbe595e8 100644 --- a/clang/test/Driver/linux-as.c +++ b/clang/test/Driver/linux-as.c @@ -108,12 +108,12 @@ // RUN: %clang -target arm-linux-androideabi -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-ANDROID %s -// CHECK-ARM-ANDROID: as{{(.exe)?}}" "--noexecstack" "-EL" "-mfloat-abi=soft" +// CHECK-ARM-ANDROID: as{{(.exe)?}}" "-EL" "-mfloat-abi=soft" // // RUN: %clang -target arm-linux-androideabi -march=armv7-a -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=CHECK-ARM-ANDROID-SOFTFP %s -// CHECK-ARM-ANDROID-SOFTFP: as{{(.exe)?}}" "--noexecstack" "-EL" "-mfloat-abi=softfp" "-march=armv7-a" +// CHECK-ARM-ANDROID-SOFTFP: as{{(.exe)?}}" "-EL" "-mfloat-abi=softfp" "-march=armv7-a" // // RUN: %clang -target arm-linux-eabi -mhard-float -### \ // RUN: -no-integrated-as -c %s 2>&1 \ diff --git a/clang/test/Driver/linux-ld.c b/clang/test/Driver/linux-ld.c index bbb54c76e6a4..89fd22f7e8c6 100644 --- a/clang/test/Driver/linux-ld.c +++ b/clang/test/Driver/linux-ld.c @@ -989,15 +989,6 @@ // CHECK-ANDROID-HASH-STYLE-M: "{{.*}}ld{{(.exe)?}}" // CHECK-ANDROID-HASH-STYLE-M: "--hash-style=gnu" -// RUN: %clang %s -### -o %t.o 2>&1 \ -// RUN: --target=armv7-linux-android21 \ -// RUN: | FileCheck --check-prefix=CHECK-ANDROID-NOEXECSTACK %s -// CHECK-ANDROID-NOEXECSTACK: "{{.*}}ld{{(.exe)?}}" -// CHECK-ANDROID-NOEXECSTACK: "-z" "noexecstack" -// CHECK-ANDROID-NOEXECSTACK-NOT: "-z" "execstack" -// CHECK-ANDROID-NOEXECSTACK-NOT: "-z,execstack" -// CHECK-ANDROID-NOEXECSTACK-NOT: "-zexecstack" - // RUN: %clang %s -### -o %t.o 2>&1 \ // RUN: --target=armv7-linux-android21 \ // RUN: | FileCheck --check-prefix=CHECK-ANDROID-WARN-SHARED-TEXTREL %s