emaste created this revision. emaste added reviewers: serge-sans-paille, craig.topper, dim. Herald added subscribers: krytarowski, arichardson. emaste requested review of this revision.
`-fstack-clash-protection` was added in Clang commit e67cbac81211 <https://reviews.llvm.org/rGe67cbac81211d40332a79d98c9d5953624cc1202> but was enabled only on Linux. Allow it on FreeBSD as well, as it works fine. https://reviews.llvm.org/D108571 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/stack-clash-protection.c Index: clang/test/Driver/stack-clash-protection.c =================================================================== --- clang/test/Driver/stack-clash-protection.c +++ clang/test/Driver/stack-clash-protection.c @@ -5,6 +5,7 @@ // SCP-i386-NO-NOT: "-fstack-clash-protection" // RUN: %clang -target x86_64-scei-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x86 +// RUN: %clang -target x86_64-unknown-freebsd -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x86 // SCP-x86: "-fstack-clash-protection" // RUN: %clang -target armv7k-apple-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-armv7 Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -3198,7 +3198,7 @@ ArgStringList &CmdArgs) { const llvm::Triple &EffectiveTriple = TC.getEffectiveTriple(); - if (!EffectiveTriple.isOSLinux()) + if (!EffectiveTriple.isOSFreeBSD() && !EffectiveTriple.isOSLinux()) return; if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() &&
Index: clang/test/Driver/stack-clash-protection.c =================================================================== --- clang/test/Driver/stack-clash-protection.c +++ clang/test/Driver/stack-clash-protection.c @@ -5,6 +5,7 @@ // SCP-i386-NO-NOT: "-fstack-clash-protection" // RUN: %clang -target x86_64-scei-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x86 +// RUN: %clang -target x86_64-unknown-freebsd -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-x86 // SCP-x86: "-fstack-clash-protection" // RUN: %clang -target armv7k-apple-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-armv7 Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -3198,7 +3198,7 @@ ArgStringList &CmdArgs) { const llvm::Triple &EffectiveTriple = TC.getEffectiveTriple(); - if (!EffectiveTriple.isOSLinux()) + if (!EffectiveTriple.isOSFreeBSD() && !EffectiveTriple.isOSLinux()) return; if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() &&
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits