summarylogtreecommitdiffstats
path: root/0022-bmo-1516803-force-one-LTO-partition-for-sandbox-when.patch
blob: e5e1bcfee5fa664cc82a5eb35efdc82e6ab82b24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 0539ac3b5a6574e8ba3a27b62681c0a49d89edcb Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@gentoo.org>
Date: Wed, 15 Apr 2020 00:27:25 +0200
Subject: [PATCH 22/34] bmo#1516803: force one LTO partition for sandbox when
 using GCC

Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
---
 security/sandbox/linux/moz.build | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
index 81c89bd947..a5b76067a7 100644
@@ -114,9 +114,10 @@
 # gcc lto likes to put the top level asm in syscall.cc in a different partition
 # from the function using it which breaks the build.  Work around that by
 # forcing there to be only one partition.
-for f in CONFIG["OS_CXXFLAGS"]:
-    if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
-        LDFLAGS += ["--param lto-partitions=1"]
+if CONFIG["CC_TYPE"] != "clang" and CONFIG["MOZ_LTO_LDFLAGS"] is not None:
+    for f in CONFIG["MOZ_LTO_LDFLAGS"]:
+       if f.startswith("-flto"):
+            LDFLAGS += ["--param", "lto-partitions=1"]
 
 DEFINES["NS_NO_XPCOM"] = True
 DisableStlWrapping()
-- 
2.33.1