summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glib-2.0
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2019-03-26 12:02:02 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-29 08:28:52 +0000
commit3835162e21ac87d19c4bf37b22ccc216399e73d3 (patch)
tree7a480bb6563e720bc097a29eeacdb603fb1a57d6 /meta/recipes-core/glib-2.0
parent9bad984bf3fd828a655614568214b6c6c4f99860 (diff)
downloadpoky-3835162e21ac87d19c4bf37b22ccc216399e73d3.tar.gz
glib: do a build check for strlcpy before runtime
There's no need to do a runtime check for the behaviour of strlcpy if it doesn't even exist. (From OE-Core rev: 2b6c855737afbf2b0f2baa1b14029f8ddc37e9ed) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glib-2.0')
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/0001-meson-do-a-build-time-check-for-strlcpy-before-attem.patch62
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb1
2 files changed, 63 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-meson-do-a-build-time-check-for-strlcpy-before-attem.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-meson-do-a-build-time-check-for-strlcpy-before-attem.patch
new file mode 100644
index 0000000000..d1ed028759
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-meson-do-a-build-time-check-for-strlcpy-before-attem.patch
@@ -0,0 +1,62 @@
1Upstream-Status: Backport [fc88e56bfc2b09a8fb2b350e76f6425ab0a056d7]
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From 141acf6a2f3b21d63c9cfe620b8e20a506e78493 Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@intel.com>
6Date: Wed, 13 Mar 2019 16:22:09 +0000
7Subject: [PATCH] meson: do a build-time check for strlcpy before attempting
8 runtime check
9
10In cross-compilation environments the runtime check isn't possible so it is up
11to the builder to seed the cross file, but we can definitely state that strlcpy
12doesn't exist with a build test.
13---
14 meson.build | 30 ++++++++++++++++--------------
15 1 file changed, 16 insertions(+), 14 deletions(-)
16
17diff --git a/meson.build b/meson.build
18index 15039e448..414f2d9b1 100644
19--- a/meson.build
20+++ b/meson.build
21@@ -1860,22 +1860,24 @@ endif
22
23 # Test if we have strlcpy/strlcat with a compatible implementation:
24 # https://bugzilla.gnome.org/show_bug.cgi?id=53933
25-if cc_can_run
26- rres = cc.run('''#include <stdlib.h>
27- #include <string.h>
28- int main() {
29- char p[10];
30- (void) strlcpy (p, "hi", 10);
31- if (strlcat (p, "bye", 0) != 3)
32- return 1;
33- return 0;
34- }''',
35- name : 'OpenBSD strlcpy/strlcat')
36- if rres.compiled() and rres.returncode() == 0
37+if cc.has_function('strlcpy')
38+ if cc_can_run
39+ rres = cc.run('''#include <stdlib.h>
40+ #include <string.h>
41+ int main() {
42+ char p[10];
43+ (void) strlcpy (p, "hi", 10);
44+ if (strlcat (p, "bye", 0) != 3)
45+ return 1;
46+ return 0;
47+ }''',
48+ name : 'OpenBSD strlcpy/strlcat')
49+ if rres.compiled() and rres.returncode() == 0
50+ glib_conf.set('HAVE_STRLCPY', 1)
51+ endif
52+ elif meson.get_cross_property('have_strlcpy', false)
53 glib_conf.set('HAVE_STRLCPY', 1)
54 endif
55-elif meson.get_cross_property('have_strlcpy', false)
56- glib_conf.set('HAVE_STRLCPY', 1)
57 endif
58
59 python = import('python').find_installation('python3')
60--
612.11.0
62
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb
index c872c74920..733a2d46d9 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.58.3.bb
@@ -16,6 +16,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
16 file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \ 16 file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \
17 file://0001-Do-not-write-bindir-into-pkg-config-files.patch \ 17 file://0001-Do-not-write-bindir-into-pkg-config-files.patch \
18 file://0001-meson.build-do-not-hardcode-linux-as-the-host-system.patch \ 18 file://0001-meson.build-do-not-hardcode-linux-as-the-host-system.patch \
19 file://0001-meson-do-a-build-time-check-for-strlcpy-before-attem.patch \
19 file://glib-meson.cross \ 20 file://glib-meson.cross \
20 " 21 "
21 22