aports/main/clang15/clang-default-fno-semantic-interposition.patch
psykose 314d661ecd main/clang15: move from community
needed back in main for libclc
2023-07-11 16:36:20 +02:00

39 lines
1.6 KiB
Diff

Patch-Source: https://github.com/chimera-linux/cports/commit/77fdf96a59bddfca32b6737335f01afaf64ff380
reference: https://maskray.me/blog/2021-05-09-fno-semantic-interposition
in general, this is not '100% safe'.
however:
- we only use clang in a few places
- chimera has had good success with this flag and not seen issues
so, it should be fine to default in our clang too. it should bring some
noticable performance gains paired with pic.
--
From 73b8ed17fed2145b29bde40a0c658712e34d48c3 Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Tue, 28 Feb 2023 01:59:26 +0100
Subject: [PATCH] clang: default to -fno-semantic-interposition on supported
targets
---
clang/lib/Driver/ToolChains/Clang.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 3704ed85..d3d67a22 100644
--- a/lib/Driver/ToolChains/Clang.cpp
+++ b/lib/Driver/ToolChains/Clang.cpp
@@ -5072,9 +5072,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// The supported targets need to call AsmPrinter::getSymbolPreferLocal.
bool SupportsLocalAlias =
Triple.isAArch64() || Triple.isRISCV() || Triple.isX86();
- if (!A)
- CmdArgs.push_back("-fhalf-no-semantic-interposition");
- else if (A->getOption().matches(options::OPT_fsemantic_interposition))
+ if (A && A->getOption().matches(options::OPT_fsemantic_interposition))
A->render(Args, CmdArgs);
else if (!SupportsLocalAlias)
CmdArgs.push_back("-fhalf-no-semantic-interposition");
--
2.39.0