summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-12-12 16:50:19 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-04 10:18:37 +0200
commit14738de583ce4263e1df9253a8b490eafe6b5556 (patch)
tree802c9a4fb35e59dcc585be9c00bfeb6b7511720e
parent54d588f43cf3b29cfe33aa0f712ca73977bc42ba (diff)
downloadqtwebengine-chromium-14738de583ce4263e1df9253a8b490eafe6b5556.tar.gz
Fix 32bit sandboxing on Windows
Static linking would lose essential symbols, we need it to be a source_set, but can make the places that uses it static_libraries instead. Change-Id: I77454a217c937117d497330b023da6fa45c95d0f Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
-rw-r--r--chromium/content/browser/BUILD.gn2
-rw-r--r--chromium/content/common/BUILD.gn2
-rw-r--r--chromium/sandbox/win/BUILD.gn10
3 files changed, 10 insertions, 4 deletions
diff --git a/chromium/content/browser/BUILD.gn b/chromium/content/browser/BUILD.gn
index dc86295d040..66267286c52 100644
--- a/chromium/content/browser/BUILD.gn
+++ b/chromium/content/browser/BUILD.gn
@@ -23,7 +23,7 @@ import("//printing/buildflags/buildflags.gni")
import("//third_party/blink/public/public_features.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
-source_set("browser") {
+static_library("browser") {
# Only the public target should depend on this. All other targets (even
# internal content ones) should depend on the public one.
visibility = [
diff --git a/chromium/content/common/BUILD.gn b/chromium/content/common/BUILD.gn
index 0fb9b184f7b..4b4f87c1d8c 100644
--- a/chromium/content/common/BUILD.gn
+++ b/chromium/content/common/BUILD.gn
@@ -34,7 +34,7 @@ buildflag_header("buildflags") {
]
}
-source_set("common") {
+static_library("common") {
# Targets external to content should always link to the public API.
# In addition, targets outside of the content component (shell and tests)
# must not link to this because it will duplicate the code in the component
diff --git a/chromium/sandbox/win/BUILD.gn b/chromium/sandbox/win/BUILD.gn
index be1b960a93f..5aafafe4502 100644
--- a/chromium/sandbox/win/BUILD.gn
+++ b/chromium/sandbox/win/BUILD.gn
@@ -14,11 +14,17 @@ declare_args() {
heterogeneous_executables = false
}
+config("sandbox_exports") {
+ defines = [ "SANDBOX_EXPORTS=1" ]
+}
+
# This needs to be a static library rather than a sources set because small
# portions of this are used in some contexts (like chrome_elf), and it
# doesn't seem to dead-code strip very well. This saves 12K on chrome_elf.dll,
# over a source set, for example.
-static_library("sandbox") {
+# QtWebEngine: Needs to be source_set as stripping unreferenced files breaks
+# the sandbox.
+source_set("sandbox") {
sources = [
"src/acl.cc",
"src/acl.h",
@@ -194,7 +200,7 @@ static_library("sandbox") {
public_deps = [ "//base" ]
if (heterogeneous_executables) {
- defines = [ "SANDBOX_EXPORTS=1" ]
+ configs += [ ":sandbox_exports" ]
}
deps = [