From c17ee0bdce889cc20030eb984f127046695f84e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 14 May 2019 00:00:01 +0000 Subject: [PATCH] userland: disable PIE explicitly on command line for all executables --- path_properties.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/path_properties.py b/path_properties.py index 49520b1..70c1381 100644 --- a/path_properties.py +++ b/path_properties.py @@ -17,6 +17,15 @@ class PathProperties: '-Wno-unused-function', LF, '-fopenmp', LF, '-ggdb3', LF, + # PIE causes the following problems: + # * QEMU GDB step debug does not find breakpoints: + # https://stackoverflow.com/questions/51310756/how-to-gdb-step-debug-a-dynamically-linked-executable-in-qemu-user-mode/51343326#51343326 + # * when writing assembly code, we have to constantly think about it: + # https://stackoverflow.com/questions/2463150/what-is-the-fpie-option-for-position-independent-executables-in-gcc-and-ld/51308031#51308031 + # As of 91986fb2955f96e06d1c5ffcc5536ba9f0af1fd9, our Buildroot toolchain + # does not have it enabled by default, but the Ubuntu 18.04 host toolchain does. + '-fno-pie', LF, + '-no-pie', LF, ], 'cc_flags_after': [], 'cc_pedantic': True, @@ -266,10 +275,6 @@ path_properties_tuples = ( { 'arch': ( { - 'cc_flags': [ - '-fno-pie', LF, - '-no-pie', LF, - ], 'extra_objs_userland_asm': True, }, {