Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -3081,9 +3081,6 @@ ArgStringList &CmdArgs) { const llvm::Triple &EffectiveTriple = TC.getEffectiveTriple(); - if (!EffectiveTriple.isOSLinux()) - return; - if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() && !EffectiveTriple.isPPC64()) return; Index: clang/test/Driver/stack-clash-protection.c =================================================================== --- clang/test/Driver/stack-clash-protection.c +++ clang/test/Driver/stack-clash-protection.c @@ -17,6 +17,9 @@ // RUN: %clang -target x86_64-pc-unknown-linux -fstack-clash-protection -S -emit-llvm -o- %s | FileCheck %s -check-prefix=SCP-ll-linux64 // SCP-ll-linux64: attributes {{.*}} "probe-stack"="inline-asm" +// RUN: %clang -target x86_64-unknown-freebsd13 -fstack-clash-protection -S -emit-llvm -o- %s | FileCheck %s -check-prefix=SCP-freebsd +// SCP-freebsd: attributes {{.*}} "probe-stack"="inline-asm" + // RUN: %clang -target x86_64-pc-windows-msvc -fstack-clash-protection -S -emit-llvm -o- %s 2>&1 | FileCheck %s -check-prefix=SCP-ll-win64 // SCP-ll-win64-NOT: attributes {{.*}} "probe-stack"="inline-asm" // SCP-ll-win64: argument unused during compilation: '-fstack-clash-protection'