mozilla-fix-top-level-asm.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Sat, 08 Jan 2022 10:41:19 +0100
branchfirefox95
changeset 1169 7481543bab31
parent 1154 71a92b4d0527
permissions -rw-r--r--
Firefox 95.0.2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1111
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     1
From 91bb79836ee274855393bdf6ab10e24899b1b349 Mon Sep 17 00:00:00 2001
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     2
From: Martin Liska <mliska@suse.cz>
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     3
Date: Fri, 17 May 2019 14:41:35 +0200
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     4
Subject: [PATCH] Fix top-level asm issue.
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     5
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     6
---
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     7
 security/sandbox/linux/moz.build | 5 ++++-
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     8
 1 file changed, 4 insertions(+), 1 deletion(-)
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     9
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    10
diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    11
--- a/security/sandbox/linux/moz.build
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    12
+++ b/security/sandbox/linux/moz.build
1152
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    13
@@ -66,32 +66,32 @@ UNIFIED_SOURCES += [
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    14
     "../chromium/base/time/time_now_posix.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    15
     "../chromium/sandbox/linux/bpf_dsl/bpf_dsl.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    16
     "../chromium/sandbox/linux/bpf_dsl/codegen.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    17
     "../chromium/sandbox/linux/bpf_dsl/dump_bpf.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    18
     "../chromium/sandbox/linux/bpf_dsl/policy.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    19
     "../chromium/sandbox/linux/bpf_dsl/policy_compiler.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    20
     "../chromium/sandbox/linux/bpf_dsl/syscall_set.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    21
     "../chromium/sandbox/linux/seccomp-bpf/die.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    22
-    "../chromium/sandbox/linux/seccomp-bpf/syscall.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    23
     "broker/SandboxBrokerCommon.cpp",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    24
     "Sandbox.cpp",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    25
     "SandboxBrokerClient.cpp",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    26
     "SandboxFilter.cpp",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    27
     "SandboxFilterUtil.cpp",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    28
     "SandboxHooks.cpp",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    29
     "SandboxInfo.cpp",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    30
     "SandboxLogging.cpp",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    31
     "SandboxOpenedFiles.cpp",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    32
     "SandboxReporterClient.cpp",
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1111
diff changeset
    33
 ]
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1111
diff changeset
    34
 
1111
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    35
 SOURCES += [
1152
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    36
     "../chromium/base/strings/safe_sprintf.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    37
     "../chromium/base/third_party/icu/icu_utf.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    38
+    "../chromium/sandbox/linux/seccomp-bpf/syscall.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    39
     "../chromium/sandbox/linux/seccomp-bpf/trap.cc",
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    40
     "../chromium/sandbox/linux/services/syscall_wrappers.cc",
1111
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    41
 ]
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1111
diff changeset
    42
 
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1111
diff changeset
    43
 # This copy of SafeSPrintf doesn't need to avoid the Chromium logging
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1111
diff changeset
    44
 # dependency like the one in libxul does, but this way the behavior is
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1111
diff changeset
    45
 # consistent.  See also the comment in SandboxLogging.h.
1152
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    46
 SOURCES["../chromium/base/strings/safe_sprintf.cc"].flags += ["-DNDEBUG"]
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    47
@@ -105,16 +105,19 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc")
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    48
         "-Wno-unreachable-code-return"
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    49
     ]
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1111
diff changeset
    50
 
1152
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    51
 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
1154
71a92b4d0527 Firefox 85.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1152
diff changeset
    52
     CXXFLAGS += ["-Wno-shadow", "-Wno-error=stack-protector"]
1152
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    53
     SOURCES["../chromium/sandbox/linux/services/syscall_wrappers.cc"].flags += [
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    54
         "-Wno-empty-body",
1111
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    55
     ]
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    56
+    SOURCES['../chromium/sandbox/linux/seccomp-bpf/syscall.cc'].flags += [
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    57
+        '-fno-lto'
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    58
+    ]
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    59
 
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    60
 # gcc lto likes to put the top level asm in syscall.cc in a different partition
97a6da6d7e29 Firefox 69.0.3
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    61
 # from the function using it which breaks the build.  Work around that by
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1111
diff changeset
    62
 # forcing there to be only one partition.
1152
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    63
 for f in CONFIG["OS_CXXFLAGS"]:
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    64
     if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    65
         LDFLAGS += ["--param lto-partitions=1"]
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1111
diff changeset
    66