diff options
| -rw-r--r-- | meta/recipes-support/p11-kit/files/strerror-1.patch | 76 | ||||
| -rw-r--r-- | meta/recipes-support/p11-kit/files/strerror-2.patch | 30 | ||||
| -rw-r--r-- | meta/recipes-support/p11-kit/p11-kit_0.25.2.bb (renamed from meta/recipes-support/p11-kit/p11-kit_0.25.0.bb) | 6 |
3 files changed, 2 insertions, 110 deletions
diff --git a/meta/recipes-support/p11-kit/files/strerror-1.patch b/meta/recipes-support/p11-kit/files/strerror-1.patch deleted file mode 100644 index 6af4fee724..0000000000 --- a/meta/recipes-support/p11-kit/files/strerror-1.patch +++ /dev/null | |||
| @@ -1,76 +0,0 @@ | |||
| 1 | From 3ba2c55dfdc8ff20de369f07f6c57d08718d3add Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Adam Sampson <ats@offog.org> | ||
| 3 | Date: Sun, 2 Jul 2023 15:22:49 +0100 | ||
| 4 | Subject: [PATCH] Check for GNU strerror_r using the compiler only | ||
| 5 | |||
| 6 | The new test that was added to distinguish GNU/XSI strerror_r ran a | ||
| 7 | compiled program, which doesn't work when cross-compiling. The only | ||
| 8 | difference at compile time is that the GNU version returns char * and | ||
| 9 | the XSI version returns int, so detect it by compiling a program that | ||
| 10 | dereferences the return value. | ||
| 11 | |||
| 12 | Signed-off-by: Adam Sampson <ats@offog.org> | ||
| 13 | |||
| 14 | Upstream-Status: Backport | ||
| 15 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 16 | --- | ||
| 17 | configure.ac | 19 +++++++------------ | ||
| 18 | meson.build | 10 +++++----- | ||
| 19 | 2 files changed, 12 insertions(+), 17 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/configure.ac b/configure.ac | ||
| 22 | index 40f5a583..29890622 100644 | ||
| 23 | --- a/configure.ac | ||
| 24 | +++ b/configure.ac | ||
| 25 | @@ -146,19 +146,14 @@ if test "$os_unix" = "yes"; then | ||
| 26 | |||
| 27 | AC_CHECK_FUNC( | ||
| 28 | [strerror_r], | ||
| 29 | - [AC_RUN_IFELSE( | ||
| 30 | - [AC_LANG_SOURCE([[ | ||
| 31 | - #include <errno.h> | ||
| 32 | - #include <string.h> | ||
| 33 | - | ||
| 34 | - int main (void) | ||
| 35 | - { | ||
| 36 | - char buf[32]; | ||
| 37 | - return strerror_r (EINVAL, buf, 32); | ||
| 38 | - } | ||
| 39 | - ]])], | ||
| 40 | - [AC_DEFINE([HAVE_XSI_STRERROR_R], 1, [Whether XSI-compliant strerror_r() is available])], | ||
| 41 | + [AC_COMPILE_IFELSE( | ||
| 42 | + [AC_LANG_PROGRAM([[#include <errno.h> | ||
| 43 | + #include <string.h>]], | ||
| 44 | + [[/* GNU strerror_r returns char *, XSI returns int */ | ||
| 45 | + char buf[32]; | ||
| 46 | + return *strerror_r (EINVAL, buf, 32);]])], | ||
| 47 | [AC_DEFINE([HAVE_GNU_STRERROR_R], 1, [Whether GNU-specific strerror_r() is available])], | ||
| 48 | + [AC_DEFINE([HAVE_XSI_STRERROR_R], 1, [Whether XSI-compliant strerror_r() is available])], | ||
| 49 | [])], | ||
| 50 | []) | ||
| 51 | |||
| 52 | diff --git a/meson.build b/meson.build | ||
| 53 | index 0f8c8da0..4cc3f89a 100644 | ||
| 54 | --- a/meson.build | ||
| 55 | +++ b/meson.build | ||
| 56 | @@ -306,15 +306,15 @@ if cc.has_function('strerror_r', prefix: '#include <string.h>') | ||
| 57 | |||
| 58 | int main (void) | ||
| 59 | { | ||
| 60 | + /* GNU strerror_r returns char *, XSI returns int */ | ||
| 61 | char buf[32]; | ||
| 62 | - return strerror_r (EINVAL, buf, 32); | ||
| 63 | + return *strerror_r (EINVAL, buf, 32); | ||
| 64 | } | ||
| 65 | ''' | ||
| 66 | - strerror_r_check = cc.run(strerror_r_code, name : 'strerror_r check') | ||
| 67 | - if strerror_r_check.returncode() == 0 | ||
| 68 | - conf.set('HAVE_XSI_STRERROR_R', 1) | ||
| 69 | - else | ||
| 70 | + if cc.compiles(strerror_r_code, name : 'GNU strerror_r check') | ||
| 71 | conf.set('HAVE_GNU_STRERROR_R', 1) | ||
| 72 | + else | ||
| 73 | + conf.set('HAVE_XSI_STRERROR_R', 1) | ||
| 74 | endif | ||
| 75 | endif | ||
| 76 | |||
diff --git a/meta/recipes-support/p11-kit/files/strerror-2.patch b/meta/recipes-support/p11-kit/files/strerror-2.patch deleted file mode 100644 index 1a9180b508..0000000000 --- a/meta/recipes-support/p11-kit/files/strerror-2.patch +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | From 7aa6251bf4ce36d027d53c9c96bb05f90ef7eb5b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Adam Sampson <ats@offog.org> | ||
| 3 | Date: Sun, 2 Jul 2023 15:44:06 +0100 | ||
| 4 | Subject: [PATCH] Define _GNU_SOURCE when testing for strerror_r | ||
| 5 | |||
| 6 | The Meson check for GNU/XSI strerror_r didn't inherit the project | ||
| 7 | options that include _GNU_SOURCE (unlike the autoconf version), so the | ||
| 8 | result didn't match how the code that uses it will be compiled. Add | ||
| 9 | _GNU_SOURCE explicitly as with the following checks. | ||
| 10 | |||
| 11 | Signed-off-by: Adam Sampson <ats@offog.org> | ||
| 12 | |||
| 13 | Upstream-Status: Backport | ||
| 14 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 15 | --- | ||
| 16 | meson.build | 1 + | ||
| 17 | 1 file changed, 1 insertion(+) | ||
| 18 | |||
| 19 | diff --git a/meson.build b/meson.build | ||
| 20 | index 4cc3f89a..9a72e148 100644 | ||
| 21 | --- a/meson.build | ||
| 22 | +++ b/meson.build | ||
| 23 | @@ -301,6 +301,7 @@ endforeach | ||
| 24 | |||
| 25 | if cc.has_function('strerror_r', prefix: '#include <string.h>') | ||
| 26 | strerror_r_code = ''' | ||
| 27 | +#define _GNU_SOURCE | ||
| 28 | #include <errno.h> | ||
| 29 | #include <string.h> | ||
| 30 | |||
diff --git a/meta/recipes-support/p11-kit/p11-kit_0.25.0.bb b/meta/recipes-support/p11-kit/p11-kit_0.25.2.bb index ad1fda3f3b..d00ef2daf5 100644 --- a/meta/recipes-support/p11-kit/p11-kit_0.25.0.bb +++ b/meta/recipes-support/p11-kit/p11-kit_0.25.2.bb | |||
| @@ -10,10 +10,8 @@ DEPENDS = "libtasn1 libtasn1-native libffi" | |||
| 10 | 10 | ||
| 11 | DEPENDS:append = "${@' glib-2.0' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}" | 11 | DEPENDS:append = "${@' glib-2.0' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}" |
| 12 | 12 | ||
| 13 | SRC_URI = "git://github.com/p11-glue/p11-kit;branch=master;protocol=https \ | 13 | SRC_URI = "gitsm://github.com/p11-glue/p11-kit;branch=master;protocol=https" |
| 14 | file://strerror-1.patch \ | 14 | SRCREV = "66d6b42ef8dd84fcd8e199ac9f23f822f1a058c9" |
| 15 | file://strerror-2.patch" | ||
| 16 | SRCREV = "a8cce8bd8065bbf80bd47219f85f0cd9cf27dd0c" | ||
| 17 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
| 18 | 16 | ||
| 19 | PACKAGECONFIG ??= "" | 17 | PACKAGECONFIG ??= "" |
