[sysprof: 1/2] meson.build: fix build without stack-protector
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof: 1/2] meson.build: fix build without stack-protector
- Date: Wed, 25 Nov 2020 16:59:00 +0000 (UTC)
commit b8ac99dd48b4dc302a4bd01626fa02f58c0a8df7
Author: Fabrice Fontaine <fontaine fabrice gmail com>
Date: Wed Nov 25 07:38:03 2020 +0100
meson.build: fix build without stack-protector
Check for -fstack-protector-strong availability through
has_link_argument as some compilers could missed the needed library
(-lssp or -lssp_nonshared) at linking step resulting in a build failure.
Signed-off-by: Fabrice Fontaine <fontaine fabrice gmail com>
meson.build | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index ed73d72..c3acb30 100644
--- a/meson.build
+++ b/meson.build
@@ -140,10 +140,6 @@ else
test_c_args += ['-Werror=incompatible-pointer-types']
endif
-if get_option('buildtype') != 'plain'
- test_c_args += '-fstack-protector-strong'
-endif
-
foreach arg: test_c_args
if cc.has_multi_arguments(arg)
global_c_args += arg
@@ -158,6 +154,11 @@ test_link_args = [
'-Wl,-z,relro',
'-Wl,-z,now',
]
+
+if get_option('buildtype') != 'plain'
+ test_link_args += '-fstack-protector-strong'
+endif
+
if not get_option('buildtype').startswith('debug')
release_flags += [
'-DG_DISABLE_CAST_CHECKS',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]