From 1b93db30fa48135d892b8c3bdb381ba1b688b287 Mon Sep 17 00:00:00 2001 From: Roy Kollen Svendsen Date: Wed, 5 Jun 2024 11:06:51 +0200 Subject: [PATCH] package/libffi: fix host build failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Host build fails on updated Arch Linux desktop. My current /usr/bin/gcc version is 14.1.1 20240522, where implicit-function-declaration cause build to fail: 2024-06-05T07:03:20 libtool: compile: /home/roy/hymatek/connexi-touchpanel-firmware/mxxf1/output/host/bin/ccache /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/roy/hymatek/connexi-touchpanel-firmware/mxxf1/output/host/include -Wall -O2 -I/home/roy/hymatek/connexi-touchpanel-firmware/mxxf1/output/host/include -fexceptions -c ../src/tramp.c -fPIC -DPIC -o src/.libs/tramp.o 2024-06-05T07:03:20 ../src/tramp.c: In function ‘ffi_tramp_get_temp_file’: 2024-06-05T07:03:20 ../src/tramp.c:262:22: error: implicit declaration of function ‘open_temp_exec_file’ [-Wimplicit-function-declaration] 2024-06-05T07:03:20 262 | tramp_globals.fd = open_temp_exec_file (); 2024-06-05T07:03:20 | ^~~~~~~~~~~~~~~~~~~ Patch from master was added to fix build. Signed-off-by: Roy Kollen Svendsen Signed-off-by: Peter Korsgaard --- ...ward-declare-open_temp_exec_file-764.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 package/libffi/0004-Forward-declare-open_temp_exec_file-764.patch diff --git a/package/libffi/0004-Forward-declare-open_temp_exec_file-764.patch b/package/libffi/0004-Forward-declare-open_temp_exec_file-764.patch new file mode 100644 index 0000000000..341a2e4e43 --- /dev/null +++ b/package/libffi/0004-Forward-declare-open_temp_exec_file-764.patch @@ -0,0 +1,49 @@ +From ce077e5565366171aa1b4438749b0922fce887a4 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Thu, 2 Feb 2023 14:46:29 +0000 +Subject: [PATCH] Forward declare open_temp_exec_file (#764) + +It's defined in closures.c and used in tramp.c. +Also declare it as an hidden symbol, as it should be. + +Co-authored-by: serge-sans-paille +Upstream: https://github.com/libffi/libffi/pull/764 +Signed-off-by: Roy Kollen Svendsen +--- + include/ffi_common.h | 4 ++++ + src/tramp.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/include/ffi_common.h b/include/ffi_common.h +index 2bd31b0..c53a794 100644 +--- a/include/ffi_common.h ++++ b/include/ffi_common.h +@@ -128,6 +128,10 @@ void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN; + static trampoline. */ + int ffi_tramp_is_present (void *closure) FFI_HIDDEN; + ++/* Return a file descriptor of a temporary zero-sized file in a ++ writable and executable filesystem. */ ++int open_temp_exec_file(void) FFI_HIDDEN; ++ + /* Extended cif, used in callback from assembly routine */ + typedef struct + { +diff --git a/src/tramp.c b/src/tramp.c +index 7e005b0..5f19b55 100644 +--- a/src/tramp.c ++++ b/src/tramp.c +@@ -39,6 +39,10 @@ + #ifdef __linux__ + #define _GNU_SOURCE 1 + #endif ++ ++#include ++#include ++ + #include + #include + #include +-- +2.45.1 +