summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2023-03-10 09:01:29 +0100
committerJan Janssen <medhefgo@web.de>2023-03-17 10:35:29 +0100
commit48e1b2c250ec2fcd0b528d4062609c576afe1780 (patch)
treeff94741956998b2b9753e044397062d4cf05a16d /meson.build
parenta05f03225ed5c27436d1c8689957687937a493bc (diff)
downloadsystemd-48e1b2c250ec2fcd0b528d4062609c576afe1780.tar.gz
boot: Add support for -fstack-protector
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build15
1 files changed, 11 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index b1521e5937..b575b04dc6 100644
--- a/meson.build
+++ b/meson.build
@@ -397,7 +397,14 @@ possible_common_cc_flags = [
'-Wno-error=#warnings', # clang
'-Wno-string-plus-int', # clang
+ '-fstack-protector',
+ '-fstack-protector-strong',
'-fstrict-flex-arrays',
+ '--param=ssp-buffer-size=4',
+]
+
+possible_common_link_flags = [
+ '-fstack-protector',
]
c_args = get_option('c_args')
@@ -432,7 +439,6 @@ possible_link_flags = [
'-Wl,--fatal-warnings',
'-Wl,-z,now',
'-Wl,-z,relro',
- '-fstack-protector',
]
if get_option('b_sanitize') == 'none'
@@ -459,11 +465,8 @@ possible_cc_flags = [
'-fdiagnostics-show-option',
'-fno-common',
'-fno-strict-aliasing',
- '-fstack-protector',
- '-fstack-protector-strong',
'-fstrict-flex-arrays=1',
'-fvisibility=hidden',
- '--param=ssp-buffer-size=4',
]
if get_option('buildtype') != 'debug'
@@ -486,6 +489,10 @@ add_project_arguments(
),
language : 'c')
+add_project_link_arguments(
+ cc.get_supported_link_arguments(possible_common_link_flags),
+ language : 'c')
+
userspace_c_args += cc.get_supported_arguments(possible_cc_flags)
userspace_c_ld_args += cc.get_supported_link_arguments(possible_link_flags)