diff options
| author | Woodpecker CI <emmett1.2miligrams@protonmail.com> | 2025-06-03 14:32:34 +0000 |
|---|---|---|
| committer | Woodpecker CI <emmett1.2miligrams@protonmail.com> | 2025-06-03 14:32:34 +0000 |
| commit | 8df1d35909ec2d57a6845f5b2c26ee1e83cfd032 (patch) | |
| tree | 88e5aaa8cf9d3c0538cdff935a56786705548d75 /llvm/0017-clang-use-as-needed-by-default.patch | |
| parent | 96ec28ea0d2c05032f40f50bc6b9de7020138f57 (diff) | |
| download | alicelinux-8df1d35909ec2d57a6845f5b2c26ee1e83cfd032.tar.gz alicelinux-8df1d35909ec2d57a6845f5b2c26ee1e83cfd032.zip | |
Woodpecker CI 5171f1fdd74e7137c305450dd69a29fa5be4143f [SKIP CI]
Diffstat (limited to 'llvm/0017-clang-use-as-needed-by-default.patch')
| -rw-r--r-- | llvm/0017-clang-use-as-needed-by-default.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/0017-clang-use-as-needed-by-default.patch b/llvm/0017-clang-use-as-needed-by-default.patch new file mode 100644 index 00000000..baf51e7d --- /dev/null +++ b/llvm/0017-clang-use-as-needed-by-default.patch @@ -0,0 +1,30 @@ +From 28381edd19f49f3bbc9938a714782e0e92691953 Mon Sep 17 00:00:00 2001 +From: q66 <q66@chimera-linux.org> +Date: Sun, 14 Apr 2024 14:48:51 +0200 +Subject: [PATCH 17/30] clang: use --as-needed by default + +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 5e9a655ea..263c4632a 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -543,6 +543,13 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, + bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs); + bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs); + addLinkerCompressDebugSectionsOption(ToolChain, Args, CmdArgs); ++ ++ // Use --as-needed by default for all explicit linker inputs on Linux ++ // We don't reset it afterwards because explicit argument does not ++ // get reset either (and that is permitted, so it should be fine) ++ if (Triple.isOSLinux()) ++ CmdArgs.push_back("--as-needed"); ++ + AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA); + + addHIPRuntimeLibArgs(ToolChain, C, Args, CmdArgs); +-- +2.47.0 + |