summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2024-10-27 18:02:01 +0100
committerSteve Sakoman <steve@sakoman.com>2024-11-02 06:32:36 -0700
commit7274615f22479c47dd37f2fd438737ac086a59c1 (patch)
tree9f8bd1091788f219a29a520371823fc9050dff03
parentba7e4e7f756be95ab5e2f6995af12d7383fa7e21 (diff)
downloadpoky-7274615f22479c47dd37f2fd438737ac086a59c1.tar.gz
libffi: backport a fix to build libffi-native with gcc-14
(From OE-Core rev: 1054417a217417ab192dc4aee8307133451fb0e4) Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-support/libffi/libffi/0001-Forward-declare-open_temp_exec_file-764.patch47
-rw-r--r--meta/recipes-support/libffi/libffi_3.4.4.bb1
2 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-support/libffi/libffi/0001-Forward-declare-open_temp_exec_file-764.patch b/meta/recipes-support/libffi/libffi/0001-Forward-declare-open_temp_exec_file-764.patch
new file mode 100644
index 0000000000..4b135961fd
--- /dev/null
+++ b/meta/recipes-support/libffi/libffi/0001-Forward-declare-open_temp_exec_file-764.patch
@@ -0,0 +1,47 @@
1From 216bf8daeb30880957e0c888efbed1f0a7478c32 Mon Sep 17 00:00:00 2001
2From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
3Date: Thu, 2 Feb 2023 14:46:29 +0000
4Subject: [PATCH] Forward declare open_temp_exec_file (#764)
5
6It's defined in closures.c and used in tramp.c.
7Also declare it as an hidden symbol, as it should be.
8
9Co-authored-by: serge-sans-paille <sguelton@mozilla.com>
10Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
11
12Upstream-Status: Backport [v3.4.5 https://github.com/libffi/libffi/commit/ce077e5565366171aa1b4438749b0922fce887a4]
13---
14 include/ffi_common.h | 4 ++++
15 src/tramp.c | 4 ++++
16 2 files changed, 8 insertions(+)
17
18diff --git a/include/ffi_common.h b/include/ffi_common.h
19index 2bd31b0..c53a794 100644
20--- a/include/ffi_common.h
21+++ b/include/ffi_common.h
22@@ -128,6 +128,10 @@ void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN;
23 static trampoline. */
24 int ffi_tramp_is_present (void *closure) FFI_HIDDEN;
25
26+/* Return a file descriptor of a temporary zero-sized file in a
27+ writable and executable filesystem. */
28+int open_temp_exec_file(void) FFI_HIDDEN;
29+
30 /* Extended cif, used in callback from assembly routine */
31 typedef struct
32 {
33diff --git a/src/tramp.c b/src/tramp.c
34index b9d273a..c3f4c99 100644
35--- a/src/tramp.c
36+++ b/src/tramp.c
37@@ -39,6 +39,10 @@
38 #ifdef __linux__
39 #define _GNU_SOURCE 1
40 #endif
41+
42+#include <ffi.h>
43+#include <ffi_common.h>
44+
45 #include <stdio.h>
46 #include <unistd.h>
47 #include <stdlib.h>
diff --git a/meta/recipes-support/libffi/libffi_3.4.4.bb b/meta/recipes-support/libffi/libffi_3.4.4.bb
index 4ceee6f3cc..f727e91345 100644
--- a/meta/recipes-support/libffi/libffi_3.4.4.bb
+++ b/meta/recipes-support/libffi/libffi_3.4.4.bb
@@ -13,6 +13,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=32c0d09a0641daf4903e5d61cc8f23a8"
13SRC_URI = "https://github.com/libffi/libffi/releases/download/v${PV}/${BPN}-${PV}.tar.gz \ 13SRC_URI = "https://github.com/libffi/libffi/releases/download/v${PV}/${BPN}-${PV}.tar.gz \
14 file://not-win32.patch \ 14 file://not-win32.patch \
15 file://0001-arm-sysv-reverted-clang-VFP-mitigation.patch \ 15 file://0001-arm-sysv-reverted-clang-VFP-mitigation.patch \
16 file://0001-Forward-declare-open_temp_exec_file-764.patch \
16 " 17 "
17SRC_URI[sha256sum] = "d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676" 18SRC_URI[sha256sum] = "d66c56ad259a82cf2a9dfc408b32bf5da52371500b84745f7fb8b645712df676"
18UPSTREAM_CHECK_URI = "https://github.com/libffi/libffi/releases/" 19UPSTREAM_CHECK_URI = "https://github.com/libffi/libffi/releases/"