From 6495e99e433b6f086642f8845be0463eb9b38d0d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 7 Jul 2020 12:06:04 +0200 Subject: Fix building with xcode 10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Doesn't support -ftrivial-auto-var-init=pattern Change-Id: Id998b775cd51f13395c69fafd46c6ec5e997ef5b Reviewed-by: Michael BrĂ¼ning --- src/buildtools/config/mac_osx.pri | 1 + 1 file changed, 1 insertion(+) (limited to 'src/buildtools') 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 -- cgit v1.2.3 From 1de4c8077246dd0443aa16ecdbafd8859f218d3c Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Fri, 17 Jul 2020 17:11:11 +0200 Subject: Fix platform support for qtpdf on ios Add missing check for ios. Change-Id: I7fce6addb154ea83b8308094d5a6c4275d050d9b Reviewed-by: Shawn Rutledge Reviewed-by: Allan Sandfeld Jensen --- src/buildtools/config/support.pri | 19 ++++++++----------- src/buildtools/configure.json | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'src/buildtools') 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 e59757a69..a4c9b1776 100644 --- a/src/buildtools/configure.json +++ b/src/buildtools/configure.json @@ -383,7 +383,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 -- cgit v1.2.3 From 6178015dff6f2f83c16a1dddb199c7f6c3e9c694 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 20 Jul 2020 15:55:27 +0200 Subject: Move webengine-noexecstack to buildtools Change-Id: I854034fd63c8847867fd7ec01d5c25781e7de5ef Reviewed-by: Allan Sandfeld Jensen --- src/buildtools/configure.json | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/buildtools') diff --git a/src/buildtools/configure.json b/src/buildtools/configure.json index a4c9b1776..1ca6214a0 100644 --- a/src/buildtools/configure.json +++ b/src/buildtools/configure.json @@ -352,6 +352,11 @@ "webengine-sanitizer": { "label" : "sanitizer support", "type": "isSanitizerSupported" + }, + "webengine-noexecstack" : { + "label": "linker supports -z noexecstack", + "type": "linkerSupportsFlag", + "flag": "-z,noexecstack" } }, "features": { @@ -671,6 +676,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": [ -- cgit v1.2.3 From 74fe796039e85c97ffac3f7b014ca718e7284dea Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 20 Jul 2020 15:56:14 +0200 Subject: Share linking config between webenginecore and pdf Change-Id: Ib06a0a1ec3372d483008cc0ac0ec211ec8316e0e Reviewed-by: Allan Sandfeld Jensen --- src/buildtools/config/linking.pri | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/buildtools/config/linking.pri (limited to 'src/buildtools') diff --git a/src/buildtools/config/linking.pri b/src/buildtools/config/linking.pri new file mode 100644 index 000000000..a458b06bc --- /dev/null +++ b/src/buildtools/config/linking.pri @@ -0,0 +1,53 @@ +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) + +macos:LIBS_PRIVATE += -Wl,-filelist,$$shell_quote($${RSP_OBJECT_FILE}) @$${RSP_ARCHIVE_FILE} +linux:QMAKE_LFLAGS += @$${RSP_OBJECT_FILE} -Wl,--start-group @$${RSP_ARCHIVE_FILE} -Wl,--end-group +win32:QMAKE_LFLAGS += @$${RSP_OBJECT_FILE} @$${RSP_ARCHIVE_FILE} +ios: OBJECTS += $$NINJA_OBJECTS + +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) + -- cgit v1.2.3 From ff50fbf446f8902b91613930b6705d0074bd9872 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 20 Jul 2020 16:26:38 +0200 Subject: Cleanup linking param order and prl generation When doing builds we use rsp files also for archives. For static builds this would require to install rsp file. Since static builds are possible only for qtpdf with small amount of archives simply do not use rsp files for archives. Cleanup linker parameters so prl files do not point object rsp files (do not use LIBS_PRIVATE in that case). Task-number: QTBUG-85616 Change-Id: I165610e418f162c16fcfa7056af3344b80f60c05 Reviewed-by: Allan Sandfeld Jensen --- src/buildtools/config/linking.pri | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'src/buildtools') diff --git a/src/buildtools/config/linking.pri b/src/buildtools/config/linking.pri index a458b06bc..0ee18f3a5 100644 --- a/src/buildtools/config/linking.pri +++ b/src/buildtools/config/linking.pri @@ -24,10 +24,32 @@ 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) -macos:LIBS_PRIVATE += -Wl,-filelist,$$shell_quote($${RSP_OBJECT_FILE}) @$${RSP_ARCHIVE_FILE} -linux:QMAKE_LFLAGS += @$${RSP_OBJECT_FILE} -Wl,--start-group @$${RSP_ARCHIVE_FILE} -Wl,--end-group -win32:QMAKE_LFLAGS += @$${RSP_OBJECT_FILE} @$${RSP_ARCHIVE_FILE} -ios: OBJECTS += $$NINJA_OBJECTS +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. -- cgit v1.2.3