public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] libffi: Sync with upstream
@ 2021-09-02 15:50 H.J. Lu
  2021-09-02 15:50 ` [PATCH v2 1/4] libffi: Add HOWTO_MERGE, autogen.sh and merge.sh H.J. Lu
                   ` (5 more replies)
  0 siblings, 6 replies; 27+ messages in thread
From: H.J. Lu @ 2021-09-02 15:50 UTC (permalink / raw)
  To: gcc-patches
  Cc: Jeff Law, Jakub Jelinek, DJ Delorie, Xi Ruoyao, Richard Biener

Change in the v2 patch:

1. Disable static trampolines by default.


GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes 
from upstream over the last 10+ years.  In the meantime, libffi upstream
has been changed significantly with new features, bug fixes and new target
support.  Here is a set of patches to sync with libffi 3.4.2 release and
make it easier to sync with libffi upstream:

1. Document how to sync with upstream.
2. Add scripts to help sync with upstream.
3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at

https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
4. Integrate libffi build and testsuite with GCC.

H.J. Lu (4):
  libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
  libffi: Sync with libffi 3.4.2
  libffi: Integrate build with GCC
  libffi: Integrate testsuite with GCC testsuite

 libffi/.gitattributes                         |    4 +
 libffi/ChangeLog.libffi                       | 7743 ++++++++++++++++-
 libffi/HOWTO_MERGE                            |   13 +
 libffi/LICENSE                                |    2 +-
 libffi/LICENSE-BUILDTOOLS                     |  353 +
 libffi/MERGE                                  |    4 +
 libffi/Makefile.am                            |  135 +-
 libffi/Makefile.in                            |  219 +-
 libffi/README                                 |  450 -
 libffi/README.md                              |  495 ++
 libffi/acinclude.m4                           |   38 +-
 libffi/autogen.sh                             |   11 +
 libffi/configure                              |  487 +-
 libffi/configure.ac                           |   91 +-
 libffi/configure.host                         |   97 +-
 libffi/doc/Makefile.am                        |    3 +
 libffi/doc/libffi.texi                        |  382 +-
 libffi/doc/version.texi                       |    8 +-
 libffi/fficonfig.h.in                         |   21 +-
 libffi/generate-darwin-source-and-headers.py  |  143 +-
 libffi/include/Makefile.am                    |    2 +-
 libffi/include/Makefile.in                    |    3 +-
 libffi/include/ffi.h.in                       |  213 +-
 libffi/include/ffi_cfi.h                      |   21 +
 libffi/include/ffi_common.h                   |   50 +-
 libffi/include/tramp.h                        |   45 +
 libffi/libffi.map.in                          |   24 +-
 libffi/libffi.pc.in                           |    2 +-
 libffi/libffi.xcodeproj/project.pbxproj       |  530 +-
 libffi/libtool-version                        |   25 +-
 libffi/man/Makefile.in                        |    1 +
 libffi/mdate-sh                               |   39 +-
 libffi/merge.sh                               |   51 +
 libffi/msvcc.sh                               |  134 +-
 libffi/src/aarch64/ffi.c                      |  536 +-
 libffi/src/aarch64/ffitarget.h                |   35 +-
 libffi/src/aarch64/internal.h                 |   33 +
 libffi/src/aarch64/sysv.S                     |  189 +-
 libffi/src/aarch64/win64_armasm.S             |  506 ++
 libffi/src/alpha/ffi.c                        |    6 +-
 libffi/src/arc/ffi.c                          |    6 +-
 libffi/src/arm/ffi.c                          |  380 +-
 libffi/src/arm/ffitarget.h                    |   24 +-
 libffi/src/arm/internal.h                     |   10 +
 libffi/src/arm/sysv.S                         |  304 +-
 libffi/src/arm/sysv_msvc_arm32.S              |  311 +
 libffi/src/closures.c                         |  489 +-
 libffi/src/cris/ffi.c                         |    4 +-
 libffi/src/csky/ffi.c                         |  395 +
 libffi/src/csky/ffitarget.h                   |   63 +
 libffi/src/csky/sysv.S                        |  371 +
 libffi/src/dlmalloc.c                         |    7 +-
 libffi/src/frv/ffi.c                          |    4 +-
 libffi/src/ia64/ffi.c                         |   30 +-
 libffi/src/ia64/ffitarget.h                   |    3 +-
 libffi/src/ia64/unix.S                        |    9 +-
 libffi/src/java_raw_api.c                     |    6 +-
 libffi/src/kvx/asm.h                          |    5 +
 libffi/src/kvx/ffi.c                          |  273 +
 libffi/src/kvx/ffitarget.h                    |   75 +
 libffi/src/kvx/sysv.S                         |  127 +
 libffi/src/m32r/ffi.c                         |    2 +-
 libffi/src/m68k/ffi.c                         |    4 +-
 libffi/src/m68k/sysv.S                        |   29 +-
 libffi/src/m88k/ffi.c                         |    8 +-
 libffi/src/metag/ffi.c                        |   14 +-
 libffi/src/microblaze/ffi.c                   |   10 +-
 libffi/src/mips/ffi.c                         |  146 +-
 libffi/src/mips/ffitarget.h                   |   23 +-
 libffi/src/mips/n32.S                         |  151 +-
 libffi/src/mips/o32.S                         |  177 +-
 libffi/src/moxie/eabi.S                       |    2 +-
 libffi/src/moxie/ffi.c                        |   27 +-
 libffi/src/nios2/ffi.c                        |    4 +-
 libffi/src/pa/ffi.c                           |  216 +-
 libffi/src/pa/ffitarget.h                     |   11 +-
 libffi/src/pa/hpux32.S                        |   76 +-
 libffi/src/pa/linux.S                         |  160 +-
 libffi/src/powerpc/asm.h                      |    4 +-
 libffi/src/powerpc/darwin_closure.S           |    6 +-
 libffi/src/powerpc/ffi.c                      |   10 +-
 libffi/src/powerpc/ffi_darwin.c               |   48 +-
 libffi/src/powerpc/ffi_linux64.c              |  247 +-
 libffi/src/powerpc/ffi_powerpc.h              |   25 +-
 libffi/src/powerpc/ffitarget.h                |   14 +-
 libffi/src/powerpc/linux64.S                  |  111 +-
 libffi/src/powerpc/linux64_closure.S          |   70 +-
 libffi/src/powerpc/sysv.S                     |   12 +-
 libffi/src/prep_cif.c                         |   64 +-
 libffi/src/raw_api.c                          |   10 +-
 libffi/src/riscv/ffi.c                        |   16 +-
 libffi/src/sparc/ffi.c                        |    6 +-
 libffi/src/sparc/ffi64.c                      |   18 +-
 libffi/src/tramp.c                            |  729 ++
 libffi/src/types.c                            |    4 +-
 libffi/src/vax/ffi.c                          |    4 +-
 libffi/src/x86/asmnames.h                     |   30 +
 libffi/src/x86/darwin.S                       |  444 -
 libffi/src/x86/darwin64.S                     |  416 -
 libffi/src/x86/darwin64_c.c                   |  643 --
 libffi/src/x86/darwin_c.c                     |  843 --
 libffi/src/x86/ffi.c                          |  162 +-
 libffi/src/x86/ffi64.c                        |  164 +-
 libffi/src/x86/ffitarget.h                    |   42 +-
 libffi/src/x86/ffiw64.c                       |  114 +-
 libffi/src/x86/internal.h                     |   14 +
 libffi/src/x86/internal64.h                   |   14 +
 libffi/src/x86/sysv.S                         |  215 +-
 libffi/src/x86/sysv_intel.S                   |  995 +++
 libffi/src/x86/unix64.S                       |  204 +-
 libffi/src/x86/win64.S                        |  170 +-
 libffi/src/x86/win64_intel.S                  |  238 +
 libffi/src/xtensa/ffi.c                       |    4 +-
 libffi/src/xtensa/sysv.S                      |    7 +-
 libffi/testsuite/Makefile.am                  |  206 +-
 libffi/testsuite/Makefile.in                  |  210 +-
 libffi/testsuite/lib/libffi.exp               |  294 +-
 libffi/testsuite/libffi.bhaible/Makefile      |   28 +
 libffi/testsuite/libffi.bhaible/README        |   78 +
 libffi/testsuite/libffi.bhaible/alignof.h     |   50 +
 libffi/testsuite/libffi.bhaible/bhaible.exp   |   63 +
 libffi/testsuite/libffi.bhaible/test-call.c   | 1745 ++++
 .../testsuite/libffi.bhaible/test-callback.c  | 2885 ++++++
 libffi/testsuite/libffi.bhaible/testcases.c   |  747 ++
 libffi/testsuite/libffi.call/align_mixed.c    |   46 +
 libffi/testsuite/libffi.call/align_stdcall.c  |   46 +
 libffi/testsuite/libffi.call/call.exp         |   28 +-
 libffi/testsuite/libffi.call/cls_uchar_va.c   |   44 -
 libffi/testsuite/libffi.call/cls_ushort_va.c  |   44 -
 libffi/testsuite/libffi.call/ffitest.h        |   13 +-
 libffi/testsuite/libffi.call/float2.c         |   23 +-
 libffi/testsuite/libffi.call/offsets.c        |   46 +
 libffi/testsuite/libffi.call/struct10.c       |   57 +
 libffi/testsuite/libffi.call/va_1.c           |  120 +-
 libffi/testsuite/libffi.call/va_2.c           |  196 +
 libffi/testsuite/libffi.closures/closure.exp  |   67 +
 .../closure_fn0.c                             |    0
 .../closure_fn1.c                             |    0
 .../closure_fn2.c                             |    0
 .../closure_fn3.c                             |    0
 .../closure_fn4.c                             |    0
 .../closure_fn5.c                             |    0
 .../closure_fn6.c                             |    0
 .../closure_loc_fn0.c                         |    3 +
 .../closure_simple.c                          |    0
 .../cls_12byte.c                              |    0
 .../cls_16byte.c                              |    0
 .../cls_18byte.c                              |    0
 .../cls_19byte.c                              |    0
 .../cls_1_1byte.c                             |    0
 .../cls_20byte.c                              |    2 +-
 .../cls_20byte1.c                             |    2 +-
 .../cls_24byte.c                              |    6 +-
 .../cls_2byte.c                               |    0
 .../cls_3_1byte.c                             |    0
 .../cls_3byte1.c                              |    0
 .../cls_3byte2.c                              |    0
 libffi/testsuite/libffi.closures/cls_3float.c |   95 +
 .../cls_4_1byte.c                             |    0
 .../cls_4byte.c                               |    0
 .../cls_5_1_byte.c                            |    2 +-
 .../cls_5byte.c                               |    2 +-
 .../cls_64byte.c                              |    0
 .../cls_6_1_byte.c                            |    2 +-
 .../cls_6byte.c                               |    2 +-
 .../cls_7_1_byte.c                            |    2 +-
 .../cls_7byte.c                               |    2 +-
 .../cls_8byte.c                               |    0
 .../cls_9byte1.c                              |    2 +-
 .../cls_9byte2.c                              |    2 +-
 .../cls_align_double.c                        |    2 +-
 .../cls_align_float.c                         |    2 +-
 .../cls_align_longdouble.c                    |    2 +-
 .../cls_align_longdouble_split.c              |    2 +-
 .../cls_align_longdouble_split2.c             |    2 +-
 .../cls_align_pointer.c                       |    2 +-
 .../cls_align_sint16.c                        |    2 +-
 .../cls_align_sint32.c                        |    2 +-
 .../cls_align_sint64.c                        |    2 +-
 .../cls_align_uint16.c                        |    2 +-
 .../cls_align_uint32.c                        |    2 +-
 .../cls_align_uint64.c                        |    2 +-
 .../cls_dbls_struct.c                         |    6 +-
 .../cls_double.c                              |    0
 .../cls_double_va.c                           |    0
 .../cls_float.c                               |    0
 .../cls_longdouble.c                          |    0
 .../cls_longdouble_va.c                       |    0
 .../cls_many_mixed_args.c                     |    0
 .../cls_many_mixed_float_double.c             |    0
 .../cls_multi_schar.c                         |    2 +-
 .../cls_multi_sshort.c                        |    2 +-
 .../cls_multi_sshortchar.c                    |    2 +-
 .../cls_multi_uchar.c                         |    2 +-
 .../cls_multi_ushort.c                        |    2 +-
 .../cls_multi_ushortchar.c                    |    2 +-
 .../cls_pointer.c                             |    0
 .../cls_pointer_stack.c                       |    0
 .../cls_schar.c                               |    0
 .../cls_sint.c                                |    0
 .../cls_sshort.c                              |    0
 .../cls_struct_va1.c                          |    0
 .../cls_uchar.c                               |    0
 .../cls_uint.c                                |    0
 .../cls_uint_va.c                             |    0
 .../cls_ulong_va.c                            |    0
 .../cls_ulonglong.c                           |    0
 .../cls_ushort.c                              |    0
 .../err_bad_abi.c                             |    0
 libffi/testsuite/libffi.closures/ffitest.h    |  144 +
 .../huge_struct.c                             |    4 +-
 .../nested_struct.c                           |    2 +-
 .../nested_struct1.c                          |    2 +-
 .../nested_struct10.c                         |    1 +
 .../nested_struct11.c                         |    0
 .../libffi.closures/nested_struct12.c         |   86 +
 .../nested_struct13.c}                        |   14 +-
 .../nested_struct2.c                          |    2 +-
 .../nested_struct3.c                          |    2 +-
 .../nested_struct4.c                          |    0
 .../nested_struct5.c                          |    0
 .../nested_struct6.c                          |    0
 .../nested_struct7.c                          |    0
 .../nested_struct8.c                          |    0
 .../nested_struct9.c                          |    0
 .../problem1.c                                |    0
 .../libffi.closures/single_entry_structs1.c   |   86 +
 .../libffi.closures/single_entry_structs2.c   |  102 +
 .../libffi.closures/single_entry_structs3.c   |  101 +
 .../stret_large.c                             |    0
 .../stret_large2.c                            |    0
 .../stret_medium.c                            |    2 +-
 .../stret_medium2.c                           |    2 +-
 .../testclosure.c                             |    2 +-
 .../unwindtest.cc                             |   13 +-
 .../unwindtest_ffi_call.cc                    |    5 +-
 libffi/testsuite/libffi.go/static-chain.h     |    6 -
 libffi/testsuite/libffi.special/ffitestcxx.h  |   96 -
 libffi/testsuite/libffi.special/special.exp   |   35 -
 239 files changed, 24951 insertions(+), 6175 deletions(-)
 create mode 100644 libffi/.gitattributes
 create mode 100644 libffi/HOWTO_MERGE
 create mode 100644 libffi/LICENSE-BUILDTOOLS
 create mode 100644 libffi/MERGE
 delete mode 100644 libffi/README
 create mode 100644 libffi/README.md
 create mode 100755 libffi/autogen.sh
 create mode 100644 libffi/doc/Makefile.am
 mode change 100644 => 100755 libffi/generate-darwin-source-and-headers.py
 create mode 100644 libffi/include/tramp.h
 mode change 100644 => 100755 libffi/mdate-sh
 create mode 100755 libffi/merge.sh
 create mode 100644 libffi/src/aarch64/win64_armasm.S
 create mode 100644 libffi/src/arm/sysv_msvc_arm32.S
 create mode 100644 libffi/src/csky/ffi.c
 create mode 100644 libffi/src/csky/ffitarget.h
 create mode 100644 libffi/src/csky/sysv.S
 create mode 100644 libffi/src/kvx/asm.h
 create mode 100644 libffi/src/kvx/ffi.c
 create mode 100644 libffi/src/kvx/ffitarget.h
 create mode 100644 libffi/src/kvx/sysv.S
 create mode 100644 libffi/src/tramp.c
 create mode 100644 libffi/src/x86/asmnames.h
 delete mode 100644 libffi/src/x86/darwin.S
 delete mode 100644 libffi/src/x86/darwin64.S
 delete mode 100644 libffi/src/x86/darwin64_c.c
 delete mode 100644 libffi/src/x86/darwin_c.c
 create mode 100644 libffi/src/x86/sysv_intel.S
 create mode 100644 libffi/src/x86/win64_intel.S
 create mode 100644 libffi/testsuite/libffi.bhaible/Makefile
 create mode 100644 libffi/testsuite/libffi.bhaible/README
 create mode 100644 libffi/testsuite/libffi.bhaible/alignof.h
 create mode 100644 libffi/testsuite/libffi.bhaible/bhaible.exp
 create mode 100644 libffi/testsuite/libffi.bhaible/test-call.c
 create mode 100644 libffi/testsuite/libffi.bhaible/test-callback.c
 create mode 100644 libffi/testsuite/libffi.bhaible/testcases.c
 create mode 100644 libffi/testsuite/libffi.call/align_mixed.c
 create mode 100644 libffi/testsuite/libffi.call/align_stdcall.c
 delete mode 100644 libffi/testsuite/libffi.call/cls_uchar_va.c
 delete mode 100644 libffi/testsuite/libffi.call/cls_ushort_va.c
 create mode 100644 libffi/testsuite/libffi.call/offsets.c
 create mode 100644 libffi/testsuite/libffi.call/struct10.c
 create mode 100644 libffi/testsuite/libffi.call/va_2.c
 create mode 100644 libffi/testsuite/libffi.closures/closure.exp
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn0.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn1.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn2.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn3.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn4.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn5.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn6.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_loc_fn0.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_simple.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_12byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_16byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_18byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_19byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_1_1byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte1.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_24byte.c (95%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_2byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3_1byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte1.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte2.c (100%)
 create mode 100644 libffi/testsuite/libffi.closures/cls_3float.c
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4_1byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5_1_byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_64byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6_1_byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7_1_byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_8byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte1.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte2.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_double.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_float.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split2.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_pointer.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint16.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint32.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint64.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint16.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint32.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint64.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_dbls_struct.c (92%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double_va.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_float.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble_va.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_args.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_float_double.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_schar.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshort.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshortchar.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_uchar.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushort.c (95%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushortchar.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer_stack.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_schar.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sint.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sshort.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_struct_va1.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uchar.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint_va.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulong_va.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulonglong.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ushort.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/err_bad_abi.c (100%)
 create mode 100644 libffi/testsuite/libffi.closures/ffitest.h
 rename libffi/testsuite/{libffi.call => libffi.closures}/huge_struct.c (99%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct1.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct10.c (99%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct11.c (100%)
 create mode 100644 libffi/testsuite/libffi.closures/nested_struct12.c
 rename libffi/testsuite/{libffi.call/nested_struct12.c => libffi.closures/nested_struct13.c} (88%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct2.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct3.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct4.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct5.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct6.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct7.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct8.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct9.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/problem1.c (100%)
 create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs1.c
 create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs2.c
 create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs3.c
 rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large2.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium2.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/testclosure.c (95%)
 rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest.cc (95%)
 rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest_ffi_call.cc (94%)
 delete mode 100644 libffi/testsuite/libffi.special/ffitestcxx.h
 delete mode 100644 libffi/testsuite/libffi.special/special.exp

-- 
2.31.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 1/4] libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
  2021-09-02 15:50 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
@ 2021-09-02 15:50 ` H.J. Lu
  2021-09-02 15:50 ` [PATCH v2 2/4] libffi: Sync with libffi 3.4.2 H.J. Lu
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 27+ messages in thread
From: H.J. Lu @ 2021-09-02 15:50 UTC (permalink / raw)
  To: gcc-patches
  Cc: Jeff Law, Jakub Jelinek, DJ Delorie, Xi Ruoyao, Richard Biener

Add scripts for syncing with libffi upstream:

1. Clone libffi repo.
2. Checkout the specific commit.
3. Remove the unused files.
4. Add new files and remove old files if needed.

	* HOWTO_MERGE: New file.
	* autogen.sh: Likewise.
	* merge.sh: Likewise.
---
 libffi/HOWTO_MERGE | 13 ++++++++++++
 libffi/autogen.sh  | 11 ++++++++++
 libffi/merge.sh    | 51 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+)
 create mode 100644 libffi/HOWTO_MERGE
 create mode 100755 libffi/autogen.sh
 create mode 100755 libffi/merge.sh

diff --git a/libffi/HOWTO_MERGE b/libffi/HOWTO_MERGE
new file mode 100644
index 00000000000..5b92b10c15c
--- /dev/null
+++ b/libffi/HOWTO_MERGE
@@ -0,0 +1,13 @@
+In general, merging process should not be very difficult, but we need to
+track GCC-specific patches carefully.  Here is a general list of actions
+required to perform the merge:
+
+* Checkout recent GCC tree.
+* Run merge.sh script from the libffi directory.
+* Add new files and remove old files if needed.
+* Apply all needed GCC-specific patches to libffi (note that some of
+  them might be already included to upstream).  The list of these patches
+  is stored into LOCAL_PATCHES file.  May need to re-run autogen.sh to
+  regenerate configure and Makefile.in files.
+* Send your patches for review to GCC Patches Mailing List (gcc-patches@gcc.gnu.org).
+* Update LOCAL_PATCHES file when you've committed the whole patch set with new revisions numbers.
diff --git a/libffi/autogen.sh b/libffi/autogen.sh
new file mode 100755
index 00000000000..95bfc389faf
--- /dev/null
+++ b/libffi/autogen.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+#exec autoreconf -v -i
+
+rm -rf autom4te.cache
+aclocal  -I .. -I ../config
+autoheader -I .. -I ../config
+autoconf
+automake --foreign --add-missing --copy Makefile
+automake --foreign include/Makefile
+automake --foreign man/Makefile
+automake --foreign testsuite/Makefile
diff --git a/libffi/merge.sh b/libffi/merge.sh
new file mode 100755
index 00000000000..b36fbb92185
--- /dev/null
+++ b/libffi/merge.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# FIXME: do we need a license (or whatever else) header here?
+
+# This script merges libffi sources from upstream.
+
+# Default to the tip of master branch.
+commit=${1-master}
+
+fatal() {
+  echo "$1"
+  exit 1;
+}
+
+get_upstream() {
+  rm -rf upstream
+  git clone https://github.com/libffi/libffi.git upstream
+  pushd upstream
+  git checkout $commit || fatal "Failed to checkout $commit"
+  popd
+}
+
+get_current_rev() {
+  cd upstream
+  git rev-parse HEAD
+}
+
+pwd | grep 'libffi$' || \
+  fatal "Run this script from the libffi directory"
+get_upstream
+CUR_REV=$(get_current_rev)
+echo Current upstream revision: $CUR_REV
+
+# Remove the unused files.
+pushd upstream
+rm -rf ChangeLog.old .appveyor* .ci .github .gitignore .travis* \
+	config.guess config.sub libtool-ldflags m4 make_sunver.pl \
+	msvc_build
+rm -rf .git autogen.sh
+cp -a . ..
+popd
+
+rm -rf upstream
+
+# Update the MERGE file.
+cat << EOF > MERGE
+$CUR_REV
+
+The first line of this file holds the git revision number of the
+last merge done from the master library sources.
+EOF
-- 
2.31.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 2/4] libffi: Sync with libffi 3.4.2
  2021-09-02 15:50 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
  2021-09-02 15:50 ` [PATCH v2 1/4] libffi: Add HOWTO_MERGE, autogen.sh and merge.sh H.J. Lu
@ 2021-09-02 15:50 ` H.J. Lu
  2021-09-02 15:50 ` [PATCH v2 3/4] libffi: Integrate build with GCC H.J. Lu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 27+ messages in thread
From: H.J. Lu @ 2021-09-02 15:50 UTC (permalink / raw)
  To: gcc-patches
  Cc: Jeff Law, Jakub Jelinek, DJ Delorie, Xi Ruoyao, Richard Biener

Merged commit: f9ea41683444ebe11cfa45b05223899764df28fb
---
 libffi/.gitattributes                         |     4 +
 libffi/ChangeLog.libffi                       |  7743 +++++-
 libffi/LICENSE                                |     2 +-
 libffi/LICENSE-BUILDTOOLS                     |   353 +
 libffi/MERGE                                  |     4 +
 libffi/Makefile.am                            |   249 +-
 libffi/Makefile.in                            |  1944 --
 libffi/README                                 |   450 -
 libffi/README.md                              |   495 +
 libffi/acinclude.m4                           |    38 +-
 libffi/aclocal.m4                             |  1202 -
 libffi/configure                              | 19411 ----------------
 libffi/configure.ac                           |   199 +-
 libffi/configure.host                         |    97 +-
 libffi/doc/Makefile.am                        |     3 +
 libffi/doc/libffi.texi                        |   382 +-
 libffi/doc/version.texi                       |     8 +-
 libffi/fficonfig.h.in                         |   208 -
 libffi/generate-darwin-source-and-headers.py  |   143 +-
 libffi/include/Makefile.am                    |     8 +-
 libffi/include/Makefile.in                    |   565 -
 libffi/include/ffi.h.in                       |   213 +-
 libffi/include/ffi_cfi.h                      |    21 +
 libffi/include/ffi_common.h                   |    50 +-
 libffi/include/tramp.h                        |    45 +
 libffi/libffi.map.in                          |    24 +-
 libffi/libffi.pc.in                           |     2 +-
 libffi/libffi.xcodeproj/project.pbxproj       |   530 +-
 libffi/libtool-version                        |    25 +-
 libffi/man/Makefile.in                        |   515 -
 libffi/mdate-sh                               |   205 -
 libffi/msvcc.sh                               |   134 +-
 libffi/src/aarch64/ffi.c                      |   536 +-
 libffi/src/aarch64/ffitarget.h                |    35 +-
 libffi/src/aarch64/internal.h                 |    33 +
 libffi/src/aarch64/sysv.S                     |   189 +-
 libffi/src/aarch64/win64_armasm.S             |   506 +
 libffi/src/alpha/ffi.c                        |     6 +-
 libffi/src/arc/ffi.c                          |     6 +-
 libffi/src/arm/ffi.c                          |   380 +-
 libffi/src/arm/ffitarget.h                    |    24 +-
 libffi/src/arm/internal.h                     |    10 +
 libffi/src/arm/sysv.S                         |   304 +-
 libffi/src/arm/sysv_msvc_arm32.S              |   311 +
 libffi/src/closures.c                         |   489 +-
 libffi/src/cris/ffi.c                         |     4 +-
 libffi/src/csky/ffi.c                         |   395 +
 libffi/src/csky/ffitarget.h                   |    63 +
 libffi/src/csky/sysv.S                        |   371 +
 libffi/src/dlmalloc.c                         |     7 +-
 libffi/src/frv/ffi.c                          |     4 +-
 libffi/src/ia64/ffi.c                         |    30 +-
 libffi/src/ia64/ffitarget.h                   |     3 +-
 libffi/src/ia64/unix.S                        |     9 +-
 libffi/src/java_raw_api.c                     |     6 +-
 libffi/src/kvx/asm.h                          |     5 +
 libffi/src/kvx/ffi.c                          |   273 +
 libffi/src/kvx/ffitarget.h                    |    75 +
 libffi/src/kvx/sysv.S                         |   127 +
 libffi/src/m32r/ffi.c                         |     2 +-
 libffi/src/m68k/ffi.c                         |     4 +-
 libffi/src/m68k/sysv.S                        |    29 +-
 libffi/src/m88k/ffi.c                         |     8 +-
 libffi/src/metag/ffi.c                        |    14 +-
 libffi/src/microblaze/ffi.c                   |    10 +-
 libffi/src/mips/ffi.c                         |   146 +-
 libffi/src/mips/ffitarget.h                   |    23 +-
 libffi/src/mips/n32.S                         |   151 +-
 libffi/src/mips/o32.S                         |   177 +-
 libffi/src/moxie/eabi.S                       |     2 +-
 libffi/src/moxie/ffi.c                        |    27 +-
 libffi/src/nios2/ffi.c                        |     4 +-
 libffi/src/pa/ffi.c                           |   216 +-
 libffi/src/pa/ffitarget.h                     |    11 +-
 libffi/src/pa/hpux32.S                        |    76 +-
 libffi/src/pa/linux.S                         |   160 +-
 libffi/src/powerpc/asm.h                      |     4 +-
 libffi/src/powerpc/darwin_closure.S           |     6 +-
 libffi/src/powerpc/ffi.c                      |    10 +-
 libffi/src/powerpc/ffi_darwin.c               |    48 +-
 libffi/src/powerpc/ffi_linux64.c              |   247 +-
 libffi/src/powerpc/ffi_powerpc.h              |    25 +-
 libffi/src/powerpc/ffitarget.h                |    14 +-
 libffi/src/powerpc/linux64.S                  |   111 +-
 libffi/src/powerpc/linux64_closure.S          |    70 +-
 libffi/src/powerpc/sysv.S                     |    12 +-
 libffi/src/prep_cif.c                         |    64 +-
 libffi/src/raw_api.c                          |    10 +-
 libffi/src/riscv/ffi.c                        |    16 +-
 libffi/src/sparc/ffi.c                        |     6 +-
 libffi/src/sparc/ffi64.c                      |    18 +-
 libffi/src/tramp.c                            |   729 +
 libffi/src/types.c                            |     4 +-
 libffi/src/vax/ffi.c                          |     4 +-
 libffi/src/x86/asmnames.h                     |    30 +
 libffi/src/x86/darwin.S                       |   444 -
 libffi/src/x86/darwin64.S                     |   416 -
 libffi/src/x86/darwin64_c.c                   |   643 -
 libffi/src/x86/darwin_c.c                     |   843 -
 libffi/src/x86/ffi.c                          |   162 +-
 libffi/src/x86/ffi64.c                        |   164 +-
 libffi/src/x86/ffitarget.h                    |    42 +-
 libffi/src/x86/ffiw64.c                       |   114 +-
 libffi/src/x86/internal.h                     |    14 +
 libffi/src/x86/internal64.h                   |    14 +
 libffi/src/x86/sysv.S                         |   215 +-
 libffi/src/x86/sysv_intel.S                   |   995 +
 libffi/src/x86/unix64.S                       |   204 +-
 libffi/src/x86/win64.S                        |   170 +-
 libffi/src/x86/win64_intel.S                  |   238 +
 libffi/src/xtensa/ffi.c                       |     4 +-
 libffi/src/xtensa/sysv.S                      |     7 +-
 libffi/testsuite/Makefile.am                  |   206 +-
 libffi/testsuite/Makefile.in                  |   572 -
 libffi/testsuite/lib/libffi.exp               |   314 +-
 libffi/testsuite/libffi.bhaible/Makefile      |    28 +
 libffi/testsuite/libffi.bhaible/README        |    78 +
 libffi/testsuite/libffi.bhaible/alignof.h     |    50 +
 libffi/testsuite/libffi.bhaible/bhaible.exp   |    63 +
 libffi/testsuite/libffi.bhaible/test-call.c   |  1745 ++
 .../testsuite/libffi.bhaible/test-callback.c  |  2885 +++
 libffi/testsuite/libffi.bhaible/testcases.c   |   747 +
 libffi/testsuite/libffi.call/align_mixed.c    |    46 +
 libffi/testsuite/libffi.call/align_stdcall.c  |    46 +
 libffi/testsuite/libffi.call/call.exp         |    28 +-
 libffi/testsuite/libffi.call/cls_uchar_va.c   |    44 -
 libffi/testsuite/libffi.call/cls_ushort_va.c  |    44 -
 libffi/testsuite/libffi.call/ffitest.h        |    13 +-
 libffi/testsuite/libffi.call/float2.c         |    23 +-
 libffi/testsuite/libffi.call/offsets.c        |    46 +
 libffi/testsuite/libffi.call/struct10.c       |    57 +
 libffi/testsuite/libffi.call/va_1.c           |   120 +-
 libffi/testsuite/libffi.call/va_2.c           |   196 +
 libffi/testsuite/libffi.closures/closure.exp  |    67 +
 .../closure_fn0.c                             |     0
 .../closure_fn1.c                             |     0
 .../closure_fn2.c                             |     0
 .../closure_fn3.c                             |     0
 .../closure_fn4.c                             |     0
 .../closure_fn5.c                             |     0
 .../closure_fn6.c                             |     0
 .../closure_loc_fn0.c                         |     3 +
 .../closure_simple.c                          |     0
 .../cls_12byte.c                              |     0
 .../cls_16byte.c                              |     0
 .../cls_18byte.c                              |     0
 .../cls_19byte.c                              |     0
 .../cls_1_1byte.c                             |     0
 .../cls_20byte.c                              |     2 +-
 .../cls_20byte1.c                             |     2 +-
 .../cls_24byte.c                              |     6 +-
 .../cls_2byte.c                               |     0
 .../cls_3_1byte.c                             |     0
 .../cls_3byte1.c                              |     0
 .../cls_3byte2.c                              |     0
 libffi/testsuite/libffi.closures/cls_3float.c |    95 +
 .../cls_4_1byte.c                             |     0
 .../cls_4byte.c                               |     0
 .../cls_5_1_byte.c                            |     2 +-
 .../cls_5byte.c                               |     2 +-
 .../cls_64byte.c                              |     0
 .../cls_6_1_byte.c                            |     2 +-
 .../cls_6byte.c                               |     2 +-
 .../cls_7_1_byte.c                            |     2 +-
 .../cls_7byte.c                               |     2 +-
 .../cls_8byte.c                               |     0
 .../cls_9byte1.c                              |     2 +-
 .../cls_9byte2.c                              |     2 +-
 .../cls_align_double.c                        |     2 +-
 .../cls_align_float.c                         |     2 +-
 .../cls_align_longdouble.c                    |     2 +-
 .../cls_align_longdouble_split.c              |     2 +-
 .../cls_align_longdouble_split2.c             |     2 +-
 .../cls_align_pointer.c                       |     2 +-
 .../cls_align_sint16.c                        |     2 +-
 .../cls_align_sint32.c                        |     2 +-
 .../cls_align_sint64.c                        |     2 +-
 .../cls_align_uint16.c                        |     2 +-
 .../cls_align_uint32.c                        |     2 +-
 .../cls_align_uint64.c                        |     2 +-
 .../cls_dbls_struct.c                         |     6 +-
 .../cls_double.c                              |     0
 .../cls_double_va.c                           |     0
 .../cls_float.c                               |     0
 .../cls_longdouble.c                          |     0
 .../cls_longdouble_va.c                       |     0
 .../cls_many_mixed_args.c                     |     0
 .../cls_many_mixed_float_double.c             |     0
 .../cls_multi_schar.c                         |     2 +-
 .../cls_multi_sshort.c                        |     2 +-
 .../cls_multi_sshortchar.c                    |     2 +-
 .../cls_multi_uchar.c                         |     2 +-
 .../cls_multi_ushort.c                        |     2 +-
 .../cls_multi_ushortchar.c                    |     2 +-
 .../cls_pointer.c                             |     0
 .../cls_pointer_stack.c                       |     0
 .../cls_schar.c                               |     0
 .../cls_sint.c                                |     0
 .../cls_sshort.c                              |     0
 .../cls_struct_va1.c                          |     0
 .../cls_uchar.c                               |     0
 .../cls_uint.c                                |     0
 .../cls_uint_va.c                             |     0
 .../cls_ulong_va.c                            |     0
 .../cls_ulonglong.c                           |     0
 .../cls_ushort.c                              |     0
 .../err_bad_abi.c                             |     0
 libffi/testsuite/libffi.closures/ffitest.h    |   144 +
 .../huge_struct.c                             |     4 +-
 .../nested_struct.c                           |     2 +-
 .../nested_struct1.c                          |     2 +-
 .../nested_struct10.c                         |     1 +
 .../nested_struct11.c                         |     0
 .../libffi.closures/nested_struct12.c         |    86 +
 .../nested_struct13.c}                        |    14 +-
 .../nested_struct2.c                          |     2 +-
 .../nested_struct3.c                          |     2 +-
 .../nested_struct4.c                          |     0
 .../nested_struct5.c                          |     0
 .../nested_struct6.c                          |     0
 .../nested_struct7.c                          |     0
 .../nested_struct8.c                          |     0
 .../nested_struct9.c                          |     0
 .../problem1.c                                |     0
 .../libffi.closures/single_entry_structs1.c   |    86 +
 .../libffi.closures/single_entry_structs2.c   |   102 +
 .../libffi.closures/single_entry_structs3.c   |   101 +
 .../stret_large.c                             |     0
 .../stret_large2.c                            |     0
 .../stret_medium.c                            |     2 +-
 .../stret_medium2.c                           |     2 +-
 .../testclosure.c                             |     2 +-
 .../unwindtest.cc                             |    13 +-
 .../unwindtest_ffi_call.cc                    |     5 +-
 libffi/testsuite/libffi.go/static-chain.h     |     6 -
 libffi/testsuite/libffi.special/ffitestcxx.h  |    96 -
 libffi/testsuite/libffi.special/special.exp   |    35 -
 237 files changed, 24334 insertions(+), 30607 deletions(-)
 create mode 100644 libffi/.gitattributes
 create mode 100644 libffi/LICENSE-BUILDTOOLS
 create mode 100644 libffi/MERGE
 delete mode 100644 libffi/Makefile.in
 delete mode 100644 libffi/README
 create mode 100644 libffi/README.md
 delete mode 100644 libffi/aclocal.m4
 delete mode 100755 libffi/configure
 create mode 100644 libffi/doc/Makefile.am
 delete mode 100644 libffi/fficonfig.h.in
 mode change 100644 => 100755 libffi/generate-darwin-source-and-headers.py
 delete mode 100644 libffi/include/Makefile.in
 create mode 100644 libffi/include/tramp.h
 delete mode 100644 libffi/man/Makefile.in
 delete mode 100644 libffi/mdate-sh
 create mode 100644 libffi/src/aarch64/win64_armasm.S
 create mode 100644 libffi/src/arm/sysv_msvc_arm32.S
 create mode 100644 libffi/src/csky/ffi.c
 create mode 100644 libffi/src/csky/ffitarget.h
 create mode 100644 libffi/src/csky/sysv.S
 create mode 100644 libffi/src/kvx/asm.h
 create mode 100644 libffi/src/kvx/ffi.c
 create mode 100644 libffi/src/kvx/ffitarget.h
 create mode 100644 libffi/src/kvx/sysv.S
 create mode 100644 libffi/src/tramp.c
 create mode 100644 libffi/src/x86/asmnames.h
 delete mode 100644 libffi/src/x86/darwin.S
 delete mode 100644 libffi/src/x86/darwin64.S
 delete mode 100644 libffi/src/x86/darwin64_c.c
 delete mode 100644 libffi/src/x86/darwin_c.c
 create mode 100644 libffi/src/x86/sysv_intel.S
 create mode 100644 libffi/src/x86/win64_intel.S
 delete mode 100644 libffi/testsuite/Makefile.in
 create mode 100644 libffi/testsuite/libffi.bhaible/Makefile
 create mode 100644 libffi/testsuite/libffi.bhaible/README
 create mode 100644 libffi/testsuite/libffi.bhaible/alignof.h
 create mode 100644 libffi/testsuite/libffi.bhaible/bhaible.exp
 create mode 100644 libffi/testsuite/libffi.bhaible/test-call.c
 create mode 100644 libffi/testsuite/libffi.bhaible/test-callback.c
 create mode 100644 libffi/testsuite/libffi.bhaible/testcases.c
 create mode 100644 libffi/testsuite/libffi.call/align_mixed.c
 create mode 100644 libffi/testsuite/libffi.call/align_stdcall.c
 delete mode 100644 libffi/testsuite/libffi.call/cls_uchar_va.c
 delete mode 100644 libffi/testsuite/libffi.call/cls_ushort_va.c
 create mode 100644 libffi/testsuite/libffi.call/offsets.c
 create mode 100644 libffi/testsuite/libffi.call/struct10.c
 create mode 100644 libffi/testsuite/libffi.call/va_2.c
 create mode 100644 libffi/testsuite/libffi.closures/closure.exp
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn0.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn1.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn2.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn3.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn4.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn5.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn6.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_loc_fn0.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/closure_simple.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_12byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_16byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_18byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_19byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_1_1byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte1.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_24byte.c (95%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_2byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3_1byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte1.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte2.c (100%)
 create mode 100644 libffi/testsuite/libffi.closures/cls_3float.c
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4_1byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5_1_byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_64byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6_1_byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7_1_byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7byte.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_8byte.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte1.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte2.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_double.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_float.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split2.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_pointer.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint16.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint32.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint64.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint16.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint32.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint64.c (97%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_dbls_struct.c (92%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double_va.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_float.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble_va.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_args.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_float_double.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_schar.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshort.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshortchar.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_uchar.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushort.c (95%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushortchar.c (96%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer_stack.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_schar.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sint.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sshort.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_struct_va1.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uchar.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint_va.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulong_va.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulonglong.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ushort.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/err_bad_abi.c (100%)
 create mode 100644 libffi/testsuite/libffi.closures/ffitest.h
 rename libffi/testsuite/{libffi.call => libffi.closures}/huge_struct.c (99%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct1.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct10.c (99%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct11.c (100%)
 create mode 100644 libffi/testsuite/libffi.closures/nested_struct12.c
 rename libffi/testsuite/{libffi.call/nested_struct12.c => libffi.closures/nested_struct13.c} (88%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct2.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct3.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct4.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct5.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct6.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct7.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct8.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct9.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/problem1.c (100%)
 create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs1.c
 create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs2.c
 create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs3.c
 rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large2.c (100%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium2.c (98%)
 rename libffi/testsuite/{libffi.call => libffi.closures}/testclosure.c (95%)
 rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest.cc (95%)
 rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest_ffi_call.cc (94%)
 delete mode 100644 libffi/testsuite/libffi.special/ffitestcxx.h
 delete mode 100644 libffi/testsuite/libffi.special/special.exp

https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 3/4] libffi: Integrate build with GCC
  2021-09-02 15:50 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
  2021-09-02 15:50 ` [PATCH v2 1/4] libffi: Add HOWTO_MERGE, autogen.sh and merge.sh H.J. Lu
  2021-09-02 15:50 ` [PATCH v2 2/4] libffi: Sync with libffi 3.4.2 H.J. Lu
@ 2021-09-02 15:50 ` H.J. Lu
  2021-09-02 15:50 ` [PATCH v2 4/4] libffi: Integrate testsuite with GCC testsuite H.J. Lu
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 27+ messages in thread
From: H.J. Lu @ 2021-09-02 15:50 UTC (permalink / raw)
  To: gcc-patches
  Cc: Jeff Law, Jakub Jelinek, DJ Delorie, Xi Ruoyao, Richard Biener

1. Integrate with GCC build.
2. Disable static trampolines by default.
3. Support multilib.

	* Makefile.am (AUTOMAKE_OPTIONS): Add info-in-builddir.
	(ACLOCAL_AMFLAGS): Set to -I .. -I ../config.
	(SUBDIRS): Don't add doc.
	(TEXINFO_TEX): New.
	(MAKEINFOFLAGS): Likewise.
	(info_TEXINFOS): Likewise.
	(STAMP_GENINSRC): Likewise.
	(STAMP_BUILD_INFO): Likewise.
	(all-local): Likewise.
	(stamp-geninsrc): Likewise.
	(doc/libffi.info): Likewise.
	(stamp-build-info:): Likewise.
	(CLEANFILES): Likewise.
	(MAINTAINERCLEANFILES): Likewise.
	(AM_MAKEFLAGS): Likewise.
	(all-recursive): Likewise.
	(install-recursive): Likewise.
	(mostlyclean-recursive): Likewise.
	(clean-recursive): Likewise.
	(distclean-recursive): Likewise.
	(maintainer-clean-recursive): Likewise.
	(LTLDFLAGS): Replace libtool-ldflags with ../libtool-ldflags.
	(AM_CFLAGS): Add -g -fexceptions.
	(libffi.map-sun): Replace make_sunver.pl with
	../contrib/make_sunver.pl.
	(dist-hook): Removed.
	Include $(top_srcdir)/../multilib.am.
	* configure.ac: Add AM_ENABLE_MULTILIB.
	Remove the frv*-elf check.
	(AX_ENABLE_BUILDDIR): Removed.
	(AM_INIT_AUTOMAKE): Add [no-dist].
	Add --enable-generated-files-in-srcdir.
	(C_CONFIG_MACRO_DIR): Removed.
	(AX_COMPILER_VENDOR): Likewise.
	(AX_CC_MAXOPT): Likewise.
	(AX_CFLAGS_WARN_ALL): Likewise.
	Remove the GCC check.
	(SYMBOL_UNDERSCORE): Removed.
	(AX_CHECK_COMPILE_FLAG): Likewise.
	Remove --disable-docs.
	(ACX_CHECK_PROG_VER): Check makeinfo.
	(BUILD_DOCS): Updated.
	(exec-static-tramp): Don't enable use of static exec trampolines
	by default.
	Remove --disable-multi-os-directory.
	(GCC_WITH_TOOLEXECLIBDIR): New.
	Support cross host.
	Support --enable-multilib.
	* include/Makefile.am (nodist_include_HEADERS): Removed.
	(gcc_version): New.
	(toollibffidir): Likewise.
	(toollibffi_HEADERS): Likewise.
	* Makefile.in: Regenerate.
	(GCC_BASE_VER): New.
	(AC_CONFIG_FILES): Remove doc/Makefile.
	(AC_CONFIG_LINKS): New.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* fficonfig.h.in: Likewise.
	* mdate-sh: Likewise.
	* include/Makefile.in: Likewise.
	* man/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.
---
 libffi/Makefile.am           |   116 +-
 libffi/Makefile.in           |  1963 ++++
 libffi/aclocal.m4            |  1202 ++
 libffi/configure             | 19584 +++++++++++++++++++++++++++++++++
 libffi/configure.ac          |   130 +-
 libffi/fficonfig.h.in        |   227 +
 libffi/include/Makefile.am   |     6 +-
 libffi/include/Makefile.in   |   566 +
 libffi/man/Makefile.in       |   516 +
 libffi/mdate-sh              |   224 +
 libffi/testsuite/Makefile.in |   606 +
 11 files changed, 25054 insertions(+), 86 deletions(-)
 create mode 100644 libffi/Makefile.in
 create mode 100644 libffi/aclocal.m4
 create mode 100755 libffi/configure
 create mode 100644 libffi/fficonfig.h.in
 create mode 100644 libffi/include/Makefile.in
 create mode 100644 libffi/man/Makefile.in
 create mode 100755 libffi/mdate-sh
 create mode 100644 libffi/testsuite/Makefile.in

diff --git a/libffi/Makefile.am b/libffi/Makefile.am
index 1b18198ad18..02e36176c67 100644
--- a/libffi/Makefile.am
+++ b/libffi/Makefile.am
@@ -1,18 +1,10 @@
 ## Process this with automake to create Makefile.in
 
-AUTOMAKE_OPTIONS = foreign subdir-objects
+AUTOMAKE_OPTIONS = foreign subdir-objects info-in-builddir
 
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I .. -I ../config
 
 SUBDIRS = include testsuite man
-if BUILD_DOCS
-## This hack is needed because it doesn't seem possible to make a
-## conditional info_TEXINFOS in Automake.  At least Automake 1.14
-## either gives errors -- if this attempted in the most
-## straightforward way -- or simply unconditionally tries to build the
-## info file.
-SUBDIRS += doc
-endif
 
 EXTRA_DIST = LICENSE ChangeLog.old					\
 	m4/libtool.m4 m4/lt~obsolete.m4					\
@@ -26,6 +18,90 @@ EXTRA_DIST = LICENSE ChangeLog.old					\
 # local.exp is generated by configure
 DISTCLEANFILES = local.exp
 
+# Automake Documentation:
+# If your package has Texinfo files in many directories, you can use the
+# variable TEXINFO_TEX to tell Automake where to find the canonical
+# `texinfo.tex' for your package. The value of this variable should be
+# the relative path from the current `Makefile.am' to `texinfo.tex'.
+TEXINFO_TEX   = ../gcc/doc/include/texinfo.tex
+
+# Defines info, dvi, pdf and html targets
+MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
+info_TEXINFOS = doc/libffi.texi
+
+# AM_CONDITIONAL on configure option --generated-files-in-srcdir
+if GENINSRC
+STAMP_GENINSRC = stamp-geninsrc
+else
+STAMP_GENINSRC =
+endif
+
+# AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO])
+if BUILD_DOCS
+STAMP_BUILD_INFO = stamp-build-info
+else
+STAMP_BUILD_INFO =
+endif
+
+all-local: $(STAMP_GENINSRC)
+
+stamp-geninsrc: doc/libffi.info
+	cp -p $(top_builddir)/doc/libffi.info $(srcdir)/doc/libffi.info
+	@touch $@
+
+doc/libffi.info: $(STAMP_BUILD_INFO)
+
+stamp-build-info: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
+	$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)/doc -o doc/libffi.info $(srcdir)/doc/libffi.texi
+	@touch $@
+
+CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO)
+MAINTAINERCLEANFILES = $(srcdir)/doc/libffi.info
+
+## ################################################################
+
+##
+## This section is for make and multilib madness.
+##
+
+# Work around what appears to be a GNU make bug handling MAKEFLAGS
+# values defined in terms of make variables, as is the case for CC and
+# friends when we are called from the top level Makefile.
+AM_MAKEFLAGS = \
+	"AR_FLAGS=$(AR_FLAGS)" \
+	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+	"CFLAGS=$(CFLAGS)" \
+	"CXXFLAGS=$(CXXFLAGS)" \
+	"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
+	"INSTALL=$(INSTALL)" \
+	"INSTALL_DATA=$(INSTALL_DATA)" \
+	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+	"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
+	"JC1FLAGS=$(JC1FLAGS)" \
+	"LDFLAGS=$(LDFLAGS)" \
+	"LIBCFLAGS=$(LIBCFLAGS)" \
+	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
+	"MAKE=$(MAKE)" \
+	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
+	"PICFLAG=$(PICFLAG)" \
+	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
+	"SHELL=$(SHELL)" \
+	"exec_prefix=$(exec_prefix)" \
+	"infodir=$(infodir)" \
+	"libdir=$(libdir)" \
+	"mandir=$(mandir)" \
+	"prefix=$(prefix)" \
+	"AR=$(AR)" \
+	"AS=$(AS)" \
+	"CC=$(CC)" \
+	"CXX=$(CXX)" \
+	"LD=$(LD)" \
+	"NM=$(NM)" \
+	"RANLIB=$(RANLIB)" \
+	"DESTDIR=$(DESTDIR)"
+
 # Subdir rules rely on $(FLAGS_TO_PASS)
 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 
@@ -104,9 +180,9 @@ libffi_convenience_la_LIBADD = $(libffi_la_LIBADD)
 libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 
-LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 
-AM_CFLAGS =
+AM_CFLAGS = -Wall -g -fexceptions
 if FFI_DEBUG
 # Build debug. Define FFI_DEBUG on the commandline so that, when building with
 # MSVC, it can link against the debug CRT.
@@ -121,9 +197,9 @@ endif
 if LIBFFI_BUILD_VERSIONED_SHLIB_SUN
 libffi_version_script = -Wl,-M,libffi.map-sun
 libffi_version_dep = libffi.map-sun
-libffi.map-sun : libffi.map $(top_srcdir)/make_sunver.pl \
+libffi.map-sun : libffi.map $(top_srcdir)/../contrib/make_sunver.pl \
 		 $(libffi_la_OBJECTS) $(libffi_la_LIBADD)
-	perl $(top_srcdir)/make_sunver.pl libffi.map \
+	perl $(top_srcdir)/../contrib/make_sunver.pl libffi.map \
 	 `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \
 	    sed 's,\([^/        ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
 	 > $@ || (rm -f $@ ; exit 1)
@@ -144,8 +220,12 @@ libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)
 
-dist-hook:
-	d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc)
-	if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog
-	s=`awk '/was released on/{ print NR; exit}' $(top_srcdir)/README.md`; tail -n +$$(($$s-1)) $(top_srcdir)/README.md > $(distdir)/README.md
+# Multilib support.  Automake should provide these on its own.
+all-recursive: all-multi
+install-recursive: install-multi
+mostlyclean-recursive: mostlyclean-multi
+clean-recursive: clean-multi
+distclean-recursive: distclean-multi
+maintainer-clean-recursive: maintainer-clean-multi
 
+include $(top_srcdir)/../multilib.am
diff --git a/libffi/configure.ac b/libffi/configure.ac
index 70f6d2c2ea4..bff5a1e7189 100644
--- a/libffi/configure.ac
+++ b/libffi/configure.ac
@@ -5,18 +5,30 @@ AC_PREREQ(2.68)
 AC_INIT([libffi], [3.4.2], [http://github.com/libffi/libffi/issues])
 AC_CONFIG_HEADERS([fficonfig.h])
 
+AM_ENABLE_MULTILIB(, ..)
+
 AC_CANONICAL_SYSTEM
 target_alias=${target_alias-$host_alias}
 
-case "${host}" in
-  frv*-elf)
-    LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
-    ;;
-esac
-
-AX_ENABLE_BUILDDIR
-
-AM_INIT_AUTOMAKE
+AM_INIT_AUTOMAKE([no-dist])
+
+# We would like our source tree to be readonly. However when releases or
+# pre-releases are generated, the flex/bison generated files as well as the
+# various formats of manuals need to be included along with the rest of the
+# sources.  Therefore we have --enable-generated-files-in-srcdir to do
+# just that.
+AC_MSG_CHECKING(generated-files-in-srcdir)
+AC_ARG_ENABLE(generated-files-in-srcdir,
+AS_HELP_STRING([--enable-generated-files-in-srcdir],
+ [put copies of generated files in source dir intended for creating source tarballs for users without texinfo bison or flex]),
+[case "$enableval" in
+ yes) enable_generated_files_in_srcdir=yes ;;
+ no)  enable_generated_files_in_srcdir=no ;;
+ *)   AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
+ esac],
+[enable_generated_files_in_srcdir=no])
+AC_MSG_RESULT($enable_generated_files_in_srcdir)
+AM_CONDITIONAL(GENINSRC, test "$enable_generated_files_in_srcdir" = yes)
 
 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
 # We must force CC to /not/ be precious variables; otherwise
@@ -39,25 +51,12 @@ AC_SUBST(CFLAGS)
 AM_PROG_AS
 AM_PROG_CC_C_O
 AC_PROG_LIBTOOL
-AC_CONFIG_MACRO_DIR([m4])
 
 AC_CHECK_TOOL(READELF, readelf)
 
 # Test for 64-bit build.
 AC_CHECK_SIZEOF([size_t])
 
-AX_COMPILER_VENDOR
-AX_CC_MAXOPT
-# The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro
-# compiler.
-if test "$ax_cv_c_compiler_vendor" != "sun"; then
-  AX_CFLAGS_WARN_ALL
-fi
-
-if test "x$GCC" = "xyes"; then
-  CFLAGS="$CFLAGS -fexceptions"
-fi
-
 cat > local.exp <<EOF
 set CC_FOR_TARGET "$CC"
 set CXX_FOR_TARGET "$CXX"
@@ -212,11 +211,6 @@ AC_ARG_ENABLE(pax_emutramp,
       [Define this if you want to enable pax emulated trampolines])
   fi)
 
-LT_SYS_SYMBOL_USCORE
-if test "x$sys_symbol_underscore" = xyes; then
-    AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
-fi
-
 FFI_EXEC_TRAMPOLINE_TABLE=0
 case "$target" in
      *arm*-apple-* | aarch64-apple-*)
@@ -266,13 +260,11 @@ EOF
 fi
 
 if test "x$GCC" = "xyes"; then
-  AX_CHECK_COMPILE_FLAG(-fno-lto, libffi_cv_no_lto=-fno-lto)
-
   AC_CACHE_CHECK([whether .eh_frame section should be read-only],
       libffi_cv_ro_eh_frame, [
   	libffi_cv_ro_eh_frame=yes
   	echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
-  	if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
+  	if $CC $CFLAGS -c -fpic -fexceptions -fno-lto -o conftest.o conftest.c > /dev/null 2>&1; then
 	    if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
 	        libffi_cv_ro_eh_frame=no
 	    fi
@@ -306,12 +298,12 @@ if test "x$GCC" = "xyes"; then
   fi
 fi
 
-AC_ARG_ENABLE(docs,
-              AC_HELP_STRING([--disable-docs],
-                             [Disable building of docs (default: no)]),
-              [enable_docs=no],
-              [enable_docs=yes])
-AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes])
+# See if makeinfo has been installed and is modern enough
+# that we can use it.
+ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version],
+                   [GNU texinfo.* \([0-9][0-9.]*\)],
+                   [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
+AM_CONDITIONAL(BUILD_DOCS, test $gcc_cv_prog_makeinfo_modern = "yes")
 
 AH_BOTTOM([
 #ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
@@ -367,9 +359,9 @@ AC_ARG_ENABLE(raw-api,
   fi)
 
 AC_ARG_ENABLE(exec-static-tramp,
-[  --disable-exec-static-tramp  disable use of static exec trampolines (enabled by default)])
+[  --enable-exec-static-tramp  enable use of static exec trampolines])
 
-if test "$enable_exec_static_tramp" != no; then
+if test "$enable_exec_static_tramp" = yes; then
 case "$target" in
      *-cygwin*)
      ;;
@@ -386,47 +378,51 @@ AC_ARG_ENABLE(purify-safety,
     AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
   fi)
 
-AC_ARG_ENABLE(multi-os-directory,
-[  --disable-multi-os-directory
-                          disable use of gcc --print-multi-os-directory to change the library installation directory])
-                          
-# These variables are only ever used when we cross-build to X86_WIN32.
-# And we only support this with GCC, so...
-if test "x$GCC" = "xyes"; then
-  if test -n "$with_cross_host" &&
-     test x"$with_cross_host" != x"no"; then
-    toolexecdir='${exec_prefix}'/'$(target_alias)'
-    toolexeclibdir='${toolexecdir}'/lib
-  else
-    toolexecdir='${libdir}'/gcc-lib/'$(target_alias)'
-    toolexeclibdir='${libdir}'
-  fi
-  if test x"$enable_multi_os_directory" != x"no"; then
-    multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
-    case $multi_os_directory in
-      .) ;; # Avoid trailing /.
-      ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
-    esac
-  fi
-  AC_SUBST(toolexecdir)
+GCC_WITH_TOOLEXECLIBDIR
+
+if test -n "$with_cross_host" &&
+   test x"$with_cross_host" != x"no"; then
+  toolexecdir='$(exec_prefix)/$(target_alias)'
+  case ${with_toolexeclibdir} in
+    no)
+      toolexeclibdir='$(toolexecdir)/lib'
+      ;;
+    *)
+      toolexeclibdir=${with_toolexeclibdir}
+      ;;
+  esac
 else
-  toolexeclibdir='${libdir}'
+  toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+  toolexeclibdir='$(libdir)'
 fi
+multi_os_directory=`$CC -print-multi-os-directory`
+case $multi_os_directory in
+  .) ;; # Avoid trailing /.
+  *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
+esac
+AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+if test "${multilib}" = "yes"; then
+  multilib_arg="--enable-multilib"
+else
+  multilib_arg=
+fi
+
 # Check linker support.
 LIBFFI_ENABLE_SYMVERS
 
+# Determine what GCC version number to use in filesystem paths.
+GCC_BASE_VER
+
 AC_CONFIG_COMMANDS(include, [test -d include || mkdir include])
 AC_CONFIG_COMMANDS(src, [
 test -d src || mkdir src
 test -d src/$TARGETDIR || mkdir src/$TARGETDIR
 ], [TARGETDIR="$TARGETDIR"])
 
-AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile doc/Makefile libffi.pc)
+AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
 
-AC_OUTPUT
+AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
 
-# Copy this file instead of using AC_CONFIG_LINK in order to support
-# compiling with MSVC, which won't understand cygwin style symlinks.
-cp ${srcdir}/src/$TARGETDIR/ffitarget.h include/ffitarget.h
+AC_OUTPUT
diff --git a/libffi/include/Makefile.am b/libffi/include/Makefile.am
index 5f0d4066f4a..d7d1641f00c 100644
--- a/libffi/include/Makefile.am
+++ b/libffi/include/Makefile.am
@@ -6,4 +6,8 @@ DISTCLEANFILES=ffitarget.h
 noinst_HEADERS=ffi_common.h ffi_cfi.h tramp.h
 EXTRA_DIST=ffi.h.in
 
-nodist_include_HEADERS = ffi.h ffitarget.h
+# Where generated headers like ffitarget.h get installed.
+gcc_version   := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
+toollibffidir := $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
+
+toollibffi_HEADERS = ffi.h ffitarget.h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH v2 4/4] libffi: Integrate testsuite with GCC testsuite
  2021-09-02 15:50 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
                   ` (2 preceding siblings ...)
  2021-09-02 15:50 ` [PATCH v2 3/4] libffi: Integrate build with GCC H.J. Lu
@ 2021-09-02 15:50 ` H.J. Lu
  2021-10-10 13:55 ` PING^1 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
  2021-10-13 12:45 ` Richard Biener
  5 siblings, 0 replies; 27+ messages in thread
From: H.J. Lu @ 2021-09-02 15:50 UTC (permalink / raw)
  To: gcc-patches
  Cc: Jeff Law, Jakub Jelinek, DJ Delorie, Xi Ruoyao, Richard Biener

	* testsuite/lib/libffi.exp (load_gcc_lib): Load library from GCC
	testsuite.
	Load target-supports.exp and target-supports-dg.exp.
	(libffi-init): Use libraries in GCC build tree.
	(libffi_target_compile): Link with -lstdc++ for C++ sources.
---
 libffi/testsuite/lib/libffi.exp | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/libffi/testsuite/lib/libffi.exp b/libffi/testsuite/lib/libffi.exp
index 4f4dd48d2c6..d8bf6269a36 100644
--- a/libffi/testsuite/lib/libffi.exp
+++ b/libffi/testsuite/lib/libffi.exp
@@ -15,12 +15,15 @@
 # <http://www.gnu.org/licenses/>.
 
 proc load_gcc_lib { filename } {
-    global srcdir
-    load_file $srcdir/lib/$filename
+    global srcdir loaded_libs
+    load_file $srcdir/../../gcc/testsuite/lib/$filename
+    set loaded_libs($filename) ""
 }
 
 load_lib dg.exp
 load_lib libgloss.exp
+load_gcc_lib target-supports.exp
+load_gcc_lib target-supports-dg.exp
 load_gcc_lib target-libpath.exp
 load_gcc_lib wrapper.exp
 
@@ -277,6 +280,7 @@ proc libffi-init { args } {
     global srcdir
     global blddirffi
     global objdir
+    global blddircxx
     global TOOL_OPTIONS
     global tool
     global libffi_include
@@ -285,13 +289,13 @@ proc libffi-init { args } {
     global ld_library_path
     global compiler_vendor
 
-    if ![info exists blddirffi] {
-	set blddirffi [pwd]/..
-    }
-
+    set blddirffi [lookfor_file [get_multilibs] libffi]
     verbose "libffi $blddirffi"
+    set blddircxx [lookfor_file [get_multilibs] libstdc++-v3]
+    verbose "libstdc++ $blddircxx"
+
+    set compiler_vendor "gnu"
 
-    # Which compiler are we building with?
     if { [string match $compiler_vendor "gnu"] } {
         set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
         if {$gccdir != ""} {
@@ -320,6 +324,8 @@ proc libffi-init { args } {
 
     # add the library path for libffi.
     append ld_library_path ":${blddirffi}/.libs"
+    # add the library path for libstdc++ as well.
+    append ld_library_path ":${blddircxx}/src/.libs"
 
     verbose "ld_library_path: $ld_library_path"
 
@@ -332,6 +338,7 @@ proc libffi-init { args } {
     if { $libffi_dir != "" } {
 	set libffi_dir [file dirname ${libffi_dir}]
 	set libffi_link_flags "-L${libffi_dir}/.libs"
+	lappend libffi_link_flags "-L${blddircxx}/src/.libs"
     }
 
     set_ld_library_path_env_vars
@@ -398,9 +405,8 @@ proc libffi_target_compile { source dest type options } {
 	lappend options "libs= -lpthread"
     }
 
-    # this may be required for g++, but just confused clang.
     if { [string match "*.cc" $source] } {
-        lappend options "c++"
+	lappend options "ldflags=-lstdc++"
     }
 
     if { [string match "arc*-*-linux*" $target_triplet] } {
-- 
2.31.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

* PING^1 [PATCH v2 0/4] libffi: Sync with upstream
  2021-09-02 15:50 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
                   ` (3 preceding siblings ...)
  2021-09-02 15:50 ` [PATCH v2 4/4] libffi: Integrate testsuite with GCC testsuite H.J. Lu
@ 2021-10-10 13:55 ` H.J. Lu
  2021-10-13 12:45 ` Richard Biener
  5 siblings, 0 replies; 27+ messages in thread
From: H.J. Lu @ 2021-10-10 13:55 UTC (permalink / raw)
  To: GCC Patches
  Cc: Jeff Law, Jakub Jelinek, DJ Delorie, Xi Ruoyao, Richard Biener

On Thu, Sep 2, 2021 at 8:50 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> Change in the v2 patch:
>
> 1. Disable static trampolines by default.
>
>
> GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> from upstream over the last 10+ years.  In the meantime, libffi upstream
> has been changed significantly with new features, bug fixes and new target
> support.  Here is a set of patches to sync with libffi 3.4.2 release and
> make it easier to sync with libffi upstream:
>
> 1. Document how to sync with upstream.
> 2. Add scripts to help sync with upstream.
> 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
>
> https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> 4. Integrate libffi build and testsuite with GCC.
>
> H.J. Lu (4):
>   libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
>   libffi: Sync with libffi 3.4.2
>   libffi: Integrate build with GCC
>   libffi: Integrate testsuite with GCC testsuite
>
>  libffi/.gitattributes                         |    4 +
>  libffi/ChangeLog.libffi                       | 7743 ++++++++++++++++-
>  libffi/HOWTO_MERGE                            |   13 +
>  libffi/LICENSE                                |    2 +-
>  libffi/LICENSE-BUILDTOOLS                     |  353 +
>  libffi/MERGE                                  |    4 +
>  libffi/Makefile.am                            |  135 +-
>  libffi/Makefile.in                            |  219 +-
>  libffi/README                                 |  450 -
>  libffi/README.md                              |  495 ++
>  libffi/acinclude.m4                           |   38 +-
>  libffi/autogen.sh                             |   11 +
>  libffi/configure                              |  487 +-
>  libffi/configure.ac                           |   91 +-
>  libffi/configure.host                         |   97 +-
>  libffi/doc/Makefile.am                        |    3 +
>  libffi/doc/libffi.texi                        |  382 +-
>  libffi/doc/version.texi                       |    8 +-
>  libffi/fficonfig.h.in                         |   21 +-
>  libffi/generate-darwin-source-and-headers.py  |  143 +-
>  libffi/include/Makefile.am                    |    2 +-
>  libffi/include/Makefile.in                    |    3 +-
>  libffi/include/ffi.h.in                       |  213 +-
>  libffi/include/ffi_cfi.h                      |   21 +
>  libffi/include/ffi_common.h                   |   50 +-
>  libffi/include/tramp.h                        |   45 +
>  libffi/libffi.map.in                          |   24 +-
>  libffi/libffi.pc.in                           |    2 +-
>  libffi/libffi.xcodeproj/project.pbxproj       |  530 +-
>  libffi/libtool-version                        |   25 +-
>  libffi/man/Makefile.in                        |    1 +
>  libffi/mdate-sh                               |   39 +-
>  libffi/merge.sh                               |   51 +
>  libffi/msvcc.sh                               |  134 +-
>  libffi/src/aarch64/ffi.c                      |  536 +-
>  libffi/src/aarch64/ffitarget.h                |   35 +-
>  libffi/src/aarch64/internal.h                 |   33 +
>  libffi/src/aarch64/sysv.S                     |  189 +-
>  libffi/src/aarch64/win64_armasm.S             |  506 ++
>  libffi/src/alpha/ffi.c                        |    6 +-
>  libffi/src/arc/ffi.c                          |    6 +-
>  libffi/src/arm/ffi.c                          |  380 +-
>  libffi/src/arm/ffitarget.h                    |   24 +-
>  libffi/src/arm/internal.h                     |   10 +
>  libffi/src/arm/sysv.S                         |  304 +-
>  libffi/src/arm/sysv_msvc_arm32.S              |  311 +
>  libffi/src/closures.c                         |  489 +-
>  libffi/src/cris/ffi.c                         |    4 +-
>  libffi/src/csky/ffi.c                         |  395 +
>  libffi/src/csky/ffitarget.h                   |   63 +
>  libffi/src/csky/sysv.S                        |  371 +
>  libffi/src/dlmalloc.c                         |    7 +-
>  libffi/src/frv/ffi.c                          |    4 +-
>  libffi/src/ia64/ffi.c                         |   30 +-
>  libffi/src/ia64/ffitarget.h                   |    3 +-
>  libffi/src/ia64/unix.S                        |    9 +-
>  libffi/src/java_raw_api.c                     |    6 +-
>  libffi/src/kvx/asm.h                          |    5 +
>  libffi/src/kvx/ffi.c                          |  273 +
>  libffi/src/kvx/ffitarget.h                    |   75 +
>  libffi/src/kvx/sysv.S                         |  127 +
>  libffi/src/m32r/ffi.c                         |    2 +-
>  libffi/src/m68k/ffi.c                         |    4 +-
>  libffi/src/m68k/sysv.S                        |   29 +-
>  libffi/src/m88k/ffi.c                         |    8 +-
>  libffi/src/metag/ffi.c                        |   14 +-
>  libffi/src/microblaze/ffi.c                   |   10 +-
>  libffi/src/mips/ffi.c                         |  146 +-
>  libffi/src/mips/ffitarget.h                   |   23 +-
>  libffi/src/mips/n32.S                         |  151 +-
>  libffi/src/mips/o32.S                         |  177 +-
>  libffi/src/moxie/eabi.S                       |    2 +-
>  libffi/src/moxie/ffi.c                        |   27 +-
>  libffi/src/nios2/ffi.c                        |    4 +-
>  libffi/src/pa/ffi.c                           |  216 +-
>  libffi/src/pa/ffitarget.h                     |   11 +-
>  libffi/src/pa/hpux32.S                        |   76 +-
>  libffi/src/pa/linux.S                         |  160 +-
>  libffi/src/powerpc/asm.h                      |    4 +-
>  libffi/src/powerpc/darwin_closure.S           |    6 +-
>  libffi/src/powerpc/ffi.c                      |   10 +-
>  libffi/src/powerpc/ffi_darwin.c               |   48 +-
>  libffi/src/powerpc/ffi_linux64.c              |  247 +-
>  libffi/src/powerpc/ffi_powerpc.h              |   25 +-
>  libffi/src/powerpc/ffitarget.h                |   14 +-
>  libffi/src/powerpc/linux64.S                  |  111 +-
>  libffi/src/powerpc/linux64_closure.S          |   70 +-
>  libffi/src/powerpc/sysv.S                     |   12 +-
>  libffi/src/prep_cif.c                         |   64 +-
>  libffi/src/raw_api.c                          |   10 +-
>  libffi/src/riscv/ffi.c                        |   16 +-
>  libffi/src/sparc/ffi.c                        |    6 +-
>  libffi/src/sparc/ffi64.c                      |   18 +-
>  libffi/src/tramp.c                            |  729 ++
>  libffi/src/types.c                            |    4 +-
>  libffi/src/vax/ffi.c                          |    4 +-
>  libffi/src/x86/asmnames.h                     |   30 +
>  libffi/src/x86/darwin.S                       |  444 -
>  libffi/src/x86/darwin64.S                     |  416 -
>  libffi/src/x86/darwin64_c.c                   |  643 --
>  libffi/src/x86/darwin_c.c                     |  843 --
>  libffi/src/x86/ffi.c                          |  162 +-
>  libffi/src/x86/ffi64.c                        |  164 +-
>  libffi/src/x86/ffitarget.h                    |   42 +-
>  libffi/src/x86/ffiw64.c                       |  114 +-
>  libffi/src/x86/internal.h                     |   14 +
>  libffi/src/x86/internal64.h                   |   14 +
>  libffi/src/x86/sysv.S                         |  215 +-
>  libffi/src/x86/sysv_intel.S                   |  995 +++
>  libffi/src/x86/unix64.S                       |  204 +-
>  libffi/src/x86/win64.S                        |  170 +-
>  libffi/src/x86/win64_intel.S                  |  238 +
>  libffi/src/xtensa/ffi.c                       |    4 +-
>  libffi/src/xtensa/sysv.S                      |    7 +-
>  libffi/testsuite/Makefile.am                  |  206 +-
>  libffi/testsuite/Makefile.in                  |  210 +-
>  libffi/testsuite/lib/libffi.exp               |  294 +-
>  libffi/testsuite/libffi.bhaible/Makefile      |   28 +
>  libffi/testsuite/libffi.bhaible/README        |   78 +
>  libffi/testsuite/libffi.bhaible/alignof.h     |   50 +
>  libffi/testsuite/libffi.bhaible/bhaible.exp   |   63 +
>  libffi/testsuite/libffi.bhaible/test-call.c   | 1745 ++++
>  .../testsuite/libffi.bhaible/test-callback.c  | 2885 ++++++
>  libffi/testsuite/libffi.bhaible/testcases.c   |  747 ++
>  libffi/testsuite/libffi.call/align_mixed.c    |   46 +
>  libffi/testsuite/libffi.call/align_stdcall.c  |   46 +
>  libffi/testsuite/libffi.call/call.exp         |   28 +-
>  libffi/testsuite/libffi.call/cls_uchar_va.c   |   44 -
>  libffi/testsuite/libffi.call/cls_ushort_va.c  |   44 -
>  libffi/testsuite/libffi.call/ffitest.h        |   13 +-
>  libffi/testsuite/libffi.call/float2.c         |   23 +-
>  libffi/testsuite/libffi.call/offsets.c        |   46 +
>  libffi/testsuite/libffi.call/struct10.c       |   57 +
>  libffi/testsuite/libffi.call/va_1.c           |  120 +-
>  libffi/testsuite/libffi.call/va_2.c           |  196 +
>  libffi/testsuite/libffi.closures/closure.exp  |   67 +
>  .../closure_fn0.c                             |    0
>  .../closure_fn1.c                             |    0
>  .../closure_fn2.c                             |    0
>  .../closure_fn3.c                             |    0
>  .../closure_fn4.c                             |    0
>  .../closure_fn5.c                             |    0
>  .../closure_fn6.c                             |    0
>  .../closure_loc_fn0.c                         |    3 +
>  .../closure_simple.c                          |    0
>  .../cls_12byte.c                              |    0
>  .../cls_16byte.c                              |    0
>  .../cls_18byte.c                              |    0
>  .../cls_19byte.c                              |    0
>  .../cls_1_1byte.c                             |    0
>  .../cls_20byte.c                              |    2 +-
>  .../cls_20byte1.c                             |    2 +-
>  .../cls_24byte.c                              |    6 +-
>  .../cls_2byte.c                               |    0
>  .../cls_3_1byte.c                             |    0
>  .../cls_3byte1.c                              |    0
>  .../cls_3byte2.c                              |    0
>  libffi/testsuite/libffi.closures/cls_3float.c |   95 +
>  .../cls_4_1byte.c                             |    0
>  .../cls_4byte.c                               |    0
>  .../cls_5_1_byte.c                            |    2 +-
>  .../cls_5byte.c                               |    2 +-
>  .../cls_64byte.c                              |    0
>  .../cls_6_1_byte.c                            |    2 +-
>  .../cls_6byte.c                               |    2 +-
>  .../cls_7_1_byte.c                            |    2 +-
>  .../cls_7byte.c                               |    2 +-
>  .../cls_8byte.c                               |    0
>  .../cls_9byte1.c                              |    2 +-
>  .../cls_9byte2.c                              |    2 +-
>  .../cls_align_double.c                        |    2 +-
>  .../cls_align_float.c                         |    2 +-
>  .../cls_align_longdouble.c                    |    2 +-
>  .../cls_align_longdouble_split.c              |    2 +-
>  .../cls_align_longdouble_split2.c             |    2 +-
>  .../cls_align_pointer.c                       |    2 +-
>  .../cls_align_sint16.c                        |    2 +-
>  .../cls_align_sint32.c                        |    2 +-
>  .../cls_align_sint64.c                        |    2 +-
>  .../cls_align_uint16.c                        |    2 +-
>  .../cls_align_uint32.c                        |    2 +-
>  .../cls_align_uint64.c                        |    2 +-
>  .../cls_dbls_struct.c                         |    6 +-
>  .../cls_double.c                              |    0
>  .../cls_double_va.c                           |    0
>  .../cls_float.c                               |    0
>  .../cls_longdouble.c                          |    0
>  .../cls_longdouble_va.c                       |    0
>  .../cls_many_mixed_args.c                     |    0
>  .../cls_many_mixed_float_double.c             |    0
>  .../cls_multi_schar.c                         |    2 +-
>  .../cls_multi_sshort.c                        |    2 +-
>  .../cls_multi_sshortchar.c                    |    2 +-
>  .../cls_multi_uchar.c                         |    2 +-
>  .../cls_multi_ushort.c                        |    2 +-
>  .../cls_multi_ushortchar.c                    |    2 +-
>  .../cls_pointer.c                             |    0
>  .../cls_pointer_stack.c                       |    0
>  .../cls_schar.c                               |    0
>  .../cls_sint.c                                |    0
>  .../cls_sshort.c                              |    0
>  .../cls_struct_va1.c                          |    0
>  .../cls_uchar.c                               |    0
>  .../cls_uint.c                                |    0
>  .../cls_uint_va.c                             |    0
>  .../cls_ulong_va.c                            |    0
>  .../cls_ulonglong.c                           |    0
>  .../cls_ushort.c                              |    0
>  .../err_bad_abi.c                             |    0
>  libffi/testsuite/libffi.closures/ffitest.h    |  144 +
>  .../huge_struct.c                             |    4 +-
>  .../nested_struct.c                           |    2 +-
>  .../nested_struct1.c                          |    2 +-
>  .../nested_struct10.c                         |    1 +
>  .../nested_struct11.c                         |    0
>  .../libffi.closures/nested_struct12.c         |   86 +
>  .../nested_struct13.c}                        |   14 +-
>  .../nested_struct2.c                          |    2 +-
>  .../nested_struct3.c                          |    2 +-
>  .../nested_struct4.c                          |    0
>  .../nested_struct5.c                          |    0
>  .../nested_struct6.c                          |    0
>  .../nested_struct7.c                          |    0
>  .../nested_struct8.c                          |    0
>  .../nested_struct9.c                          |    0
>  .../problem1.c                                |    0
>  .../libffi.closures/single_entry_structs1.c   |   86 +
>  .../libffi.closures/single_entry_structs2.c   |  102 +
>  .../libffi.closures/single_entry_structs3.c   |  101 +
>  .../stret_large.c                             |    0
>  .../stret_large2.c                            |    0
>  .../stret_medium.c                            |    2 +-
>  .../stret_medium2.c                           |    2 +-
>  .../testclosure.c                             |    2 +-
>  .../unwindtest.cc                             |   13 +-
>  .../unwindtest_ffi_call.cc                    |    5 +-
>  libffi/testsuite/libffi.go/static-chain.h     |    6 -
>  libffi/testsuite/libffi.special/ffitestcxx.h  |   96 -
>  libffi/testsuite/libffi.special/special.exp   |   35 -
>  239 files changed, 24951 insertions(+), 6175 deletions(-)
>  create mode 100644 libffi/.gitattributes
>  create mode 100644 libffi/HOWTO_MERGE
>  create mode 100644 libffi/LICENSE-BUILDTOOLS
>  create mode 100644 libffi/MERGE
>  delete mode 100644 libffi/README
>  create mode 100644 libffi/README.md
>  create mode 100755 libffi/autogen.sh
>  create mode 100644 libffi/doc/Makefile.am
>  mode change 100644 => 100755 libffi/generate-darwin-source-and-headers.py
>  create mode 100644 libffi/include/tramp.h
>  mode change 100644 => 100755 libffi/mdate-sh
>  create mode 100755 libffi/merge.sh
>  create mode 100644 libffi/src/aarch64/win64_armasm.S
>  create mode 100644 libffi/src/arm/sysv_msvc_arm32.S
>  create mode 100644 libffi/src/csky/ffi.c
>  create mode 100644 libffi/src/csky/ffitarget.h
>  create mode 100644 libffi/src/csky/sysv.S
>  create mode 100644 libffi/src/kvx/asm.h
>  create mode 100644 libffi/src/kvx/ffi.c
>  create mode 100644 libffi/src/kvx/ffitarget.h
>  create mode 100644 libffi/src/kvx/sysv.S
>  create mode 100644 libffi/src/tramp.c
>  create mode 100644 libffi/src/x86/asmnames.h
>  delete mode 100644 libffi/src/x86/darwin.S
>  delete mode 100644 libffi/src/x86/darwin64.S
>  delete mode 100644 libffi/src/x86/darwin64_c.c
>  delete mode 100644 libffi/src/x86/darwin_c.c
>  create mode 100644 libffi/src/x86/sysv_intel.S
>  create mode 100644 libffi/src/x86/win64_intel.S
>  create mode 100644 libffi/testsuite/libffi.bhaible/Makefile
>  create mode 100644 libffi/testsuite/libffi.bhaible/README
>  create mode 100644 libffi/testsuite/libffi.bhaible/alignof.h
>  create mode 100644 libffi/testsuite/libffi.bhaible/bhaible.exp
>  create mode 100644 libffi/testsuite/libffi.bhaible/test-call.c
>  create mode 100644 libffi/testsuite/libffi.bhaible/test-callback.c
>  create mode 100644 libffi/testsuite/libffi.bhaible/testcases.c
>  create mode 100644 libffi/testsuite/libffi.call/align_mixed.c
>  create mode 100644 libffi/testsuite/libffi.call/align_stdcall.c
>  delete mode 100644 libffi/testsuite/libffi.call/cls_uchar_va.c
>  delete mode 100644 libffi/testsuite/libffi.call/cls_ushort_va.c
>  create mode 100644 libffi/testsuite/libffi.call/offsets.c
>  create mode 100644 libffi/testsuite/libffi.call/struct10.c
>  create mode 100644 libffi/testsuite/libffi.call/va_2.c
>  create mode 100644 libffi/testsuite/libffi.closures/closure.exp
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn0.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn1.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn2.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn3.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn4.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn5.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn6.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_loc_fn0.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_simple.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_12byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_16byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_18byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_19byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_1_1byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte1.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_24byte.c (95%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_2byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3_1byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte1.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte2.c (100%)
>  create mode 100644 libffi/testsuite/libffi.closures/cls_3float.c
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4_1byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5_1_byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_64byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6_1_byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7_1_byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_8byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte1.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte2.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_double.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_float.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split2.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_pointer.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint16.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint32.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint64.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint16.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint32.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint64.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_dbls_struct.c (92%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double_va.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_float.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble_va.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_args.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_float_double.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_schar.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshort.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshortchar.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_uchar.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushort.c (95%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushortchar.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer_stack.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_schar.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sint.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sshort.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_struct_va1.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uchar.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint_va.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulong_va.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulonglong.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ushort.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/err_bad_abi.c (100%)
>  create mode 100644 libffi/testsuite/libffi.closures/ffitest.h
>  rename libffi/testsuite/{libffi.call => libffi.closures}/huge_struct.c (99%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct1.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct10.c (99%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct11.c (100%)
>  create mode 100644 libffi/testsuite/libffi.closures/nested_struct12.c
>  rename libffi/testsuite/{libffi.call/nested_struct12.c => libffi.closures/nested_struct13.c} (88%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct2.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct3.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct4.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct5.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct6.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct7.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct8.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct9.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/problem1.c (100%)
>  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs1.c
>  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs2.c
>  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs3.c
>  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large2.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium2.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/testclosure.c (95%)
>  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest.cc (95%)
>  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest_ffi_call.cc (94%)
>  delete mode 100644 libffi/testsuite/libffi.special/ffitestcxx.h
>  delete mode 100644 libffi/testsuite/libffi.special/special.exp
>
> --
> 2.31.1
>

PING:

https://gcc.gnu.org/pipermail/gcc-patches/2021-September/578702.html

-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-09-02 15:50 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
                   ` (4 preceding siblings ...)
  2021-10-10 13:55 ` PING^1 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
@ 2021-10-13 12:45 ` Richard Biener
  2021-10-13 12:56   ` H.J. Lu
  5 siblings, 1 reply; 27+ messages in thread
From: Richard Biener @ 2021-10-13 12:45 UTC (permalink / raw)
  To: H.J. Lu, Ian Lance Taylor
  Cc: GCC Patches, Jeff Law, Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> Change in the v2 patch:
>
> 1. Disable static trampolines by default.
>
>
> GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> from upstream over the last 10+ years.  In the meantime, libffi upstream
> has been changed significantly with new features, bug fixes and new target
> support.  Here is a set of patches to sync with libffi 3.4.2 release and
> make it easier to sync with libffi upstream:
>
> 1. Document how to sync with upstream.
> 2. Add scripts to help sync with upstream.
> 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
>
> https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> 4. Integrate libffi build and testsuite with GCC.

How did you test this?  It looks like libgo is the only consumer of
libffi these days.
In particular go/libgo seems to be supported on almost all targets besides
darwin/windows - did you test cross and canadian configurations?

I applaud the attempt to sync to upsteam but I fear you won't get any "review"
of this massive diff.

I suppose the SONAME changes after the sync?

Thanks,
Richard.

> H.J. Lu (4):
>   libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
>   libffi: Sync with libffi 3.4.2
>   libffi: Integrate build with GCC
>   libffi: Integrate testsuite with GCC testsuite
>
>  libffi/.gitattributes                         |    4 +
>  libffi/ChangeLog.libffi                       | 7743 ++++++++++++++++-
>  libffi/HOWTO_MERGE                            |   13 +
>  libffi/LICENSE                                |    2 +-
>  libffi/LICENSE-BUILDTOOLS                     |  353 +
>  libffi/MERGE                                  |    4 +
>  libffi/Makefile.am                            |  135 +-
>  libffi/Makefile.in                            |  219 +-
>  libffi/README                                 |  450 -
>  libffi/README.md                              |  495 ++
>  libffi/acinclude.m4                           |   38 +-
>  libffi/autogen.sh                             |   11 +
>  libffi/configure                              |  487 +-
>  libffi/configure.ac                           |   91 +-
>  libffi/configure.host                         |   97 +-
>  libffi/doc/Makefile.am                        |    3 +
>  libffi/doc/libffi.texi                        |  382 +-
>  libffi/doc/version.texi                       |    8 +-
>  libffi/fficonfig.h.in                         |   21 +-
>  libffi/generate-darwin-source-and-headers.py  |  143 +-
>  libffi/include/Makefile.am                    |    2 +-
>  libffi/include/Makefile.in                    |    3 +-
>  libffi/include/ffi.h.in                       |  213 +-
>  libffi/include/ffi_cfi.h                      |   21 +
>  libffi/include/ffi_common.h                   |   50 +-
>  libffi/include/tramp.h                        |   45 +
>  libffi/libffi.map.in                          |   24 +-
>  libffi/libffi.pc.in                           |    2 +-
>  libffi/libffi.xcodeproj/project.pbxproj       |  530 +-
>  libffi/libtool-version                        |   25 +-
>  libffi/man/Makefile.in                        |    1 +
>  libffi/mdate-sh                               |   39 +-
>  libffi/merge.sh                               |   51 +
>  libffi/msvcc.sh                               |  134 +-
>  libffi/src/aarch64/ffi.c                      |  536 +-
>  libffi/src/aarch64/ffitarget.h                |   35 +-
>  libffi/src/aarch64/internal.h                 |   33 +
>  libffi/src/aarch64/sysv.S                     |  189 +-
>  libffi/src/aarch64/win64_armasm.S             |  506 ++
>  libffi/src/alpha/ffi.c                        |    6 +-
>  libffi/src/arc/ffi.c                          |    6 +-
>  libffi/src/arm/ffi.c                          |  380 +-
>  libffi/src/arm/ffitarget.h                    |   24 +-
>  libffi/src/arm/internal.h                     |   10 +
>  libffi/src/arm/sysv.S                         |  304 +-
>  libffi/src/arm/sysv_msvc_arm32.S              |  311 +
>  libffi/src/closures.c                         |  489 +-
>  libffi/src/cris/ffi.c                         |    4 +-
>  libffi/src/csky/ffi.c                         |  395 +
>  libffi/src/csky/ffitarget.h                   |   63 +
>  libffi/src/csky/sysv.S                        |  371 +
>  libffi/src/dlmalloc.c                         |    7 +-
>  libffi/src/frv/ffi.c                          |    4 +-
>  libffi/src/ia64/ffi.c                         |   30 +-
>  libffi/src/ia64/ffitarget.h                   |    3 +-
>  libffi/src/ia64/unix.S                        |    9 +-
>  libffi/src/java_raw_api.c                     |    6 +-
>  libffi/src/kvx/asm.h                          |    5 +
>  libffi/src/kvx/ffi.c                          |  273 +
>  libffi/src/kvx/ffitarget.h                    |   75 +
>  libffi/src/kvx/sysv.S                         |  127 +
>  libffi/src/m32r/ffi.c                         |    2 +-
>  libffi/src/m68k/ffi.c                         |    4 +-
>  libffi/src/m68k/sysv.S                        |   29 +-
>  libffi/src/m88k/ffi.c                         |    8 +-
>  libffi/src/metag/ffi.c                        |   14 +-
>  libffi/src/microblaze/ffi.c                   |   10 +-
>  libffi/src/mips/ffi.c                         |  146 +-
>  libffi/src/mips/ffitarget.h                   |   23 +-
>  libffi/src/mips/n32.S                         |  151 +-
>  libffi/src/mips/o32.S                         |  177 +-
>  libffi/src/moxie/eabi.S                       |    2 +-
>  libffi/src/moxie/ffi.c                        |   27 +-
>  libffi/src/nios2/ffi.c                        |    4 +-
>  libffi/src/pa/ffi.c                           |  216 +-
>  libffi/src/pa/ffitarget.h                     |   11 +-
>  libffi/src/pa/hpux32.S                        |   76 +-
>  libffi/src/pa/linux.S                         |  160 +-
>  libffi/src/powerpc/asm.h                      |    4 +-
>  libffi/src/powerpc/darwin_closure.S           |    6 +-
>  libffi/src/powerpc/ffi.c                      |   10 +-
>  libffi/src/powerpc/ffi_darwin.c               |   48 +-
>  libffi/src/powerpc/ffi_linux64.c              |  247 +-
>  libffi/src/powerpc/ffi_powerpc.h              |   25 +-
>  libffi/src/powerpc/ffitarget.h                |   14 +-
>  libffi/src/powerpc/linux64.S                  |  111 +-
>  libffi/src/powerpc/linux64_closure.S          |   70 +-
>  libffi/src/powerpc/sysv.S                     |   12 +-
>  libffi/src/prep_cif.c                         |   64 +-
>  libffi/src/raw_api.c                          |   10 +-
>  libffi/src/riscv/ffi.c                        |   16 +-
>  libffi/src/sparc/ffi.c                        |    6 +-
>  libffi/src/sparc/ffi64.c                      |   18 +-
>  libffi/src/tramp.c                            |  729 ++
>  libffi/src/types.c                            |    4 +-
>  libffi/src/vax/ffi.c                          |    4 +-
>  libffi/src/x86/asmnames.h                     |   30 +
>  libffi/src/x86/darwin.S                       |  444 -
>  libffi/src/x86/darwin64.S                     |  416 -
>  libffi/src/x86/darwin64_c.c                   |  643 --
>  libffi/src/x86/darwin_c.c                     |  843 --
>  libffi/src/x86/ffi.c                          |  162 +-
>  libffi/src/x86/ffi64.c                        |  164 +-
>  libffi/src/x86/ffitarget.h                    |   42 +-
>  libffi/src/x86/ffiw64.c                       |  114 +-
>  libffi/src/x86/internal.h                     |   14 +
>  libffi/src/x86/internal64.h                   |   14 +
>  libffi/src/x86/sysv.S                         |  215 +-
>  libffi/src/x86/sysv_intel.S                   |  995 +++
>  libffi/src/x86/unix64.S                       |  204 +-
>  libffi/src/x86/win64.S                        |  170 +-
>  libffi/src/x86/win64_intel.S                  |  238 +
>  libffi/src/xtensa/ffi.c                       |    4 +-
>  libffi/src/xtensa/sysv.S                      |    7 +-
>  libffi/testsuite/Makefile.am                  |  206 +-
>  libffi/testsuite/Makefile.in                  |  210 +-
>  libffi/testsuite/lib/libffi.exp               |  294 +-
>  libffi/testsuite/libffi.bhaible/Makefile      |   28 +
>  libffi/testsuite/libffi.bhaible/README        |   78 +
>  libffi/testsuite/libffi.bhaible/alignof.h     |   50 +
>  libffi/testsuite/libffi.bhaible/bhaible.exp   |   63 +
>  libffi/testsuite/libffi.bhaible/test-call.c   | 1745 ++++
>  .../testsuite/libffi.bhaible/test-callback.c  | 2885 ++++++
>  libffi/testsuite/libffi.bhaible/testcases.c   |  747 ++
>  libffi/testsuite/libffi.call/align_mixed.c    |   46 +
>  libffi/testsuite/libffi.call/align_stdcall.c  |   46 +
>  libffi/testsuite/libffi.call/call.exp         |   28 +-
>  libffi/testsuite/libffi.call/cls_uchar_va.c   |   44 -
>  libffi/testsuite/libffi.call/cls_ushort_va.c  |   44 -
>  libffi/testsuite/libffi.call/ffitest.h        |   13 +-
>  libffi/testsuite/libffi.call/float2.c         |   23 +-
>  libffi/testsuite/libffi.call/offsets.c        |   46 +
>  libffi/testsuite/libffi.call/struct10.c       |   57 +
>  libffi/testsuite/libffi.call/va_1.c           |  120 +-
>  libffi/testsuite/libffi.call/va_2.c           |  196 +
>  libffi/testsuite/libffi.closures/closure.exp  |   67 +
>  .../closure_fn0.c                             |    0
>  .../closure_fn1.c                             |    0
>  .../closure_fn2.c                             |    0
>  .../closure_fn3.c                             |    0
>  .../closure_fn4.c                             |    0
>  .../closure_fn5.c                             |    0
>  .../closure_fn6.c                             |    0
>  .../closure_loc_fn0.c                         |    3 +
>  .../closure_simple.c                          |    0
>  .../cls_12byte.c                              |    0
>  .../cls_16byte.c                              |    0
>  .../cls_18byte.c                              |    0
>  .../cls_19byte.c                              |    0
>  .../cls_1_1byte.c                             |    0
>  .../cls_20byte.c                              |    2 +-
>  .../cls_20byte1.c                             |    2 +-
>  .../cls_24byte.c                              |    6 +-
>  .../cls_2byte.c                               |    0
>  .../cls_3_1byte.c                             |    0
>  .../cls_3byte1.c                              |    0
>  .../cls_3byte2.c                              |    0
>  libffi/testsuite/libffi.closures/cls_3float.c |   95 +
>  .../cls_4_1byte.c                             |    0
>  .../cls_4byte.c                               |    0
>  .../cls_5_1_byte.c                            |    2 +-
>  .../cls_5byte.c                               |    2 +-
>  .../cls_64byte.c                              |    0
>  .../cls_6_1_byte.c                            |    2 +-
>  .../cls_6byte.c                               |    2 +-
>  .../cls_7_1_byte.c                            |    2 +-
>  .../cls_7byte.c                               |    2 +-
>  .../cls_8byte.c                               |    0
>  .../cls_9byte1.c                              |    2 +-
>  .../cls_9byte2.c                              |    2 +-
>  .../cls_align_double.c                        |    2 +-
>  .../cls_align_float.c                         |    2 +-
>  .../cls_align_longdouble.c                    |    2 +-
>  .../cls_align_longdouble_split.c              |    2 +-
>  .../cls_align_longdouble_split2.c             |    2 +-
>  .../cls_align_pointer.c                       |    2 +-
>  .../cls_align_sint16.c                        |    2 +-
>  .../cls_align_sint32.c                        |    2 +-
>  .../cls_align_sint64.c                        |    2 +-
>  .../cls_align_uint16.c                        |    2 +-
>  .../cls_align_uint32.c                        |    2 +-
>  .../cls_align_uint64.c                        |    2 +-
>  .../cls_dbls_struct.c                         |    6 +-
>  .../cls_double.c                              |    0
>  .../cls_double_va.c                           |    0
>  .../cls_float.c                               |    0
>  .../cls_longdouble.c                          |    0
>  .../cls_longdouble_va.c                       |    0
>  .../cls_many_mixed_args.c                     |    0
>  .../cls_many_mixed_float_double.c             |    0
>  .../cls_multi_schar.c                         |    2 +-
>  .../cls_multi_sshort.c                        |    2 +-
>  .../cls_multi_sshortchar.c                    |    2 +-
>  .../cls_multi_uchar.c                         |    2 +-
>  .../cls_multi_ushort.c                        |    2 +-
>  .../cls_multi_ushortchar.c                    |    2 +-
>  .../cls_pointer.c                             |    0
>  .../cls_pointer_stack.c                       |    0
>  .../cls_schar.c                               |    0
>  .../cls_sint.c                                |    0
>  .../cls_sshort.c                              |    0
>  .../cls_struct_va1.c                          |    0
>  .../cls_uchar.c                               |    0
>  .../cls_uint.c                                |    0
>  .../cls_uint_va.c                             |    0
>  .../cls_ulong_va.c                            |    0
>  .../cls_ulonglong.c                           |    0
>  .../cls_ushort.c                              |    0
>  .../err_bad_abi.c                             |    0
>  libffi/testsuite/libffi.closures/ffitest.h    |  144 +
>  .../huge_struct.c                             |    4 +-
>  .../nested_struct.c                           |    2 +-
>  .../nested_struct1.c                          |    2 +-
>  .../nested_struct10.c                         |    1 +
>  .../nested_struct11.c                         |    0
>  .../libffi.closures/nested_struct12.c         |   86 +
>  .../nested_struct13.c}                        |   14 +-
>  .../nested_struct2.c                          |    2 +-
>  .../nested_struct3.c                          |    2 +-
>  .../nested_struct4.c                          |    0
>  .../nested_struct5.c                          |    0
>  .../nested_struct6.c                          |    0
>  .../nested_struct7.c                          |    0
>  .../nested_struct8.c                          |    0
>  .../nested_struct9.c                          |    0
>  .../problem1.c                                |    0
>  .../libffi.closures/single_entry_structs1.c   |   86 +
>  .../libffi.closures/single_entry_structs2.c   |  102 +
>  .../libffi.closures/single_entry_structs3.c   |  101 +
>  .../stret_large.c                             |    0
>  .../stret_large2.c                            |    0
>  .../stret_medium.c                            |    2 +-
>  .../stret_medium2.c                           |    2 +-
>  .../testclosure.c                             |    2 +-
>  .../unwindtest.cc                             |   13 +-
>  .../unwindtest_ffi_call.cc                    |    5 +-
>  libffi/testsuite/libffi.go/static-chain.h     |    6 -
>  libffi/testsuite/libffi.special/ffitestcxx.h  |   96 -
>  libffi/testsuite/libffi.special/special.exp   |   35 -
>  239 files changed, 24951 insertions(+), 6175 deletions(-)
>  create mode 100644 libffi/.gitattributes
>  create mode 100644 libffi/HOWTO_MERGE
>  create mode 100644 libffi/LICENSE-BUILDTOOLS
>  create mode 100644 libffi/MERGE
>  delete mode 100644 libffi/README
>  create mode 100644 libffi/README.md
>  create mode 100755 libffi/autogen.sh
>  create mode 100644 libffi/doc/Makefile.am
>  mode change 100644 => 100755 libffi/generate-darwin-source-and-headers.py
>  create mode 100644 libffi/include/tramp.h
>  mode change 100644 => 100755 libffi/mdate-sh
>  create mode 100755 libffi/merge.sh
>  create mode 100644 libffi/src/aarch64/win64_armasm.S
>  create mode 100644 libffi/src/arm/sysv_msvc_arm32.S
>  create mode 100644 libffi/src/csky/ffi.c
>  create mode 100644 libffi/src/csky/ffitarget.h
>  create mode 100644 libffi/src/csky/sysv.S
>  create mode 100644 libffi/src/kvx/asm.h
>  create mode 100644 libffi/src/kvx/ffi.c
>  create mode 100644 libffi/src/kvx/ffitarget.h
>  create mode 100644 libffi/src/kvx/sysv.S
>  create mode 100644 libffi/src/tramp.c
>  create mode 100644 libffi/src/x86/asmnames.h
>  delete mode 100644 libffi/src/x86/darwin.S
>  delete mode 100644 libffi/src/x86/darwin64.S
>  delete mode 100644 libffi/src/x86/darwin64_c.c
>  delete mode 100644 libffi/src/x86/darwin_c.c
>  create mode 100644 libffi/src/x86/sysv_intel.S
>  create mode 100644 libffi/src/x86/win64_intel.S
>  create mode 100644 libffi/testsuite/libffi.bhaible/Makefile
>  create mode 100644 libffi/testsuite/libffi.bhaible/README
>  create mode 100644 libffi/testsuite/libffi.bhaible/alignof.h
>  create mode 100644 libffi/testsuite/libffi.bhaible/bhaible.exp
>  create mode 100644 libffi/testsuite/libffi.bhaible/test-call.c
>  create mode 100644 libffi/testsuite/libffi.bhaible/test-callback.c
>  create mode 100644 libffi/testsuite/libffi.bhaible/testcases.c
>  create mode 100644 libffi/testsuite/libffi.call/align_mixed.c
>  create mode 100644 libffi/testsuite/libffi.call/align_stdcall.c
>  delete mode 100644 libffi/testsuite/libffi.call/cls_uchar_va.c
>  delete mode 100644 libffi/testsuite/libffi.call/cls_ushort_va.c
>  create mode 100644 libffi/testsuite/libffi.call/offsets.c
>  create mode 100644 libffi/testsuite/libffi.call/struct10.c
>  create mode 100644 libffi/testsuite/libffi.call/va_2.c
>  create mode 100644 libffi/testsuite/libffi.closures/closure.exp
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn0.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn1.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn2.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn3.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn4.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn5.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn6.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_loc_fn0.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_simple.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_12byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_16byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_18byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_19byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_1_1byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte1.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_24byte.c (95%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_2byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3_1byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte1.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte2.c (100%)
>  create mode 100644 libffi/testsuite/libffi.closures/cls_3float.c
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4_1byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5_1_byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_64byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6_1_byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7_1_byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7byte.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_8byte.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte1.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte2.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_double.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_float.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split2.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_pointer.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint16.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint32.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint64.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint16.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint32.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint64.c (97%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_dbls_struct.c (92%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double_va.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_float.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble_va.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_args.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_float_double.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_schar.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshort.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshortchar.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_uchar.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushort.c (95%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushortchar.c (96%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer_stack.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_schar.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sint.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sshort.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_struct_va1.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uchar.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint_va.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulong_va.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulonglong.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ushort.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/err_bad_abi.c (100%)
>  create mode 100644 libffi/testsuite/libffi.closures/ffitest.h
>  rename libffi/testsuite/{libffi.call => libffi.closures}/huge_struct.c (99%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct1.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct10.c (99%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct11.c (100%)
>  create mode 100644 libffi/testsuite/libffi.closures/nested_struct12.c
>  rename libffi/testsuite/{libffi.call/nested_struct12.c => libffi.closures/nested_struct13.c} (88%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct2.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct3.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct4.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct5.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct6.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct7.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct8.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct9.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/problem1.c (100%)
>  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs1.c
>  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs2.c
>  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs3.c
>  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large2.c (100%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium2.c (98%)
>  rename libffi/testsuite/{libffi.call => libffi.closures}/testclosure.c (95%)
>  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest.cc (95%)
>  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest_ffi_call.cc (94%)
>  delete mode 100644 libffi/testsuite/libffi.special/ffitestcxx.h
>  delete mode 100644 libffi/testsuite/libffi.special/special.exp
>
> --
> 2.31.1
>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-13 12:45 ` Richard Biener
@ 2021-10-13 12:56   ` H.J. Lu
  2021-10-13 13:03     ` Richard Biener
  0 siblings, 1 reply; 27+ messages in thread
From: H.J. Lu @ 2021-10-13 12:56 UTC (permalink / raw)
  To: Richard Biener
  Cc: Ian Lance Taylor, GCC Patches, Jeff Law, Jakub Jelinek,
	DJ Delorie, Xi Ruoyao

On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > Change in the v2 patch:
> >
> > 1. Disable static trampolines by default.
> >
> >
> > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > has been changed significantly with new features, bug fixes and new target
> > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > make it easier to sync with libffi upstream:
> >
> > 1. Document how to sync with upstream.
> > 2. Add scripts to help sync with upstream.
> > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> >
> > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > 4. Integrate libffi build and testsuite with GCC.
>
> How did you test this?  It looks like libgo is the only consumer of
> libffi these days.
> In particular go/libgo seems to be supported on almost all targets besides
> darwin/windows - did you test cross and canadian configurations?

I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
the upstream libffi works on Darwin and Windows.

> I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> of this massive diff.

I believe that it should just work.  Our libffi is very much out of date.

> I suppose the SONAME changes after the sync?

Yes, SONAME is synced with upstream which was updated.

> Thanks,
> Richard.
>
> > H.J. Lu (4):
> >   libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
> >   libffi: Sync with libffi 3.4.2
> >   libffi: Integrate build with GCC
> >   libffi: Integrate testsuite with GCC testsuite
> >
> >  libffi/.gitattributes                         |    4 +
> >  libffi/ChangeLog.libffi                       | 7743 ++++++++++++++++-
> >  libffi/HOWTO_MERGE                            |   13 +
> >  libffi/LICENSE                                |    2 +-
> >  libffi/LICENSE-BUILDTOOLS                     |  353 +
> >  libffi/MERGE                                  |    4 +
> >  libffi/Makefile.am                            |  135 +-
> >  libffi/Makefile.in                            |  219 +-
> >  libffi/README                                 |  450 -
> >  libffi/README.md                              |  495 ++
> >  libffi/acinclude.m4                           |   38 +-
> >  libffi/autogen.sh                             |   11 +
> >  libffi/configure                              |  487 +-
> >  libffi/configure.ac                           |   91 +-
> >  libffi/configure.host                         |   97 +-
> >  libffi/doc/Makefile.am                        |    3 +
> >  libffi/doc/libffi.texi                        |  382 +-
> >  libffi/doc/version.texi                       |    8 +-
> >  libffi/fficonfig.h.in                         |   21 +-
> >  libffi/generate-darwin-source-and-headers.py  |  143 +-
> >  libffi/include/Makefile.am                    |    2 +-
> >  libffi/include/Makefile.in                    |    3 +-
> >  libffi/include/ffi.h.in                       |  213 +-
> >  libffi/include/ffi_cfi.h                      |   21 +
> >  libffi/include/ffi_common.h                   |   50 +-
> >  libffi/include/tramp.h                        |   45 +
> >  libffi/libffi.map.in                          |   24 +-
> >  libffi/libffi.pc.in                           |    2 +-
> >  libffi/libffi.xcodeproj/project.pbxproj       |  530 +-
> >  libffi/libtool-version                        |   25 +-
> >  libffi/man/Makefile.in                        |    1 +
> >  libffi/mdate-sh                               |   39 +-
> >  libffi/merge.sh                               |   51 +
> >  libffi/msvcc.sh                               |  134 +-
> >  libffi/src/aarch64/ffi.c                      |  536 +-
> >  libffi/src/aarch64/ffitarget.h                |   35 +-
> >  libffi/src/aarch64/internal.h                 |   33 +
> >  libffi/src/aarch64/sysv.S                     |  189 +-
> >  libffi/src/aarch64/win64_armasm.S             |  506 ++
> >  libffi/src/alpha/ffi.c                        |    6 +-
> >  libffi/src/arc/ffi.c                          |    6 +-
> >  libffi/src/arm/ffi.c                          |  380 +-
> >  libffi/src/arm/ffitarget.h                    |   24 +-
> >  libffi/src/arm/internal.h                     |   10 +
> >  libffi/src/arm/sysv.S                         |  304 +-
> >  libffi/src/arm/sysv_msvc_arm32.S              |  311 +
> >  libffi/src/closures.c                         |  489 +-
> >  libffi/src/cris/ffi.c                         |    4 +-
> >  libffi/src/csky/ffi.c                         |  395 +
> >  libffi/src/csky/ffitarget.h                   |   63 +
> >  libffi/src/csky/sysv.S                        |  371 +
> >  libffi/src/dlmalloc.c                         |    7 +-
> >  libffi/src/frv/ffi.c                          |    4 +-
> >  libffi/src/ia64/ffi.c                         |   30 +-
> >  libffi/src/ia64/ffitarget.h                   |    3 +-
> >  libffi/src/ia64/unix.S                        |    9 +-
> >  libffi/src/java_raw_api.c                     |    6 +-
> >  libffi/src/kvx/asm.h                          |    5 +
> >  libffi/src/kvx/ffi.c                          |  273 +
> >  libffi/src/kvx/ffitarget.h                    |   75 +
> >  libffi/src/kvx/sysv.S                         |  127 +
> >  libffi/src/m32r/ffi.c                         |    2 +-
> >  libffi/src/m68k/ffi.c                         |    4 +-
> >  libffi/src/m68k/sysv.S                        |   29 +-
> >  libffi/src/m88k/ffi.c                         |    8 +-
> >  libffi/src/metag/ffi.c                        |   14 +-
> >  libffi/src/microblaze/ffi.c                   |   10 +-
> >  libffi/src/mips/ffi.c                         |  146 +-
> >  libffi/src/mips/ffitarget.h                   |   23 +-
> >  libffi/src/mips/n32.S                         |  151 +-
> >  libffi/src/mips/o32.S                         |  177 +-
> >  libffi/src/moxie/eabi.S                       |    2 +-
> >  libffi/src/moxie/ffi.c                        |   27 +-
> >  libffi/src/nios2/ffi.c                        |    4 +-
> >  libffi/src/pa/ffi.c                           |  216 +-
> >  libffi/src/pa/ffitarget.h                     |   11 +-
> >  libffi/src/pa/hpux32.S                        |   76 +-
> >  libffi/src/pa/linux.S                         |  160 +-
> >  libffi/src/powerpc/asm.h                      |    4 +-
> >  libffi/src/powerpc/darwin_closure.S           |    6 +-
> >  libffi/src/powerpc/ffi.c                      |   10 +-
> >  libffi/src/powerpc/ffi_darwin.c               |   48 +-
> >  libffi/src/powerpc/ffi_linux64.c              |  247 +-
> >  libffi/src/powerpc/ffi_powerpc.h              |   25 +-
> >  libffi/src/powerpc/ffitarget.h                |   14 +-
> >  libffi/src/powerpc/linux64.S                  |  111 +-
> >  libffi/src/powerpc/linux64_closure.S          |   70 +-
> >  libffi/src/powerpc/sysv.S                     |   12 +-
> >  libffi/src/prep_cif.c                         |   64 +-
> >  libffi/src/raw_api.c                          |   10 +-
> >  libffi/src/riscv/ffi.c                        |   16 +-
> >  libffi/src/sparc/ffi.c                        |    6 +-
> >  libffi/src/sparc/ffi64.c                      |   18 +-
> >  libffi/src/tramp.c                            |  729 ++
> >  libffi/src/types.c                            |    4 +-
> >  libffi/src/vax/ffi.c                          |    4 +-
> >  libffi/src/x86/asmnames.h                     |   30 +
> >  libffi/src/x86/darwin.S                       |  444 -
> >  libffi/src/x86/darwin64.S                     |  416 -
> >  libffi/src/x86/darwin64_c.c                   |  643 --
> >  libffi/src/x86/darwin_c.c                     |  843 --
> >  libffi/src/x86/ffi.c                          |  162 +-
> >  libffi/src/x86/ffi64.c                        |  164 +-
> >  libffi/src/x86/ffitarget.h                    |   42 +-
> >  libffi/src/x86/ffiw64.c                       |  114 +-
> >  libffi/src/x86/internal.h                     |   14 +
> >  libffi/src/x86/internal64.h                   |   14 +
> >  libffi/src/x86/sysv.S                         |  215 +-
> >  libffi/src/x86/sysv_intel.S                   |  995 +++
> >  libffi/src/x86/unix64.S                       |  204 +-
> >  libffi/src/x86/win64.S                        |  170 +-
> >  libffi/src/x86/win64_intel.S                  |  238 +
> >  libffi/src/xtensa/ffi.c                       |    4 +-
> >  libffi/src/xtensa/sysv.S                      |    7 +-
> >  libffi/testsuite/Makefile.am                  |  206 +-
> >  libffi/testsuite/Makefile.in                  |  210 +-
> >  libffi/testsuite/lib/libffi.exp               |  294 +-
> >  libffi/testsuite/libffi.bhaible/Makefile      |   28 +
> >  libffi/testsuite/libffi.bhaible/README        |   78 +
> >  libffi/testsuite/libffi.bhaible/alignof.h     |   50 +
> >  libffi/testsuite/libffi.bhaible/bhaible.exp   |   63 +
> >  libffi/testsuite/libffi.bhaible/test-call.c   | 1745 ++++
> >  .../testsuite/libffi.bhaible/test-callback.c  | 2885 ++++++
> >  libffi/testsuite/libffi.bhaible/testcases.c   |  747 ++
> >  libffi/testsuite/libffi.call/align_mixed.c    |   46 +
> >  libffi/testsuite/libffi.call/align_stdcall.c  |   46 +
> >  libffi/testsuite/libffi.call/call.exp         |   28 +-
> >  libffi/testsuite/libffi.call/cls_uchar_va.c   |   44 -
> >  libffi/testsuite/libffi.call/cls_ushort_va.c  |   44 -
> >  libffi/testsuite/libffi.call/ffitest.h        |   13 +-
> >  libffi/testsuite/libffi.call/float2.c         |   23 +-
> >  libffi/testsuite/libffi.call/offsets.c        |   46 +
> >  libffi/testsuite/libffi.call/struct10.c       |   57 +
> >  libffi/testsuite/libffi.call/va_1.c           |  120 +-
> >  libffi/testsuite/libffi.call/va_2.c           |  196 +
> >  libffi/testsuite/libffi.closures/closure.exp  |   67 +
> >  .../closure_fn0.c                             |    0
> >  .../closure_fn1.c                             |    0
> >  .../closure_fn2.c                             |    0
> >  .../closure_fn3.c                             |    0
> >  .../closure_fn4.c                             |    0
> >  .../closure_fn5.c                             |    0
> >  .../closure_fn6.c                             |    0
> >  .../closure_loc_fn0.c                         |    3 +
> >  .../closure_simple.c                          |    0
> >  .../cls_12byte.c                              |    0
> >  .../cls_16byte.c                              |    0
> >  .../cls_18byte.c                              |    0
> >  .../cls_19byte.c                              |    0
> >  .../cls_1_1byte.c                             |    0
> >  .../cls_20byte.c                              |    2 +-
> >  .../cls_20byte1.c                             |    2 +-
> >  .../cls_24byte.c                              |    6 +-
> >  .../cls_2byte.c                               |    0
> >  .../cls_3_1byte.c                             |    0
> >  .../cls_3byte1.c                              |    0
> >  .../cls_3byte2.c                              |    0
> >  libffi/testsuite/libffi.closures/cls_3float.c |   95 +
> >  .../cls_4_1byte.c                             |    0
> >  .../cls_4byte.c                               |    0
> >  .../cls_5_1_byte.c                            |    2 +-
> >  .../cls_5byte.c                               |    2 +-
> >  .../cls_64byte.c                              |    0
> >  .../cls_6_1_byte.c                            |    2 +-
> >  .../cls_6byte.c                               |    2 +-
> >  .../cls_7_1_byte.c                            |    2 +-
> >  .../cls_7byte.c                               |    2 +-
> >  .../cls_8byte.c                               |    0
> >  .../cls_9byte1.c                              |    2 +-
> >  .../cls_9byte2.c                              |    2 +-
> >  .../cls_align_double.c                        |    2 +-
> >  .../cls_align_float.c                         |    2 +-
> >  .../cls_align_longdouble.c                    |    2 +-
> >  .../cls_align_longdouble_split.c              |    2 +-
> >  .../cls_align_longdouble_split2.c             |    2 +-
> >  .../cls_align_pointer.c                       |    2 +-
> >  .../cls_align_sint16.c                        |    2 +-
> >  .../cls_align_sint32.c                        |    2 +-
> >  .../cls_align_sint64.c                        |    2 +-
> >  .../cls_align_uint16.c                        |    2 +-
> >  .../cls_align_uint32.c                        |    2 +-
> >  .../cls_align_uint64.c                        |    2 +-
> >  .../cls_dbls_struct.c                         |    6 +-
> >  .../cls_double.c                              |    0
> >  .../cls_double_va.c                           |    0
> >  .../cls_float.c                               |    0
> >  .../cls_longdouble.c                          |    0
> >  .../cls_longdouble_va.c                       |    0
> >  .../cls_many_mixed_args.c                     |    0
> >  .../cls_many_mixed_float_double.c             |    0
> >  .../cls_multi_schar.c                         |    2 +-
> >  .../cls_multi_sshort.c                        |    2 +-
> >  .../cls_multi_sshortchar.c                    |    2 +-
> >  .../cls_multi_uchar.c                         |    2 +-
> >  .../cls_multi_ushort.c                        |    2 +-
> >  .../cls_multi_ushortchar.c                    |    2 +-
> >  .../cls_pointer.c                             |    0
> >  .../cls_pointer_stack.c                       |    0
> >  .../cls_schar.c                               |    0
> >  .../cls_sint.c                                |    0
> >  .../cls_sshort.c                              |    0
> >  .../cls_struct_va1.c                          |    0
> >  .../cls_uchar.c                               |    0
> >  .../cls_uint.c                                |    0
> >  .../cls_uint_va.c                             |    0
> >  .../cls_ulong_va.c                            |    0
> >  .../cls_ulonglong.c                           |    0
> >  .../cls_ushort.c                              |    0
> >  .../err_bad_abi.c                             |    0
> >  libffi/testsuite/libffi.closures/ffitest.h    |  144 +
> >  .../huge_struct.c                             |    4 +-
> >  .../nested_struct.c                           |    2 +-
> >  .../nested_struct1.c                          |    2 +-
> >  .../nested_struct10.c                         |    1 +
> >  .../nested_struct11.c                         |    0
> >  .../libffi.closures/nested_struct12.c         |   86 +
> >  .../nested_struct13.c}                        |   14 +-
> >  .../nested_struct2.c                          |    2 +-
> >  .../nested_struct3.c                          |    2 +-
> >  .../nested_struct4.c                          |    0
> >  .../nested_struct5.c                          |    0
> >  .../nested_struct6.c                          |    0
> >  .../nested_struct7.c                          |    0
> >  .../nested_struct8.c                          |    0
> >  .../nested_struct9.c                          |    0
> >  .../problem1.c                                |    0
> >  .../libffi.closures/single_entry_structs1.c   |   86 +
> >  .../libffi.closures/single_entry_structs2.c   |  102 +
> >  .../libffi.closures/single_entry_structs3.c   |  101 +
> >  .../stret_large.c                             |    0
> >  .../stret_large2.c                            |    0
> >  .../stret_medium.c                            |    2 +-
> >  .../stret_medium2.c                           |    2 +-
> >  .../testclosure.c                             |    2 +-
> >  .../unwindtest.cc                             |   13 +-
> >  .../unwindtest_ffi_call.cc                    |    5 +-
> >  libffi/testsuite/libffi.go/static-chain.h     |    6 -
> >  libffi/testsuite/libffi.special/ffitestcxx.h  |   96 -
> >  libffi/testsuite/libffi.special/special.exp   |   35 -
> >  239 files changed, 24951 insertions(+), 6175 deletions(-)
> >  create mode 100644 libffi/.gitattributes
> >  create mode 100644 libffi/HOWTO_MERGE
> >  create mode 100644 libffi/LICENSE-BUILDTOOLS
> >  create mode 100644 libffi/MERGE
> >  delete mode 100644 libffi/README
> >  create mode 100644 libffi/README.md
> >  create mode 100755 libffi/autogen.sh
> >  create mode 100644 libffi/doc/Makefile.am
> >  mode change 100644 => 100755 libffi/generate-darwin-source-and-headers.py
> >  create mode 100644 libffi/include/tramp.h
> >  mode change 100644 => 100755 libffi/mdate-sh
> >  create mode 100755 libffi/merge.sh
> >  create mode 100644 libffi/src/aarch64/win64_armasm.S
> >  create mode 100644 libffi/src/arm/sysv_msvc_arm32.S
> >  create mode 100644 libffi/src/csky/ffi.c
> >  create mode 100644 libffi/src/csky/ffitarget.h
> >  create mode 100644 libffi/src/csky/sysv.S
> >  create mode 100644 libffi/src/kvx/asm.h
> >  create mode 100644 libffi/src/kvx/ffi.c
> >  create mode 100644 libffi/src/kvx/ffitarget.h
> >  create mode 100644 libffi/src/kvx/sysv.S
> >  create mode 100644 libffi/src/tramp.c
> >  create mode 100644 libffi/src/x86/asmnames.h
> >  delete mode 100644 libffi/src/x86/darwin.S
> >  delete mode 100644 libffi/src/x86/darwin64.S
> >  delete mode 100644 libffi/src/x86/darwin64_c.c
> >  delete mode 100644 libffi/src/x86/darwin_c.c
> >  create mode 100644 libffi/src/x86/sysv_intel.S
> >  create mode 100644 libffi/src/x86/win64_intel.S
> >  create mode 100644 libffi/testsuite/libffi.bhaible/Makefile
> >  create mode 100644 libffi/testsuite/libffi.bhaible/README
> >  create mode 100644 libffi/testsuite/libffi.bhaible/alignof.h
> >  create mode 100644 libffi/testsuite/libffi.bhaible/bhaible.exp
> >  create mode 100644 libffi/testsuite/libffi.bhaible/test-call.c
> >  create mode 100644 libffi/testsuite/libffi.bhaible/test-callback.c
> >  create mode 100644 libffi/testsuite/libffi.bhaible/testcases.c
> >  create mode 100644 libffi/testsuite/libffi.call/align_mixed.c
> >  create mode 100644 libffi/testsuite/libffi.call/align_stdcall.c
> >  delete mode 100644 libffi/testsuite/libffi.call/cls_uchar_va.c
> >  delete mode 100644 libffi/testsuite/libffi.call/cls_ushort_va.c
> >  create mode 100644 libffi/testsuite/libffi.call/offsets.c
> >  create mode 100644 libffi/testsuite/libffi.call/struct10.c
> >  create mode 100644 libffi/testsuite/libffi.call/va_2.c
> >  create mode 100644 libffi/testsuite/libffi.closures/closure.exp
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn0.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn1.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn2.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn3.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn4.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn5.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn6.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_loc_fn0.c (96%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_simple.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_12byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_16byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_18byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_19byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_1_1byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte1.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_24byte.c (95%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_2byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3_1byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte1.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte2.c (100%)
> >  create mode 100644 libffi/testsuite/libffi.closures/cls_3float.c
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4_1byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5_1_byte.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5byte.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_64byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6_1_byte.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6byte.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7_1_byte.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7byte.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_8byte.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte1.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte2.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_double.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_float.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split.c (98%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split2.c (98%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_pointer.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint16.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint32.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint64.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint16.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint32.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint64.c (97%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_dbls_struct.c (92%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double_va.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_float.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble_va.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_args.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_float_double.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_schar.c (96%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshort.c (96%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshortchar.c (96%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_uchar.c (96%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushort.c (95%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushortchar.c (96%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer_stack.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_schar.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sint.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sshort.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_struct_va1.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uchar.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint_va.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulong_va.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulonglong.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ushort.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/err_bad_abi.c (100%)
> >  create mode 100644 libffi/testsuite/libffi.closures/ffitest.h
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/huge_struct.c (99%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct.c (98%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct1.c (98%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct10.c (99%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct11.c (100%)
> >  create mode 100644 libffi/testsuite/libffi.closures/nested_struct12.c
> >  rename libffi/testsuite/{libffi.call/nested_struct12.c => libffi.closures/nested_struct13.c} (88%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct2.c (98%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct3.c (98%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct4.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct5.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct6.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct7.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct8.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct9.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/problem1.c (100%)
> >  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs1.c
> >  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs2.c
> >  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs3.c
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large2.c (100%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium.c (98%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium2.c (98%)
> >  rename libffi/testsuite/{libffi.call => libffi.closures}/testclosure.c (95%)
> >  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest.cc (95%)
> >  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest_ffi_call.cc (94%)
> >  delete mode 100644 libffi/testsuite/libffi.special/ffitestcxx.h
> >  delete mode 100644 libffi/testsuite/libffi.special/special.exp
> >
> > --
> > 2.31.1
> >



-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-13 12:56   ` H.J. Lu
@ 2021-10-13 13:03     ` Richard Biener
  2021-10-13 13:42       ` H.J. Lu
  0 siblings, 1 reply; 27+ messages in thread
From: Richard Biener @ 2021-10-13 13:03 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Ian Lance Taylor, GCC Patches, Jeff Law, Jakub Jelinek,
	DJ Delorie, Xi Ruoyao

On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> <richard.guenther@gmail.com> wrote:
> >
> > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > Change in the v2 patch:
> > >
> > > 1. Disable static trampolines by default.
> > >
> > >
> > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > has been changed significantly with new features, bug fixes and new target
> > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > make it easier to sync with libffi upstream:
> > >
> > > 1. Document how to sync with upstream.
> > > 2. Add scripts to help sync with upstream.
> > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > >
> > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > 4. Integrate libffi build and testsuite with GCC.
> >
> > How did you test this?  It looks like libgo is the only consumer of
> > libffi these days.
> > In particular go/libgo seems to be supported on almost all targets besides
> > darwin/windows - did you test cross and canadian configurations?
>
> I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> the upstream libffi works on Darwin and Windows.
>
> > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > of this massive diff.
>
> I believe that it should just work.  Our libffi is very much out of date.

Yes, you can hope.  And yes, our libffi is out of date.

Can you please do the extra step to test one weird architecture, namely
powerpc64-aix which is available on the compile-farm?

If that goes well I think it's good to "hope" at this point (and plenty of
time to fix fallout until the GCC 12 release).

Thus OK after the extra testing dance and waiting until early next
week so others can throw in a veto.

Thanks,
Richard.

> > I suppose the SONAME changes after the sync?
>
> Yes, SONAME is synced with upstream which was updated.
>
> > Thanks,
> > Richard.
> >
> > > H.J. Lu (4):
> > >   libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
> > >   libffi: Sync with libffi 3.4.2
> > >   libffi: Integrate build with GCC
> > >   libffi: Integrate testsuite with GCC testsuite
> > >
> > >  libffi/.gitattributes                         |    4 +
> > >  libffi/ChangeLog.libffi                       | 7743 ++++++++++++++++-
> > >  libffi/HOWTO_MERGE                            |   13 +
> > >  libffi/LICENSE                                |    2 +-
> > >  libffi/LICENSE-BUILDTOOLS                     |  353 +
> > >  libffi/MERGE                                  |    4 +
> > >  libffi/Makefile.am                            |  135 +-
> > >  libffi/Makefile.in                            |  219 +-
> > >  libffi/README                                 |  450 -
> > >  libffi/README.md                              |  495 ++
> > >  libffi/acinclude.m4                           |   38 +-
> > >  libffi/autogen.sh                             |   11 +
> > >  libffi/configure                              |  487 +-
> > >  libffi/configure.ac                           |   91 +-
> > >  libffi/configure.host                         |   97 +-
> > >  libffi/doc/Makefile.am                        |    3 +
> > >  libffi/doc/libffi.texi                        |  382 +-
> > >  libffi/doc/version.texi                       |    8 +-
> > >  libffi/fficonfig.h.in                         |   21 +-
> > >  libffi/generate-darwin-source-and-headers.py  |  143 +-
> > >  libffi/include/Makefile.am                    |    2 +-
> > >  libffi/include/Makefile.in                    |    3 +-
> > >  libffi/include/ffi.h.in                       |  213 +-
> > >  libffi/include/ffi_cfi.h                      |   21 +
> > >  libffi/include/ffi_common.h                   |   50 +-
> > >  libffi/include/tramp.h                        |   45 +
> > >  libffi/libffi.map.in                          |   24 +-
> > >  libffi/libffi.pc.in                           |    2 +-
> > >  libffi/libffi.xcodeproj/project.pbxproj       |  530 +-
> > >  libffi/libtool-version                        |   25 +-
> > >  libffi/man/Makefile.in                        |    1 +
> > >  libffi/mdate-sh                               |   39 +-
> > >  libffi/merge.sh                               |   51 +
> > >  libffi/msvcc.sh                               |  134 +-
> > >  libffi/src/aarch64/ffi.c                      |  536 +-
> > >  libffi/src/aarch64/ffitarget.h                |   35 +-
> > >  libffi/src/aarch64/internal.h                 |   33 +
> > >  libffi/src/aarch64/sysv.S                     |  189 +-
> > >  libffi/src/aarch64/win64_armasm.S             |  506 ++
> > >  libffi/src/alpha/ffi.c                        |    6 +-
> > >  libffi/src/arc/ffi.c                          |    6 +-
> > >  libffi/src/arm/ffi.c                          |  380 +-
> > >  libffi/src/arm/ffitarget.h                    |   24 +-
> > >  libffi/src/arm/internal.h                     |   10 +
> > >  libffi/src/arm/sysv.S                         |  304 +-
> > >  libffi/src/arm/sysv_msvc_arm32.S              |  311 +
> > >  libffi/src/closures.c                         |  489 +-
> > >  libffi/src/cris/ffi.c                         |    4 +-
> > >  libffi/src/csky/ffi.c                         |  395 +
> > >  libffi/src/csky/ffitarget.h                   |   63 +
> > >  libffi/src/csky/sysv.S                        |  371 +
> > >  libffi/src/dlmalloc.c                         |    7 +-
> > >  libffi/src/frv/ffi.c                          |    4 +-
> > >  libffi/src/ia64/ffi.c                         |   30 +-
> > >  libffi/src/ia64/ffitarget.h                   |    3 +-
> > >  libffi/src/ia64/unix.S                        |    9 +-
> > >  libffi/src/java_raw_api.c                     |    6 +-
> > >  libffi/src/kvx/asm.h                          |    5 +
> > >  libffi/src/kvx/ffi.c                          |  273 +
> > >  libffi/src/kvx/ffitarget.h                    |   75 +
> > >  libffi/src/kvx/sysv.S                         |  127 +
> > >  libffi/src/m32r/ffi.c                         |    2 +-
> > >  libffi/src/m68k/ffi.c                         |    4 +-
> > >  libffi/src/m68k/sysv.S                        |   29 +-
> > >  libffi/src/m88k/ffi.c                         |    8 +-
> > >  libffi/src/metag/ffi.c                        |   14 +-
> > >  libffi/src/microblaze/ffi.c                   |   10 +-
> > >  libffi/src/mips/ffi.c                         |  146 +-
> > >  libffi/src/mips/ffitarget.h                   |   23 +-
> > >  libffi/src/mips/n32.S                         |  151 +-
> > >  libffi/src/mips/o32.S                         |  177 +-
> > >  libffi/src/moxie/eabi.S                       |    2 +-
> > >  libffi/src/moxie/ffi.c                        |   27 +-
> > >  libffi/src/nios2/ffi.c                        |    4 +-
> > >  libffi/src/pa/ffi.c                           |  216 +-
> > >  libffi/src/pa/ffitarget.h                     |   11 +-
> > >  libffi/src/pa/hpux32.S                        |   76 +-
> > >  libffi/src/pa/linux.S                         |  160 +-
> > >  libffi/src/powerpc/asm.h                      |    4 +-
> > >  libffi/src/powerpc/darwin_closure.S           |    6 +-
> > >  libffi/src/powerpc/ffi.c                      |   10 +-
> > >  libffi/src/powerpc/ffi_darwin.c               |   48 +-
> > >  libffi/src/powerpc/ffi_linux64.c              |  247 +-
> > >  libffi/src/powerpc/ffi_powerpc.h              |   25 +-
> > >  libffi/src/powerpc/ffitarget.h                |   14 +-
> > >  libffi/src/powerpc/linux64.S                  |  111 +-
> > >  libffi/src/powerpc/linux64_closure.S          |   70 +-
> > >  libffi/src/powerpc/sysv.S                     |   12 +-
> > >  libffi/src/prep_cif.c                         |   64 +-
> > >  libffi/src/raw_api.c                          |   10 +-
> > >  libffi/src/riscv/ffi.c                        |   16 +-
> > >  libffi/src/sparc/ffi.c                        |    6 +-
> > >  libffi/src/sparc/ffi64.c                      |   18 +-
> > >  libffi/src/tramp.c                            |  729 ++
> > >  libffi/src/types.c                            |    4 +-
> > >  libffi/src/vax/ffi.c                          |    4 +-
> > >  libffi/src/x86/asmnames.h                     |   30 +
> > >  libffi/src/x86/darwin.S                       |  444 -
> > >  libffi/src/x86/darwin64.S                     |  416 -
> > >  libffi/src/x86/darwin64_c.c                   |  643 --
> > >  libffi/src/x86/darwin_c.c                     |  843 --
> > >  libffi/src/x86/ffi.c                          |  162 +-
> > >  libffi/src/x86/ffi64.c                        |  164 +-
> > >  libffi/src/x86/ffitarget.h                    |   42 +-
> > >  libffi/src/x86/ffiw64.c                       |  114 +-
> > >  libffi/src/x86/internal.h                     |   14 +
> > >  libffi/src/x86/internal64.h                   |   14 +
> > >  libffi/src/x86/sysv.S                         |  215 +-
> > >  libffi/src/x86/sysv_intel.S                   |  995 +++
> > >  libffi/src/x86/unix64.S                       |  204 +-
> > >  libffi/src/x86/win64.S                        |  170 +-
> > >  libffi/src/x86/win64_intel.S                  |  238 +
> > >  libffi/src/xtensa/ffi.c                       |    4 +-
> > >  libffi/src/xtensa/sysv.S                      |    7 +-
> > >  libffi/testsuite/Makefile.am                  |  206 +-
> > >  libffi/testsuite/Makefile.in                  |  210 +-
> > >  libffi/testsuite/lib/libffi.exp               |  294 +-
> > >  libffi/testsuite/libffi.bhaible/Makefile      |   28 +
> > >  libffi/testsuite/libffi.bhaible/README        |   78 +
> > >  libffi/testsuite/libffi.bhaible/alignof.h     |   50 +
> > >  libffi/testsuite/libffi.bhaible/bhaible.exp   |   63 +
> > >  libffi/testsuite/libffi.bhaible/test-call.c   | 1745 ++++
> > >  .../testsuite/libffi.bhaible/test-callback.c  | 2885 ++++++
> > >  libffi/testsuite/libffi.bhaible/testcases.c   |  747 ++
> > >  libffi/testsuite/libffi.call/align_mixed.c    |   46 +
> > >  libffi/testsuite/libffi.call/align_stdcall.c  |   46 +
> > >  libffi/testsuite/libffi.call/call.exp         |   28 +-
> > >  libffi/testsuite/libffi.call/cls_uchar_va.c   |   44 -
> > >  libffi/testsuite/libffi.call/cls_ushort_va.c  |   44 -
> > >  libffi/testsuite/libffi.call/ffitest.h        |   13 +-
> > >  libffi/testsuite/libffi.call/float2.c         |   23 +-
> > >  libffi/testsuite/libffi.call/offsets.c        |   46 +
> > >  libffi/testsuite/libffi.call/struct10.c       |   57 +
> > >  libffi/testsuite/libffi.call/va_1.c           |  120 +-
> > >  libffi/testsuite/libffi.call/va_2.c           |  196 +
> > >  libffi/testsuite/libffi.closures/closure.exp  |   67 +
> > >  .../closure_fn0.c                             |    0
> > >  .../closure_fn1.c                             |    0
> > >  .../closure_fn2.c                             |    0
> > >  .../closure_fn3.c                             |    0
> > >  .../closure_fn4.c                             |    0
> > >  .../closure_fn5.c                             |    0
> > >  .../closure_fn6.c                             |    0
> > >  .../closure_loc_fn0.c                         |    3 +
> > >  .../closure_simple.c                          |    0
> > >  .../cls_12byte.c                              |    0
> > >  .../cls_16byte.c                              |    0
> > >  .../cls_18byte.c                              |    0
> > >  .../cls_19byte.c                              |    0
> > >  .../cls_1_1byte.c                             |    0
> > >  .../cls_20byte.c                              |    2 +-
> > >  .../cls_20byte1.c                             |    2 +-
> > >  .../cls_24byte.c                              |    6 +-
> > >  .../cls_2byte.c                               |    0
> > >  .../cls_3_1byte.c                             |    0
> > >  .../cls_3byte1.c                              |    0
> > >  .../cls_3byte2.c                              |    0
> > >  libffi/testsuite/libffi.closures/cls_3float.c |   95 +
> > >  .../cls_4_1byte.c                             |    0
> > >  .../cls_4byte.c                               |    0
> > >  .../cls_5_1_byte.c                            |    2 +-
> > >  .../cls_5byte.c                               |    2 +-
> > >  .../cls_64byte.c                              |    0
> > >  .../cls_6_1_byte.c                            |    2 +-
> > >  .../cls_6byte.c                               |    2 +-
> > >  .../cls_7_1_byte.c                            |    2 +-
> > >  .../cls_7byte.c                               |    2 +-
> > >  .../cls_8byte.c                               |    0
> > >  .../cls_9byte1.c                              |    2 +-
> > >  .../cls_9byte2.c                              |    2 +-
> > >  .../cls_align_double.c                        |    2 +-
> > >  .../cls_align_float.c                         |    2 +-
> > >  .../cls_align_longdouble.c                    |    2 +-
> > >  .../cls_align_longdouble_split.c              |    2 +-
> > >  .../cls_align_longdouble_split2.c             |    2 +-
> > >  .../cls_align_pointer.c                       |    2 +-
> > >  .../cls_align_sint16.c                        |    2 +-
> > >  .../cls_align_sint32.c                        |    2 +-
> > >  .../cls_align_sint64.c                        |    2 +-
> > >  .../cls_align_uint16.c                        |    2 +-
> > >  .../cls_align_uint32.c                        |    2 +-
> > >  .../cls_align_uint64.c                        |    2 +-
> > >  .../cls_dbls_struct.c                         |    6 +-
> > >  .../cls_double.c                              |    0
> > >  .../cls_double_va.c                           |    0
> > >  .../cls_float.c                               |    0
> > >  .../cls_longdouble.c                          |    0
> > >  .../cls_longdouble_va.c                       |    0
> > >  .../cls_many_mixed_args.c                     |    0
> > >  .../cls_many_mixed_float_double.c             |    0
> > >  .../cls_multi_schar.c                         |    2 +-
> > >  .../cls_multi_sshort.c                        |    2 +-
> > >  .../cls_multi_sshortchar.c                    |    2 +-
> > >  .../cls_multi_uchar.c                         |    2 +-
> > >  .../cls_multi_ushort.c                        |    2 +-
> > >  .../cls_multi_ushortchar.c                    |    2 +-
> > >  .../cls_pointer.c                             |    0
> > >  .../cls_pointer_stack.c                       |    0
> > >  .../cls_schar.c                               |    0
> > >  .../cls_sint.c                                |    0
> > >  .../cls_sshort.c                              |    0
> > >  .../cls_struct_va1.c                          |    0
> > >  .../cls_uchar.c                               |    0
> > >  .../cls_uint.c                                |    0
> > >  .../cls_uint_va.c                             |    0
> > >  .../cls_ulong_va.c                            |    0
> > >  .../cls_ulonglong.c                           |    0
> > >  .../cls_ushort.c                              |    0
> > >  .../err_bad_abi.c                             |    0
> > >  libffi/testsuite/libffi.closures/ffitest.h    |  144 +
> > >  .../huge_struct.c                             |    4 +-
> > >  .../nested_struct.c                           |    2 +-
> > >  .../nested_struct1.c                          |    2 +-
> > >  .../nested_struct10.c                         |    1 +
> > >  .../nested_struct11.c                         |    0
> > >  .../libffi.closures/nested_struct12.c         |   86 +
> > >  .../nested_struct13.c}                        |   14 +-
> > >  .../nested_struct2.c                          |    2 +-
> > >  .../nested_struct3.c                          |    2 +-
> > >  .../nested_struct4.c                          |    0
> > >  .../nested_struct5.c                          |    0
> > >  .../nested_struct6.c                          |    0
> > >  .../nested_struct7.c                          |    0
> > >  .../nested_struct8.c                          |    0
> > >  .../nested_struct9.c                          |    0
> > >  .../problem1.c                                |    0
> > >  .../libffi.closures/single_entry_structs1.c   |   86 +
> > >  .../libffi.closures/single_entry_structs2.c   |  102 +
> > >  .../libffi.closures/single_entry_structs3.c   |  101 +
> > >  .../stret_large.c                             |    0
> > >  .../stret_large2.c                            |    0
> > >  .../stret_medium.c                            |    2 +-
> > >  .../stret_medium2.c                           |    2 +-
> > >  .../testclosure.c                             |    2 +-
> > >  .../unwindtest.cc                             |   13 +-
> > >  .../unwindtest_ffi_call.cc                    |    5 +-
> > >  libffi/testsuite/libffi.go/static-chain.h     |    6 -
> > >  libffi/testsuite/libffi.special/ffitestcxx.h  |   96 -
> > >  libffi/testsuite/libffi.special/special.exp   |   35 -
> > >  239 files changed, 24951 insertions(+), 6175 deletions(-)
> > >  create mode 100644 libffi/.gitattributes
> > >  create mode 100644 libffi/HOWTO_MERGE
> > >  create mode 100644 libffi/LICENSE-BUILDTOOLS
> > >  create mode 100644 libffi/MERGE
> > >  delete mode 100644 libffi/README
> > >  create mode 100644 libffi/README.md
> > >  create mode 100755 libffi/autogen.sh
> > >  create mode 100644 libffi/doc/Makefile.am
> > >  mode change 100644 => 100755 libffi/generate-darwin-source-and-headers.py
> > >  create mode 100644 libffi/include/tramp.h
> > >  mode change 100644 => 100755 libffi/mdate-sh
> > >  create mode 100755 libffi/merge.sh
> > >  create mode 100644 libffi/src/aarch64/win64_armasm.S
> > >  create mode 100644 libffi/src/arm/sysv_msvc_arm32.S
> > >  create mode 100644 libffi/src/csky/ffi.c
> > >  create mode 100644 libffi/src/csky/ffitarget.h
> > >  create mode 100644 libffi/src/csky/sysv.S
> > >  create mode 100644 libffi/src/kvx/asm.h
> > >  create mode 100644 libffi/src/kvx/ffi.c
> > >  create mode 100644 libffi/src/kvx/ffitarget.h
> > >  create mode 100644 libffi/src/kvx/sysv.S
> > >  create mode 100644 libffi/src/tramp.c
> > >  create mode 100644 libffi/src/x86/asmnames.h
> > >  delete mode 100644 libffi/src/x86/darwin.S
> > >  delete mode 100644 libffi/src/x86/darwin64.S
> > >  delete mode 100644 libffi/src/x86/darwin64_c.c
> > >  delete mode 100644 libffi/src/x86/darwin_c.c
> > >  create mode 100644 libffi/src/x86/sysv_intel.S
> > >  create mode 100644 libffi/src/x86/win64_intel.S
> > >  create mode 100644 libffi/testsuite/libffi.bhaible/Makefile
> > >  create mode 100644 libffi/testsuite/libffi.bhaible/README
> > >  create mode 100644 libffi/testsuite/libffi.bhaible/alignof.h
> > >  create mode 100644 libffi/testsuite/libffi.bhaible/bhaible.exp
> > >  create mode 100644 libffi/testsuite/libffi.bhaible/test-call.c
> > >  create mode 100644 libffi/testsuite/libffi.bhaible/test-callback.c
> > >  create mode 100644 libffi/testsuite/libffi.bhaible/testcases.c
> > >  create mode 100644 libffi/testsuite/libffi.call/align_mixed.c
> > >  create mode 100644 libffi/testsuite/libffi.call/align_stdcall.c
> > >  delete mode 100644 libffi/testsuite/libffi.call/cls_uchar_va.c
> > >  delete mode 100644 libffi/testsuite/libffi.call/cls_ushort_va.c
> > >  create mode 100644 libffi/testsuite/libffi.call/offsets.c
> > >  create mode 100644 libffi/testsuite/libffi.call/struct10.c
> > >  create mode 100644 libffi/testsuite/libffi.call/va_2.c
> > >  create mode 100644 libffi/testsuite/libffi.closures/closure.exp
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn0.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn1.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn2.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn3.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn4.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn5.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn6.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_loc_fn0.c (96%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_simple.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_12byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_16byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_18byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_19byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_1_1byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte1.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_24byte.c (95%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_2byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3_1byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte1.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte2.c (100%)
> > >  create mode 100644 libffi/testsuite/libffi.closures/cls_3float.c
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4_1byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5_1_byte.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5byte.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_64byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6_1_byte.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6byte.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7_1_byte.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7byte.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_8byte.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte1.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte2.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_double.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_float.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split.c (98%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split2.c (98%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_pointer.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint16.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint32.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint64.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint16.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint32.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint64.c (97%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_dbls_struct.c (92%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double_va.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_float.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble_va.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_args.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_float_double.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_schar.c (96%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshort.c (96%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshortchar.c (96%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_uchar.c (96%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushort.c (95%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushortchar.c (96%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer_stack.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_schar.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sint.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sshort.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_struct_va1.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uchar.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint_va.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulong_va.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulonglong.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ushort.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/err_bad_abi.c (100%)
> > >  create mode 100644 libffi/testsuite/libffi.closures/ffitest.h
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/huge_struct.c (99%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct.c (98%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct1.c (98%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct10.c (99%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct11.c (100%)
> > >  create mode 100644 libffi/testsuite/libffi.closures/nested_struct12.c
> > >  rename libffi/testsuite/{libffi.call/nested_struct12.c => libffi.closures/nested_struct13.c} (88%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct2.c (98%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct3.c (98%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct4.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct5.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct6.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct7.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct8.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct9.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/problem1.c (100%)
> > >  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs1.c
> > >  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs2.c
> > >  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs3.c
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large2.c (100%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium.c (98%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium2.c (98%)
> > >  rename libffi/testsuite/{libffi.call => libffi.closures}/testclosure.c (95%)
> > >  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest.cc (95%)
> > >  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest_ffi_call.cc (94%)
> > >  delete mode 100644 libffi/testsuite/libffi.special/ffitestcxx.h
> > >  delete mode 100644 libffi/testsuite/libffi.special/special.exp
> > >
> > > --
> > > 2.31.1
> > >
>
>
>
> --
> H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-13 13:03     ` Richard Biener
@ 2021-10-13 13:42       ` H.J. Lu
  2021-10-16  0:06         ` H.J. Lu
  0 siblings, 1 reply; 27+ messages in thread
From: H.J. Lu @ 2021-10-13 13:42 UTC (permalink / raw)
  To: Richard Biener
  Cc: Ian Lance Taylor, GCC Patches, Jeff Law, Jakub Jelinek,
	DJ Delorie, Xi Ruoyao

On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > <richard.guenther@gmail.com> wrote:
> > >
> > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >
> > > > Change in the v2 patch:
> > > >
> > > > 1. Disable static trampolines by default.
> > > >
> > > >
> > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > has been changed significantly with new features, bug fixes and new target
> > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > make it easier to sync with libffi upstream:
> > > >
> > > > 1. Document how to sync with upstream.
> > > > 2. Add scripts to help sync with upstream.
> > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > >
> > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > 4. Integrate libffi build and testsuite with GCC.
> > >
> > > How did you test this?  It looks like libgo is the only consumer of
> > > libffi these days.
> > > In particular go/libgo seems to be supported on almost all targets besides
> > > darwin/windows - did you test cross and canadian configurations?
> >
> > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > the upstream libffi works on Darwin and Windows.
> >
> > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > of this massive diff.
> >
> > I believe that it should just work.  Our libffi is very much out of date.
>
> Yes, you can hope.  And yes, our libffi is out of date.
>
> Can you please do the extra step to test one weird architecture, namely
> powerpc64-aix which is available on the compile-farm?

I will give it a try and report back.

> If that goes well I think it's good to "hope" at this point (and plenty of
> time to fix fallout until the GCC 12 release).
>
> Thus OK after the extra testing dance and waiting until early next
> week so others can throw in a veto.
>
> Thanks,
> Richard.
>
> > > I suppose the SONAME changes after the sync?
> >
> > Yes, SONAME is synced with upstream which was updated.
> >
> > > Thanks,
> > > Richard.
> > >
> > > > H.J. Lu (4):
> > > >   libffi: Add HOWTO_MERGE, autogen.sh and merge.sh
> > > >   libffi: Sync with libffi 3.4.2
> > > >   libffi: Integrate build with GCC
> > > >   libffi: Integrate testsuite with GCC testsuite
> > > >
> > > >  libffi/.gitattributes                         |    4 +
> > > >  libffi/ChangeLog.libffi                       | 7743 ++++++++++++++++-
> > > >  libffi/HOWTO_MERGE                            |   13 +
> > > >  libffi/LICENSE                                |    2 +-
> > > >  libffi/LICENSE-BUILDTOOLS                     |  353 +
> > > >  libffi/MERGE                                  |    4 +
> > > >  libffi/Makefile.am                            |  135 +-
> > > >  libffi/Makefile.in                            |  219 +-
> > > >  libffi/README                                 |  450 -
> > > >  libffi/README.md                              |  495 ++
> > > >  libffi/acinclude.m4                           |   38 +-
> > > >  libffi/autogen.sh                             |   11 +
> > > >  libffi/configure                              |  487 +-
> > > >  libffi/configure.ac                           |   91 +-
> > > >  libffi/configure.host                         |   97 +-
> > > >  libffi/doc/Makefile.am                        |    3 +
> > > >  libffi/doc/libffi.texi                        |  382 +-
> > > >  libffi/doc/version.texi                       |    8 +-
> > > >  libffi/fficonfig.h.in                         |   21 +-
> > > >  libffi/generate-darwin-source-and-headers.py  |  143 +-
> > > >  libffi/include/Makefile.am                    |    2 +-
> > > >  libffi/include/Makefile.in                    |    3 +-
> > > >  libffi/include/ffi.h.in                       |  213 +-
> > > >  libffi/include/ffi_cfi.h                      |   21 +
> > > >  libffi/include/ffi_common.h                   |   50 +-
> > > >  libffi/include/tramp.h                        |   45 +
> > > >  libffi/libffi.map.in                          |   24 +-
> > > >  libffi/libffi.pc.in                           |    2 +-
> > > >  libffi/libffi.xcodeproj/project.pbxproj       |  530 +-
> > > >  libffi/libtool-version                        |   25 +-
> > > >  libffi/man/Makefile.in                        |    1 +
> > > >  libffi/mdate-sh                               |   39 +-
> > > >  libffi/merge.sh                               |   51 +
> > > >  libffi/msvcc.sh                               |  134 +-
> > > >  libffi/src/aarch64/ffi.c                      |  536 +-
> > > >  libffi/src/aarch64/ffitarget.h                |   35 +-
> > > >  libffi/src/aarch64/internal.h                 |   33 +
> > > >  libffi/src/aarch64/sysv.S                     |  189 +-
> > > >  libffi/src/aarch64/win64_armasm.S             |  506 ++
> > > >  libffi/src/alpha/ffi.c                        |    6 +-
> > > >  libffi/src/arc/ffi.c                          |    6 +-
> > > >  libffi/src/arm/ffi.c                          |  380 +-
> > > >  libffi/src/arm/ffitarget.h                    |   24 +-
> > > >  libffi/src/arm/internal.h                     |   10 +
> > > >  libffi/src/arm/sysv.S                         |  304 +-
> > > >  libffi/src/arm/sysv_msvc_arm32.S              |  311 +
> > > >  libffi/src/closures.c                         |  489 +-
> > > >  libffi/src/cris/ffi.c                         |    4 +-
> > > >  libffi/src/csky/ffi.c                         |  395 +
> > > >  libffi/src/csky/ffitarget.h                   |   63 +
> > > >  libffi/src/csky/sysv.S                        |  371 +
> > > >  libffi/src/dlmalloc.c                         |    7 +-
> > > >  libffi/src/frv/ffi.c                          |    4 +-
> > > >  libffi/src/ia64/ffi.c                         |   30 +-
> > > >  libffi/src/ia64/ffitarget.h                   |    3 +-
> > > >  libffi/src/ia64/unix.S                        |    9 +-
> > > >  libffi/src/java_raw_api.c                     |    6 +-
> > > >  libffi/src/kvx/asm.h                          |    5 +
> > > >  libffi/src/kvx/ffi.c                          |  273 +
> > > >  libffi/src/kvx/ffitarget.h                    |   75 +
> > > >  libffi/src/kvx/sysv.S                         |  127 +
> > > >  libffi/src/m32r/ffi.c                         |    2 +-
> > > >  libffi/src/m68k/ffi.c                         |    4 +-
> > > >  libffi/src/m68k/sysv.S                        |   29 +-
> > > >  libffi/src/m88k/ffi.c                         |    8 +-
> > > >  libffi/src/metag/ffi.c                        |   14 +-
> > > >  libffi/src/microblaze/ffi.c                   |   10 +-
> > > >  libffi/src/mips/ffi.c                         |  146 +-
> > > >  libffi/src/mips/ffitarget.h                   |   23 +-
> > > >  libffi/src/mips/n32.S                         |  151 +-
> > > >  libffi/src/mips/o32.S                         |  177 +-
> > > >  libffi/src/moxie/eabi.S                       |    2 +-
> > > >  libffi/src/moxie/ffi.c                        |   27 +-
> > > >  libffi/src/nios2/ffi.c                        |    4 +-
> > > >  libffi/src/pa/ffi.c                           |  216 +-
> > > >  libffi/src/pa/ffitarget.h                     |   11 +-
> > > >  libffi/src/pa/hpux32.S                        |   76 +-
> > > >  libffi/src/pa/linux.S                         |  160 +-
> > > >  libffi/src/powerpc/asm.h                      |    4 +-
> > > >  libffi/src/powerpc/darwin_closure.S           |    6 +-
> > > >  libffi/src/powerpc/ffi.c                      |   10 +-
> > > >  libffi/src/powerpc/ffi_darwin.c               |   48 +-
> > > >  libffi/src/powerpc/ffi_linux64.c              |  247 +-
> > > >  libffi/src/powerpc/ffi_powerpc.h              |   25 +-
> > > >  libffi/src/powerpc/ffitarget.h                |   14 +-
> > > >  libffi/src/powerpc/linux64.S                  |  111 +-
> > > >  libffi/src/powerpc/linux64_closure.S          |   70 +-
> > > >  libffi/src/powerpc/sysv.S                     |   12 +-
> > > >  libffi/src/prep_cif.c                         |   64 +-
> > > >  libffi/src/raw_api.c                          |   10 +-
> > > >  libffi/src/riscv/ffi.c                        |   16 +-
> > > >  libffi/src/sparc/ffi.c                        |    6 +-
> > > >  libffi/src/sparc/ffi64.c                      |   18 +-
> > > >  libffi/src/tramp.c                            |  729 ++
> > > >  libffi/src/types.c                            |    4 +-
> > > >  libffi/src/vax/ffi.c                          |    4 +-
> > > >  libffi/src/x86/asmnames.h                     |   30 +
> > > >  libffi/src/x86/darwin.S                       |  444 -
> > > >  libffi/src/x86/darwin64.S                     |  416 -
> > > >  libffi/src/x86/darwin64_c.c                   |  643 --
> > > >  libffi/src/x86/darwin_c.c                     |  843 --
> > > >  libffi/src/x86/ffi.c                          |  162 +-
> > > >  libffi/src/x86/ffi64.c                        |  164 +-
> > > >  libffi/src/x86/ffitarget.h                    |   42 +-
> > > >  libffi/src/x86/ffiw64.c                       |  114 +-
> > > >  libffi/src/x86/internal.h                     |   14 +
> > > >  libffi/src/x86/internal64.h                   |   14 +
> > > >  libffi/src/x86/sysv.S                         |  215 +-
> > > >  libffi/src/x86/sysv_intel.S                   |  995 +++
> > > >  libffi/src/x86/unix64.S                       |  204 +-
> > > >  libffi/src/x86/win64.S                        |  170 +-
> > > >  libffi/src/x86/win64_intel.S                  |  238 +
> > > >  libffi/src/xtensa/ffi.c                       |    4 +-
> > > >  libffi/src/xtensa/sysv.S                      |    7 +-
> > > >  libffi/testsuite/Makefile.am                  |  206 +-
> > > >  libffi/testsuite/Makefile.in                  |  210 +-
> > > >  libffi/testsuite/lib/libffi.exp               |  294 +-
> > > >  libffi/testsuite/libffi.bhaible/Makefile      |   28 +
> > > >  libffi/testsuite/libffi.bhaible/README        |   78 +
> > > >  libffi/testsuite/libffi.bhaible/alignof.h     |   50 +
> > > >  libffi/testsuite/libffi.bhaible/bhaible.exp   |   63 +
> > > >  libffi/testsuite/libffi.bhaible/test-call.c   | 1745 ++++
> > > >  .../testsuite/libffi.bhaible/test-callback.c  | 2885 ++++++
> > > >  libffi/testsuite/libffi.bhaible/testcases.c   |  747 ++
> > > >  libffi/testsuite/libffi.call/align_mixed.c    |   46 +
> > > >  libffi/testsuite/libffi.call/align_stdcall.c  |   46 +
> > > >  libffi/testsuite/libffi.call/call.exp         |   28 +-
> > > >  libffi/testsuite/libffi.call/cls_uchar_va.c   |   44 -
> > > >  libffi/testsuite/libffi.call/cls_ushort_va.c  |   44 -
> > > >  libffi/testsuite/libffi.call/ffitest.h        |   13 +-
> > > >  libffi/testsuite/libffi.call/float2.c         |   23 +-
> > > >  libffi/testsuite/libffi.call/offsets.c        |   46 +
> > > >  libffi/testsuite/libffi.call/struct10.c       |   57 +
> > > >  libffi/testsuite/libffi.call/va_1.c           |  120 +-
> > > >  libffi/testsuite/libffi.call/va_2.c           |  196 +
> > > >  libffi/testsuite/libffi.closures/closure.exp  |   67 +
> > > >  .../closure_fn0.c                             |    0
> > > >  .../closure_fn1.c                             |    0
> > > >  .../closure_fn2.c                             |    0
> > > >  .../closure_fn3.c                             |    0
> > > >  .../closure_fn4.c                             |    0
> > > >  .../closure_fn5.c                             |    0
> > > >  .../closure_fn6.c                             |    0
> > > >  .../closure_loc_fn0.c                         |    3 +
> > > >  .../closure_simple.c                          |    0
> > > >  .../cls_12byte.c                              |    0
> > > >  .../cls_16byte.c                              |    0
> > > >  .../cls_18byte.c                              |    0
> > > >  .../cls_19byte.c                              |    0
> > > >  .../cls_1_1byte.c                             |    0
> > > >  .../cls_20byte.c                              |    2 +-
> > > >  .../cls_20byte1.c                             |    2 +-
> > > >  .../cls_24byte.c                              |    6 +-
> > > >  .../cls_2byte.c                               |    0
> > > >  .../cls_3_1byte.c                             |    0
> > > >  .../cls_3byte1.c                              |    0
> > > >  .../cls_3byte2.c                              |    0
> > > >  libffi/testsuite/libffi.closures/cls_3float.c |   95 +
> > > >  .../cls_4_1byte.c                             |    0
> > > >  .../cls_4byte.c                               |    0
> > > >  .../cls_5_1_byte.c                            |    2 +-
> > > >  .../cls_5byte.c                               |    2 +-
> > > >  .../cls_64byte.c                              |    0
> > > >  .../cls_6_1_byte.c                            |    2 +-
> > > >  .../cls_6byte.c                               |    2 +-
> > > >  .../cls_7_1_byte.c                            |    2 +-
> > > >  .../cls_7byte.c                               |    2 +-
> > > >  .../cls_8byte.c                               |    0
> > > >  .../cls_9byte1.c                              |    2 +-
> > > >  .../cls_9byte2.c                              |    2 +-
> > > >  .../cls_align_double.c                        |    2 +-
> > > >  .../cls_align_float.c                         |    2 +-
> > > >  .../cls_align_longdouble.c                    |    2 +-
> > > >  .../cls_align_longdouble_split.c              |    2 +-
> > > >  .../cls_align_longdouble_split2.c             |    2 +-
> > > >  .../cls_align_pointer.c                       |    2 +-
> > > >  .../cls_align_sint16.c                        |    2 +-
> > > >  .../cls_align_sint32.c                        |    2 +-
> > > >  .../cls_align_sint64.c                        |    2 +-
> > > >  .../cls_align_uint16.c                        |    2 +-
> > > >  .../cls_align_uint32.c                        |    2 +-
> > > >  .../cls_align_uint64.c                        |    2 +-
> > > >  .../cls_dbls_struct.c                         |    6 +-
> > > >  .../cls_double.c                              |    0
> > > >  .../cls_double_va.c                           |    0
> > > >  .../cls_float.c                               |    0
> > > >  .../cls_longdouble.c                          |    0
> > > >  .../cls_longdouble_va.c                       |    0
> > > >  .../cls_many_mixed_args.c                     |    0
> > > >  .../cls_many_mixed_float_double.c             |    0
> > > >  .../cls_multi_schar.c                         |    2 +-
> > > >  .../cls_multi_sshort.c                        |    2 +-
> > > >  .../cls_multi_sshortchar.c                    |    2 +-
> > > >  .../cls_multi_uchar.c                         |    2 +-
> > > >  .../cls_multi_ushort.c                        |    2 +-
> > > >  .../cls_multi_ushortchar.c                    |    2 +-
> > > >  .../cls_pointer.c                             |    0
> > > >  .../cls_pointer_stack.c                       |    0
> > > >  .../cls_schar.c                               |    0
> > > >  .../cls_sint.c                                |    0
> > > >  .../cls_sshort.c                              |    0
> > > >  .../cls_struct_va1.c                          |    0
> > > >  .../cls_uchar.c                               |    0
> > > >  .../cls_uint.c                                |    0
> > > >  .../cls_uint_va.c                             |    0
> > > >  .../cls_ulong_va.c                            |    0
> > > >  .../cls_ulonglong.c                           |    0
> > > >  .../cls_ushort.c                              |    0
> > > >  .../err_bad_abi.c                             |    0
> > > >  libffi/testsuite/libffi.closures/ffitest.h    |  144 +
> > > >  .../huge_struct.c                             |    4 +-
> > > >  .../nested_struct.c                           |    2 +-
> > > >  .../nested_struct1.c                          |    2 +-
> > > >  .../nested_struct10.c                         |    1 +
> > > >  .../nested_struct11.c                         |    0
> > > >  .../libffi.closures/nested_struct12.c         |   86 +
> > > >  .../nested_struct13.c}                        |   14 +-
> > > >  .../nested_struct2.c                          |    2 +-
> > > >  .../nested_struct3.c                          |    2 +-
> > > >  .../nested_struct4.c                          |    0
> > > >  .../nested_struct5.c                          |    0
> > > >  .../nested_struct6.c                          |    0
> > > >  .../nested_struct7.c                          |    0
> > > >  .../nested_struct8.c                          |    0
> > > >  .../nested_struct9.c                          |    0
> > > >  .../problem1.c                                |    0
> > > >  .../libffi.closures/single_entry_structs1.c   |   86 +
> > > >  .../libffi.closures/single_entry_structs2.c   |  102 +
> > > >  .../libffi.closures/single_entry_structs3.c   |  101 +
> > > >  .../stret_large.c                             |    0
> > > >  .../stret_large2.c                            |    0
> > > >  .../stret_medium.c                            |    2 +-
> > > >  .../stret_medium2.c                           |    2 +-
> > > >  .../testclosure.c                             |    2 +-
> > > >  .../unwindtest.cc                             |   13 +-
> > > >  .../unwindtest_ffi_call.cc                    |    5 +-
> > > >  libffi/testsuite/libffi.go/static-chain.h     |    6 -
> > > >  libffi/testsuite/libffi.special/ffitestcxx.h  |   96 -
> > > >  libffi/testsuite/libffi.special/special.exp   |   35 -
> > > >  239 files changed, 24951 insertions(+), 6175 deletions(-)
> > > >  create mode 100644 libffi/.gitattributes
> > > >  create mode 100644 libffi/HOWTO_MERGE
> > > >  create mode 100644 libffi/LICENSE-BUILDTOOLS
> > > >  create mode 100644 libffi/MERGE
> > > >  delete mode 100644 libffi/README
> > > >  create mode 100644 libffi/README.md
> > > >  create mode 100755 libffi/autogen.sh
> > > >  create mode 100644 libffi/doc/Makefile.am
> > > >  mode change 100644 => 100755 libffi/generate-darwin-source-and-headers.py
> > > >  create mode 100644 libffi/include/tramp.h
> > > >  mode change 100644 => 100755 libffi/mdate-sh
> > > >  create mode 100755 libffi/merge.sh
> > > >  create mode 100644 libffi/src/aarch64/win64_armasm.S
> > > >  create mode 100644 libffi/src/arm/sysv_msvc_arm32.S
> > > >  create mode 100644 libffi/src/csky/ffi.c
> > > >  create mode 100644 libffi/src/csky/ffitarget.h
> > > >  create mode 100644 libffi/src/csky/sysv.S
> > > >  create mode 100644 libffi/src/kvx/asm.h
> > > >  create mode 100644 libffi/src/kvx/ffi.c
> > > >  create mode 100644 libffi/src/kvx/ffitarget.h
> > > >  create mode 100644 libffi/src/kvx/sysv.S
> > > >  create mode 100644 libffi/src/tramp.c
> > > >  create mode 100644 libffi/src/x86/asmnames.h
> > > >  delete mode 100644 libffi/src/x86/darwin.S
> > > >  delete mode 100644 libffi/src/x86/darwin64.S
> > > >  delete mode 100644 libffi/src/x86/darwin64_c.c
> > > >  delete mode 100644 libffi/src/x86/darwin_c.c
> > > >  create mode 100644 libffi/src/x86/sysv_intel.S
> > > >  create mode 100644 libffi/src/x86/win64_intel.S
> > > >  create mode 100644 libffi/testsuite/libffi.bhaible/Makefile
> > > >  create mode 100644 libffi/testsuite/libffi.bhaible/README
> > > >  create mode 100644 libffi/testsuite/libffi.bhaible/alignof.h
> > > >  create mode 100644 libffi/testsuite/libffi.bhaible/bhaible.exp
> > > >  create mode 100644 libffi/testsuite/libffi.bhaible/test-call.c
> > > >  create mode 100644 libffi/testsuite/libffi.bhaible/test-callback.c
> > > >  create mode 100644 libffi/testsuite/libffi.bhaible/testcases.c
> > > >  create mode 100644 libffi/testsuite/libffi.call/align_mixed.c
> > > >  create mode 100644 libffi/testsuite/libffi.call/align_stdcall.c
> > > >  delete mode 100644 libffi/testsuite/libffi.call/cls_uchar_va.c
> > > >  delete mode 100644 libffi/testsuite/libffi.call/cls_ushort_va.c
> > > >  create mode 100644 libffi/testsuite/libffi.call/offsets.c
> > > >  create mode 100644 libffi/testsuite/libffi.call/struct10.c
> > > >  create mode 100644 libffi/testsuite/libffi.call/va_2.c
> > > >  create mode 100644 libffi/testsuite/libffi.closures/closure.exp
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn0.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn1.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn2.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn3.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn4.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn5.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_fn6.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_loc_fn0.c (96%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/closure_simple.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_12byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_16byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_18byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_19byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_1_1byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_20byte1.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_24byte.c (95%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_2byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3_1byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte1.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_3byte2.c (100%)
> > > >  create mode 100644 libffi/testsuite/libffi.closures/cls_3float.c
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4_1byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_4byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5_1_byte.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_5byte.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_64byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6_1_byte.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_6byte.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7_1_byte.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_7byte.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_8byte.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte1.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_9byte2.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_double.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_float.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split.c (98%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_longdouble_split2.c (98%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_pointer.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint16.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint32.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_sint64.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint16.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint32.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_align_uint64.c (97%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_dbls_struct.c (92%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_double_va.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_float.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_longdouble_va.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_args.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_many_mixed_float_double.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_schar.c (96%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshort.c (96%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_sshortchar.c (96%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_uchar.c (96%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushort.c (95%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_multi_ushortchar.c (96%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_pointer_stack.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_schar.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sint.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_sshort.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_struct_va1.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uchar.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_uint_va.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulong_va.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ulonglong.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/cls_ushort.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/err_bad_abi.c (100%)
> > > >  create mode 100644 libffi/testsuite/libffi.closures/ffitest.h
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/huge_struct.c (99%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct.c (98%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct1.c (98%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct10.c (99%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct11.c (100%)
> > > >  create mode 100644 libffi/testsuite/libffi.closures/nested_struct12.c
> > > >  rename libffi/testsuite/{libffi.call/nested_struct12.c => libffi.closures/nested_struct13.c} (88%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct2.c (98%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct3.c (98%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct4.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct5.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct6.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct7.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct8.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/nested_struct9.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/problem1.c (100%)
> > > >  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs1.c
> > > >  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs2.c
> > > >  create mode 100644 libffi/testsuite/libffi.closures/single_entry_structs3.c
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_large2.c (100%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium.c (98%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/stret_medium2.c (98%)
> > > >  rename libffi/testsuite/{libffi.call => libffi.closures}/testclosure.c (95%)
> > > >  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest.cc (95%)
> > > >  rename libffi/testsuite/{libffi.special => libffi.closures}/unwindtest_ffi_call.cc (94%)
> > > >  delete mode 100644 libffi/testsuite/libffi.special/ffitestcxx.h
> > > >  delete mode 100644 libffi/testsuite/libffi.special/special.exp
> > > >
> > > > --
> > > > 2.31.1
> > > >
> >
> >
> >
> > --
> > H.J.



-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-13 13:42       ` H.J. Lu
@ 2021-10-16  0:06         ` H.J. Lu
  2021-10-16  0:22           ` David Edelsohn
  0 siblings, 1 reply; 27+ messages in thread
From: H.J. Lu @ 2021-10-16  0:06 UTC (permalink / raw)
  To: Richard Biener, David Edelsohn
  Cc: Ian Lance Taylor, GCC Patches, Jeff Law, Jakub Jelinek,
	DJ Delorie, Xi Ruoyao

On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> <richard.guenther@gmail.com> wrote:
> >
> > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > <richard.guenther@gmail.com> wrote:
> > > >
> > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > >
> > > > > Change in the v2 patch:
> > > > >
> > > > > 1. Disable static trampolines by default.
> > > > >
> > > > >
> > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > has been changed significantly with new features, bug fixes and new target
> > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > make it easier to sync with libffi upstream:
> > > > >
> > > > > 1. Document how to sync with upstream.
> > > > > 2. Add scripts to help sync with upstream.
> > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > >
> > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > 4. Integrate libffi build and testsuite with GCC.
> > > >
> > > > How did you test this?  It looks like libgo is the only consumer of
> > > > libffi these days.
> > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > darwin/windows - did you test cross and canadian configurations?
> > >
> > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > the upstream libffi works on Darwin and Windows.
> > >
> > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > of this massive diff.
> > >
> > > I believe that it should just work.  Our libffi is very much out of date.
> >
> > Yes, you can hope.  And yes, our libffi is out of date.
> >
> > Can you please do the extra step to test one weird architecture, namely
> > powerpc64-aix which is available on the compile-farm?
>
> I will give it a try and report back.
>
> > If that goes well I think it's good to "hope" at this point (and plenty of
> > time to fix fallout until the GCC 12 release).
> >
> > Thus OK after the extra testing dance and waiting until early next
> > week so others can throw in a veto.

I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:

*  MT/MODEL: 8284-22A                                                         *
* Partition: gcc119                                                           *
*    System: power8-aix.osuosl.org                                            *
*       O/S: AIX V7.2 7200-04-03-2038

I configured GCC with

--with-as=/usr/bin/as --with-ld=/usr/bin/ld
--enable-version-specific-runtime-libs --disable-nls
--enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
--enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
--with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
--with-local-prefix=/opt/freeware --enable-languages=c,c++,go

I got

g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
-Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
    build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
4.0/libiberty/libiberty.a
ld: 0711-317 ERROR: Undefined symbol: lexer_line
ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
ld: 0711-317 ERROR: Undefined symbol: .yyend()
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status
Makefile:3000: recipe for target 'build/gengtype' failed
gmake[5]: *** [build/gengtype] Error 1

David, is there an instruction to bootstrap GCC on AIX?

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16  0:06         ` H.J. Lu
@ 2021-10-16  0:22           ` David Edelsohn
  2021-10-16 11:48             ` H.J. Lu
  0 siblings, 1 reply; 27+ messages in thread
From: David Edelsohn @ 2021-10-16  0:22 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > <richard.guenther@gmail.com> wrote:
> > >
> > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >
> > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > <richard.guenther@gmail.com> wrote:
> > > > >
> > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > >
> > > > > > Change in the v2 patch:
> > > > > >
> > > > > > 1. Disable static trampolines by default.
> > > > > >
> > > > > >
> > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > make it easier to sync with libffi upstream:
> > > > > >
> > > > > > 1. Document how to sync with upstream.
> > > > > > 2. Add scripts to help sync with upstream.
> > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > >
> > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > >
> > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > libffi these days.
> > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > darwin/windows - did you test cross and canadian configurations?
> > > >
> > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > the upstream libffi works on Darwin and Windows.
> > > >
> > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > of this massive diff.
> > > >
> > > > I believe that it should just work.  Our libffi is very much out of date.
> > >
> > > Yes, you can hope.  And yes, our libffi is out of date.
> > >
> > > Can you please do the extra step to test one weird architecture, namely
> > > powerpc64-aix which is available on the compile-farm?
> >
> > I will give it a try and report back.
> >
> > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > time to fix fallout until the GCC 12 release).
> > >
> > > Thus OK after the extra testing dance and waiting until early next
> > > week so others can throw in a veto.
>
> I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
>
> *  MT/MODEL: 8284-22A                                                         *
> * Partition: gcc119                                                           *
> *    System: power8-aix.osuosl.org                                            *
> *       O/S: AIX V7.2 7200-04-03-2038
>
> I configured GCC with
>
> --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> --enable-version-specific-runtime-libs --disable-nls
> --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
>
> I got
>
> g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
>     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> 4.0/libiberty/libiberty.a
> ld: 0711-317 ERROR: Undefined symbol: lexer_line
> ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> ld: 0711-317 ERROR: Undefined symbol: .yyend()
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> collect2: error: ld returned 8 exit status
> Makefile:3000: recipe for target 'build/gengtype' failed
> gmake[5]: *** [build/gengtype] Error 1
>
> David, is there an instruction to bootstrap GCC on AIX?

The CompileFarm page in the GCC wiki has instructions under "build tips":

https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines

The error that you show might be due to not having /opt/freeware/bin
first in your path and the bootstrap used the AIX version of lex or
sed or some other command.

Thanks, David

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16  0:22           ` David Edelsohn
@ 2021-10-16 11:48             ` H.J. Lu
  2021-10-16 17:04               ` David Edelsohn
  0 siblings, 1 reply; 27+ messages in thread
From: H.J. Lu @ 2021-10-16 11:48 UTC (permalink / raw)
  To: David Edelsohn
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>
> On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > <richard.guenther@gmail.com> wrote:
> > > >
> > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > >
> > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > <richard.guenther@gmail.com> wrote:
> > > > > >
> > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > >
> > > > > > > Change in the v2 patch:
> > > > > > >
> > > > > > > 1. Disable static trampolines by default.
> > > > > > >
> > > > > > >
> > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > make it easier to sync with libffi upstream:
> > > > > > >
> > > > > > > 1. Document how to sync with upstream.
> > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > >
> > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > >
> > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > libffi these days.
> > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > >
> > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > the upstream libffi works on Darwin and Windows.
> > > > >
> > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > of this massive diff.
> > > > >
> > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > >
> > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > >
> > > > Can you please do the extra step to test one weird architecture, namely
> > > > powerpc64-aix which is available on the compile-farm?
> > >
> > > I will give it a try and report back.
> > >
> > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > time to fix fallout until the GCC 12 release).
> > > >
> > > > Thus OK after the extra testing dance and waiting until early next
> > > > week so others can throw in a veto.
> >
> > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> >
> > *  MT/MODEL: 8284-22A                                                         *
> > * Partition: gcc119                                                           *
> > *    System: power8-aix.osuosl.org                                            *
> > *       O/S: AIX V7.2 7200-04-03-2038
> >
> > I configured GCC with
> >
> > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > --enable-version-specific-runtime-libs --disable-nls
> > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> >
> > I got
> >
> > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > 4.0/libiberty/libiberty.a
> > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > collect2: error: ld returned 8 exit status
> > Makefile:3000: recipe for target 'build/gengtype' failed
> > gmake[5]: *** [build/gengtype] Error 1
> >
> > David, is there an instruction to bootstrap GCC on AIX?
>
> The CompileFarm page in the GCC wiki has instructions under "build tips":
>
> https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
>
> The error that you show might be due to not having /opt/freeware/bin
> first in your path and the bootstrap used the AIX version of lex or
> sed or some other command.
>

Hi David,

I made some progress.  I am trying to verify my libffi sync branch:

https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master

on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
suggestion is

.../src/configure --disable-werror --enable-languages=c,c++
--with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
--disable-libstdcxx-pch --with-included-gettext

When I added Go with --enable-languages=c,c++,go, I got

/opt/freeware/bin/bash: missing-objcopy: command not found
/opt/freeware/bin/bash: missing-objcopy: command not found
/opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
cfg.go.tmp buildcfg.go
mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
der.gox:
             A file or directory in the path name does not exist.
mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
/atomic.gox:
             A file or directory in the path name does not exist.
mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
             A file or directory in the path name does not exist.
Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1

Is Go supported on AIX? If yes, what did I do wrong?

-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16 11:48             ` H.J. Lu
@ 2021-10-16 17:04               ` David Edelsohn
  2021-10-16 17:13                 ` H.J. Lu
  0 siblings, 1 reply; 27+ messages in thread
From: David Edelsohn @ 2021-10-16 17:04 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Sat, Oct 16, 2021 at 7:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> >
> > On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >
> > > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > > <richard.guenther@gmail.com> wrote:
> > > > >
> > > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > >
> > > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > >
> > > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Change in the v2 patch:
> > > > > > > >
> > > > > > > > 1. Disable static trampolines by default.
> > > > > > > >
> > > > > > > >
> > > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > > make it easier to sync with libffi upstream:
> > > > > > > >
> > > > > > > > 1. Document how to sync with upstream.
> > > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > > >
> > > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > > >
> > > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > > libffi these days.
> > > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > > >
> > > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > > the upstream libffi works on Darwin and Windows.
> > > > > >
> > > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > > of this massive diff.
> > > > > >
> > > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > > >
> > > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > > >
> > > > > Can you please do the extra step to test one weird architecture, namely
> > > > > powerpc64-aix which is available on the compile-farm?
> > > >
> > > > I will give it a try and report back.
> > > >
> > > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > > time to fix fallout until the GCC 12 release).
> > > > >
> > > > > Thus OK after the extra testing dance and waiting until early next
> > > > > week so others can throw in a veto.
> > >
> > > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> > >
> > > *  MT/MODEL: 8284-22A                                                         *
> > > * Partition: gcc119                                                           *
> > > *    System: power8-aix.osuosl.org                                            *
> > > *       O/S: AIX V7.2 7200-04-03-2038
> > >
> > > I configured GCC with
> > >
> > > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > > --enable-version-specific-runtime-libs --disable-nls
> > > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> > >
> > > I got
> > >
> > > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> > >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > > 4.0/libiberty/libiberty.a
> > > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > > collect2: error: ld returned 8 exit status
> > > Makefile:3000: recipe for target 'build/gengtype' failed
> > > gmake[5]: *** [build/gengtype] Error 1
> > >
> > > David, is there an instruction to bootstrap GCC on AIX?
> >
> > The CompileFarm page in the GCC wiki has instructions under "build tips":
> >
> > https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> >
> > The error that you show might be due to not having /opt/freeware/bin
> > first in your path and the bootstrap used the AIX version of lex or
> > sed or some other command.
> >
>
> Hi David,
>
> I made some progress.  I am trying to verify my libffi sync branch:
>
> https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
>
> on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
> suggestion is
>
> .../src/configure --disable-werror --enable-languages=c,c++
> --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> --disable-libstdcxx-pch --with-included-gettext
>
> When I added Go with --enable-languages=c,c++,go, I got
>
> /opt/freeware/bin/bash: missing-objcopy: command not found
> /opt/freeware/bin/bash: missing-objcopy: command not found
> /opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
> cfg.go.tmp buildcfg.go
> mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
> der.gox:
>              A file or directory in the path name does not exist.
> mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
> /atomic.gox:
>              A file or directory in the path name does not exist.
> mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
>              A file or directory in the path name does not exist.
> Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
> gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1
>
> Is Go supported on AIX? If yes, what did I do wrong?

I believe that GCC Go works on AIX, but I have not been testing it
regularly.  There was more focus on GCC Go for AIX prior to the Golang
port to AIX.

It looks like the problem is that the objcopy command is not
installed.  There have been various issues with Binutils on AIX.  I'm
not certain if GCC Go had relied on objcopy or not.

Thanks, David

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16 17:04               ` David Edelsohn
@ 2021-10-16 17:13                 ` H.J. Lu
  2021-10-16 19:21                   ` Ian Lance Taylor
  2021-10-16 19:53                   ` David Edelsohn
  0 siblings, 2 replies; 27+ messages in thread
From: H.J. Lu @ 2021-10-16 17:13 UTC (permalink / raw)
  To: David Edelsohn
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Sat, Oct 16, 2021 at 10:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
>
> On Sat, Oct 16, 2021 at 7:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > >
> > > On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >
> > > > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > >
> > > > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > > > <richard.guenther@gmail.com> wrote:
> > > > > >
> > > > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > >
> > > > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > >
> > > > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > Change in the v2 patch:
> > > > > > > > >
> > > > > > > > > 1. Disable static trampolines by default.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > > > make it easier to sync with libffi upstream:
> > > > > > > > >
> > > > > > > > > 1. Document how to sync with upstream.
> > > > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > > > >
> > > > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > > > >
> > > > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > > > libffi these days.
> > > > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > > > >
> > > > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > > > the upstream libffi works on Darwin and Windows.
> > > > > > >
> > > > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > > > of this massive diff.
> > > > > > >
> > > > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > > > >
> > > > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > > > >
> > > > > > Can you please do the extra step to test one weird architecture, namely
> > > > > > powerpc64-aix which is available on the compile-farm?
> > > > >
> > > > > I will give it a try and report back.
> > > > >
> > > > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > > > time to fix fallout until the GCC 12 release).
> > > > > >
> > > > > > Thus OK after the extra testing dance and waiting until early next
> > > > > > week so others can throw in a veto.
> > > >
> > > > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> > > >
> > > > *  MT/MODEL: 8284-22A                                                         *
> > > > * Partition: gcc119                                                           *
> > > > *    System: power8-aix.osuosl.org                                            *
> > > > *       O/S: AIX V7.2 7200-04-03-2038
> > > >
> > > > I configured GCC with
> > > >
> > > > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > > > --enable-version-specific-runtime-libs --disable-nls
> > > > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > > > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > > > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > > > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> > > >
> > > > I got
> > > >
> > > > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > > > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > > > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > > > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > > > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> > > >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > > > 4.0/libiberty/libiberty.a
> > > > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > > > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > > > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > > > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > > > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > > > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > > > collect2: error: ld returned 8 exit status
> > > > Makefile:3000: recipe for target 'build/gengtype' failed
> > > > gmake[5]: *** [build/gengtype] Error 1
> > > >
> > > > David, is there an instruction to bootstrap GCC on AIX?
> > >
> > > The CompileFarm page in the GCC wiki has instructions under "build tips":
> > >
> > > https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> > >
> > > The error that you show might be due to not having /opt/freeware/bin
> > > first in your path and the bootstrap used the AIX version of lex or
> > > sed or some other command.
> > >
> >
> > Hi David,
> >
> > I made some progress.  I am trying to verify my libffi sync branch:
> >
> > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
> >
> > on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
> > suggestion is
> >
> > .../src/configure --disable-werror --enable-languages=c,c++
> > --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> > --disable-libstdcxx-pch --with-included-gettext
> >
> > When I added Go with --enable-languages=c,c++,go, I got
> >
> > /opt/freeware/bin/bash: missing-objcopy: command not found
> > /opt/freeware/bin/bash: missing-objcopy: command not found
> > /opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
> > cfg.go.tmp buildcfg.go
> > mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
> > der.gox:
> >              A file or directory in the path name does not exist.
> > mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
> > /atomic.gox:
> >              A file or directory in the path name does not exist.
> > mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
> >              A file or directory in the path name does not exist.
> > Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
> > gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1
> >
> > Is Go supported on AIX? If yes, what did I do wrong?
>
> I believe that GCC Go works on AIX, but I have not been testing it
> regularly.  There was more focus on GCC Go for AIX prior to the Golang
> port to AIX.
>
> It looks like the problem is that the objcopy command is not
> installed.  There have been various issues with Binutils on AIX.  I'm
> not certain if GCC Go had relied on objcopy or not.
>

Hi Richard,

Go on master branch isn't buildable on AIX.  What should I do
next to get my libffi sync patches into master branch?

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16 17:13                 ` H.J. Lu
@ 2021-10-16 19:21                   ` Ian Lance Taylor
  2021-10-16 19:53                   ` David Edelsohn
  1 sibling, 0 replies; 27+ messages in thread
From: Ian Lance Taylor @ 2021-10-16 19:21 UTC (permalink / raw)
  To: H.J. Lu; +Cc: David Edelsohn, Jakub Jelinek, GCC Patches

On Sat, Oct 16, 2021 at 10:14 AM H.J. Lu via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Go on master branch isn't buildable on AIX.  What should I do
> next to get my libffi sync patches into master branch?

Is the only problem you are having the missing-objcopy problem?  To
fix that one, install the GNU binutils.

There are people who regularly use gccgo on AIX and send fixes for it,
I don't think it could be very badly broken.

Ian

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16 17:13                 ` H.J. Lu
  2021-10-16 19:21                   ` Ian Lance Taylor
@ 2021-10-16 19:53                   ` David Edelsohn
  2021-10-16 19:58                     ` H.J. Lu
  1 sibling, 1 reply; 27+ messages in thread
From: David Edelsohn @ 2021-10-16 19:53 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Sat, Oct 16, 2021 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Sat, Oct 16, 2021 at 10:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
> >
> > On Sat, Oct 16, 2021 at 7:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > >
> > > > On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > >
> > > > > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > >
> > > > > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > >
> > > > > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > >
> > > > > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > Change in the v2 patch:
> > > > > > > > > >
> > > > > > > > > > 1. Disable static trampolines by default.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > > > > make it easier to sync with libffi upstream:
> > > > > > > > > >
> > > > > > > > > > 1. Document how to sync with upstream.
> > > > > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > > > > >
> > > > > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > > > > >
> > > > > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > > > > libffi these days.
> > > > > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > > > > >
> > > > > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > > > > the upstream libffi works on Darwin and Windows.
> > > > > > > >
> > > > > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > > > > of this massive diff.
> > > > > > > >
> > > > > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > > > > >
> > > > > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > > > > >
> > > > > > > Can you please do the extra step to test one weird architecture, namely
> > > > > > > powerpc64-aix which is available on the compile-farm?
> > > > > >
> > > > > > I will give it a try and report back.
> > > > > >
> > > > > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > > > > time to fix fallout until the GCC 12 release).
> > > > > > >
> > > > > > > Thus OK after the extra testing dance and waiting until early next
> > > > > > > week so others can throw in a veto.
> > > > >
> > > > > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> > > > >
> > > > > *  MT/MODEL: 8284-22A                                                         *
> > > > > * Partition: gcc119                                                           *
> > > > > *    System: power8-aix.osuosl.org                                            *
> > > > > *       O/S: AIX V7.2 7200-04-03-2038
> > > > >
> > > > > I configured GCC with
> > > > >
> > > > > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > > > > --enable-version-specific-runtime-libs --disable-nls
> > > > > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > > > > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > > > > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > > > > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> > > > >
> > > > > I got
> > > > >
> > > > > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > > > > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > > > > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > > > > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > > > > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> > > > >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > > > > 4.0/libiberty/libiberty.a
> > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > > > > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > > > > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > > > > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > > > > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > > > > collect2: error: ld returned 8 exit status
> > > > > Makefile:3000: recipe for target 'build/gengtype' failed
> > > > > gmake[5]: *** [build/gengtype] Error 1
> > > > >
> > > > > David, is there an instruction to bootstrap GCC on AIX?
> > > >
> > > > The CompileFarm page in the GCC wiki has instructions under "build tips":
> > > >
> > > > https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> > > >
> > > > The error that you show might be due to not having /opt/freeware/bin
> > > > first in your path and the bootstrap used the AIX version of lex or
> > > > sed or some other command.
> > > >
> > >
> > > Hi David,
> > >
> > > I made some progress.  I am trying to verify my libffi sync branch:
> > >
> > > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
> > >
> > > on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
> > > suggestion is
> > >
> > > .../src/configure --disable-werror --enable-languages=c,c++
> > > --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> > > --disable-libstdcxx-pch --with-included-gettext
> > >
> > > When I added Go with --enable-languages=c,c++,go, I got
> > >
> > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > /opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
> > > cfg.go.tmp buildcfg.go
> > > mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
> > > der.gox:
> > >              A file or directory in the path name does not exist.
> > > mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
> > > /atomic.gox:
> > >              A file or directory in the path name does not exist.
> > > mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
> > >              A file or directory in the path name does not exist.
> > > Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
> > > gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1
> > >
> > > Is Go supported on AIX? If yes, what did I do wrong?
> >
> > I believe that GCC Go works on AIX, but I have not been testing it
> > regularly.  There was more focus on GCC Go for AIX prior to the Golang
> > port to AIX.
> >
> > It looks like the problem is that the objcopy command is not
> > installed.  There have been various issues with Binutils on AIX.  I'm
> > not certain if GCC Go had relied on objcopy or not.
> >
>
> Hi Richard,
>
> Go on master branch isn't buildable on AIX.  What should I do
> next to get my libffi sync patches into master branch?

H.J.,

You have mischaracterized and misrepresented the issue.  No one stated
that GCC Go is not buildable, only that GCC Go requires objcopy, which
is not currently installed on gcc119.

Thanks, David

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16 19:53                   ` David Edelsohn
@ 2021-10-16 19:58                     ` H.J. Lu
  2021-10-16 20:07                       ` David Edelsohn
  2021-10-18 15:04                       ` David Edelsohn
  0 siblings, 2 replies; 27+ messages in thread
From: H.J. Lu @ 2021-10-16 19:58 UTC (permalink / raw)
  To: David Edelsohn
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Sat, Oct 16, 2021 at 12:53 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>
> On Sat, Oct 16, 2021 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Sat, Oct 16, 2021 at 10:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
> > >
> > > On Sat, Oct 16, 2021 at 7:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >
> > > > On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > > >
> > > > > On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > >
> > > > > > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > >
> > > > > > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > >
> > > > > > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Change in the v2 patch:
> > > > > > > > > > >
> > > > > > > > > > > 1. Disable static trampolines by default.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > > > > > make it easier to sync with libffi upstream:
> > > > > > > > > > >
> > > > > > > > > > > 1. Document how to sync with upstream.
> > > > > > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > > > > > >
> > > > > > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > > > > > >
> > > > > > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > > > > > libffi these days.
> > > > > > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > > > > > >
> > > > > > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > > > > > the upstream libffi works on Darwin and Windows.
> > > > > > > > >
> > > > > > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > > > > > of this massive diff.
> > > > > > > > >
> > > > > > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > > > > > >
> > > > > > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > > > > > >
> > > > > > > > Can you please do the extra step to test one weird architecture, namely
> > > > > > > > powerpc64-aix which is available on the compile-farm?
> > > > > > >
> > > > > > > I will give it a try and report back.
> > > > > > >
> > > > > > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > > > > > time to fix fallout until the GCC 12 release).
> > > > > > > >
> > > > > > > > Thus OK after the extra testing dance and waiting until early next
> > > > > > > > week so others can throw in a veto.
> > > > > >
> > > > > > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> > > > > >
> > > > > > *  MT/MODEL: 8284-22A                                                         *
> > > > > > * Partition: gcc119                                                           *
> > > > > > *    System: power8-aix.osuosl.org                                            *
> > > > > > *       O/S: AIX V7.2 7200-04-03-2038
> > > > > >
> > > > > > I configured GCC with
> > > > > >
> > > > > > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > > > > > --enable-version-specific-runtime-libs --disable-nls
> > > > > > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > > > > > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > > > > > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > > > > > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> > > > > >
> > > > > > I got
> > > > > >
> > > > > > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > > > > > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > > > > > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > > > > > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > > > > > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> > > > > >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > > > > > 4.0/libiberty/libiberty.a
> > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > > > > > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > > > > > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > > > > > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > > > > > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > > > > > collect2: error: ld returned 8 exit status
> > > > > > Makefile:3000: recipe for target 'build/gengtype' failed
> > > > > > gmake[5]: *** [build/gengtype] Error 1
> > > > > >
> > > > > > David, is there an instruction to bootstrap GCC on AIX?
> > > > >
> > > > > The CompileFarm page in the GCC wiki has instructions under "build tips":
> > > > >
> > > > > https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> > > > >
> > > > > The error that you show might be due to not having /opt/freeware/bin
> > > > > first in your path and the bootstrap used the AIX version of lex or
> > > > > sed or some other command.
> > > > >
> > > >
> > > > Hi David,
> > > >
> > > > I made some progress.  I am trying to verify my libffi sync branch:
> > > >
> > > > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
> > > >
> > > > on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
> > > > suggestion is
> > > >
> > > > .../src/configure --disable-werror --enable-languages=c,c++
> > > > --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> > > > --disable-libstdcxx-pch --with-included-gettext
> > > >
> > > > When I added Go with --enable-languages=c,c++,go, I got
> > > >
> > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > /opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
> > > > cfg.go.tmp buildcfg.go
> > > > mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
> > > > der.gox:
> > > >              A file or directory in the path name does not exist.
> > > > mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
> > > > /atomic.gox:
> > > >              A file or directory in the path name does not exist.
> > > > mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
> > > >              A file or directory in the path name does not exist.
> > > > Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
> > > > gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1
> > > >
> > > > Is Go supported on AIX? If yes, what did I do wrong?
> > >
> > > I believe that GCC Go works on AIX, but I have not been testing it
> > > regularly.  There was more focus on GCC Go for AIX prior to the Golang
> > > port to AIX.
> > >
> > > It looks like the problem is that the objcopy command is not
> > > installed.  There have been various issues with Binutils on AIX.  I'm
> > > not certain if GCC Go had relied on objcopy or not.
> > >
> >
> > Hi Richard,
> >
> > Go on master branch isn't buildable on AIX.  What should I do
> > next to get my libffi sync patches into master branch?
>
> H.J.,
>
> You have mischaracterized and misrepresented the issue.  No one stated
> that GCC Go is not buildable, only that GCC Go requires objcopy, which
> is not currently installed on gcc119.
>
> Thanks, David

I installed GNU binutils and got


/home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
error: ./internal/unsafeheader.gox exists but does not contain any Go
export data
   17 |         "internal/unsafeheader"
      |                              ^
/home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
error: internal/unsafeheader.gox exists but does not contain any Go
export data
/home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
error: import file 'internal/unsafeheader' not found
/home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:42:
error: reference to undefined name 'unsafeheader'
  146 |                         ptr :=
(*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
      |                                          ^
/home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:41:
error: expected pointer
  146 |                         ptr :=
(*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
      |                                         ^
gmake[8]: Entering directory
'/home/hjl/work/build/gnu/tools-build/gcc-gitlab/build-powerpc64-aix7.2/powerpc-ibm-aix7.2.4.0/pthread/libgo'
f="internal/itoa.o"; if test ! -f $f; then f="internal/.libs/itoa.o";
fi; objcopy -j .go_export $f internal/itoa.s-gox.tmp;
/opt/freeware/bin/bash
/home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh
internal/itoa.s-gox.tmp `echo internal/itoa.s-gox | sed -e
's/s-gox/gox/'`
echo timestamp > internal/itoa.s-gox
Makefile:3019: recipe for target 'hash/maphash.lo' failed
gmake[6]: *** [hash/maphash.lo] Error 1

and there were more errors like this.

-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16 19:58                     ` H.J. Lu
@ 2021-10-16 20:07                       ` David Edelsohn
  2021-10-17 13:26                         ` H.J. Lu
  2021-10-18 15:04                       ` David Edelsohn
  1 sibling, 1 reply; 27+ messages in thread
From: David Edelsohn @ 2021-10-16 20:07 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Sat, Oct 16, 2021 at 3:59 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Sat, Oct 16, 2021 at 12:53 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> >
> > On Sat, Oct 16, 2021 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Sat, Oct 16, 2021 at 10:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > >
> > > > On Sat, Oct 16, 2021 at 7:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > >
> > > > > On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > > > >
> > > > > > On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > >
> > > > > > > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > >
> > > > > > > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Change in the v2 patch:
> > > > > > > > > > > >
> > > > > > > > > > > > 1. Disable static trampolines by default.
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > > > > > > make it easier to sync with libffi upstream:
> > > > > > > > > > > >
> > > > > > > > > > > > 1. Document how to sync with upstream.
> > > > > > > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > > > > > > >
> > > > > > > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > > > > > > >
> > > > > > > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > > > > > > libffi these days.
> > > > > > > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > > > > > > >
> > > > > > > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > > > > > > the upstream libffi works on Darwin and Windows.
> > > > > > > > > >
> > > > > > > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > > > > > > of this massive diff.
> > > > > > > > > >
> > > > > > > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > > > > > > >
> > > > > > > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > > > > > > >
> > > > > > > > > Can you please do the extra step to test one weird architecture, namely
> > > > > > > > > powerpc64-aix which is available on the compile-farm?
> > > > > > > >
> > > > > > > > I will give it a try and report back.
> > > > > > > >
> > > > > > > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > > > > > > time to fix fallout until the GCC 12 release).
> > > > > > > > >
> > > > > > > > > Thus OK after the extra testing dance and waiting until early next
> > > > > > > > > week so others can throw in a veto.
> > > > > > >
> > > > > > > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> > > > > > >
> > > > > > > *  MT/MODEL: 8284-22A                                                         *
> > > > > > > * Partition: gcc119                                                           *
> > > > > > > *    System: power8-aix.osuosl.org                                            *
> > > > > > > *       O/S: AIX V7.2 7200-04-03-2038
> > > > > > >
> > > > > > > I configured GCC with
> > > > > > >
> > > > > > > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > > > > > > --enable-version-specific-runtime-libs --disable-nls
> > > > > > > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > > > > > > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > > > > > > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > > > > > > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> > > > > > >
> > > > > > > I got
> > > > > > >
> > > > > > > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > > > > > > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > > > > > > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > > > > > > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > > > > > > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> > > > > > >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > > > > > > 4.0/libiberty/libiberty.a
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > > > > > > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > > > > > > collect2: error: ld returned 8 exit status
> > > > > > > Makefile:3000: recipe for target 'build/gengtype' failed
> > > > > > > gmake[5]: *** [build/gengtype] Error 1
> > > > > > >
> > > > > > > David, is there an instruction to bootstrap GCC on AIX?
> > > > > >
> > > > > > The CompileFarm page in the GCC wiki has instructions under "build tips":
> > > > > >
> > > > > > https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> > > > > >
> > > > > > The error that you show might be due to not having /opt/freeware/bin
> > > > > > first in your path and the bootstrap used the AIX version of lex or
> > > > > > sed or some other command.
> > > > > >
> > > > >
> > > > > Hi David,
> > > > >
> > > > > I made some progress.  I am trying to verify my libffi sync branch:
> > > > >
> > > > > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
> > > > >
> > > > > on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
> > > > > suggestion is
> > > > >
> > > > > .../src/configure --disable-werror --enable-languages=c,c++
> > > > > --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> > > > > --disable-libstdcxx-pch --with-included-gettext
> > > > >
> > > > > When I added Go with --enable-languages=c,c++,go, I got
> > > > >
> > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > /opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
> > > > > cfg.go.tmp buildcfg.go
> > > > > mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
> > > > > der.gox:
> > > > >              A file or directory in the path name does not exist.
> > > > > mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
> > > > > /atomic.gox:
> > > > >              A file or directory in the path name does not exist.
> > > > > mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
> > > > >              A file or directory in the path name does not exist.
> > > > > Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
> > > > > gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1
> > > > >
> > > > > Is Go supported on AIX? If yes, what did I do wrong?
> > > >
> > > > I believe that GCC Go works on AIX, but I have not been testing it
> > > > regularly.  There was more focus on GCC Go for AIX prior to the Golang
> > > > port to AIX.
> > > >
> > > > It looks like the problem is that the objcopy command is not
> > > > installed.  There have been various issues with Binutils on AIX.  I'm
> > > > not certain if GCC Go had relied on objcopy or not.
> > > >
> > >
> > > Hi Richard,
> > >
> > > Go on master branch isn't buildable on AIX.  What should I do
> > > next to get my libffi sync patches into master branch?
> >
> > H.J.,
> >
> > You have mischaracterized and misrepresented the issue.  No one stated
> > that GCC Go is not buildable, only that GCC Go requires objcopy, which
> > is not currently installed on gcc119.
> >
> > Thanks, David
>
> I installed GNU binutils and got
>
>
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> error: ./internal/unsafeheader.gox exists but does not contain any Go
> export data
>    17 |         "internal/unsafeheader"
>       |                              ^
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> error: internal/unsafeheader.gox exists but does not contain any Go
> export data
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> error: import file 'internal/unsafeheader' not found
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:42:
> error: reference to undefined name 'unsafeheader'
>   146 |                         ptr :=
> (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
>       |                                          ^
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:41:
> error: expected pointer
>   146 |                         ptr :=
> (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
>       |                                         ^
> gmake[8]: Entering directory
> '/home/hjl/work/build/gnu/tools-build/gcc-gitlab/build-powerpc64-aix7.2/powerpc-ibm-aix7.2.4.0/pthread/libgo'
> f="internal/itoa.o"; if test ! -f $f; then f="internal/.libs/itoa.o";
> fi; objcopy -j .go_export $f internal/itoa.s-gox.tmp;
> /opt/freeware/bin/bash
> /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh
> internal/itoa.s-gox.tmp `echo internal/itoa.s-gox | sed -e
> 's/s-gox/gox/'`
> echo timestamp > internal/itoa.s-gox
> Makefile:3019: recipe for target 'hash/maphash.lo' failed
> gmake[6]: *** [hash/maphash.lo] Error 1
>
> and there were more errors like this.

I have asked my colleagues who work on Go for AIX about the status. I
will let you know when I receive a reply.

libffi trunk works on AIX.

Is Go the only usage of libffi within GCC?  If so, then it seems that
the issue for the AIX build of GCC is to ensure that the update of
libffi doesn't break the rest of the build and that the in-tree build
of libffi succeeds.  Does the in-tree build of libffi pass its
self-tests, or at least the same results as libffi out of the tree?

Thanks, David

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16 20:07                       ` David Edelsohn
@ 2021-10-17 13:26                         ` H.J. Lu
  0 siblings, 0 replies; 27+ messages in thread
From: H.J. Lu @ 2021-10-17 13:26 UTC (permalink / raw)
  To: David Edelsohn
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Sat, Oct 16, 2021 at 1:07 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>
> On Sat, Oct 16, 2021 at 3:59 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Sat, Oct 16, 2021 at 12:53 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > >
> > > On Sat, Oct 16, 2021 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >
> > > > On Sat, Oct 16, 2021 at 10:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > > >
> > > > > On Sat, Oct 16, 2021 at 7:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > >
> > > > > > On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > > > > >
> > > > > > > On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > >
> > > > > > > > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > Change in the v2 patch:
> > > > > > > > > > > > >
> > > > > > > > > > > > > 1. Disable static trampolines by default.
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > > > > > > > make it easier to sync with libffi upstream:
> > > > > > > > > > > > >
> > > > > > > > > > > > > 1. Document how to sync with upstream.
> > > > > > > > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > > > > > > > >
> > > > > > > > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > > > > > > > >
> > > > > > > > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > > > > > > > libffi these days.
> > > > > > > > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > > > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > > > > > > > >
> > > > > > > > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > > > > > > > the upstream libffi works on Darwin and Windows.
> > > > > > > > > > >
> > > > > > > > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > > > > > > > of this massive diff.
> > > > > > > > > > >
> > > > > > > > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > > > > > > > >
> > > > > > > > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > > > > > > > >
> > > > > > > > > > Can you please do the extra step to test one weird architecture, namely
> > > > > > > > > > powerpc64-aix which is available on the compile-farm?
> > > > > > > > >
> > > > > > > > > I will give it a try and report back.
> > > > > > > > >
> > > > > > > > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > > > > > > > time to fix fallout until the GCC 12 release).
> > > > > > > > > >
> > > > > > > > > > Thus OK after the extra testing dance and waiting until early next
> > > > > > > > > > week so others can throw in a veto.
> > > > > > > >
> > > > > > > > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> > > > > > > >
> > > > > > > > *  MT/MODEL: 8284-22A                                                         *
> > > > > > > > * Partition: gcc119                                                           *
> > > > > > > > *    System: power8-aix.osuosl.org                                            *
> > > > > > > > *       O/S: AIX V7.2 7200-04-03-2038
> > > > > > > >
> > > > > > > > I configured GCC with
> > > > > > > >
> > > > > > > > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > > > > > > > --enable-version-specific-runtime-libs --disable-nls
> > > > > > > > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > > > > > > > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > > > > > > > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > > > > > > > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> > > > > > > >
> > > > > > > > I got
> > > > > > > >
> > > > > > > > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > > > > > > > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > > > > > > > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > > > > > > > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > > > > > > > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> > > > > > > >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > > > > > > > 4.0/libiberty/libiberty.a
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > > > > > > > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > > > > > > > collect2: error: ld returned 8 exit status
> > > > > > > > Makefile:3000: recipe for target 'build/gengtype' failed
> > > > > > > > gmake[5]: *** [build/gengtype] Error 1
> > > > > > > >
> > > > > > > > David, is there an instruction to bootstrap GCC on AIX?
> > > > > > >
> > > > > > > The CompileFarm page in the GCC wiki has instructions under "build tips":
> > > > > > >
> > > > > > > https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> > > > > > >
> > > > > > > The error that you show might be due to not having /opt/freeware/bin
> > > > > > > first in your path and the bootstrap used the AIX version of lex or
> > > > > > > sed or some other command.
> > > > > > >
> > > > > >
> > > > > > Hi David,
> > > > > >
> > > > > > I made some progress.  I am trying to verify my libffi sync branch:
> > > > > >
> > > > > > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
> > > > > >
> > > > > > on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
> > > > > > suggestion is
> > > > > >
> > > > > > .../src/configure --disable-werror --enable-languages=c,c++
> > > > > > --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> > > > > > --disable-libstdcxx-pch --with-included-gettext
> > > > > >
> > > > > > When I added Go with --enable-languages=c,c++,go, I got
> > > > > >
> > > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > > /opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
> > > > > > cfg.go.tmp buildcfg.go
> > > > > > mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
> > > > > > der.gox:
> > > > > >              A file or directory in the path name does not exist.
> > > > > > mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
> > > > > > /atomic.gox:
> > > > > >              A file or directory in the path name does not exist.
> > > > > > mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
> > > > > >              A file or directory in the path name does not exist.
> > > > > > Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
> > > > > > gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1
> > > > > >
> > > > > > Is Go supported on AIX? If yes, what did I do wrong?
> > > > >
> > > > > I believe that GCC Go works on AIX, but I have not been testing it
> > > > > regularly.  There was more focus on GCC Go for AIX prior to the Golang
> > > > > port to AIX.
> > > > >
> > > > > It looks like the problem is that the objcopy command is not
> > > > > installed.  There have been various issues with Binutils on AIX.  I'm
> > > > > not certain if GCC Go had relied on objcopy or not.
> > > > >
> > > >
> > > > Hi Richard,
> > > >
> > > > Go on master branch isn't buildable on AIX.  What should I do
> > > > next to get my libffi sync patches into master branch?
> > >
> > > H.J.,
> > >
> > > You have mischaracterized and misrepresented the issue.  No one stated
> > > that GCC Go is not buildable, only that GCC Go requires objcopy, which
> > > is not currently installed on gcc119.
> > >
> > > Thanks, David
> >
> > I installed GNU binutils and got
> >
> >
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> > error: ./internal/unsafeheader.gox exists but does not contain any Go
> > export data
> >    17 |         "internal/unsafeheader"
> >       |                              ^
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> > error: internal/unsafeheader.gox exists but does not contain any Go
> > export data
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> > error: import file 'internal/unsafeheader' not found
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:42:
> > error: reference to undefined name 'unsafeheader'
> >   146 |                         ptr :=
> > (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
> >       |                                          ^
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:41:
> > error: expected pointer
> >   146 |                         ptr :=
> > (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
> >       |                                         ^
> > gmake[8]: Entering directory
> > '/home/hjl/work/build/gnu/tools-build/gcc-gitlab/build-powerpc64-aix7.2/powerpc-ibm-aix7.2.4.0/pthread/libgo'
> > f="internal/itoa.o"; if test ! -f $f; then f="internal/.libs/itoa.o";
> > fi; objcopy -j .go_export $f internal/itoa.s-gox.tmp;
> > /opt/freeware/bin/bash
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh
> > internal/itoa.s-gox.tmp `echo internal/itoa.s-gox | sed -e
> > 's/s-gox/gox/'`
> > echo timestamp > internal/itoa.s-gox
> > Makefile:3019: recipe for target 'hash/maphash.lo' failed
> > gmake[6]: *** [hash/maphash.lo] Error 1
> >
> > and there were more errors like this.
>
> I have asked my colleagues who work on Go for AIX about the status. I
> will let you know when I receive a reply.
>
> libffi trunk works on AIX.
>
> Is Go the only usage of libffi within GCC?  If so, then it seems that

Yes.

> the issue for the AIX build of GCC is to ensure that the update of
> libffi doesn't break the rest of the build and that the in-tree build
> of libffi succeeds.  Does the in-tree build of libffi pass its
> self-tests, or at least the same results as libffi out of the tree?

The test results of the in-tree libffi from libffi 3.4.2 are

FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=12
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O0 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=12
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O2 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=13
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O0 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=13
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O2 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=55
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O0 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=55
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O2 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=56
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O0 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=56
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O2 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=57
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O0 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=57
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O2 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=68
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O0 execution test
FAIL: libffi.bhaible/test-call.c -W -Wall -Wno-psabi -DDGTEST=68
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O2 execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=54
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O0 execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=54
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O2 execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=55
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O0 execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=55
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O2 execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=56
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O0 execution test
FAIL: libffi.bhaible/test-callback.c -W -Wall -Wno-psabi -DDGTEST=56
-Wno-unused-variable -Wno-unused-parameter
-Wno-unused-but-set-variable -Wno-uninitialized -O2 execution test

=== libffi Summary ===

# of expected passes 1444
# of unexpected failures 18
# of unsupported tests 28

which are identical to the upstream libffi 3.4.2.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-16 19:58                     ` H.J. Lu
  2021-10-16 20:07                       ` David Edelsohn
@ 2021-10-18 15:04                       ` David Edelsohn
  2021-10-18 15:08                         ` H.J. Lu
  1 sibling, 1 reply; 27+ messages in thread
From: David Edelsohn @ 2021-10-18 15:04 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

Hi, H.J.

My colleague responded that GCC Go builds and works on AIX, but it
currently requires a special, custom version of GNU objcopy that adds
support for the types of features that Go requires to operate on AIX
XCOFF files.  Those changes have not yet been updated and contributed
to GNU Binutils.

I will see if I can install that version of objcopy standalone.  We
also can ask Clement and ATOS to test GCC Go build with your proposed
libffi patch, or is it vanilla libffi trunk?

Thanks, David


On Sat, Oct 16, 2021 at 3:59 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Sat, Oct 16, 2021 at 12:53 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> >
> > On Sat, Oct 16, 2021 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Sat, Oct 16, 2021 at 10:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > >
> > > > On Sat, Oct 16, 2021 at 7:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > >
> > > > > On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > > > >
> > > > > > On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > >
> > > > > > > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > >
> > > > > > > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Change in the v2 patch:
> > > > > > > > > > > >
> > > > > > > > > > > > 1. Disable static trampolines by default.
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > > > > > > make it easier to sync with libffi upstream:
> > > > > > > > > > > >
> > > > > > > > > > > > 1. Document how to sync with upstream.
> > > > > > > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > > > > > > >
> > > > > > > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > > > > > > >
> > > > > > > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > > > > > > libffi these days.
> > > > > > > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > > > > > > >
> > > > > > > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > > > > > > the upstream libffi works on Darwin and Windows.
> > > > > > > > > >
> > > > > > > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > > > > > > of this massive diff.
> > > > > > > > > >
> > > > > > > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > > > > > > >
> > > > > > > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > > > > > > >
> > > > > > > > > Can you please do the extra step to test one weird architecture, namely
> > > > > > > > > powerpc64-aix which is available on the compile-farm?
> > > > > > > >
> > > > > > > > I will give it a try and report back.
> > > > > > > >
> > > > > > > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > > > > > > time to fix fallout until the GCC 12 release).
> > > > > > > > >
> > > > > > > > > Thus OK after the extra testing dance and waiting until early next
> > > > > > > > > week so others can throw in a veto.
> > > > > > >
> > > > > > > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> > > > > > >
> > > > > > > *  MT/MODEL: 8284-22A                                                         *
> > > > > > > * Partition: gcc119                                                           *
> > > > > > > *    System: power8-aix.osuosl.org                                            *
> > > > > > > *       O/S: AIX V7.2 7200-04-03-2038
> > > > > > >
> > > > > > > I configured GCC with
> > > > > > >
> > > > > > > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > > > > > > --enable-version-specific-runtime-libs --disable-nls
> > > > > > > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > > > > > > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > > > > > > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > > > > > > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> > > > > > >
> > > > > > > I got
> > > > > > >
> > > > > > > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > > > > > > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > > > > > > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > > > > > > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > > > > > > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> > > > > > >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > > > > > > 4.0/libiberty/libiberty.a
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > > > > > > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > > > > > > collect2: error: ld returned 8 exit status
> > > > > > > Makefile:3000: recipe for target 'build/gengtype' failed
> > > > > > > gmake[5]: *** [build/gengtype] Error 1
> > > > > > >
> > > > > > > David, is there an instruction to bootstrap GCC on AIX?
> > > > > >
> > > > > > The CompileFarm page in the GCC wiki has instructions under "build tips":
> > > > > >
> > > > > > https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> > > > > >
> > > > > > The error that you show might be due to not having /opt/freeware/bin
> > > > > > first in your path and the bootstrap used the AIX version of lex or
> > > > > > sed or some other command.
> > > > > >
> > > > >
> > > > > Hi David,
> > > > >
> > > > > I made some progress.  I am trying to verify my libffi sync branch:
> > > > >
> > > > > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
> > > > >
> > > > > on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
> > > > > suggestion is
> > > > >
> > > > > .../src/configure --disable-werror --enable-languages=c,c++
> > > > > --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> > > > > --disable-libstdcxx-pch --with-included-gettext
> > > > >
> > > > > When I added Go with --enable-languages=c,c++,go, I got
> > > > >
> > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > /opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
> > > > > cfg.go.tmp buildcfg.go
> > > > > mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
> > > > > der.gox:
> > > > >              A file or directory in the path name does not exist.
> > > > > mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
> > > > > /atomic.gox:
> > > > >              A file or directory in the path name does not exist.
> > > > > mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
> > > > >              A file or directory in the path name does not exist.
> > > > > Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
> > > > > gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1
> > > > >
> > > > > Is Go supported on AIX? If yes, what did I do wrong?
> > > >
> > > > I believe that GCC Go works on AIX, but I have not been testing it
> > > > regularly.  There was more focus on GCC Go for AIX prior to the Golang
> > > > port to AIX.
> > > >
> > > > It looks like the problem is that the objcopy command is not
> > > > installed.  There have been various issues with Binutils on AIX.  I'm
> > > > not certain if GCC Go had relied on objcopy or not.
> > > >
> > >
> > > Hi Richard,
> > >
> > > Go on master branch isn't buildable on AIX.  What should I do
> > > next to get my libffi sync patches into master branch?
> >
> > H.J.,
> >
> > You have mischaracterized and misrepresented the issue.  No one stated
> > that GCC Go is not buildable, only that GCC Go requires objcopy, which
> > is not currently installed on gcc119.
> >
> > Thanks, David
>
> I installed GNU binutils and got
>
>
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> error: ./internal/unsafeheader.gox exists but does not contain any Go
> export data
>    17 |         "internal/unsafeheader"
>       |                              ^
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> error: internal/unsafeheader.gox exists but does not contain any Go
> export data
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> error: import file 'internal/unsafeheader' not found
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:42:
> error: reference to undefined name 'unsafeheader'
>   146 |                         ptr :=
> (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
>       |                                          ^
> /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:41:
> error: expected pointer
>   146 |                         ptr :=
> (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
>       |                                         ^
> gmake[8]: Entering directory
> '/home/hjl/work/build/gnu/tools-build/gcc-gitlab/build-powerpc64-aix7.2/powerpc-ibm-aix7.2.4.0/pthread/libgo'
> f="internal/itoa.o"; if test ! -f $f; then f="internal/.libs/itoa.o";
> fi; objcopy -j .go_export $f internal/itoa.s-gox.tmp;
> /opt/freeware/bin/bash
> /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh
> internal/itoa.s-gox.tmp `echo internal/itoa.s-gox | sed -e
> 's/s-gox/gox/'`
> echo timestamp > internal/itoa.s-gox
> Makefile:3019: recipe for target 'hash/maphash.lo' failed
> gmake[6]: *** [hash/maphash.lo] Error 1
>
> and there were more errors like this.
>
> --
> H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-18 15:04                       ` David Edelsohn
@ 2021-10-18 15:08                         ` H.J. Lu
  2021-10-19 15:02                           ` David Edelsohn
  0 siblings, 1 reply; 27+ messages in thread
From: H.J. Lu @ 2021-10-18 15:08 UTC (permalink / raw)
  To: David Edelsohn
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Mon, Oct 18, 2021 at 8:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
>
> Hi, H.J.
>
> My colleague responded that GCC Go builds and works on AIX, but it
> currently requires a special, custom version of GNU objcopy that adds
> support for the types of features that Go requires to operate on AIX
> XCOFF files.  Those changes have not yet been updated and contributed
> to GNU Binutils.
>
> I will see if I can install that version of objcopy standalone.  We
> also can ask Clement and ATOS to test GCC Go build with your proposed
> libffi patch, or is it vanilla libffi trunk?

My libffi branch:

https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master

synced with libffi v3.4.2, not master.

BTW, the current master branch won't build libgo:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102796

Thanks.

> Thanks, David
>
>
> On Sat, Oct 16, 2021 at 3:59 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Sat, Oct 16, 2021 at 12:53 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > >
> > > On Sat, Oct 16, 2021 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >
> > > > On Sat, Oct 16, 2021 at 10:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > > >
> > > > > On Sat, Oct 16, 2021 at 7:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > >
> > > > > > On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > > > > >
> > > > > > > On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > >
> > > > > > > > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > Change in the v2 patch:
> > > > > > > > > > > > >
> > > > > > > > > > > > > 1. Disable static trampolines by default.
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > > > > > > > make it easier to sync with libffi upstream:
> > > > > > > > > > > > >
> > > > > > > > > > > > > 1. Document how to sync with upstream.
> > > > > > > > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > > > > > > > >
> > > > > > > > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > > > > > > > >
> > > > > > > > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > > > > > > > libffi these days.
> > > > > > > > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > > > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > > > > > > > >
> > > > > > > > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > > > > > > > the upstream libffi works on Darwin and Windows.
> > > > > > > > > > >
> > > > > > > > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > > > > > > > of this massive diff.
> > > > > > > > > > >
> > > > > > > > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > > > > > > > >
> > > > > > > > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > > > > > > > >
> > > > > > > > > > Can you please do the extra step to test one weird architecture, namely
> > > > > > > > > > powerpc64-aix which is available on the compile-farm?
> > > > > > > > >
> > > > > > > > > I will give it a try and report back.
> > > > > > > > >
> > > > > > > > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > > > > > > > time to fix fallout until the GCC 12 release).
> > > > > > > > > >
> > > > > > > > > > Thus OK after the extra testing dance and waiting until early next
> > > > > > > > > > week so others can throw in a veto.
> > > > > > > >
> > > > > > > > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> > > > > > > >
> > > > > > > > *  MT/MODEL: 8284-22A                                                         *
> > > > > > > > * Partition: gcc119                                                           *
> > > > > > > > *    System: power8-aix.osuosl.org                                            *
> > > > > > > > *       O/S: AIX V7.2 7200-04-03-2038
> > > > > > > >
> > > > > > > > I configured GCC with
> > > > > > > >
> > > > > > > > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > > > > > > > --enable-version-specific-runtime-libs --disable-nls
> > > > > > > > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > > > > > > > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > > > > > > > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > > > > > > > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> > > > > > > >
> > > > > > > > I got
> > > > > > > >
> > > > > > > > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > > > > > > > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > > > > > > > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > > > > > > > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > > > > > > > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> > > > > > > >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > > > > > > > 4.0/libiberty/libiberty.a
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > > > > > > > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > > > > > > > collect2: error: ld returned 8 exit status
> > > > > > > > Makefile:3000: recipe for target 'build/gengtype' failed
> > > > > > > > gmake[5]: *** [build/gengtype] Error 1
> > > > > > > >
> > > > > > > > David, is there an instruction to bootstrap GCC on AIX?
> > > > > > >
> > > > > > > The CompileFarm page in the GCC wiki has instructions under "build tips":
> > > > > > >
> > > > > > > https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> > > > > > >
> > > > > > > The error that you show might be due to not having /opt/freeware/bin
> > > > > > > first in your path and the bootstrap used the AIX version of lex or
> > > > > > > sed or some other command.
> > > > > > >
> > > > > >
> > > > > > Hi David,
> > > > > >
> > > > > > I made some progress.  I am trying to verify my libffi sync branch:
> > > > > >
> > > > > > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
> > > > > >
> > > > > > on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
> > > > > > suggestion is
> > > > > >
> > > > > > .../src/configure --disable-werror --enable-languages=c,c++
> > > > > > --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> > > > > > --disable-libstdcxx-pch --with-included-gettext
> > > > > >
> > > > > > When I added Go with --enable-languages=c,c++,go, I got
> > > > > >
> > > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > > /opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
> > > > > > cfg.go.tmp buildcfg.go
> > > > > > mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
> > > > > > der.gox:
> > > > > >              A file or directory in the path name does not exist.
> > > > > > mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
> > > > > > /atomic.gox:
> > > > > >              A file or directory in the path name does not exist.
> > > > > > mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
> > > > > >              A file or directory in the path name does not exist.
> > > > > > Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
> > > > > > gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1
> > > > > >
> > > > > > Is Go supported on AIX? If yes, what did I do wrong?
> > > > >
> > > > > I believe that GCC Go works on AIX, but I have not been testing it
> > > > > regularly.  There was more focus on GCC Go for AIX prior to the Golang
> > > > > port to AIX.
> > > > >
> > > > > It looks like the problem is that the objcopy command is not
> > > > > installed.  There have been various issues with Binutils on AIX.  I'm
> > > > > not certain if GCC Go had relied on objcopy or not.
> > > > >
> > > >
> > > > Hi Richard,
> > > >
> > > > Go on master branch isn't buildable on AIX.  What should I do
> > > > next to get my libffi sync patches into master branch?
> > >
> > > H.J.,
> > >
> > > You have mischaracterized and misrepresented the issue.  No one stated
> > > that GCC Go is not buildable, only that GCC Go requires objcopy, which
> > > is not currently installed on gcc119.
> > >
> > > Thanks, David
> >
> > I installed GNU binutils and got
> >
> >
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> > error: ./internal/unsafeheader.gox exists but does not contain any Go
> > export data
> >    17 |         "internal/unsafeheader"
> >       |                              ^
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> > error: internal/unsafeheader.gox exists but does not contain any Go
> > export data
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> > error: import file 'internal/unsafeheader' not found
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:42:
> > error: reference to undefined name 'unsafeheader'
> >   146 |                         ptr :=
> > (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
> >       |                                          ^
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:41:
> > error: expected pointer
> >   146 |                         ptr :=
> > (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
> >       |                                         ^
> > gmake[8]: Entering directory
> > '/home/hjl/work/build/gnu/tools-build/gcc-gitlab/build-powerpc64-aix7.2/powerpc-ibm-aix7.2.4.0/pthread/libgo'
> > f="internal/itoa.o"; if test ! -f $f; then f="internal/.libs/itoa.o";
> > fi; objcopy -j .go_export $f internal/itoa.s-gox.tmp;
> > /opt/freeware/bin/bash
> > /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh
> > internal/itoa.s-gox.tmp `echo internal/itoa.s-gox | sed -e
> > 's/s-gox/gox/'`
> > echo timestamp > internal/itoa.s-gox
> > Makefile:3019: recipe for target 'hash/maphash.lo' failed
> > gmake[6]: *** [hash/maphash.lo] Error 1
> >
> > and there were more errors like this.
> >
> > --
> > H.J.



-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-18 15:08                         ` H.J. Lu
@ 2021-10-19 15:02                           ` David Edelsohn
  2021-10-19 18:01                             ` H.J. Lu
  0 siblings, 1 reply; 27+ messages in thread
From: David Edelsohn @ 2021-10-19 15:02 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

Hi, H.J.

My colleague built GCC, including GCC Go, with your patch:

"I was able to build libgo and test it partially.  The results are
similar to the current master without libffi updates. But 64bit tests
aren't working in both cases. It's related to LIBPATH issues..."

- David

On Mon, Oct 18, 2021 at 11:09 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Mon, Oct 18, 2021 at 8:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
> >
> > Hi, H.J.
> >
> > My colleague responded that GCC Go builds and works on AIX, but it
> > currently requires a special, custom version of GNU objcopy that adds
> > support for the types of features that Go requires to operate on AIX
> > XCOFF files.  Those changes have not yet been updated and contributed
> > to GNU Binutils.
> >
> > I will see if I can install that version of objcopy standalone.  We
> > also can ask Clement and ATOS to test GCC Go build with your proposed
> > libffi patch, or is it vanilla libffi trunk?
>
> My libffi branch:
>
> https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
>
> synced with libffi v3.4.2, not master.
>
> BTW, the current master branch won't build libgo:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102796
>
> Thanks.
>
> > Thanks, David
> >
> >
> > On Sat, Oct 16, 2021 at 3:59 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On Sat, Oct 16, 2021 at 12:53 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > >
> > > > On Sat, Oct 16, 2021 at 1:13 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > >
> > > > > On Sat, Oct 16, 2021 at 10:04 AM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > > > >
> > > > > > On Sat, Oct 16, 2021 at 7:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > >
> > > > > > > On Fri, Oct 15, 2021 at 5:22 PM David Edelsohn <dje.gcc@gmail.com> wrote:
> > > > > > > >
> > > > > > > > On Fri, Oct 15, 2021 at 8:06 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > On Wed, Oct 13, 2021 at 6:42 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > On Wed, Oct 13, 2021 at 6:03 AM Richard Biener
> > > > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > On Wed, Oct 13, 2021 at 2:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > On Wed, Oct 13, 2021 at 5:45 AM Richard Biener
> > > > > > > > > > > > <richard.guenther@gmail.com> wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > On Thu, Sep 2, 2021 at 5:50 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Change in the v2 patch:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > 1. Disable static trampolines by default.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > GCC maintained a copy of libffi snapshot from 2009 and cherry-picked fixes
> > > > > > > > > > > > > > from upstream over the last 10+ years.  In the meantime, libffi upstream
> > > > > > > > > > > > > > has been changed significantly with new features, bug fixes and new target
> > > > > > > > > > > > > > support.  Here is a set of patches to sync with libffi 3.4.2 release and
> > > > > > > > > > > > > > make it easier to sync with libffi upstream:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > 1. Document how to sync with upstream.
> > > > > > > > > > > > > > 2. Add scripts to help sync with upstream.
> > > > > > > > > > > > > > 3. Sync with libffi 3.4.2. This patch is quite big.  It is availale at
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > https://gitlab.com/x86-gcc/gcc/-/commit/15e80c879c571f79a0e57702848a9df5fba5be2f
> > > > > > > > > > > > > > 4. Integrate libffi build and testsuite with GCC.
> > > > > > > > > > > > >
> > > > > > > > > > > > > How did you test this?  It looks like libgo is the only consumer of
> > > > > > > > > > > > > libffi these days.
> > > > > > > > > > > > > In particular go/libgo seems to be supported on almost all targets besides
> > > > > > > > > > > > > darwin/windows - did you test cross and canadian configurations?
> > > > > > > > > > > >
> > > > > > > > > > > > I only tested it on Linux/i686 and Linux/x86-64.   My understanding is that
> > > > > > > > > > > > the upstream libffi works on Darwin and Windows.
> > > > > > > > > > > >
> > > > > > > > > > > > > I applaud the attempt to sync to upsteam but I fear you won't get any "review"
> > > > > > > > > > > > > of this massive diff.
> > > > > > > > > > > >
> > > > > > > > > > > > I believe that it should just work.  Our libffi is very much out of date.
> > > > > > > > > > >
> > > > > > > > > > > Yes, you can hope.  And yes, our libffi is out of date.
> > > > > > > > > > >
> > > > > > > > > > > Can you please do the extra step to test one weird architecture, namely
> > > > > > > > > > > powerpc64-aix which is available on the compile-farm?
> > > > > > > > > >
> > > > > > > > > > I will give it a try and report back.
> > > > > > > > > >
> > > > > > > > > > > If that goes well I think it's good to "hope" at this point (and plenty of
> > > > > > > > > > > time to fix fallout until the GCC 12 release).
> > > > > > > > > > >
> > > > > > > > > > > Thus OK after the extra testing dance and waiting until early next
> > > > > > > > > > > week so others can throw in a veto.
> > > > > > > > >
> > > > > > > > > I tried to bootstrap GCC master branch on  gcc119.fsffrance.org:
> > > > > > > > >
> > > > > > > > > *  MT/MODEL: 8284-22A                                                         *
> > > > > > > > > * Partition: gcc119                                                           *
> > > > > > > > > *    System: power8-aix.osuosl.org                                            *
> > > > > > > > > *       O/S: AIX V7.2 7200-04-03-2038
> > > > > > > > >
> > > > > > > > > I configured GCC with
> > > > > > > > >
> > > > > > > > > --with-as=/usr/bin/as --with-ld=/usr/bin/ld
> > > > > > > > > --enable-version-specific-runtime-libs --disable-nls
> > > > > > > > > --enable-decimal-float=dpd --disable-libstdcxx-pch --disable-werror
> > > > > > > > > --enable-__cxa_atexit --with-gmp=/opt/cfarm --with-mpfr=/opt/cfarm
> > > > > > > > > --with-mpc=/opt/cfarm --with-isl=/opt/cfarm --prefix=/opt/freeware
> > > > > > > > > --with-local-prefix=/opt/freeware --enable-languages=c,c++,go
> > > > > > > > >
> > > > > > > > > I got
> > > > > > > > >
> > > > > > > > > g++   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W
> > > > > > > > > -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-at
> > > > > > > > > tribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-
> > > > > > > > > overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstd
> > > > > > > > > c++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o build/genenums \
> > > > > > > > >     build/genenums.o build/read-md.o build/errors.o ../build-powerpc-ibm-aix7.2.
> > > > > > > > > 4.0/libiberty/libiberty.a
> > > > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_line
> > > > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yylex(char const**)
> > > > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yybegin(char const*)
> > > > > > > > > ld: 0711-317 ERROR: Undefined symbol: lexer_toplevel_done
> > > > > > > > > ld: 0711-317 ERROR: Undefined symbol: .yyend()
> > > > > > > > > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> > > > > > > > > collect2: error: ld returned 8 exit status
> > > > > > > > > Makefile:3000: recipe for target 'build/gengtype' failed
> > > > > > > > > gmake[5]: *** [build/gengtype] Error 1
> > > > > > > > >
> > > > > > > > > David, is there an instruction to bootstrap GCC on AIX?
> > > > > > > >
> > > > > > > > The CompileFarm page in the GCC wiki has instructions under "build tips":
> > > > > > > >
> > > > > > > > https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
> > > > > > > >
> > > > > > > > The error that you show might be due to not having /opt/freeware/bin
> > > > > > > > first in your path and the bootstrap used the AIX version of lex or
> > > > > > > > sed or some other command.
> > > > > > > >
> > > > > > >
> > > > > > > Hi David,
> > > > > > >
> > > > > > > I made some progress.  I am trying to verify my libffi sync branch:
> > > > > > >
> > > > > > > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/libffi/master
> > > > > > >
> > > > > > > on powerpc64-aix.  Go is the only user of libffi.  But compiler farm
> > > > > > > suggestion is
> > > > > > >
> > > > > > > .../src/configure --disable-werror --enable-languages=c,c++
> > > > > > > --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm
> > > > > > > --disable-libstdcxx-pch --with-included-gettext
> > > > > > >
> > > > > > > When I added Go with --enable-languages=c,c++,go, I got
> > > > > > >
> > > > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > > > /opt/freeware/bin/bash: missing-objcopy: command not found
> > > > > > > /opt/freeware/bin/bash /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh build
> > > > > > > cfg.go.tmp buildcfg.go
> > > > > > > mv: 0653-401 Cannot rename internal/unsafeheader.s-gox.tmp to internal/unsafehea
> > > > > > > der.gox:
> > > > > > >              A file or directory in the path name does not exist.
> > > > > > > mv: 0653-401 Cannot rename runtime/internal/atomic.s-gox.tmp to runtime/internal
> > > > > > > /atomic.gox:
> > > > > > >              A file or directory in the path name does not exist.
> > > > > > > mv: 0653-401 Cannot rename internal/race.s-gox.tmp to internal/race.gox:
> > > > > > >              A file or directory in the path name does not exist.
> > > > > > > Makefile:3019: recipe for target 'runtime/internal/atomic.s-gox' failed
> > > > > > > gmake[10]: *** [runtime/internal/atomic.s-gox] Error 1
> > > > > > >
> > > > > > > Is Go supported on AIX? If yes, what did I do wrong?
> > > > > >
> > > > > > I believe that GCC Go works on AIX, but I have not been testing it
> > > > > > regularly.  There was more focus on GCC Go for AIX prior to the Golang
> > > > > > port to AIX.
> > > > > >
> > > > > > It looks like the problem is that the objcopy command is not
> > > > > > installed.  There have been various issues with Binutils on AIX.  I'm
> > > > > > not certain if GCC Go had relied on objcopy or not.
> > > > > >
> > > > >
> > > > > Hi Richard,
> > > > >
> > > > > Go on master branch isn't buildable on AIX.  What should I do
> > > > > next to get my libffi sync patches into master branch?
> > > >
> > > > H.J.,
> > > >
> > > > You have mischaracterized and misrepresented the issue.  No one stated
> > > > that GCC Go is not buildable, only that GCC Go requires objcopy, which
> > > > is not currently installed on gcc119.
> > > >
> > > > Thanks, David
> > >
> > > I installed GNU binutils and got
> > >
> > >
> > > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> > > error: ./internal/unsafeheader.gox exists but does not contain any Go
> > > export data
> > >    17 |         "internal/unsafeheader"
> > >       |                              ^
> > > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> > > error: internal/unsafeheader.gox exists but does not contain any Go
> > > export data
> > > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:17:30:
> > > error: import file 'internal/unsafeheader' not found
> > > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:42:
> > > error: reference to undefined name 'unsafeheader'
> > >   146 |                         ptr :=
> > > (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
> > >       |                                          ^
> > > /home/hjl/work/git/gitlab/x86-gcc/libgo/go/hash/maphash/maphash.go:146:41:
> > > error: expected pointer
> > >   146 |                         ptr :=
> > > (*byte)((*unsafeheader.String)(unsafe.Pointer(&s)).Data)
> > >       |                                         ^
> > > gmake[8]: Entering directory
> > > '/home/hjl/work/build/gnu/tools-build/gcc-gitlab/build-powerpc64-aix7.2/powerpc-ibm-aix7.2.4.0/pthread/libgo'
> > > f="internal/itoa.o"; if test ! -f $f; then f="internal/.libs/itoa.o";
> > > fi; objcopy -j .go_export $f internal/itoa.s-gox.tmp;
> > > /opt/freeware/bin/bash
> > > /home/hjl/work/git/gitlab/x86-gcc/libgo/mvifdiff.sh
> > > internal/itoa.s-gox.tmp `echo internal/itoa.s-gox | sed -e
> > > 's/s-gox/gox/'`
> > > echo timestamp > internal/itoa.s-gox
> > > Makefile:3019: recipe for target 'hash/maphash.lo' failed
> > > gmake[6]: *** [hash/maphash.lo] Error 1
> > >
> > > and there were more errors like this.
> > >
> > > --
> > > H.J.
>
>
>
> --
> H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-19 15:02                           ` David Edelsohn
@ 2021-10-19 18:01                             ` H.J. Lu
  2021-10-24 20:36                               ` Iain Sandoe
  0 siblings, 1 reply; 27+ messages in thread
From: H.J. Lu @ 2021-10-19 18:01 UTC (permalink / raw)
  To: David Edelsohn
  Cc: Richard Biener, Ian Lance Taylor, GCC Patches, Jeff Law,
	Jakub Jelinek, DJ Delorie, Xi Ruoyao

On Tue, Oct 19, 2021 at 8:03 AM David Edelsohn <dje.gcc@gmail.com> wrote:
>
> Hi, H.J.
>
> My colleague built GCC, including GCC Go, with your patch:
>
> "I was able to build libgo and test it partially.  The results are
> similar to the current master without libffi updates. But 64bit tests
> aren't working in both cases. It's related to LIBPATH issues..."
>

Thanks for checking.  I will rebase and retest.  If there is no regression,
I will check them in.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-19 18:01                             ` H.J. Lu
@ 2021-10-24 20:36                               ` Iain Sandoe
  2021-10-24 20:40                                 ` H.J. Lu
  0 siblings, 1 reply; 27+ messages in thread
From: Iain Sandoe @ 2021-10-24 20:36 UTC (permalink / raw)
  To: H.J. Lu; +Cc: David Edelsohn, Jakub Jelinek, Ian Lance Taylor, GCC Patches

Hi H.J.

> On 19 Oct 2021, at 19:01, H.J. Lu via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> On Tue, Oct 19, 2021 at 8:03 AM David Edelsohn <dje.gcc@gmail.com> wrote:
>> 

>> My colleague built GCC, including GCC Go, with your patch:
>> 
>> "I was able to build libgo and test it partially.  The results are
>> similar to the current master without libffi updates. But 64bit tests
>> aren't working in both cases. It's related to LIBPATH issues..."
>> 
> 
> Thanks for checking.  I will rebase and retest.  If there is no regression,
> I will check them in.

At r12-4638.

It seems that there are quite a few m32 libffi fails on x86_64-linux-gnu [gcc123].

It seems that all-languages bootstrap is broken on BE powerpc64-linux-gnu [gcc110]:

../../../src-patched/libffi/src/powerpc/linux64_closure.S:404: Error: unrecognized opcode: `lvx'
make[4]: *** [src/powerpc/linux64_closure.lo] Error 1

could you take a look please?
thanks
Iain


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-24 20:36                               ` Iain Sandoe
@ 2021-10-24 20:40                                 ` H.J. Lu
  2021-10-25  6:58                                   ` Iain Sandoe
  0 siblings, 1 reply; 27+ messages in thread
From: H.J. Lu @ 2021-10-24 20:40 UTC (permalink / raw)
  To: Iain Sandoe; +Cc: David Edelsohn, Jakub Jelinek, Ian Lance Taylor, GCC Patches

On Sun, Oct 24, 2021 at 1:36 PM Iain Sandoe <idsandoe@googlemail.com> wrote:
>
> Hi H.J.
>
> > On 19 Oct 2021, at 19:01, H.J. Lu via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> >
> > On Tue, Oct 19, 2021 at 8:03 AM David Edelsohn <dje.gcc@gmail.com> wrote:
> >>
>
> >> My colleague built GCC, including GCC Go, with your patch:
> >>
> >> "I was able to build libgo and test it partially.  The results are
> >> similar to the current master without libffi updates. But 64bit tests
> >> aren't working in both cases. It's related to LIBPATH issues..."
> >>
> >
> > Thanks for checking.  I will rebase and retest.  If there is no regression,
> > I will check them in.
>
> At r12-4638.
>
> It seems that there are quite a few m32 libffi fails on x86_64-linux-gnu [gcc123].
>
> It seems that all-languages bootstrap is broken on BE powerpc64-linux-gnu [gcc110]:
>
> ../../../src-patched/libffi/src/powerpc/linux64_closure.S:404: Error: unrecognized opcode: `lvx'
> make[4]: *** [src/powerpc/linux64_closure.lo] Error 1
>
> could you take a look please?

Does it fail in libffi upstream? If yes, please open an issue in libffi
upstream.  If not, why does it fail in GCC?

-- 
H.J.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH v2 0/4] libffi: Sync with upstream
  2021-10-24 20:40                                 ` H.J. Lu
@ 2021-10-25  6:58                                   ` Iain Sandoe
  0 siblings, 0 replies; 27+ messages in thread
From: Iain Sandoe @ 2021-10-25  6:58 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Jakub Jelinek, GCC Patches, Ian Lance Taylor, David Edelsohn



> On 24 Oct 2021, at 21:40, H.J. Lu via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> On Sun, Oct 24, 2021 at 1:36 PM Iain Sandoe <idsandoe@googlemail.com> wrote:
>> 
>> Hi H.J.
>> 
>>> On 19 Oct 2021, at 19:01, H.J. Lu via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>>> 
>>> On Tue, Oct 19, 2021 at 8:03 AM David Edelsohn <dje.gcc@gmail.com> wrote:
>>>> 
>> 
>>>> My colleague built GCC, including GCC Go, with your patch:
>>>> 
>>>> "I was able to build libgo and test it partially.  The results are
>>>> similar to the current master without libffi updates. But 64bit tests
>>>> aren't working in both cases. It's related to LIBPATH issues..."
>>>> 
>>> 
>>> Thanks for checking.  I will rebase and retest.  If there is no regression,
>>> I will check them in.
>> 
>> At r12-4638.
>> 
>> It seems that there are quite a few m32 libffi fails on x86_64-linux-gnu [gcc123].
>> 
>> It seems that all-languages bootstrap is broken on BE powerpc64-linux-gnu [gcc110]:
>> 
>> ../../../src-patched/libffi/src/powerpc/linux64_closure.S:404: Error: unrecognized opcode: `lvx'
>> make[4]: *** [src/powerpc/linux64_closure.lo] Error 1
>> 
>> could you take a look please?
> 
> Does it fail in libffi upstream? If yes, please open an issue in libffi
> upstream.  If not, why does it fail in GCC?

I do not have spare resources to debug this for you - the problems occur on cfarm machines
so you do not need special resources to do it.
Iain


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2021-10-25  6:58 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 15:50 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
2021-09-02 15:50 ` [PATCH v2 1/4] libffi: Add HOWTO_MERGE, autogen.sh and merge.sh H.J. Lu
2021-09-02 15:50 ` [PATCH v2 2/4] libffi: Sync with libffi 3.4.2 H.J. Lu
2021-09-02 15:50 ` [PATCH v2 3/4] libffi: Integrate build with GCC H.J. Lu
2021-09-02 15:50 ` [PATCH v2 4/4] libffi: Integrate testsuite with GCC testsuite H.J. Lu
2021-10-10 13:55 ` PING^1 [PATCH v2 0/4] libffi: Sync with upstream H.J. Lu
2021-10-13 12:45 ` Richard Biener
2021-10-13 12:56   ` H.J. Lu
2021-10-13 13:03     ` Richard Biener
2021-10-13 13:42       ` H.J. Lu
2021-10-16  0:06         ` H.J. Lu
2021-10-16  0:22           ` David Edelsohn
2021-10-16 11:48             ` H.J. Lu
2021-10-16 17:04               ` David Edelsohn
2021-10-16 17:13                 ` H.J. Lu
2021-10-16 19:21                   ` Ian Lance Taylor
2021-10-16 19:53                   ` David Edelsohn
2021-10-16 19:58                     ` H.J. Lu
2021-10-16 20:07                       ` David Edelsohn
2021-10-17 13:26                         ` H.J. Lu
2021-10-18 15:04                       ` David Edelsohn
2021-10-18 15:08                         ` H.J. Lu
2021-10-19 15:02                           ` David Edelsohn
2021-10-19 18:01                             ` H.J. Lu
2021-10-24 20:36                               ` Iain Sandoe
2021-10-24 20:40                                 ` H.J. Lu
2021-10-25  6:58                                   ` Iain Sandoe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).