summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-03-21 16:33:56 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-25 07:09:01 +0000
commit2925dd484f42bb26cf34f840e7b13726e76e4158 (patch)
treeecaf7a38660a3991bf9a0eabab296a0aab46bc7d /libexec
parent0a574d7a7bdd71236c453bc882f92629fc8f7e9d (diff)
CMake: Generate and use a wrapper script for stripping binaries
MinGW 11.2.0 comes with a strip.exe that strips the ".gnu_debuglink" section in binaries, a section that is needed for the separate debug information feature. binutils version 2.34 mentions the feature for the first time: https://sourceware.org/binutils/docs-2.34/binutils/strip.html#strip To ensure the debuglink section is preserved, generate a shell wrapper that calls the original strip binary with an extra option to keep the required section. To determine if the option is supported, we build a real shared library on which strip will be called with the --keep-section option. If the option is not supported, a wrapper is not generated and the stock strip binary is used. This logic only applies when targeting Linux and MinGW + a shared library Qt. For other targets, the stock strip binary is used. Developers can opt out of this logic by passing -DQT_NO_STRIP_WRAPPER=TRUE when configuring each Qt repo. Fixes: QTBUG-101653 Change-Id: Idd213d48d087d3c9600c853362aebaba348cde33 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 39f657032b5e65bfcb93472201f6607c0388ba37) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'libexec')
-rw-r--r--libexec/qt-internal-strip.bat.in1
-rwxr-xr-xlibexec/qt-internal-strip.in4
2 files changed, 5 insertions, 0 deletions
diff --git a/libexec/qt-internal-strip.bat.in b/libexec/qt-internal-strip.bat.in
new file mode 100644
index 0000000000..4ab365ce6e
--- /dev/null
+++ b/libexec/qt-internal-strip.bat.in
@@ -0,0 +1 @@
+@original_strip@ @strip_arguments@ %*
diff --git a/libexec/qt-internal-strip.in b/libexec/qt-internal-strip.in
new file mode 100755
index 0000000000..bc75a976aa
--- /dev/null
+++ b/libexec/qt-internal-strip.in
@@ -0,0 +1,4 @@
+#!/bin/sh
+# echo the invoked command
+set -x
+@original_strip@ @strip_arguments@ "$@"