On Wed, Oct 15, 2025 at 6:01 PM Pietro Monteiro <[email protected]> wrote: > > Patch 1 updates the list of local libffi patches, except for those > that only touch generated files. > > Patch 2 updates the sync script to remove a few more useless files.
I reviewed the above 2 since those don't touch the build at this stage. I am not 100% sure we want the rest during stage 4. I am trying to remember what libffi is used for at this point. Is it just go? Or a primary language too? If not a primary language I will go and review the rest tomorrow. Thanks, Andrew Pinski > > Patch 3 imports the latest libffi release from the upstream git > repo. The actual contents have been omitted because of its size and > because it's easy to replicate it by running the merge script. > > Patch 4 re-does the changes to adapt libffi to GCC's build system. > > Patch 5 re-does the changes to adapt libffi to GCC's test system. > > Patch 6 is the only local patch left that has not been merged upstream > or that is not build/test system related. I have forwarded that patch > upstream. > > Patch 7 removes a warning that make dejagnu mark 32-bit tests on > x86_64 as failed though they pass. I have forwarded that patch > upstream. > > libffi/LOCAL_PATCHES will need to be updated once this is merged. > > Bootstraped and regtested on x86_64-linux with multilib enabled and > `-m32',`-m64'. > > These are the test results for libffi in the GCC build: > > Trunk: > === libffi Summary for unix/-m32 === > > # of expected passes 3764 > > === libffi Summary for unix/-m64 === > > # of expected passes 2304 > > === libffi Summary === > > # of expected passes 6068 > > This series: > === libffi Summary for unix/-m32 === > > # of expected passes 4068 > > === libffi Summary for unix/-m64 === > > # of expected passes 2464 > > === libffi Summary === > > # of expected passes 6532 > > Pietro Monteiro (7): > libffi: Add missing GCC patches to LOCAL_PATCHES > libffi: Remove more unneeded files when merging > libffi: Sync with libffi 3.5.2 > libffi: Integrate build with GCC > libffi: Integrate testsuite with GCC testsuite > libffi: Always define `WIN32_LEAN_AND_MEAN` before <windows.h> > libffi: Remove debugging output > > libffi/LICENSE | 2 +- > libffi/LOCAL_PATCHES | 13 + > libffi/MERGE | 2 +- > libffi/Makefile.am | 34 +- > libffi/Makefile.in | 78 +- > libffi/README.md | 164 ++- > libffi/acinclude.m4 | 128 +- > libffi/configure | 1253 +++++------------ > libffi/configure.ac | 91 +- > libffi/configure.host | 28 +- > libffi/doc/libffi.texi | 68 +- > libffi/doc/version.texi | 8 +- > libffi/fficonfig.h.in | 55 +- > libffi/generate-darwin-source-and-headers.py | 155 +- > libffi/include/Makefile.in | 6 +- > libffi/include/ffi.h.in | 110 +- > libffi/include/ffi_cfi.h | 4 +- > libffi/include/ffi_common.h | 27 +- > libffi/libffi.map.in | 19 +- > libffi/libtool-version | 4 +- > libffi/man/Makefile.in | 6 +- > libffi/merge.sh | 8 +- > libffi/src/aarch64/ffi.c | 173 ++- > libffi/src/aarch64/ffitarget.h | 4 +- > libffi/src/aarch64/internal.h | 80 +- > libffi/src/aarch64/sysv.S | 280 +++- > libffi/src/arc/arcompact.S | 263 ++-- > libffi/src/arc/ffi.c | 475 +++++-- > libffi/src/arc/ffitarget.h | 14 + > libffi/src/arm/ffi.c | 34 +- > libffi/src/arm/sysv.S | 33 - > libffi/src/closures.c | 140 +- > libffi/src/debug.c | 4 +- > libffi/src/dlmalloc.c | 8 +- > libffi/src/ia64/ffi.c | 12 + > libffi/src/ia64/unix.S | 22 +- > libffi/src/loongarch64/ffi.c | 1 + > libffi/src/m32r/ffi.c | 45 +- > libffi/src/mips/ffi.c | 317 ++++- > libffi/src/mips/ffitarget.h | 13 +- > libffi/src/mips/n32.S | 228 ++- > libffi/src/mips/o32.S | 69 +- > libffi/src/moxie/ffi.c | 69 +- > libffi/src/or1k/ffi.c | 41 +- > libffi/src/pa/ffi.c | 65 +- > libffi/src/pa/ffi64.c | 614 ++++++++ > libffi/src/pa/ffitarget.h | 30 +- > libffi/src/pa/hpux32.S | 119 +- > libffi/src/pa/hpux64.S | 681 +++++++++ > libffi/src/pa/linux.S | 121 +- > libffi/src/powerpc/ffi.c | 19 + > libffi/src/powerpc/ffi_darwin.c | 60 +- > libffi/src/powerpc/ffi_linux64.c | 45 +- > libffi/src/powerpc/ffi_sysv.c | 42 +- > libffi/src/powerpc/internal.h | 10 + > libffi/src/powerpc/linux64_closure.S | 47 + > libffi/src/powerpc/ppc_closure.S | 24 + > libffi/src/powerpc/t-aix | 5 + > libffi/src/prep_cif.c | 10 +- > libffi/src/riscv/ffi.c | 41 +- > libffi/src/s390/ffi.c | 29 +- > libffi/src/s390/internal.h | 11 + > libffi/src/s390/sysv.S | 38 + > libffi/src/sparc/ffi64.c | 24 +- > libffi/src/tramp.c | 76 +- > libffi/src/types.c | 32 +- > libffi/src/wasm/ffi.c | 798 +++++++++++ > libffi/src/wasm/ffitarget.h | 79 ++ > libffi/src/x86/ffi.c | 74 +- > libffi/src/x86/ffi64.c | 44 +- > libffi/src/x86/ffitarget.h | 5 +- > libffi/src/x86/ffiw64.c | 20 +- > libffi/src/x86/sysv_intel.S | 179 +-- > libffi/src/x86/unix64.S | 35 +- > libffi/src/xtensa/ffi.c | 24 +- > libffi/src/xtensa/ffitarget.h | 4 + > libffi/src/xtensa/sysv.S | 42 +- > libffi/testsuite/Makefile.am | 199 ++- > libffi/testsuite/Makefile.in | 205 ++- > libffi/testsuite/emscripten/build-tests.sh | 34 + > libffi/testsuite/emscripten/build.sh | 46 + > libffi/testsuite/emscripten/conftest.py | 86 ++ > libffi/testsuite/emscripten/node-tests.sh | 23 + > libffi/testsuite/emscripten/test.html | 7 + > libffi/testsuite/emscripten/test_libffi.py | 51 + > libffi/testsuite/lib/libffi.exp | 532 +++---- > libffi/testsuite/lib/target-libpath.exp | 4 +- > libffi/testsuite/libffi.bhaible/test-call.c | 1 + > libffi/testsuite/libffi.bhaible/testcases.c | 2 +- > libffi/testsuite/libffi.call/bpo_38748.c | 41 + > libffi/testsuite/libffi.call/callback.c | 99 ++ > libffi/testsuite/libffi.call/callback2.c | 108 ++ > libffi/testsuite/libffi.call/callback3.c | 114 ++ > libffi/testsuite/libffi.call/callback4.c | 119 ++ > libffi/testsuite/libffi.call/ffitest.h | 26 +- > libffi/testsuite/libffi.call/float_va.c | 3 + > libffi/testsuite/libffi.call/longjmp.c | 60 + > libffi/testsuite/libffi.call/overread.c | 54 + > libffi/testsuite/libffi.call/pyobjc_tc.c | 114 ++ > libffi/testsuite/libffi.call/return_ll1.c | 5 + > libffi/testsuite/libffi.call/return_sl.c | 4 + > libffi/testsuite/libffi.call/return_ul.c | 4 + > libffi/testsuite/libffi.call/s55.c | 60 + > libffi/testsuite/libffi.call/strlen.c | 17 +- > libffi/testsuite/libffi.call/strlen2.c | 4 +- > libffi/testsuite/libffi.call/strlen3.c | 4 +- > libffi/testsuite/libffi.call/strlen4.c | 4 +- > libffi/testsuite/libffi.call/struct10.c | 2 +- > .../testsuite/libffi.call/struct_by_value_2.c | 63 + > .../testsuite/libffi.call/struct_by_value_3.c | 65 + > .../libffi.call/struct_by_value_3f.c | 65 + > .../testsuite/libffi.call/struct_by_value_4.c | 67 + > .../libffi.call/struct_by_value_4f.c | 67 + > .../libffi.call/struct_by_value_big.c | 93 ++ > .../libffi.call/struct_by_value_small.c | 61 + > .../testsuite/libffi.call/struct_int_float.c | 88 ++ > .../testsuite/libffi.call/struct_return_2H.c | 63 + > .../testsuite/libffi.call/struct_return_8H.c | 90 ++ > libffi/testsuite/libffi.call/va_2.c | 26 +- > libffi/testsuite/libffi.call/va_3.c | 154 ++ > libffi/testsuite/libffi.call/va_struct1.c | 13 + > libffi/testsuite/libffi.call/va_struct2.c | 11 + > libffi/testsuite/libffi.call/va_struct3.c | 15 + > libffi/testsuite/libffi.call/x32.c | 31 + > .../testsuite/libffi.closures/closure_fn0.c | 5 +- > .../testsuite/libffi.closures/closure_fn1.c | 2 + > .../testsuite/libffi.closures/closure_fn2.c | 2 + > .../testsuite/libffi.closures/closure_fn3.c | 22 +- > .../testsuite/libffi.closures/closure_fn4.c | 2 + > .../testsuite/libffi.closures/closure_fn5.c | 2 + > .../testsuite/libffi.closures/closure_fn6.c | 2 + > .../libffi.closures/closure_loc_fn0.c | 12 +- > .../libffi.closures/closure_simple.c | 6 + > libffi/testsuite/libffi.closures/cls_12byte.c | 18 + > libffi/testsuite/libffi.closures/cls_16byte.c | 22 + > libffi/testsuite/libffi.closures/cls_18byte.c | 24 + > libffi/testsuite/libffi.closures/cls_19byte.c | 29 + > .../testsuite/libffi.closures/cls_1_1byte.c | 4 + > libffi/testsuite/libffi.closures/cls_20byte.c | 18 + > .../testsuite/libffi.closures/cls_20byte1.c | 20 + > libffi/testsuite/libffi.closures/cls_24byte.c | 32 + > libffi/testsuite/libffi.closures/cls_2byte.c | 13 + > .../testsuite/libffi.closures/cls_3_1byte.c | 19 + > libffi/testsuite/libffi.closures/cls_3byte1.c | 13 + > libffi/testsuite/libffi.closures/cls_3byte2.c | 13 + > libffi/testsuite/libffi.closures/cls_3float.c | 18 + > .../testsuite/libffi.closures/cls_4_1byte.c | 22 + > libffi/testsuite/libffi.closures/cls_4byte.c | 13 + > .../testsuite/libffi.closures/cls_5_1_byte.c | 28 + > libffi/testsuite/libffi.closures/cls_5byte.c | 18 + > libffi/testsuite/libffi.closures/cls_64byte.c | 24 + > .../testsuite/libffi.closures/cls_6_1_byte.c | 27 + > libffi/testsuite/libffi.closures/cls_6byte.c | 24 +- > .../testsuite/libffi.closures/cls_7_1_byte.c | 38 + > libffi/testsuite/libffi.closures/cls_7byte.c | 24 + > libffi/testsuite/libffi.closures/cls_8byte.c | 14 + > libffi/testsuite/libffi.closures/cls_9byte1.c | 13 + > libffi/testsuite/libffi.closures/cls_9byte2.c | 14 +- > .../libffi.closures/cls_align_double.c | 18 + > .../libffi.closures/cls_align_float.c | 18 + > .../libffi.closures/cls_align_longdouble.c | 19 + > .../cls_align_longdouble_split.c | 63 +- > .../cls_align_longdouble_split2.c | 41 +- > .../libffi.closures/cls_align_pointer.c | 18 + > .../libffi.closures/cls_align_sint16.c | 17 + > .../libffi.closures/cls_align_sint32.c | 19 +- > .../libffi.closures/cls_align_sint64.c | 17 + > .../libffi.closures/cls_align_uint16.c | 17 + > .../libffi.closures/cls_align_uint32.c | 18 + > .../libffi.closures/cls_align_uint64.c | 18 + > .../libffi.closures/cls_dbls_struct.c | 4 +- > .../testsuite/libffi.closures/cls_double_va.c | 10 +- > libffi/testsuite/libffi.closures/cls_float.c | 4 + > .../libffi.closures/cls_longdouble.c | 12 +- > .../libffi.closures/cls_longdouble_va.c | 25 +- > .../libffi.closures/cls_multi_schar.c | 4 + > .../libffi.closures/cls_multi_sshort.c | 5 + > .../libffi.closures/cls_multi_sshortchar.c | 8 + > .../libffi.closures/cls_multi_uchar.c | 8 + > .../libffi.closures/cls_multi_ushort.c | 6 +- > .../libffi.closures/cls_multi_ushortchar.c | 8 + > .../testsuite/libffi.closures/cls_pointer.c | 5 + > .../libffi.closures/cls_pointer_stack.c | 10 + > libffi/testsuite/libffi.closures/cls_schar.c | 3 + > libffi/testsuite/libffi.closures/cls_sint.c | 2 + > libffi/testsuite/libffi.closures/cls_sshort.c | 3 + > .../libffi.closures/cls_struct_va1.c | 11 + > libffi/testsuite/libffi.closures/cls_uchar.c | 3 + > libffi/testsuite/libffi.closures/cls_uint.c | 4 + > .../testsuite/libffi.closures/cls_uint_va.c | 4 + > .../testsuite/libffi.closures/cls_ulong_va.c | 4 + > .../testsuite/libffi.closures/cls_ulonglong.c | 2 + > libffi/testsuite/libffi.closures/cls_ushort.c | 3 + > libffi/testsuite/libffi.closures/ffitest.h | 145 +- > .../testsuite/libffi.closures/huge_struct.c | 45 +- > .../testsuite/libffi.closures/nested_struct.c | 39 +- > .../libffi.closures/nested_struct10.c | 12 + > .../libffi.closures/nested_struct11.c | 26 +- > .../libffi.closures/nested_struct12.c | 2 +- > .../libffi.closures/nested_struct13.c | 20 +- > .../libffi.closures/nested_struct2.c | 9 + > .../libffi.closures/nested_struct3.c | 9 + > .../libffi.closures/nested_struct4.c | 9 + > .../libffi.closures/nested_struct5.c | 9 + > .../libffi.closures/nested_struct6.c | 11 + > .../libffi.closures/nested_struct7.c | 9 + > .../libffi.closures/nested_struct8.c | 11 + > .../libffi.closures/nested_struct9.c | 11 + > .../testsuite/libffi.closures/testclosure.c | 5 + > .../testsuite/libffi.closures/unwindtest.cc | 5 +- > .../libffi.closures/unwindtest_ffi_call.cc | 3 + > libffi/testsuite/libffi.complex/complex_int.c | 2 +- > libffi/testsuite/libffi.threads/ffitest.h | 1 + > libffi/testsuite/libffi.threads/threads.exp | 50 + > libffi/testsuite/libffi.threads/tsan.c | 74 + > 215 files changed, 9394 insertions(+), 3140 deletions(-) > create mode 100644 libffi/src/pa/ffi64.c > create mode 100644 libffi/src/pa/hpux64.S > create mode 100644 libffi/src/powerpc/internal.h > create mode 100644 libffi/src/powerpc/t-aix > create mode 100644 libffi/src/wasm/ffi.c > create mode 100644 libffi/src/wasm/ffitarget.h > create mode 100755 libffi/testsuite/emscripten/build-tests.sh > create mode 100755 libffi/testsuite/emscripten/build.sh > create mode 100644 libffi/testsuite/emscripten/conftest.py > create mode 100755 libffi/testsuite/emscripten/node-tests.sh > create mode 100644 libffi/testsuite/emscripten/test.html > create mode 100644 libffi/testsuite/emscripten/test_libffi.py > create mode 100644 libffi/testsuite/libffi.call/bpo_38748.c > create mode 100644 libffi/testsuite/libffi.call/callback.c > create mode 100644 libffi/testsuite/libffi.call/callback2.c > create mode 100644 libffi/testsuite/libffi.call/callback3.c > create mode 100644 libffi/testsuite/libffi.call/callback4.c > create mode 100644 libffi/testsuite/libffi.call/longjmp.c > create mode 100644 libffi/testsuite/libffi.call/overread.c > create mode 100644 libffi/testsuite/libffi.call/pyobjc_tc.c > create mode 100644 libffi/testsuite/libffi.call/s55.c > create mode 100644 libffi/testsuite/libffi.call/struct_by_value_2.c > create mode 100644 libffi/testsuite/libffi.call/struct_by_value_3.c > create mode 100644 libffi/testsuite/libffi.call/struct_by_value_3f.c > create mode 100644 libffi/testsuite/libffi.call/struct_by_value_4.c > create mode 100644 libffi/testsuite/libffi.call/struct_by_value_4f.c > create mode 100644 libffi/testsuite/libffi.call/struct_by_value_big.c > create mode 100644 libffi/testsuite/libffi.call/struct_by_value_small.c > create mode 100644 libffi/testsuite/libffi.call/struct_int_float.c > create mode 100644 libffi/testsuite/libffi.call/struct_return_2H.c > create mode 100644 libffi/testsuite/libffi.call/struct_return_8H.c > create mode 100644 libffi/testsuite/libffi.call/va_3.c > create mode 100644 libffi/testsuite/libffi.call/x32.c > create mode 100644 libffi/testsuite/libffi.threads/ffitest.h > create mode 100644 libffi/testsuite/libffi.threads/threads.exp > create mode 100644 libffi/testsuite/libffi.threads/tsan.c > > -- > 2.43.0 >
