-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmeson-move-FORTIFY_SOURCE-setting-to-header-file.patch
49 lines (43 loc) · 1.54 KB
/
meson-move-FORTIFY_SOURCE-setting-to-header-file.patch
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
48
From 9000d9e1c1b1d0dc6e43772aeb32d0a2433298ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 29 Apr 2024 12:40:07 +0100
Subject: [PATCH] meson: move _FORTIFY_SOURCE setting to header file
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some build environments may already define _FORTIFY_SOURCE, resulting
in an error when we try to define it again on the command line. Move
setting to a common header file, so we only get it if not already
defined.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
meson.build | 1 -
tools/osinfo-db-util.h | 4 ++++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 95b0528..425809d 100644
--- a/meson.build
+++ b/meson.build
@@ -201,7 +201,6 @@ osinfo_db_tools_check_cflags = [
'-Wjump-misses-init',
'-Wframe-larger-than=4096',
'-Wno-overlength-strings',
- '-Wp,-D_FORTIFY_SOURCE=2',
'--param=ssp-buffer-size=4',
'-fexceptions',
'-fasynchronous-unwind-tables',
diff --git a/tools/osinfo-db-util.h b/tools/osinfo-db-util.h
index 8d7a456..b458c6e 100644
--- a/tools/osinfo-db-util.h
+++ b/tools/osinfo-db-util.h
@@ -27,6 +27,10 @@
# define OSINFO_DB_ERROR osinfo_db_error_quark()
+# if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
+# define _FORTIFY_SOURCE 2
+# endif
+
GQuark osinfo_db_error_quark(void);
GFile *osinfo_db_get_system_path(const gchar *root);
GFile *osinfo_db_get_local_path(const gchar *root);
--
GitLab