linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
commit 58f49fd507b5a8b7321173ec1b807f55fde42066 parent 004fc0fae6d36ddba0c9ffc00e5a14af92b3d829 Author: Jul <jul@9o.is> Date: Fri, 28 Nov 2025 03:19:05 -0500 add libffi Diffstat:
| M | .gitmodules | | | 4 | ++++ |
| M | pkg/gen.sh | | | 1 | + |
| A | pkg/libffi/fficonfig.h | | | 85 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/libffi/gen.sh | | | 41 | +++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/libffi/patch/0001-Use-fixed-type-integer-types-when-available.patch | | | 36 | ++++++++++++++++++++++++++++++++++++ |
| A | pkg/libffi/patch/0002-Use-generic-padding-instead-of-128-bit-integers.patch | | | 41 | +++++++++++++++++++++++++++++++++++++++++ |
| A | pkg/libffi/patch/0003-Don-t-use-complex-types-if-they-are-not-supported.patch | | | 25 | +++++++++++++++++++++++++ |
7 files changed, 233 insertions(+), 0 deletions(-)
diff --git a/.gitmodules b/.gitmodules @@ -46,6 +46,10 @@ path = pkg/libevdev/src url = https://gitlab.freedesktop.org/libevdev/libevdev.git ignore = all +[submodule "libffi"] + path = pkg/libffi/src + url = https://github.com/libffi/libffi + ignore = all [submodule "libinput"] path = pkg/libinput/src url = https://github.com/oasislinux/libinput diff --git a/pkg/gen.sh b/pkg/gen.sh @@ -27,6 +27,7 @@ pkg fzy pkg less pkg libdrm pkg libevdev +pkg libffi pkg libinput pkg libpciaccess pkg libpng diff --git a/pkg/libffi/fficonfig.h b/pkg/libffi/fficonfig.h @@ -0,0 +1,85 @@ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ +/* #undef CRAY_STACKSEG_END */ +/* #undef C_ALLOCA */ +#define EH_FRAME_FLAGS "a" +/* #undef FFI_DEBUG */ +/* #undef FFI_EXEC_TRAMPOLINE_TABLE */ +/* #undef FFI_MMAP_EXEC_EMUTRAMP_PAX */ +/* #undef FFI_MMAP_EXEC_WRIT */ +/* #undef FFI_NO_RAW_API */ +/* #undef FFI_NO_STRUCTS */ +#define HAVE_ALLOCA 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_AS_CFI_PSEUDO_OP 1 +/* #undef HAVE_AS_REGISTER_PSEUDO_OP */ +/* #undef HAVE_AS_S390_ZARCH */ +/* #undef HAVE_AS_SPARC_UA_PCREL */ +#ifdef __x86_64__ +#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1 +#define HAVE_AS_X86_PCREL 1 +#endif +#define HAVE_DLFCN_H 1 +#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LONG_DOUBLE 1 +/* #undef HAVE_LONG_DOUBLE_VARIANT */ +#define HAVE_MEMCPY 1 +#define HAVE_MEMORY_H 1 +#define HAVE_MKOSTEMP 1 +#define HAVE_MMAP 1 +#define HAVE_MMAP_ANON 1 +#define HAVE_MMAP_DEV_ZERO 1 +#define HAVE_MMAP_FILE 1 +#define HAVE_RO_EH_FRAME 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_MMAN_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_UNISTD_H 1 +#define LIBFFI_GNU_SYMBOL_VERSIONING 1 +#define LT_OBJDIR ".libs/" +#define PACKAGE "libffi" +#define PACKAGE_BUGREPORT "http://github.com/libffi/libffi/issues" +#define PACKAGE_NAME "libffi" +#define PACKAGE_STRING "libffi 3.3" +#define PACKAGE_TARNAME "libffi" +#define PACKAGE_URL "" +#define PACKAGE_VERSION "3.3" +#define SIZEOF_DOUBLE 8 +#define SIZEOF_LONG_DOUBLE 16 +#define SIZEOF_SIZE_T 8 +/* #undef STACK_DIRECTION */ +#define STDC_HEADERS 1 +/* #undef SYMBOL_UNDERSCORE */ +/* #undef USING_PURIFY */ +#define VERSION "3.3" +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif +/* #undef size_t */ +#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE +#ifdef LIBFFI_ASM +#ifdef __APPLE__ +#define FFI_HIDDEN(name) .private_extern name +#else +#define FFI_HIDDEN(name) .hidden name +#endif +#else +#define FFI_HIDDEN __attribute__ ((visibility ("hidden"))) +#endif +#else +#ifdef LIBFFI_ASM +#define FFI_HIDDEN(name) +#else +#define FFI_HIDDEN +#endif +#endif diff --git a/pkg/libffi/gen.sh b/pkg/libffi/gen.sh @@ -0,0 +1,41 @@ +git v3.3 + +cflags " + -I$dir + -I$outdir/include + -I$srcdir/include + -Wno-pedantic + -Wno-unused-parameter + -Wno-empty-body + -Wno-sign-compare + -Wno-deprecated-declarations + -Wno-implicit-fallthrough +" + +dep $dir/headers + +include " + src/x86/ffitarget.h + $outdir/ffi.h +" + +sed ffi.h include/ffi.h.in +bind expr " + -e s,@VERSION@,3.3, + -e s,@HAVE_LONG_DOUBLE@,1, + -e s,@HAVE_LONG_DOUBLE_VARIANT@,0, + -e s,@FFI_EXEC_TRAMPOLINE_TABLE@,0, + -e s,@TARGET@,X86_64, +" + +lib libffi.a --src-prefix src " + closures.c + java_raw_api.c + prep_cif.c + raw_api.c + types.c + x86/ffi64.c + x86/ffiw64.c + x86/unix64.S + x86/win64.S +" diff --git a/pkg/libffi/patch/0001-Use-fixed-type-integer-types-when-available.patch b/pkg/libffi/patch/0001-Use-fixed-type-integer-types-when-available.patch @@ -0,0 +1,36 @@ +From a53acabb2bade1d1934cc3a44f0174689255cf8a Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 13 Aug 2019 22:20:39 +0000 +Subject: [PATCH] Use fixed-type integer types when available + +This avoids the use of gcc attributes to select the integer width. +--- + include/ffi_common.h | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/include/ffi_common.h b/include/ffi_common.h +index 76b9dd6..cfec340 100644 +--- a/include/ffi_common.h ++++ b/include/ffi_common.h +@@ -112,7 +112,17 @@ typedef struct + } extended_cif; + + /* Terse sized type definitions. */ +-#if defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C) ++#if __STDC_VERSION__ >= 199901L ++# include <inttypes.h> ++typedef uint8_t UINT8; ++typedef int8_t SINT8; ++typedef uint16_t UINT16; ++typedef int16_t SINT16; ++typedef uint32_t UINT32; ++typedef int32_t SINT32; ++typedef uint64_t UINT64; ++typedef int64_t SINT64; ++#elif defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C) + typedef unsigned char UINT8; + typedef signed char SINT8; + typedef unsigned short UINT16; +-- +2.24.0 + diff --git a/pkg/libffi/patch/0002-Use-generic-padding-instead-of-128-bit-integers.patch b/pkg/libffi/patch/0002-Use-generic-padding-instead-of-128-bit-integers.patch @@ -0,0 +1,41 @@ +From 68b09c2e546bb3ea3ad43904e5b499729ee3bee8 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 13 Aug 2019 22:27:49 +0000 +Subject: [PATCH] Use generic padding instead of 128-bit integers + +--- + src/x86/ffi64.c | 14 +------------- + 1 file changed, 1 insertion(+), 13 deletions(-) + +diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c +index dec331c..a48c74d 100644 +--- a/src/x86/ffi64.c ++++ b/src/x86/ffi64.c +@@ -40,23 +40,11 @@ + #define MAX_GPR_REGS 6 + #define MAX_SSE_REGS 8 + +-#if defined(__INTEL_COMPILER) +-#include "xmmintrin.h" +-#define UINT128 __m128 +-#else +-#if defined(__SUNPRO_C) +-#include <sunmedia_types.h> +-#define UINT128 __m128i +-#else +-#define UINT128 __int128_t +-#endif +-#endif +- + union big_int_union + { + UINT32 i32; + UINT64 i64; +- UINT128 i128; ++ char pad[16]; + }; + + struct register_args +-- +2.24.0 + diff --git a/pkg/libffi/patch/0003-Don-t-use-complex-types-if-they-are-not-supported.patch b/pkg/libffi/patch/0003-Don-t-use-complex-types-if-they-are-not-supported.patch @@ -0,0 +1,25 @@ +From 160695fc15e589d08843b07b9f9950be574f3aee Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 13 Aug 2019 22:28:49 +0000 +Subject: [PATCH] Don't use complex types if they are not supported + +--- + src/x86/ffitarget.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/x86/ffitarget.h b/src/x86/ffitarget.h +index 85ccedf..d4f384c 100644 +--- a/src/x86/ffitarget.h ++++ b/src/x86/ffitarget.h +@@ -50,7 +50,7 @@ + #endif + + #define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION +-#ifndef _MSC_VER ++#if !defined(_MSC_VER) && !defined(__STDC_NO_COMPLEX__) + #define FFI_TARGET_HAS_COMPLEX_TYPE + #endif + +-- +2.24.0 +