Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -2993,7 +2993,9 @@ if (SanArgs.linkCXXRuntimes()) StaticRuntimes.push_back("ubsan_standalone_cxx"); } - if (SanArgs.needsSafeStackRt()) + // Using a separate stack segment with SafeStack requires more extensive + // runtime support than this provides. + if (SanArgs.needsSafeStackRt() && !Args.hasArg(options::OPT_mseparate_stack_seg)) StaticRuntimes.push_back("safestack"); if (SanArgs.needsCfiRt()) StaticRuntimes.push_back("cfi");