From c534e36940fdf678fe5db033cbefc83d683af8a4 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Fri, 23 May 2025 02:04:47 +0000 Subject: [PATCH] flex: use TARGET_CC not HOST_CC for target compile --- packages/devel/flex/package.mk | 8 +++++++ ...E_SYSTEM_EXTENSIONS-in-configure-ac.patch} | 0 ...-Match--malloc--signature-to-its-use.patch | 22 +++++++++++++++++++ 3 files changed, 30 insertions(+) rename packages/devel/flex/patches/{c5a26b17a2b091c560f6c4e6703e55f496bf74fa.patch => flex-0262-AC_USE_SYSTEM_EXTENSIONS-in-configure-ac.patch} (100%) create mode 100644 packages/devel/flex/patches/flex-0674-Match--malloc--signature-to-its-use.patch diff --git a/packages/devel/flex/package.mk b/packages/devel/flex/package.mk index 1473535c41..afdfad6108 100644 --- a/packages/devel/flex/package.mk +++ b/packages/devel/flex/package.mk @@ -18,6 +18,14 @@ PKG_CONFIGURE_OPTS_HOST="--enable-static --disable-shared --disable-rpath --with PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_realloc_0_nonnull=yes \ ac_cv_func_malloc_0_nonnull=yes" +pre_configure_target() { + export CC_FOR_BUILD="${CC}"; + export CFLAGS_FOR_BUILD="${CFLAGS}"; + export CPP_FOR_BUILD="${CPP}"; + export CPPFLAGS_FOR_BUILD="${CPPFLAGS}"; + export LDFLAGS_FOR_BUILD="${LDFLAGS}"; +} + post_makeinstall_host() { cat >${TOOLCHAIN}/bin/lex <<"EOF" #!/bin/sh diff --git a/packages/devel/flex/patches/c5a26b17a2b091c560f6c4e6703e55f496bf74fa.patch b/packages/devel/flex/patches/flex-0262-AC_USE_SYSTEM_EXTENSIONS-in-configure-ac.patch similarity index 100% rename from packages/devel/flex/patches/c5a26b17a2b091c560f6c4e6703e55f496bf74fa.patch rename to packages/devel/flex/patches/flex-0262-AC_USE_SYSTEM_EXTENSIONS-in-configure-ac.patch diff --git a/packages/devel/flex/patches/flex-0674-Match--malloc--signature-to-its-use.patch b/packages/devel/flex/patches/flex-0674-Match--malloc--signature-to-its-use.patch new file mode 100644 index 0000000000..9742b2317e --- /dev/null +++ b/packages/devel/flex/patches/flex-0674-Match--malloc--signature-to-its-use.patch @@ -0,0 +1,22 @@ +From 4b142954b54a57a9b0af0a9661056a9c39a8fa95 Mon Sep 17 00:00:00 2001 +From: Richard Barnes +Date: Wed, 2 Oct 2024 10:35:09 -0700 +Subject: [PATCH] Match `malloc` signature to its use + +--- + lib/malloc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/malloc.c b/lib/malloc.c +index 75e8ef97c..701b9b39d 100755 +--- a/lib/malloc.c ++++ b/lib/malloc.c +@@ -3,7 +3,7 @@ + + #include + +- void *malloc (); ++ void *malloc (size_t n); + + /* Allocate an N-byte block of memory from the heap. + If N is zero, allocate a 1-byte block. */