mirror of
https://github.com/RGBCube/serenity
synced 2025-06-18 21:52:10 +00:00

This removes the patch series 1/N comments, git version at the bottom of the patch, and zeros out the original commit hash.
32 lines
1.5 KiB
Diff
32 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Daniel Bertalan <dani@danielbertalan.dev>
|
|
Date: Thu, 14 Apr 2022 10:12:54 +0200
|
|
Subject: [PATCH] [Driver] Default to -ftls-model=initial-exec on SerenityOS
|
|
|
|
This is a hack to make Clang use the initial-exec TLS model instead of
|
|
the default local-exec when building code for Serenity.
|
|
|
|
This patch should be removed when we implement proper TLS support.
|
|
---
|
|
clang/lib/Driver/ToolChains/Clang.cpp | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
|
|
index f2f18e901..39d6c18fe 100644
|
|
--- a/clang/lib/Driver/ToolChains/Clang.cpp
|
|
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
|
|
@@ -5872,7 +5872,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|
Args.AddLastArg(CmdArgs, options::OPT_fvisibility_inlines_hidden_static_local_var,
|
|
options::OPT_fno_visibility_inlines_hidden_static_local_var);
|
|
Args.AddLastArg(CmdArgs, options::OPT_fvisibility_global_new_delete_hidden);
|
|
- Args.AddLastArg(CmdArgs, options::OPT_ftlsmodel_EQ);
|
|
+ if (Triple.isOSSerenity()) {
|
|
+ StringRef tls_model =
|
|
+ Args.getLastArgValue(options::OPT_ftlsmodel_EQ, "initial-exec");
|
|
+ CmdArgs.push_back(Args.MakeArgString("-ftls-model=" + tls_model));
|
|
+ } else {
|
|
+ Args.AddLastArg(CmdArgs, options::OPT_ftlsmodel_EQ);
|
|
+ }
|
|
|
|
if (Args.hasFlag(options::OPT_fnew_infallible,
|
|
options::OPT_fno_new_infallible, false))
|