summaryrefslogtreecommitdiffstats
path: root/src/buildtools
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@qt.io>2020-07-24 10:30:54 +0200
committerMichael BrĂ¼ning <michael.bruning@qt.io>2020-07-24 15:23:10 +0200
commit54b84e14589b3e51f2f2e7980e2af2559601efe2 (patch)
treeeafef9f5b854cd90f6fa8e1ae5ab9e161a424aa3 /src/buildtools
parent27332664b2745d7d322b8afbc1a41dc0fbfc763a (diff)
parenta2a19a6965601ced75e3e48b2bf618ba2bdbd29e (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/core/compositor/delegated_frame_node.cpp src/core/core_chromium.pri src/core/render_widget_host_view_qt.cpp Change-Id: I9387151e9647c87fc387095e7b6d8d66560cdf71
Diffstat (limited to 'src/buildtools')
-rw-r--r--src/buildtools/config/linking.pri75
-rw-r--r--src/buildtools/config/mac_osx.pri1
-rw-r--r--src/buildtools/config/support.pri19
-rw-r--r--src/buildtools/configure.json12
4 files changed, 95 insertions, 12 deletions
diff --git a/src/buildtools/config/linking.pri b/src/buildtools/config/linking.pri
new file mode 100644
index 000000000..0ee18f3a5
--- /dev/null
+++ b/src/buildtools/config/linking.pri
@@ -0,0 +1,75 @@
+include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
+QT_FOR_CONFIG += buildtools-private
+
+linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
+
+!include($$linking_pri) {
+ error("Could not find the linking information that gn should have generated.")
+}
+
+# Do not precompile any headers. We are only interested in the linker step.
+PRECOMPILED_HEADER =
+
+isEmpty(NINJA_OBJECTS): error("Missing object files from linking pri.")
+isEmpty(NINJA_LFLAGS): error("Missing linker flags from linking pri")
+isEmpty(NINJA_ARCHIVES): error("Missing archive files from linking pri")
+isEmpty(NINJA_LIBS): error("Missing library files from linking pri")
+NINJA_OBJECTS = $$eval($$list($$NINJA_OBJECTS))
+# Do manual response file linking for macOS and Linux
+
+RSP_OBJECT_FILE = $$OUT_PWD/$$getConfigDir()/$${TARGET}_o.rsp
+for(object, NINJA_OBJECTS): RSP_O_CONTENT += $$object
+write_file($$RSP_OBJECT_FILE, RSP_O_CONTENT)
+RSP_ARCHIVE_FILE = $$OUT_PWD/$$getConfigDir()/$${TARGET}_a.rsp
+for(archive, NINJA_ARCHIVES): RSP_A_CONTENT += $$archive
+write_file($$RSP_ARCHIVE_FILE, RSP_A_CONTENT)
+
+if(macos|ios) {
+ QMAKE_LFLAGS += -Wl,-filelist,$$shell_quote($${RSP_OBJECT_FILE})
+ !static {
+ QMAKE_LFLAGS += @$${RSP_ARCHIVE_FILE}
+ } else {
+ LIBS_PRIVATE += $${NINJA_ARCHIVES}
+ }
+}
+
+linux {
+ QMAKE_LFLAGS += @$${RSP_OBJECT_FILE}
+ !static {
+ QMAKE_LFLAGS += -Wl,--start-group @$${RSP_ARCHIVE_FILE} -Wl,--end-group
+ } else {
+ LIBS_PRIVATE += -Wl,--start-group @$${NINJA_ARCHIVES} -Wl,--end-group
+ }
+}
+
+win32 {
+ QMAKE_LFLAGS += @$${RSP_OBJECT_FILE}
+ !static {
+ QMAKE_LFLAGS += @$${RSP_ARCHIVE_FILE}
+ } else {
+ LIBS_PRIVATE += $${NINJA_ARCHIVES}
+ }
+}
+
+LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS
+# GN's LFLAGS doesn't always work across all the Linux configurations we support.
+# The Windows and macOS ones from GN does provide a few useful flags however
+
+unix:qtConfig(webengine-noexecstack): \
+ QMAKE_LFLAGS += -Wl,-z,noexecstack
+linux {
+ # add chromium flags
+ for(flag, NINJA_LFLAGS) {
+ # filter out some flags
+ !contains(flag, .*noexecstack$): \
+ !contains(flag, .*as-needed$): \
+ !contains(flag, ^-B.*): \
+ !contains(flag, ^-fuse-ld.*): \
+ QMAKE_LFLAGS += $$flag
+ }
+} else {
+ QMAKE_LFLAGS += $$NINJA_LFLAGS
+}
+
+POST_TARGETDEPS += $$eval($$NINJA_TARGETDEPS)
+
diff --git a/src/buildtools/config/mac_osx.pri b/src/buildtools/config/mac_osx.pri
index b53f91706..a93460784 100644
--- a/src/buildtools/config/mac_osx.pri
+++ b/src/buildtools/config/mac_osx.pri
@@ -34,5 +34,6 @@ gn_args += \
mac_deployment_target=\"$${QMAKE_MACOSX_DEPLOYMENT_TARGET}\" \
mac_sdk_min=\"$${QMAKE_MAC_SDK_VERSION_MAJOR_MINOR}\" \
use_external_popup_menu=false \
+ init_stack_vars=false \
angle_enable_vulkan=false
diff --git a/src/buildtools/config/support.pri b/src/buildtools/config/support.pri
index 80f291500..e192f8777 100644
--- a/src/buildtools/config/support.pri
+++ b/src/buildtools/config/support.pri
@@ -5,7 +5,10 @@ defineTest(qtwebengine_skipBuild) {
# this should match webengine-core-support
defineReplace(qtwebengine_checkWebEngineCoreError) {
- !qtwebengine_checkForBuildSupport(QtWebEngine):return(false)
+ !linux:!win32:!macos {
+ qtwebengine_skipBuild("QtWebEngine can be built only on Linux, Windows or macOS.")
+ return(false)
+ }
static {
qtwebengine_skipBuild("Static builds of QtWebEngine are not supported.")
return(false)
@@ -35,7 +38,10 @@ defineReplace(qtwebengine_checkWebEngineCoreError) {
# this shuold match webengine-qtpdf-support
defineReplace(qtwebengine_checkPdfError) {
- !qtwebengine_checkForBuildSupport(QtPdf):return(false)
+ !linux:!win32:!macos:!ios {
+ qtwebengine_skipBuild("QtPdf can be built only on Linux, Windows, macOS or iOS.")
+ return(false)
+ }
!qtwebengine_checkForGui(QtPdf):return(false)
!qtwebengine_checkForSubmodule(QtPdf):return(false)
!qtwebengine_checkForWhiteSpace(QtPdf):return(false)
@@ -52,15 +58,6 @@ defineReplace(qtwebengine_checkPdfError) {
return(true)
}
-defineTest(qtwebengine_checkForBuildSupport) {
- module = $$1
- !linux:!win32:!macos {
- qtwebengine_skipBuild("$${module} can be build only on Linux, Windows or macOS.")
- return(false)
- }
- return(true)
-}
-
defineTest(qtwebengine_checkForGui) {
module = $$1
!qtHaveModule(gui) {
diff --git a/src/buildtools/configure.json b/src/buildtools/configure.json
index 772159add..2da87a11c 100644
--- a/src/buildtools/configure.json
+++ b/src/buildtools/configure.json
@@ -353,6 +353,11 @@
"webengine-sanitizer": {
"label" : "sanitizer support",
"type": "isSanitizerSupported"
+ },
+ "webengine-noexecstack" : {
+ "label": "linker supports -z noexecstack",
+ "type": "linkerSupportsFlag",
+ "flag": "-z,noexecstack"
}
},
"features": {
@@ -384,7 +389,7 @@
},
"webengine-qtpdf-support": {
"label": "Support Qt Pdf",
- "condition": "(config.linux || config.win32 || config.macos)
+ "condition": "(config.linux || config.win32 || config.macos || config.ios)
&& module.gui
&& features.webengine-submodule
&& features.webengine-nowhitespace
@@ -675,6 +680,11 @@
"autoDetect": "config.sanitizer && tests.webengine-sanitizer",
"condition": "config.sanitizer",
"output": [ "privateFeature" ]
+ },
+ "webengine-noexecstack": {
+ "label": "linker supports -z noexecstack",
+ "condition": "config.unix && tests.webengine-noexecstack",
+ "output": [ "privateFeature" ]
}
},
"report": [