File: no-exec-stack.patch

package info (click to toggle)
qtwebengine-opensource-src 5.11.3%2Bdfsg-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,551,988 kB
  • sloc: cpp: 10,064,061; ansic: 3,832,841; asm: 590,489; python: 455,759; xml: 261,729; sh: 90,157; objc: 77,089; perl: 71,296; makefile: 27,041; cs: 23,492; yacc: 14,360; tcl: 12,756; php: 4,714; lex: 4,028; pascal: 3,741; ml: 3,543; ruby: 1,497; lisp: 1,490; awk: 183; csh: 117; sed: 54
file content (47 lines) | stat: -rw-r--r-- 1,858 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Description: don't allow QtWebEngineCore to request executable stack
 The Chromium sources contain assembly code that causes the library to
 default to executable stack (the linker requires that *all* .o files
 have a .note.GNU-stack section in order to default to non-executable).
 So add the -z noexecstack linker flag to change the setting.
 .
 The other libraries are not affected.
Origin: upstream, https://code.qt.io/cgit/qt/qtwebengine.git/commit/?id=597359a16a798df3
Last-Update: 2019-12-03

--- a/configure.json
+++ b/configure.json
@@ -320,6 +320,11 @@
         "webengine-win-compiler64": {
             "label": "64bit compiler",
             "type": "isWindowsHostCompiler64"
+        },
+        "webengine-noexecstack": {
+            "label": "linker supports -z noexecstack",
+            "type": "linkerSupportsFlag",
+            "flag": "-z,noexecstack"
         }
     },
 
@@ -632,6 +637,11 @@
             "condition": "config.win32 && tests.webengine-win-compiler64",
             "type": "isWindowsHostCompiler64",
             "output": [ "privateFeature" ]
+        },
+        "webengine-noexecstack": {
+            "label": "linker supports -z noexecstack",
+            "condition": "config.unix && tests.webengine-noexecstack",
+            "output": [ "privateFeature" ]
         }
     },
 
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -41,6 +41,8 @@ LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA
 # 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 {
     QMAKE_LFLAGS += -Wl,--gc-sections -Wl,-O1 -Wl,-z,now
     # Embedded address sanitizer symbols are undefined and are picked up by the dynamic link loader