From f9ba9b10fedb6a70928823b977118d250af3b0a2 Mon Sep 17 00:00:00 2001 From: zhouganqing Date: Mon, 9 Jan 2023 14:32:49 +0800 Subject: [PATCH] merge upstream 3.4.4 --- ChangeLog | 3285 +++++++ LICENSE | 2 +- Makefile.am | 114 +- Makefile.in | 274 +- README.md | 230 +- acinclude.m4 | 122 +- aclocal.m4 | 94 +- compile | 6 +- config.guess | 1610 ++-- config.sub | 2990 +++--- configure | 8319 ++++++++++------- configure.ac | 119 +- configure.host | 80 +- debian/changelog | 6 + debian/patches/no-toolexeclibdir.diff | 25 + debian/patches/powerpc-fix-2.diff | 50 + debian/patches/powerpc-fix.diff | 21 + debian/patches/powerpc64-fix-2.diff | 36 + debian/patches/powerpc64-fix.diff | 24 + depcomp | 2 +- doc/Makefile.in | 15 +- doc/libffi.info | 114 +- doc/libffi.pdf | Bin 169865 -> 171524 bytes doc/libffi.texi | 115 +- doc/mdate-sh | 2 +- doc/stamp-vti | 8 +- doc/texinfo.tex | 1913 ++-- doc/version.texi | 8 +- fficonfig.h.in | 38 +- generate-darwin-source-and-headers.py | 238 +- include/Makefile.am | 2 +- include/Makefile.in | 19 +- include/ffi.h.in | 90 +- include/ffi_cfi.h | 21 + include/ffi_common.h | 25 + include/tramp.h | 45 + install-sh | 157 +- libffi.map.in | 20 +- libffi.xcodeproj/project.pbxproj | 50 +- libtool-version | 4 +- ltmain.sh | 870 +- m4/ax_cc_maxopt.m4 | 32 +- m4/ax_cflags_warn_all.m4 | 180 +- m4/ax_compiler_vendor.m4 | 121 +- m4/{ax_append_flag.m4 => ax_prepend_flag.m4} | 19 +- m4/libtool.m4 | 227 +- m4/ltoptions.m4 | 4 +- m4/ltsugar.m4 | 2 +- m4/ltversion.m4 | 13 +- m4/lt~obsolete.m4 | 4 +- man/Makefile.in | 15 +- missing | 2 +- msvc_build/aarch64/aarch64_include/ffi.h | 2 +- msvcc.sh | 24 +- src/aarch64/ffi.c | 262 +- src/aarch64/ffitarget.h | 15 +- src/aarch64/internal.h | 33 + src/aarch64/sysv.S | 155 +- src/aarch64/win64_armasm.S | 2 +- src/arm/ffi.c | 101 +- src/arm/ffitarget.h | 6 +- src/arm/internal.h | 10 + src/arm/sysv.S | 130 +- src/closures.c | 196 +- src/csky/ffi.c | 395 + src/csky/ffitarget.h | 63 + src/csky/sysv.S | 371 + src/dlmalloc.c | 7 +- src/kvx/asm.h | 5 + src/kvx/ffi.c | 273 + src/kvx/ffitarget.h | 75 + src/kvx/sysv.S | 127 + src/loongarch64/ffi.c | 621 ++ src/loongarch64/ffitarget.h | 82 + src/loongarch64/sysv.S | 327 + src/m32r/ffi.c | 45 +- src/mips/ffi.c | 311 +- src/mips/ffitarget.h | 9 +- src/mips/n32.S | 165 +- src/mips/o32.S | 67 +- src/moxie/ffi.c | 69 +- src/or1k/ffi.c | 37 +- src/pa/ffi.c | 137 +- src/pa/ffitarget.h | 7 +- src/pa/hpux32.S | 6 +- src/pa/linux.S | 6 +- src/powerpc/ffi_darwin.c | 14 +- src/powerpc/ffi_linux64.c | 2 +- src/powerpc/ffi_powerpc.h | 2 +- src/powerpc/linux64.S | 10 + src/powerpc/linux64_closure.S | 16 +- src/powerpc/t-aix | 5 + src/prep_cif.c | 26 +- src/riscv/ffi.c | 41 +- src/sparc/ffi64.c | 16 + src/tramp.c | 709 ++ src/x86/ffi.c | 157 +- src/x86/ffi64.c | 106 +- src/x86/ffitarget.h | 25 +- src/x86/ffiw64.c | 68 +- src/x86/internal.h | 14 + src/x86/internal64.h | 14 + src/x86/sysv.S | 110 +- src/x86/sysv_intel.S | 179 +- src/x86/unix64.S | 153 +- src/x86/win64.S | 37 +- src/x86/win64_intel.S | 5 +- src/xtensa/ffi.c | 24 +- src/xtensa/ffitarget.h | 4 + src/xtensa/sysv.S | 42 +- testsuite/Makefile.am | 239 +- testsuite/Makefile.in | 256 +- testsuite/lib/libffi.exp | 70 +- testsuite/lib/target-libpath.exp | 4 +- testsuite/libffi.bhaible/test-call.c | 9 +- testsuite/libffi.bhaible/test-callback.c | 4 +- testsuite/libffi.bhaible/testcases.c | 6 +- testsuite/libffi.call/bpo-38748.c | 41 + testsuite/libffi.call/call.exp | 2 +- testsuite/libffi.call/ffitest.h | 31 +- testsuite/libffi.call/float_va.c | 3 + .../libffi.call/{pyobjc-tc.c => pyobjc_tc.c} | 0 testsuite/libffi.call/return_ll1.c | 5 + testsuite/libffi.call/return_sl.c | 4 + testsuite/libffi.call/return_ul.c | 4 + testsuite/libffi.call/s55.c | 60 + testsuite/libffi.call/strlen.c | 17 +- testsuite/libffi.call/strlen2.c | 4 +- testsuite/libffi.call/strlen3.c | 4 +- testsuite/libffi.call/strlen4.c | 4 +- testsuite/libffi.call/struct10.c | 2 +- testsuite/libffi.call/struct_by_value_2.c | 63 + testsuite/libffi.call/struct_by_value_3.c | 65 + testsuite/libffi.call/struct_by_value_4.c | 67 + testsuite/libffi.call/struct_by_value_big.c | 93 + testsuite/libffi.call/struct_by_value_small.c | 61 + testsuite/libffi.call/va_1.c | 120 +- testsuite/libffi.call/va_2.c | 220 + testsuite/libffi.call/va_3.c | 154 + testsuite/libffi.call/va_struct1.c | 13 + testsuite/libffi.call/va_struct2.c | 11 + testsuite/libffi.call/va_struct3.c | 15 + testsuite/libffi.closures/closure_fn0.c | 5 +- testsuite/libffi.closures/closure_fn1.c | 2 + testsuite/libffi.closures/closure_fn2.c | 2 + testsuite/libffi.closures/closure_fn3.c | 22 +- testsuite/libffi.closures/closure_fn4.c | 2 + testsuite/libffi.closures/closure_fn5.c | 2 + testsuite/libffi.closures/closure_fn6.c | 2 + testsuite/libffi.closures/closure_loc_fn0.c | 10 +- testsuite/libffi.closures/closure_simple.c | 6 + testsuite/libffi.closures/cls_12byte.c | 18 + testsuite/libffi.closures/cls_16byte.c | 22 + testsuite/libffi.closures/cls_18byte.c | 24 + testsuite/libffi.closures/cls_19byte.c | 29 + testsuite/libffi.closures/cls_1_1byte.c | 4 + testsuite/libffi.closures/cls_20byte.c | 20 +- testsuite/libffi.closures/cls_20byte1.c | 22 +- testsuite/libffi.closures/cls_24byte.c | 38 +- testsuite/libffi.closures/cls_2byte.c | 13 + testsuite/libffi.closures/cls_3_1byte.c | 19 + testsuite/libffi.closures/cls_3byte1.c | 13 + testsuite/libffi.closures/cls_3byte2.c | 13 + testsuite/libffi.closures/cls_3float.c | 18 + testsuite/libffi.closures/cls_4_1byte.c | 22 + testsuite/libffi.closures/cls_4byte.c | 13 + testsuite/libffi.closures/cls_5_1_byte.c | 30 +- testsuite/libffi.closures/cls_5byte.c | 20 +- testsuite/libffi.closures/cls_64byte.c | 24 + testsuite/libffi.closures/cls_6_1_byte.c | 29 +- testsuite/libffi.closures/cls_6byte.c | 26 +- testsuite/libffi.closures/cls_7_1_byte.c | 40 +- testsuite/libffi.closures/cls_7byte.c | 26 +- testsuite/libffi.closures/cls_8byte.c | 14 + testsuite/libffi.closures/cls_9byte1.c | 15 +- testsuite/libffi.closures/cls_9byte2.c | 16 +- testsuite/libffi.closures/cls_align_double.c | 20 +- testsuite/libffi.closures/cls_align_float.c | 20 +- .../libffi.closures/cls_align_longdouble.c | 21 +- .../cls_align_longdouble_split.c | 61 +- .../cls_align_longdouble_split2.c | 43 +- testsuite/libffi.closures/cls_align_pointer.c | 20 +- testsuite/libffi.closures/cls_align_sint16.c | 19 +- testsuite/libffi.closures/cls_align_sint32.c | 21 +- testsuite/libffi.closures/cls_align_sint64.c | 19 +- testsuite/libffi.closures/cls_align_uint16.c | 19 +- testsuite/libffi.closures/cls_align_uint32.c | 20 +- testsuite/libffi.closures/cls_align_uint64.c | 20 +- testsuite/libffi.closures/cls_dbls_struct.c | 4 +- testsuite/libffi.closures/cls_double_va.c | 10 +- testsuite/libffi.closures/cls_float.c | 4 + testsuite/libffi.closures/cls_longdouble.c | 12 +- testsuite/libffi.closures/cls_longdouble_va.c | 12 +- testsuite/libffi.closures/cls_multi_schar.c | 6 +- testsuite/libffi.closures/cls_multi_sshort.c | 7 +- .../libffi.closures/cls_multi_sshortchar.c | 10 +- testsuite/libffi.closures/cls_multi_uchar.c | 10 +- testsuite/libffi.closures/cls_multi_ushort.c | 8 +- .../libffi.closures/cls_multi_ushortchar.c | 10 +- testsuite/libffi.closures/cls_pointer.c | 5 + testsuite/libffi.closures/cls_pointer_stack.c | 10 + testsuite/libffi.closures/cls_schar.c | 3 + testsuite/libffi.closures/cls_sint.c | 2 + testsuite/libffi.closures/cls_sshort.c | 3 + testsuite/libffi.closures/cls_struct_va1.c | 11 + testsuite/libffi.closures/cls_uchar.c | 3 + testsuite/libffi.closures/cls_uchar_va.c | 44 - testsuite/libffi.closures/cls_uint.c | 4 + testsuite/libffi.closures/cls_uint_va.c | 4 + testsuite/libffi.closures/cls_ulong_va.c | 4 + testsuite/libffi.closures/cls_ulonglong.c | 2 + testsuite/libffi.closures/cls_ushort.c | 3 + testsuite/libffi.closures/cls_ushort_va.c | 44 - testsuite/libffi.closures/ffitest.h | 139 +- testsuite/libffi.closures/huge_struct.c | 46 +- testsuite/libffi.closures/nested_struct.c | 41 +- testsuite/libffi.closures/nested_struct1.c | 2 +- testsuite/libffi.closures/nested_struct10.c | 12 + testsuite/libffi.closures/nested_struct11.c | 26 +- testsuite/libffi.closures/nested_struct12.c | 86 + testsuite/libffi.closures/nested_struct13.c | 115 + testsuite/libffi.closures/nested_struct2.c | 11 +- testsuite/libffi.closures/nested_struct3.c | 11 +- testsuite/libffi.closures/nested_struct4.c | 9 + testsuite/libffi.closures/nested_struct5.c | 9 + testsuite/libffi.closures/nested_struct6.c | 11 + testsuite/libffi.closures/nested_struct7.c | 9 + testsuite/libffi.closures/nested_struct8.c | 11 + testsuite/libffi.closures/nested_struct9.c | 11 + .../libffi.closures/single_entry_structs1.c | 86 + .../libffi.closures/single_entry_structs2.c | 102 + .../libffi.closures/single_entry_structs3.c | 101 + testsuite/libffi.closures/stret_medium.c | 2 +- testsuite/libffi.closures/stret_medium2.c | 2 +- testsuite/libffi.closures/testclosure.c | 7 +- testsuite/libffi.closures/unwindtest.cc | 2 +- 236 files changed, 21879 insertions(+), 9444 deletions(-) create mode 100644 debian/patches/no-toolexeclibdir.diff create mode 100644 debian/patches/powerpc-fix-2.diff create mode 100644 debian/patches/powerpc-fix.diff create mode 100644 debian/patches/powerpc64-fix-2.diff create mode 100644 debian/patches/powerpc64-fix.diff create mode 100644 include/tramp.h rename m4/{ax_append_flag.m4 => ax_prepend_flag.m4} (74%) create mode 100644 src/csky/ffi.c create mode 100644 src/csky/ffitarget.h create mode 100644 src/csky/sysv.S create mode 100644 src/kvx/asm.h create mode 100644 src/kvx/ffi.c create mode 100644 src/kvx/ffitarget.h create mode 100644 src/kvx/sysv.S create mode 100644 src/loongarch64/ffi.c create mode 100644 src/loongarch64/ffitarget.h create mode 100644 src/loongarch64/sysv.S create mode 100644 src/powerpc/t-aix create mode 100644 src/tramp.c create mode 100644 testsuite/libffi.call/bpo-38748.c rename testsuite/libffi.call/{pyobjc-tc.c => pyobjc_tc.c} (100%) create mode 100644 testsuite/libffi.call/s55.c create mode 100644 testsuite/libffi.call/struct_by_value_2.c create mode 100644 testsuite/libffi.call/struct_by_value_3.c create mode 100644 testsuite/libffi.call/struct_by_value_4.c create mode 100644 testsuite/libffi.call/struct_by_value_big.c create mode 100644 testsuite/libffi.call/struct_by_value_small.c create mode 100644 testsuite/libffi.call/va_2.c create mode 100644 testsuite/libffi.call/va_3.c delete mode 100644 testsuite/libffi.closures/cls_uchar_va.c delete mode 100644 testsuite/libffi.closures/cls_ushort_va.c create mode 100644 testsuite/libffi.closures/nested_struct12.c create mode 100644 testsuite/libffi.closures/nested_struct13.c create mode 100644 testsuite/libffi.closures/single_entry_structs1.c create mode 100644 testsuite/libffi.closures/single_entry_structs2.c create mode 100644 testsuite/libffi.closures/single_entry_structs3.c diff --git a/ChangeLog b/ChangeLog index fad8eae..1ca669e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,3288 @@ +commit f24180be1367f942824365b131ae894b9c769c7d +Author: Anthony Green +Date: Sun Oct 23 20:17:29 2022 -0400 + + Update to version 3.4.4 + +commit 848052fabb207d6f56485c8c2c3509eddecbe828 +Author: Anthony Green +Date: Sun Oct 23 11:25:10 2022 -0400 + + More aarch64 fixes + +commit af0f14cd6d932bd1c2f7c39c01e2df3b0ad19ea9 +Author: Icecream95 +Date: Mon Oct 24 04:08:10 2022 +1300 + + Fix types of temporary variables in aarch64 extend_integer_type (#745) + + Fixes truncated values in weston-info output. + +commit f7233db2a781b43e419a30edbec7639f74fa2a00 +Author: musvaage <112724366+musvaage@users.noreply.github.com> +Date: Mon Oct 17 17:26:17 2022 -0500 + + typos (#742) + +commit 45e492952e9f984a105ab281fb9433a4bbc12146 +Author: Anthony Green +Date: Sun Oct 16 12:41:56 2022 -0400 + + Add 32-bit cygwin test + +commit 93cfb655200f34ab1b2b7d8955291c457b91ee9f +Author: Anthony Green +Date: Mon Oct 10 14:32:35 2022 -0400 + + Correction for older compilers + +commit 77a0fb82b53087647a12334c6ddd590ea6215199 +Author: Andreas Schwab +Date: Mon Oct 10 17:59:04 2022 +0200 + + Flush output before aborting (#740) + + Co-authored-by: Andreas Schwab + +commit 3874fd9865eef72a5cf5a761781b51f8db9fa267 +Author: Andreas Schwab +Date: Mon Oct 10 17:58:48 2022 +0200 + + Fix strict aliasing problem in aarch64 ffi_call (#739) + + The assignment a = &dest in ffi_call_int may be moved after the call to + extend_integer_type because that function accesses the assigned value with + a different type. + + Co-authored-by: Andreas Schwab + +commit 4b0c358e28fae22164bf0d423f183dfed8a1ba10 +Author: Andreas Schwab +Date: Mon Oct 10 17:57:47 2022 +0200 + + riscv: make copies of structs passed by reference (#738) + + Co-authored-by: Andreas Schwab + +commit c163d93ac032a101cda1818855d681430f7af89a +Author: Anthony Green +Date: Sat Oct 8 18:35:38 2022 -0400 + + Add gcc-12 testing for aarch64 linux + +commit 62fd1f218be35976858a9f3a0b36fe0d38146bc9 +Author: Anthony Green +Date: Sun Oct 2 13:03:37 2022 -0400 + + Tweak quotes + +commit e1d1b094d31dbf97bd53c09736be97e1e9812d6a +Author: Anthony Green +Date: Wed Sep 28 10:16:45 2022 -0400 + + Add . + +commit b45f68949d7d1b705eb5e26f58a09972ad70a9c4 +Author: Anthony Green +Date: Wed Sep 28 10:16:01 2022 -0400 + + Update README for 3.4.4. + +commit 817a43fbc1d6d1c702c492e926f158b17ae988e4 +Author: Anthony Green +Date: Wed Sep 28 09:05:45 2022 -0400 + + Revert to previous cfi check. (#735) + +commit 963c4a969326192a2a0ad536d3943f21dbbb0eaa +Author: Anthony Green +Date: Tue Sep 27 22:05:42 2022 -0400 + + Remove nested comments + +commit e9e44157526c00bfd1142175ed6a7eb936ea0ede +Author: Anthony Green +Date: Tue Sep 27 21:25:30 2022 -0400 + + Don't tweak path + +commit 4594dcc98770b4fa60fce313abf557f090f8a0fd +Author: Anthony Green +Date: Tue Sep 27 21:05:26 2022 -0400 + + Fix find + +commit fe68a7b998329f471c3c0c5726073b9cb1a5a126 +Author: Anthony Green +Date: Tue Sep 27 20:29:17 2022 -0400 + + Locate tools + +commit cfb3f4c255cda534d1dc5de6a31cff70f02f9d69 +Author: Anthony Green +Date: Tue Sep 27 20:13:42 2022 -0400 + + Use cross tools for Windows + +commit ae544e0043079d778fdf0e16408db3b7a6d723bd +Author: Anthony Green +Date: Tue Sep 27 18:23:06 2022 -0400 + + Fix shell + +commit b8d849bd85294253787bbe1838de354ad2f54201 +Author: Anthony Green +Date: Tue Sep 27 17:58:31 2022 -0400 + + Find ms tools + +commit 9785eee066782d7575023f94b64402963b55aa8c +Author: Anthony Green +Date: Tue Sep 27 17:39:44 2022 -0400 + + 32- and 64-bit Windows + +commit 1421717effc7b5052e3c26e2b715a83a8a61355c +Author: Anthony Green +Date: Tue Sep 27 08:13:17 2022 -0400 + + Add "lto" to triple to identify lto builds + +commit 425acd4c2f217b00868ec1577c20b73de032c114 +Author: Anthony Green +Date: Tue Sep 27 07:57:37 2022 -0400 + + Try aarch64 linux with -flto + +commit c4261a0588fa997837e44f8417fc8577b37cd461 +Author: Anthony Green +Date: Mon Sep 26 16:45:00 2022 -0400 + + Show compiler version + +commit a1467200c36ce80dacb8d9d0d50049765809b6f4 +Author: Anthony Green +Date: Mon Sep 26 11:41:48 2022 -0400 + + Never link pthread for android + +commit 5ce26a0e03eacb483709189e8cbb05509fa68612 +Author: Frederik Seiffert +Date: Mon Sep 26 13:43:40 2022 +0200 + + CI: add Android builds (#732) + +commit 55bcc47717bb0f9c5276a45710d757cda7a61f8e +Author: Anthony Green +Date: Sat Sep 24 22:03:52 2022 -0400 + + Test idea borrowed from cpython + +commit a2473cde0a02c096dc3e0b57f0cb73f598765570 +Author: Anthony Green +Date: Sat Sep 24 21:41:02 2022 -0400 + + or1k: All struct args are passed in memory + +commit f93224d38662a8cdc33ca56fe6f2d5650a86d690 +Author: Anthony Green +Date: Sat Sep 24 21:38:57 2022 -0400 + + moxie: All struct args are passed in memory + +commit e79f19489bb294ce60bef5cdba5e56c3e7d84382 +Author: Anthony Green +Date: Sat Sep 24 17:11:30 2022 -0400 + + Add test case transcribed from cpython + +commit ab96038772ec4f4ccfaf49d621cd20f58742c401 +Author: Anthony Green +Date: Mon Sep 19 19:42:35 2022 -0400 + + Set host triplet for native builds + +commit a6fc81653d6ce649a6bc29675baa112c68a21df0 +Author: Anthony Green +Date: Mon Sep 19 19:25:09 2022 -0400 + + Update job names + +commit 6b7fb6ce9eb4751ed3179de256566971c9d46cb7 +Author: Anthony Green +Date: Mon Sep 19 18:23:42 2022 -0400 + + Give better names to CI workflows + +commit f0675ab7e85ca31095b51db5a5c955f1005240cb +Author: Anthony Green +Date: Mon Sep 19 17:30:51 2022 -0400 + + Update version to 3.4.4-experimental + +commit e3eaa609882fbcffb6c1b21270b6ff46fb57699f +Author: Hans +Date: Mon Sep 19 23:26:59 2022 +0200 + + Suppress error console output duing configure in case not an ELF file (#729) + + On Cygwin, MSYS and MinGW readelf is available, but files generated are no + ELF files. This results in an Error output on console: + 'checking whether .eh_frame section should be read-only... readelf: Error: Not an ELF file - it has the wrong magic bytes at the start + yes' + With this patch the error output is suppressed resulting in only + 'checking whether .eh_frame section should be read-only... yes' + Setting of related variables is not changed. + + Co-authored-by: Hannes Müller <> + +commit 84817695eab13c282436fca278bde2384ca955e5 +Author: Anthony Green +Date: Mon Sep 19 13:31:46 2022 -0400 + + Fix typo + +commit 53338d2bbf547682b2461a6e4199276e24ec5c85 +Author: Anthony Green +Date: Mon Sep 19 13:07:50 2022 -0400 + + Update version + +commit 0bd41b75df49f002f3fee9f4d5df225d742d3f1b +Author: Anthony Green +Date: Mon Sep 19 12:26:05 2022 -0400 + + Update libtool version + +commit 9b1dd8f2d5af8c76d120ffd566bf3c821580c96c +Author: Anthony Green +Date: Mon Sep 19 12:22:04 2022 -0400 + + Update version to 3.4.3 + +commit 0a769ccc0f7a4a7e3e76a79b61c28341fc47e3be +Author: Anthony Green +Date: Mon Sep 19 08:17:15 2022 -0400 + + Update release dates + +commit f26b56e1c547d2b4d8c9303275ecea47b5936184 +Author: Anthony Green +Date: Mon Sep 19 08:15:22 2022 -0400 + + Add new files for distribution + +commit b801b54b667340867441e922c14230a93832c8e2 +Author: Anthony Green +Date: Mon Sep 19 06:49:32 2022 -0400 + + Mention AIX with GCC + +commit ff34df233c863371912881516eae039f850fcad6 +Author: Anthony Green +Date: Mon Sep 19 06:45:19 2022 -0400 + + Update comment about platform support + +commit 598ea692b81ac8116bd9907d2b498c16fc92bde7 +Author: Anthony Green +Date: Mon Sep 19 06:43:41 2022 -0400 + + Clean ups, preparing for new release + +commit fc6b939066f211b99eed3c8111e446ec95d51ca6 +Author: Anthony Green +Date: Mon Sep 19 06:42:29 2022 -0400 + + Standardize temp exec file creation + +commit 4c2984c43fbb3db8e65b2b5702b27944eb0ed343 +Author: Anthony Green +Date: Sun Sep 18 15:06:57 2022 -0400 + + Handle win32 ABIs for struct return + +commit b05dc51bbe9aef6fcac66a8e68b59472bfaff126 +Author: Anthony Green +Date: Sun Sep 18 13:03:10 2022 -0400 + + Debug x86 + +commit cafdb8377a8be2eadac05c318fae9ef6786c36c2 +Author: Anthony Green +Date: Sun Sep 18 12:05:12 2022 -0400 + + Revert + +commit acf0ce9e9b0bcd73d39f599a53e9924ba74c13c1 +Author: Anthony Green +Date: Sun Sep 18 11:04:54 2022 -0400 + + Add test case + +commit b49308eaac7288e01a36894598fb62bfaf61b238 +Author: Anthony Green +Date: Sun Sep 18 08:26:23 2022 -0400 + + Add missing ABI_ATTR + +commit 735e7be4fb2a0401a9ca66cc64004b8b3418feb3 +Author: Anthony Green +Date: Sun Sep 18 08:21:34 2022 -0400 + + X86 is never defined. + +commit ee22ecbd11f52f8de1adbb2a6561aee2125a576a +Author: Hans +Date: Sun Sep 18 01:56:25 2022 +0200 + + Add MSYS configuration files (#728) + + * Add MSYS configuration files + + MSYS behaves very similiar to Cygwin, e.g. also __CYGWIN__ is defined. + Now 'make check' passes on MSYS without extra patches. + + * Fix warning extra tokens at end of #endif in closures.c + + Extra tokens converted into a comment. Also nearby indentations corrected. + + * Fix missing prototype warning mkostemp() on Cygwin + + Cygwin requires also _GNU_SOURCE to be defined to enable mkostemp() prototype. + + * Fix warning label ‘out’ defined but not used in ffi functions + + Define same preprocessor conditions for goto and label visibility. + + * Fix warning label ‘out’ defined but not used and related indentations. + + Define same preprocessor conditions for goto and label visibility. Correct also + related indentations. + + Co-authored-by: Hannes Müller <> + +commit 5e010474cf2e30fa053f0a1a460a752f06438cf7 +Author: Anthony Green +Date: Thu Sep 15 16:57:59 2022 -0400 + + Fix test case for 64-bit mingw + +commit 305cde7904ab676b7974ae68acb40b788b4c484e +Author: Anthony Green +Date: Thu Sep 15 15:50:35 2022 -0400 + + Passes on 64bit mingw + +commit 05785cafcf584d80c6b48651e1d33c4a3feca75c +Author: Anthony Green +Date: Thu Sep 15 15:18:09 2022 -0400 + + Fix arg alignment for STDCALL + +commit 98d4ad65e9933ed4878ef4aacfaa8299e467a903 +Author: Anthony Green +Date: Thu Sep 15 09:42:53 2022 -0400 + + Fix test headers + +commit 2abf00a6c61f4cf6232dc50f28204be020bef05d +Author: Anthony Green +Date: Thu Sep 15 08:25:39 2022 -0400 + + Tweak msys2 tools again + +commit d1b31536af74590b74236a00254e77617a8d50b0 +Author: Anthony Green +Date: Thu Sep 15 08:16:26 2022 -0400 + + Fix msys2 tool selection + +commit d352ed366722d5dfce0c1581c3820124c0bbafed +Author: Anthony Green +Date: Thu Sep 15 08:10:53 2022 -0400 + + Build 32- and 64-bit msys2 + +commit 4d0a0384ce11446e02fb7f233aae5c19c8082fb1 +Author: Anthony Green +Date: Thu Sep 15 07:58:26 2022 -0400 + + msvc requires the printf change, not mingw + +commit a509abf6b0ef9045b8df05b0c3663969b21290c4 +Author: Anthony Green +Date: Thu Sep 15 06:45:00 2022 -0400 + + Install unzip + +commit 950ed4a75384c4e7b0a512cb49f71f4d99c50a5d +Author: Anthony Green +Date: Thu Sep 15 06:33:14 2022 -0400 + + Don't make msys2 default shell + +commit 5d02c0cca3750c7aac61971b9e4cb94940793303 +Author: Anthony Green +Date: Thu Sep 15 06:28:23 2022 -0400 + + Try msys2 + +commit 64a78fa760c581f9c70199abb34aef1e0d086bd2 +Author: Anthony Green +Date: Thu Sep 15 06:08:30 2022 -0400 + + Try new path + +commit 77fdeae859f3ab96bc936f0a967d34a5609af40d +Author: Anthony Green +Date: Thu Sep 15 01:37:31 2022 -0400 + + Find mingw32 + +commit bb4e7278b7f362afd03d128e7cb68a5e0e2efaf7 +Author: Anthony Green +Date: Thu Sep 15 01:28:58 2022 -0400 + + DEbug + +commit 7443b421d39087cad2e607d00b845c670b18920f +Author: Anthony Green +Date: Wed Sep 14 23:17:21 2022 -0400 + + Try new shell + +commit 2ebc36f4be835437fa5d6c4c2b796fc22f769323 +Author: Anthony Green +Date: Wed Sep 14 23:11:52 2022 -0400 + + Fix indentation + +commit 3740b243277c6dc210d45bd0b4f8abe8c2e1cb29 +Author: Anthony Green +Date: Wed Sep 14 23:10:43 2022 -0400 + + set mingw32 path + +commit 7bf23f899cef435d023ecc8afde34d9e83829c2f +Author: Anthony Green +Date: Wed Sep 14 23:04:42 2022 -0400 + + Rename job + +commit ce5b2208121667236874181360ca91aaa285b528 +Author: Anthony Green +Date: Wed Sep 14 23:02:32 2022 -0400 + + Fix mingw32 github actions + +commit 317c9b6a13d3414c510b27bdc7ce57be56399df5 +Author: Anthony Green +Date: Wed Sep 14 22:54:10 2022 -0400 + + Add mingw32 testing + +commit 19e8354ff9b608b5410451caef6a9773375de005 +Author: Anthony Green +Date: Wed Sep 14 07:36:06 2022 -0400 + + Fix test case + +commit 4932f351579fb722e1e0b58a173b1571a6dfae79 +Author: Anthony Green +Date: Wed Sep 14 07:08:06 2022 -0400 + + Improve test case + +commit 819b01ced894028d41a34ec0178de9e7637b23de +Author: Anthony Green +Date: Wed Sep 14 07:07:15 2022 -0400 + + Add test case + +commit b577a5b801b1d1aef1aec5920d34fd1fd6597122 +Author: Anthony Green +Date: Mon Sep 12 10:23:59 2022 -0400 + + Mention Cygwin static trampoline support. + +commit 4b54a6471a8f98eb8bc1ea1694a8f3a3a433e538 +Author: Anthony Green +Date: Mon Sep 12 09:02:08 2022 -0400 + + Fix limits.h inclusion for cygwin + +commit a1130f37712c03957c9b0adf316cd006fa92a60b +Author: Anthony Green +Date: Mon Sep 12 08:53:06 2022 -0400 + + Add static trampoline support for Cygwin + +commit 26cc9a6c73c80e8459c25da3718c91cf5a36cbd8 +Author: Anthony Green +Date: Sat Sep 10 20:36:45 2022 -0400 + + Remove stray }} + +commit 078184887d65bf4a3ecd2f78f6cdbf4c91ccc357 +Author: Anthony Green +Date: Sat Sep 10 11:45:28 2022 -0400 + + Update rlgl usage (switch from player ID to labels) + +commit 6e7caacb9c94efba6775825df2479be389da51f1 +Author: Anthony Green +Date: Sat Sep 10 10:31:37 2022 -0400 + + Label rlgl reports + +commit d9a19e21c2b86e03b6acb8a2d73d992c8e4974e8 +Author: Anthony Green +Date: Wed Sep 7 07:58:03 2022 -0400 + + The right kind of quotes + +commit 2b2644969cbeeaee50938fbea591ea7f85df809e +Author: Anthony Green +Date: Wed Sep 7 07:57:26 2022 -0400 + + More quotes + +commit eb9eb1f6f041548fe670c76f7a90d1c53c75d620 +Author: Anthony Green +Date: Wed Sep 7 07:49:51 2022 -0400 + + Fix random build dir + +commit ea124a99da9efb3bde86a1706e15f62be7e68a66 +Author: Anthony Green +Date: Wed Sep 7 07:21:21 2022 -0400 + + Remove bogus sparc compiler flag + +commit cca77833fd53ffec93a4962d1e9cd7ea5a38f13f +Author: Anthony Green +Date: Wed Sep 7 07:20:59 2022 -0400 + + Fix typo + +commit 8ee64076f1b7cc654ff24adaffff25ddb3d57484 +Author: Anthony Green +Date: Wed Sep 7 07:14:13 2022 -0400 + + Fix typo + +commit 086935029d23dad133c97dfaf68749b7726460a1 +Author: Anthony Green +Date: Wed Sep 7 07:12:10 2022 -0400 + + Set CC and CXX for GCC compile farm builds + +commit da905276850342df0f9dfe2c775f6c649d4eed6b +Author: Anthony Green +Date: Tue Sep 6 21:15:58 2022 -0400 + + dlmmap fix and always check for PaX MPROTECT on linux + + Also make EMUTRAMP experimental + From Stefan Bühler + https://github.com/libffi/libffi/pull/282 + +commit b86c3dc0950ad5d8991e3970d56daeb409650d60 +Author: Anthony Green +Date: Tue Sep 6 14:25:09 2022 -0400 + + Fix typos + +commit c9be1378c709586f264dd643f92f71b9f1a842b2 +Author: Anthony Green +Date: Tue Sep 6 14:12:21 2022 -0400 + + Retry autoconf downloads + +commit 62471fd078db7ef66ca8b3118187a2911f2bb3e7 +Author: Anthony Green +Date: Tue Sep 6 13:00:02 2022 -0400 + + Fix typo + +commit b2344575569bc3bd129ad0ff92b49dc220fb287b +Author: Anthony Green +Date: Tue Sep 6 12:43:08 2022 -0400 + + Fix unwindtest on macos + +commit fc4e7c4a10dff3c99d7ea9be33d47e6d5f0efda7 +Author: Anthony Green +Date: Mon Sep 5 22:13:58 2022 -0400 + + Install automake on macos + +commit 5a6c94f7d49bcd64c85bde04c2d1f10b59d5797c +Author: Anthony Green +Date: Mon Sep 5 22:04:52 2022 -0400 + + Test with gcc and clang on macos 11 and 12. + +commit 351318e3bde9ac90c6d5eddbaa7f26ee3e7bcc6c +Author: Anthony Green +Date: Mon Sep 5 15:45:53 2022 -0400 + + Switch to 7 char SHA IDs. Fix windows crlf at git clone time. + +commit 2a024088801403ca0c579d20c3decb8dc1453df1 +Author: Anthony Green +Date: Mon Sep 5 12:56:19 2022 -0400 + + Use GitHub SHA for rlgl ID + +commit e4c5d46b0abaa8a12e97f0e0673e3efdda59fab8 +Author: Anthony Green +Date: Mon Sep 5 12:19:57 2022 -0400 + + Pass large structs by value + +commit 4b79267be359b42e7a4cbf95068abe805aae0061 +Author: Anthony Green +Date: Mon Sep 5 08:11:45 2022 -0400 + + outputs vs output + +commit 3020ad832144e35d2a42fb8782ddbd3ed69fdbaf +Author: Anthony Green +Date: Mon Sep 5 08:07:57 2022 -0400 + + Use single quotes + +commit f969a50aadfdf288797d5492dfb768d9916b9477 +Author: Anthony Green +Date: Mon Sep 5 08:06:53 2022 -0400 + + Try {{}} + +commit 8df671a35e517f27da78b1b933f19294cfc7224f +Author: Anthony Green +Date: Mon Sep 5 08:05:39 2022 -0400 + + Fix compares + +commit 6a9bbc85a95a8a6d314452c8c5ef4add61e7b280 +Author: Anthony Green +Date: Mon Sep 5 07:54:47 2022 -0400 + + Show host availability + +commit 49a361c35b3d826c02e6dc3f15c86555e62ed933 +Author: Anthony Green +Date: Mon Sep 5 07:51:34 2022 -0400 + + Fix conditionals? + +commit d9189beb6e61b20ff4b84fd994d895a29351c422 +Author: Anthony Green +Date: Mon Sep 5 07:47:46 2022 -0400 + + Use boolean values + +commit 2bcdcda8eda82cce594d2c821fc6a87069041bcc +Author: Anthony Green +Date: Mon Sep 5 07:44:01 2022 -0400 + + Try conditional steps + +commit d86d55e51fc2d35ff3a829d41c8ec1c83570cd40 +Author: Anthony Green +Date: Mon Sep 5 07:15:38 2022 -0400 + + Tweak test for host availability + +commit 5b4d5f2b3a3f3f9fb71ce40e3be00ae6191ffc37 +Author: Anthony Green +Date: Mon Sep 5 07:11:12 2022 -0400 + + Fix triples + +commit 02e6a894cbb1d851ec1a31b3277f2414c4a1370f +Author: Anthony Green +Date: Mon Sep 5 06:55:08 2022 -0400 + + Add missing paren + +commit fcaa8ebbccf2e2e4e0317164b624b683ac95c474 +Author: Anthony Green +Date: Mon Sep 5 06:47:40 2022 -0400 + + Unnest quotes + +commit f4009ed4f0351c6c8e8f410dac7c558fe9996e7e +Author: Anthony Green +Date: Mon Sep 5 06:40:00 2022 -0400 + + Fix syntax error + +commit f92e32cfacdbf82172b06ce13d63eab65f205598 +Author: Anthony Green +Date: Mon Sep 5 06:17:38 2022 -0400 + + Try dribbling output during make check + +commit ef57e08aa34dc9f55abb493a554a957ca358d931 +Author: Anthony Green +Date: Sun Sep 4 22:35:32 2022 -0400 + + Split up build into multiple steps + +commit 2480cc48def54eb155429710187452e0d495b773 +Author: Anthony Green +Date: Sun Sep 4 21:09:06 2022 -0400 + + Try to fix ssh issues + +commit 1105db1ce6cf1f7ab5a254cd04453b0c5e9dad30 +Author: Anthony Green +Date: Sun Sep 4 09:52:28 2022 -0400 + + Try forcing exit upon completion + +commit 92a7775150978b3e98b0d47280dd6dd6580dbd07 +Author: Anthony Green +Date: Sun Sep 4 09:17:01 2022 -0400 + + Source .profile on remote host if it exists + +commit 8e3ea879a9e538c9237c34ae113babe078565da9 +Author: Anthony Green +Date: Sun Sep 4 09:07:13 2022 -0400 + + Only ignore errors when testing for ssh connectivity. + +commit a643db6c1f1bd7594e42a03865b7a9063cfbf1c1 +Author: Anthony Green +Date: Sun Sep 4 08:28:50 2022 -0400 + + Don't fail on error + +commit 33f1f19a7da022a7d8dba59bb97c28cb4fd6aadf +Author: Anthony Green +Date: Sun Sep 4 08:24:06 2022 -0400 + + Add POWER hosts + +commit 7a300f3d657ee7b94bda5296b3b366b5915a5c79 +Author: Anthony Green +Date: Sun Sep 4 08:08:47 2022 -0400 + + Fix the setting of the host + +commit b104dd621f9d2b298ede781f0bd289ce8a0c20ee +Author: Anthony Green +Date: Sun Sep 4 08:07:12 2022 -0400 + + If a remote host is unavailable, don't fail the build. + +commit 7194e11832ad9609bd38c2a1fd4995d749443ee0 +Author: Anthony Green +Date: Sun Sep 4 08:01:47 2022 -0400 + + Debug build + +commit 6fccf95b4f97335eda1d8bfe2e12fc38bea571d2 +Author: Anthony Green +Date: Sun Sep 4 07:57:53 2022 -0400 + + Add connection timeouts and retries + +commit b4cf3d64b1807667eba7863701b6fcae68c65e68 +Author: Anthony Green +Date: Sun Sep 4 07:32:18 2022 -0400 + + Prune warnings from sparc64 linux ld + +commit 807283704a4a77187103f9d4d73c9feb75f3c757 +Author: Anthony Green +Date: Sun Sep 4 07:21:02 2022 -0400 + + For host triples to distinguish m1 arm64 from others. + +commit 4cba6c1858e842ef674ed41b5d79bc981fdfc411 +Author: Anthony Green +Date: Sat Sep 3 11:42:11 2022 -0400 + + Don't exit if runtest fails + +commit 439dfa1f7f96aec5689d5b28511e0162bc0ae3f9 +Author: Anthony Green +Date: Sat Sep 3 10:42:46 2022 -0400 + + Fix spaces + +commit b7d9e3a1a0c3138df513cd5df49a0e14584c7556 +Author: Anthony Green +Date: Sat Sep 3 10:41:45 2022 -0400 + + Run rlgl + +commit e85b55c2d30783db52d148f2691c8a3afd3d4ec3 +Author: Anthony Green +Date: Sat Sep 3 10:16:01 2022 -0400 + + Fix recursive copy flag + +commit 98168532a22615bd2aab0f3bf08e8a5f8abcd375 +Author: Anthony Green +Date: Sat Sep 3 10:14:56 2022 -0400 + + Fix typo + +commit 943219e3281d4f9f3ae416ca3bf9fd3482cf8c63 +Author: Anthony Green +Date: Sat Sep 3 10:13:04 2022 -0400 + + Use scp, as rsync isn't available on all hosts + +commit 0e912017c96afe6bf6500e90075df6b7366c337a +Author: Anthony Green +Date: Sat Sep 3 10:04:54 2022 -0400 + + Use ssh port numbers and copy dejagnu results back + +commit c8fe3d3d440d46b7b465e8d11ea8461a5ae86462 +Author: Anthony Green +Date: Sat Sep 3 09:58:43 2022 -0400 + + Use username + +commit 3e75f9554f06bab33e022276d320a301f1b04e44 +Author: Anthony Green +Date: Sat Sep 3 09:56:13 2022 -0400 + + Tighten permissions on key + +commit d893eda74196ecc39f1d839b340d0b158fc536eb +Author: Anthony Green +Date: Sat Sep 3 09:55:01 2022 -0400 + + Disable host key checking + +commit da35cf0fb693b6f93a745119c777b3c4aa6d779b +Author: Anthony Green +Date: Sat Sep 3 09:52:26 2022 -0400 + + Add quotes + +commit 128d57ab940a3a76658a8c8b4b98cd80fb602d65 +Author: Anthony Green +Date: Sat Sep 3 09:51:00 2022 -0400 + + Remove bad command + +commit 5b34bed4ff0a5c1c0257f4d586b868ded173dc67 +Author: Anthony Green +Date: Sat Sep 3 09:49:45 2022 -0400 + + Debug + +commit 77b32cb1533e5166bebf2a7cd1465e3a1eef55ad +Author: Anthony Green +Date: Sat Sep 3 09:43:41 2022 -0400 + + Fix typo + +commit 22c1ceb27597d21779c7565c94c444dadc606478 +Author: Anthony Green +Date: Sat Sep 3 09:42:01 2022 -0400 + + Simplify remote tests + +commit dde8e81deba0c2ef3edca804f34347bfae0e88bd +Author: Anthony Green +Date: Sat Sep 3 09:22:19 2022 -0400 + + Revert to old file copy + +commit 3cd913c8dafa71c1bb14ca5e1f4208343cc3a194 +Author: Anthony Green +Date: Sat Sep 3 09:19:08 2022 -0400 + + Remove SHA256 + +commit 3127a25df827f2afa3f6bdfdfceff169fe241fcf +Author: Anthony Green +Date: Sat Sep 3 09:13:16 2022 -0400 + + Try new fingerprint + +commit f095b747423806b44c2ef883ec65a7ce5230fbf7 +Author: Anthony Green +Date: Sat Sep 3 09:11:47 2022 -0400 + + Use correct fingerprint + +commit 1f44118157a005661b55f1747cfd15773214e458 +Author: Anthony Green +Date: Sat Sep 3 08:55:20 2022 -0400 + + Ignore fingerprints + +commit 8fd73fe61f496a24a4093ba1d195a884f86d547e +Author: Anthony Green +Date: Sat Sep 3 08:51:33 2022 -0400 + + Use rsa fingerprints + +commit 09c3908a4279f4c9e2c4a8282efb29c412964119 +Author: Anthony Green +Date: Sat Sep 3 08:43:23 2022 -0400 + + Use host fingerprints + +commit caa793a3401b92b0ef2006ab90c4dd30b7ab7d5c +Author: Anthony Green +Date: Sat Sep 3 08:35:56 2022 -0400 + + Try new scp + +commit 0cbffe5ef542641170b8cbe588fb703e7410cb13 +Author: Anthony Green +Date: Sat Sep 3 08:23:35 2022 -0400 + + Fix GITHUB_RUN_NUMBER usage + +commit 628cc2f675c6df35213d74388aac69c5c165b1f4 +Author: Anthony Green +Date: Sat Sep 3 08:16:47 2022 -0400 + + Fix loongarch64 server port. Try GITHUB_RUN_NUMBER. + +commit 9382d7955f80aaa6fc0ca036956fe4e14a0d45b6 +Author: Anthony Green +Date: Sat Sep 3 08:06:11 2022 -0400 + + Reference matrix variables properly + +commit e081b2cec74253b48a0d09d8a0d309f60e8f82e5 +Author: Anthony Green +Date: Sat Sep 3 07:58:27 2022 -0400 + + List cfarm servers explicitly + +commit 074e9c79e36e63a9cc8c8fca6c76dd927778dc54 +Author: Anthony Green +Date: Sat Sep 3 07:46:02 2022 -0400 + + Try multiple hosts + +commit 6002b2ad639f9125da56834e4b0a1b12fa232c57 +Author: Anthony Green +Date: Sat Sep 3 07:10:58 2022 -0400 + + Use correct version of scp-action + +commit a990426c5f4114c85f6cfc190276786ef5c49521 +Author: Anthony Green +Date: Sat Sep 3 07:09:33 2022 -0400 + + Use scp instead of rsync + +commit 0fabd777d91e13bb4795d0b9db0b2201f9298904 +Author: Anthony Green +Date: Sat Sep 3 07:02:34 2022 -0400 + + Remove extra debug + +commit 1922870fe3baf41991670db81b35c1ab0b482895 +Author: Anthony Green +Date: Sat Sep 3 06:53:52 2022 -0400 + + Debug rsync + +commit aee50966ca85d777271cd7e14714b916264cb190 +Author: Anthony Green +Date: Sat Sep 3 06:47:49 2022 -0400 + + Change remote path + +commit 73552c2e732df17c7f9008fecfc448c1d6397cfe +Author: Anthony Green +Date: Fri Sep 2 20:03:02 2022 -0400 + + Tweak + +commit 904424fe82bd6d4a498fee84b3f26d55426ff75f +Author: Anthony Green +Date: Fri Sep 2 19:58:19 2022 -0400 + + Work in actions dir + +commit 31c31db079b054270a19cc710f06fbb84e805511 +Author: Anthony Green +Date: Fri Sep 2 19:48:33 2022 -0400 + + Run autogen before copying files to remote server + +commit d84f2ea0ea760b8e63f50eb6c3583aeb38d89d0e +Author: Anthony Green +Date: Fri Sep 2 19:44:34 2022 -0400 + + Install autoconf + +commit 78beb4aee5386cd4ea14cfa753a778eafcc3ec2d +Author: Anthony Green +Date: Fri Sep 2 19:34:50 2022 -0400 + + Try more remote testing + +commit 16f17cd8418ce2239f8b9b31e5f3b5414298292f +Author: Anthony Green +Date: Fri Sep 2 19:16:12 2022 -0400 + + Fix ssh + +commit badccc01c84ee38f5f443c910ba06b3792029d8b +Author: Anthony Green +Date: Fri Sep 2 19:11:53 2022 -0400 + + Add platform + +commit 0eae6af297d9a34bd6adcbf43fbbd27e5feebc53 +Author: Anthony Green +Date: Fri Sep 2 19:09:43 2022 -0400 + + Missing colon + +commit ce8cec023499d8da04936e2dc40111f8d6a1783e +Author: Anthony Green +Date: Fri Sep 2 19:04:39 2022 -0400 + + Try cfarm access + +commit 9b58d4bad688820fa9bb077c0ec5f5949ac18bd2 +Author: Anthony Green +Date: Thu Sep 1 08:57:13 2022 -0400 + + GCC_AS_CFI_PSEUDO_OP passes on msvc, although it's not sufficient. + +commit e6d05bea0b4c350edaaf215a81f49298f34b10e4 +Author: Ole André Vadla Ravnås +Date: Thu Sep 1 14:51:15 2022 +0200 + + Fix struct padding warning reported by MSVC (#613) + + When building on 32-bit x86. + +commit 80912f2f09f4c06b2f720ff243d7b9b6795093f9 +Author: Clément Chigot +Date: Thu Sep 1 14:47:16 2022 +0200 + + Makefile: enable target overridings. (#661) + + This patch allows target to provide extra files enabling the + override of Makefile rules. + This patch is not needed for libffi itself but only for GCC on AIX. The + t-aix file which is here empty will be replaced in GCC repository. We cannot + include GCC version directly here because it has no sense for a standalone + libffi. + + Co-authored-by: Clement + +commit 1fa7d96cdf7bba354f61337854210f060ea56b9f +Author: Anthony Green +Date: Thu Sep 1 08:28:59 2022 -0400 + + Don't use cached configure test result + +commit bcb42e432b5372b1876e8c8db68837d92d1f94ae +Author: Anthony Green +Date: Thu Sep 1 08:05:01 2022 -0400 + + Fix .cfi pseudo-ops test. + + The existing tests were failing because the GCC was wrapping the test + asm in cfi directives, which gas doesn't like. So now we test if the + compiler emits them first, and assume that the assembler will accept + them. If that doesn't work, then we test if the assembler will accept + them assuming the compiler doesn't emit them. + +commit 0eb91425f355be19939507d4d4d056bdad12c9dd +Author: Anthony Green +Date: Wed Aug 31 20:46:24 2022 -0400 + + Change comment style + +commit ca76ab3b8551d9e7cee6f533ecd1e89fee70e16a +Author: Anthony Green +Date: Wed Aug 31 10:30:26 2022 -0400 + + Fix exports for tests + +commit 7b1dd8ce10e6bef043088896136105b8aabbb882 +Author: Anthony Green +Date: Wed Aug 31 09:49:21 2022 -0400 + + Don't -malign-double for x86-32 + +commit 41d0851fc545ff1ffd8377236d193268c8a10740 +Author: Anthony Green +Date: Wed Aug 31 07:36:43 2022 -0400 + + Update copyright year + +commit 5a4774cd4d90f9ea7e7f9e34b15de29463aba4c4 +Author: Xi Ruoyao +Date: Fri Jul 22 05:56:30 2022 +0800 + + static trampoline for LoongArch (#723) + + For the benefit and technical details of static trampoline, see + https://github.com/libffi/libffi/pull/624. As a new architecture, let's + be "safer" from the start. + + The change survived libffi testsuite on loongarch64-linux-gnu. + +commit 5264a7c5cd3460465326ebd347559828196dceb1 +Author: matoro +Date: Thu Jul 21 17:54:19 2022 -0400 + + Move FFI_TYPE definitions above include (#722) + + For powerpc at least, these definitions are referenced in the + target-specific ffitarget.h. Discovered in the jffi project. Should + close https://github.com/libffi/libffi/issues/637. Downstream jffi bug + https://github.com/jnr/jffi/issues/107. Downstream distro bug + https://bugs.gentoo.org/827215. + + Testing - both libffi and jffi test suites pass with this patch applied, + at least on ppc64le linux. I did not see any warnings about + redefinitions. + + Tested versions - libffi 3.4.2, jffi 1.3.6 and 1.3.9. + +commit ddc6764386b29449d941b2b18d000f2987a9d848 +Author: Anthony Green +Date: Sat Jun 25 22:04:53 2022 -0400 + + Add missing file + +commit 2b4728a21f9a36c6567df8dd27fc8a665264019c +Author: Anthony Green +Date: Sat Jun 25 21:58:51 2022 -0400 + + Fix path + +commit 37cc25bb25344ee33c5b7ff06c6804d31374a544 +Author: Anthony Green +Date: Sat Jun 25 21:56:40 2022 -0400 + + Install and use autoconf from special dir + +commit 2f2eab957d3acbf571c570ab2ccf894e3c85b033 +Author: Anthony Green +Date: Sat Jun 25 21:53:00 2022 -0400 + + Fix autoconf version number + +commit 4b1465495c9d6e5ef95bacc38b86483fd910f887 +Author: Anthony Green +Date: Sat Jun 25 21:51:25 2022 -0400 + + Fix wget + +commit 398b7534d97b2b642492fbb024e15be3df564da8 +Author: Anthony Green +Date: Sat Jun 25 21:49:09 2022 -0400 + + Fix wget + +commit 2c047eb7b108fba1203ba6122e830a7ae17721ca +Author: Anthony Green +Date: Sat Jun 25 21:46:54 2022 -0400 + + Fix untar + +commit 446c092f409bd37c21b5b986c2be8f87a1cb1dec +Author: Anthony Green +Date: Sat Jun 25 21:45:32 2022 -0400 + + Install autoconf-2.71 + +commit 5c76ac1ff55c4ed6faa145b395e9a14cdb834708 +Author: Anthony Green +Date: Sat Jun 25 21:22:01 2022 -0400 + + Update autoconf? + +commit 4a46f35ba5a4bbb3ea396e1fa836535d338f8930 +Author: Anthony Green +Date: Sat Jun 25 21:14:30 2022 -0400 + + Update configury + +commit fc8c8c1e2c31321b38dc079e549bc7748da4159d +Author: Anthony Green +Date: Sat Jun 25 11:06:00 2022 -0400 + + Fix ILP32 for aarch64 + +commit b5abc4f6478147ce72fa6b2eb95296883d5ef3ef +Author: Anthony Green +Date: Sat Jun 25 10:43:00 2022 -0400 + + Remove duplicate macro definition. + +commit 280fe78d37f58927b280e2e316a2ae19201f2b83 +Author: Xi Ruoyao +Date: Sat Jun 25 18:58:53 2022 +0800 + + configure.ac: use grep -E instead of egrep if possible (#720) + + Upstream will start to emit a warning if egrep is invoked in the next + grep release. Stop invoking it explicitly. Use AC_PROG_EGREP to try + "grep -E" first, and fallback to egrep if "grep -E" does not work. We + need this fallback for some non-GNU grep implementations (like Solaris). + + Url: https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a951562 + +commit 1f14b3fa92d4442a60233e9596ddec428a985e3c +Author: Russell Keith-Magee +Date: Fri Jun 3 02:46:35 2022 +0800 + + Ensure that VM_PROT_EXECUTE is set on the trampoline page. (#718) + +commit 000ecd01cb534fd8bb593422013a79c8497263ff +Author: Sergei Trofimovich +Date: Thu Jun 2 18:43:53 2022 +0000 + + powerpc64: fix build on gcc-12 (assembly requires AltiVec) (#719) + + Without the change build fails on powerpc64-gcc-12 as: + + src/powerpc/linux64_closure.S: Assembler messages: + src/powerpc/linux64_closure.S:363: Error: unrecognized opcode: `lvx' + + It's a 90205f67 "rs6000: Fix bootstrap (libffi)" patch by + Segher Boessenkool from gcc upstream repository. It's enough to get + libffi build on powerpc64. + +commit c528d5b45e248f47b5af6f16bfcafc779b196ed1 +Author: Anthony Green +Date: Sun May 29 11:22:38 2022 -0400 + + Fix windows arg passing + +commit aa2c4141722ec8b8b014b97e049ffa2d140d0c0d +Author: Anthony Green +Date: Sun May 29 10:28:10 2022 -0400 + + 64-bit cygwin: fix struct args. Document change. + +commit 36b265ae438a364722c98136ba79cb450a48fca3 +Author: Anthony Green +Date: Sun May 29 10:12:30 2022 -0400 + + m32r: pass copies of large structs + +commit c248764d3391a460cdd31a1cae82281fd6dfbecd +Author: Anthony Green +Date: Sun May 29 07:27:32 2022 -0400 + + Update testsuite Makefile + +commit fd1fe195e1d98b65ac3b0735cc0d0df95fc1b27b +Author: Martin Storsjö +Date: Sun May 29 14:16:49 2022 +0300 + + Fix building on aarch64 after e409225b41b60c490a094bb068e639a2364202fd (#716) + + The ALIGN_DOWN macro was renamed in 2018 in + e6eac7863e2bf1a009ea863041b354bdb4af6b67. + +commit c1e237b22ee6042e2d4229008acea8f38c3d0109 +Author: Anthony Green +Date: Sat May 28 20:46:14 2022 -0400 + + Pass large structs by value on the stack + +commit 769b7366d2312c7efdfa605cf1fc1156b94ba2e0 +Author: Anthony Green +Date: Sat May 28 19:59:35 2022 -0400 + + Fix for MS x64 ABI + +commit faafcb9df9aebdde1415a73d17fe9e943d97d455 +Author: Anthony Green +Date: Sat May 28 17:24:43 2022 -0400 + + Fix moxie struct passing + +commit f55d7ff1a24e9c678dac3397175772a9914c02b0 +Author: Anthony Green +Date: Sat May 28 14:30:13 2022 -0400 + + moxie: structs > 8 go on stack + +commit 55f80b026c2ac854086a2770d324fa55188f0f81 +Author: Anthony Green +Date: Sat May 28 14:17:53 2022 -0400 + + New test cases + +commit 72c3192773fe483f6517e343ecc3ea468ce73a4f +Author: Anthony Green +Date: Sat May 28 13:53:26 2022 -0400 + + Pass copies of large structs on the stack + +commit e409225b41b60c490a094bb068e639a2364202fd +Author: Anthony Green +Date: Sat May 28 09:42:13 2022 -0400 + + Pass large structs by value for Linux x86_64 and Aarch64. + + Aarch patch by Andreas Schwab. https://github.com/libffi/libffi/commit/482b37f00467325e3389bab322525099860dd9aa + +commit 01d54435c9f9e22345cb2f7d482fcfb42fd11416 +Author: Anthony Green +Date: Tue May 24 21:38:51 2022 -0400 + + Mention loongson64 + +commit f259a6f6deff9bdc7dd998b8b6bdbb4c166b33c3 +Author: zhangwenlong +Date: Wed May 25 09:31:08 2022 +0800 + + Support loongarch64 (#678) + + * update config.{guess,sub} + + * Support loongarch64 + + Co-Authored-By: Cheng Lulu + Co-Authored-By: Xi Ruoyao + Co-Authored-By: Xu Hao + Co-Authored-By: Zhang Wenlong + Co-Authored-By: Pan Xuefeng + + Co-authored-by: panxuefeng + Co-authored-by: Cheng Lulu + Co-authored-by: Xi Ruoyao + +commit d02d46607b5ba62510ddab5fa89303dfa09a7853 +Author: Anthony Green +Date: Tue May 24 12:28:08 2022 -0400 + + Debug cygwin builds + +commit 7e93ded9302d7e6e3cc77b39e8eec4b323e63585 +Author: Anthony Green +Date: Mon May 23 21:42:52 2022 -0400 + + Revert "Don't dereference beyond the last array entry. (#667)" (#715) + + This reverts commit 92d77d0e87a5f2a8c9c9b2431ffd264cb664e17a. + +commit 432384b6d47087d144d3e947b62c48ddc6e4740b +Author: Russell Keith-Magee +Date: Tue May 24 09:06:19 2022 +0800 + + Add support for ARM64 as an Apple simulator platform. (#712) + +commit 9af445fd70e4d7f2b3bdfc511cc3cc76a6b84c9a +Author: Kevin Bowling +Date: Mon May 23 18:05:01 2022 -0700 + + Upstream FreeBSD riscv patch (#708) + + Like 8276f812a99b10d1f2c387dbd6ef2ca4f597c733 commit message: + > devel/libffi: Fix abort() on ARM related to __clear_cache() + > + > The current FreeBSD __clear_cache() implementation does nothing #if + > __i386__ || __x86_64__ #else abort(); + > + > cognet@ advises this is an issue for anything !Apple that is using the + > libcompiler_rt provided by Clang on ARM, and requires upstreaming. + + Co-authored-by: Kristof Provost + +commit de95947ae5db07e4589bb16bab30b6c8ba2b3106 +Author: Roland Schatz +Date: Tue May 24 03:04:43 2022 +0200 + + Fix check for invalid varargs arguments. (#707) + +commit 92d77d0e87a5f2a8c9c9b2431ffd264cb664e17a +Author: Anthony Green +Date: Mon May 23 21:03:00 2022 -0400 + + Don't dereference beyond the last array entry. (#667) + +commit e504f90fe9123d256f6bc556badb25d1d0aa7046 +Author: A. Wilcox +Date: Mon May 23 18:42:32 2022 -0500 + + testsuite/libffi.closures: Fix PowerPC 64 (#709) + + -mlong-double-128 is only supported on glibc. + + This test still passes on glibc targets, and now passes on musl targets + as well (which uses 64-bit ldbl). + +commit f3e61d497a5ddc3bbe506e0554a0be421f6f0f35 +Author: Anthony Green +Date: Mon May 23 09:11:42 2022 -0400 + + Remove debug code + +commit a36880e710f2ec37c0cc50d436facd7c2d282e7b +Author: Anthony Green +Date: Mon May 23 08:35:21 2022 -0400 + + Remove stray export command + +commit 5f98afe802e189584e5649f53a7dd07280516efd +Author: Anthony Green +Date: Mon May 23 08:11:26 2022 -0400 + + Debug cygwin builds + +commit abaacbf8cdf80ddd9303fda5d9be4312d52b531c +Author: Anthony Green +Date: Mon May 23 07:57:26 2022 -0400 + + Debug cygwin tests + +commit e770fb76a781c642f185c23e686bf2af0429ce4c +Author: Anthony Green +Date: Sun May 22 20:43:41 2022 -0400 + + Clean up types + +commit 2e825e219fa06d308b9a9863d70320606d67490d +Author: YunQiang Su +Date: Mon May 16 09:47:11 2022 +0800 + + MIPS: fix some N32 test failure (#701) + + Some go closure and pointer testcase fails. + These failures is not introduced by the complex support code. + +commit 1f1c33753b65a75216770928018e8932168e8908 +Author: YunQiang Su +Date: Mon May 16 09:45:27 2022 +0800 + + MIPS: fix O32 softfloat support (#702) + +commit 3ac265d5c0e038e324bae29131dbc4bacb4935ea +Author: hjl-tools +Date: Sun May 15 18:43:56 2022 -0700 + + x86-64: Always double jump table slot size for CET (#710) (#711) + + When CET is enabled, double jump table slot size to add 4 bytes of ENDBR64 + for CET. Since CET enabled clang doesn't have the LLVM assembler bug: + + https://bugs.llvm.org/show_bug.cgi?id=21501 + + fixed by + + commit 04d39260d64e08b8bfb3844109ad43d4055b2e8d + Author: Rafael Espindola + Date: Wed Nov 4 23:50:29 2015 +0000 + + Simplify .org processing and make it a bit more powerful. + + we can use .org to allocate jump table slot size to 16 bytes. + +commit e67697c370e8875f28b2bf62fac25edad7558eca +Author: YunQiang Su +Date: Thu Mar 31 20:44:49 2022 +0800 + + MIPS: add Complex support (#698) + +commit e3cf8b806c3ca919f95b9d33d6037869a059c035 +Author: Ole André Vadla Ravnås +Date: Thu Mar 31 14:42:03 2022 +0200 + + Allow system to have overlapping mallopt defines (#700) + + Which is the case on some OSes, such as QNX. + +commit c086cacb8b9665fab0c046fc92959fc8af5239b8 +Author: Ole André Vadla Ravnås +Date: Thu Mar 31 14:40:59 2022 +0200 + + Clean up the QNX ARM bits (#699) + + - Add missing include. + - Use constants instead of magic values. + +commit ab1677106605aba1c27665964ff90bea59612ce3 +Author: Max Filippov +Date: Sun Feb 20 16:01:38 2022 -0800 + + Xtensa cleanups and XEA3 support (#677) + + * xtensa: clean up stack usage in ffi_trampoline call + + Space for outgoing call arguments reserved in the stack frame of the + function ffi_trampoline overlaps register spill overflow area at the + top of the frame. In xtensa XEA2 exception architecture the layout of + overlapping areas is identical so that even if the ffi_trampoline + registers frame gets spilled the memory contents doesn't change. + This is not so with the xtensa XEA3 exception architecture, where + registers a0 - a7 of a different function are spilled in that location. + + Reserve spill area for 8 registers to avoid overlapping of the spill + area with the outgoing call arguments area in the ffi_trampoline. + + Signed-off-by: Max Filippov + + * xtensa: support xtensa XEA3 exception architecture + + XEA3 requires that 32 bytes of register spill area is reserved in all + functions. Fix ffi_cacheflush entry instruction to satisfy this + requirement. + + Signed-off-by: Max Filippov + + * xtensa: maintain stack alignment + + xtensa ABI requires stack alignment on 16 byte boundary and passing + up to 6 arguments in registers. To simplify stack alignment maintenance + fixed amount of stack space is reserved for arguments passed in + registers and variable but correctly aligned amount is reserved for the + remaining arguments. After copying arguments to the stack and loading + registers the fixed part of the stack reservation is freed. + + Signed-off-by: Max Filippov + + * xtensa: fix err_bad_abi tests + + Check ffi_cif::abi value in the ffi_prep_closure_loc and return + FFI_BAD_ABI error if it's not one of the supported values. + + Signed-off-by: Max Filippov + +commit aa3fce08ba620c50db17215a9f14dd0f1facf741 +Author: Andreas Schwab +Date: Sun Feb 13 21:04:33 2022 +0100 + + riscv: extend return types smaller than ffi_arg (#680) + + Co-authored-by: Andreas Schwab + +commit 464b4b66e3cf3b5489e730c1466ee1bf825560e0 +Author: Dan Horák +Date: Mon Jan 31 14:08:09 2022 +0100 + + powerpc64: fix handling of homogeneous float128 structs (#689) + + If there is a homogeneous struct with float128 members, they should be + copied to vector register save area. The current code incorrectly copies + only the value of the first member, not increasing the pointer with each + iteration. Fix this. + +commit b60d4fc7bb4419021bf566e09de55ed1d9b041db +Author: rorth +Date: Thu Dec 23 14:32:46 2021 +0100 + + src/x86/win64.S: Use #define instead of .macro (#665) (#669) + + The Solaris/x86 assembler doesn't support .macro/.endm, so use #define since + win64.S is passed through cpp anyway. + +commit 4fa6239f42ddc7df12e40da9ae25ba715312239c +Author: Andreas Schwab +Date: Thu Dec 23 14:27:32 2021 +0100 + + testsuite/libffi.call: fix mismatching return types (#679) + + Co-authored-by: Andreas Schwab + +commit 0f2dd369cd5edcefad29b3fca4e1d08cb34f8f19 +Author: Jules Maselbas <54854023+jmaselbas@users.noreply.github.com> +Date: Wed Sep 22 21:39:56 2021 +0200 + + Makefile: Add missing kvx/asm.h to dist headers (#660) + + The header kvx/asm.h is required to build libffi and is missing from + the dist tarball. + + Signed-off-by: Jules Maselbas + +commit ee1263f7d43bd29b15fc72c4d9520a824e8004df +Author: Anthony Green +Date: Thu Jul 29 17:46:17 2021 -0400 + + Fix 'type'-o + +commit 86d5ecc5e84fbbc79fcff6a307310630d9d68549 +Author: Anthony Green +Date: Thu Jul 29 16:58:32 2021 -0400 + + Fix struct arg passing + +commit 03596285ed36b94bb3e1d8bdebfe58590e2766df +Author: Anthony Green +Date: Thu Jul 29 10:16:42 2021 -0400 + + No more xfail for alpha + +commit 4ac18f26ed16588377b1482208212aaa39624e21 +Author: Anthony Green +Date: Thu Jul 29 10:01:40 2021 -0400 + + Add alpha CPU + +commit 7643c6ee68e376810b4185e5f38e156c97bcc090 +Author: Anthony Green +Date: Thu Jul 29 08:51:35 2021 -0400 + + Try to fix ARM QEMU tests + +commit a04f57bce057604f38bb7c1bf32b7f671d2b56d5 +Author: Anthony Green +Date: Thu Jul 29 08:47:53 2021 -0400 + + Fix m32r testing + +commit 339acf3d8f049d296dafac3f482c1b7db29c0bae +Author: Anthony Green +Date: Thu Jul 29 08:38:18 2021 -0400 + + Debug cross-in-containers builds + +commit 43e4ad4d7b4bcc87ee447736a1172b2801a47908 +Author: Anthony Green +Date: Thu Jul 29 07:55:59 2021 -0400 + + Test passing structs by value + +commit 68485e33a413c3d91fbfd7ec270803ae6bd3d3db +Author: Anthony Green +Date: Thu Jul 29 07:13:35 2021 -0400 + + Mention x32 static tramponline fix + +commit 07f826fdd4d8a23a190f107f7ec6ad830a4864a0 +Author: Harald van Dijk +Date: Sun Jul 25 02:39:37 2021 +0100 + + Fix trampoline_code_table for x32. (#657) + + x32's struct tramp_parm has 32-bit pointers. This change adjusts the + loads and offsets accordingly. + +commit be0b3b6e75d4890fe18ba4164b91387beaebee06 +Author: Anthony Green +Date: Fri Jul 16 21:51:03 2021 -0400 + + Fix CHECK + +commit 7db17442a6c9f1399065748b7d5b9fbcac203344 +Author: Anthony Green +Date: Fri Jul 16 11:30:01 2021 -0400 + + Don't check the whole buffer, just what we printed. + +commit 8bcf594749882e9e4966fec2e3d6009d08a554ab +Author: Anthony Green +Date: Fri Jul 16 11:26:02 2021 -0400 + + Fix test case + +commit c96b057757446fe4277f30e8423f09851ae5d0fa +Author: Anthony Green +Date: Fri Jul 16 11:16:39 2021 -0400 + + Fix test check + +commit 4ed23be8e2a59e438c201ca1ba5affc0b0477b15 +Author: Anthony Green +Date: Fri Jul 16 11:08:01 2021 -0400 + + Fix test check + +commit eb2447249540ca568b0b464f6107501dcc0f65ab +Author: Hood Chatham +Date: Fri Jul 16 14:33:04 2021 +0000 + + Use CHECK to assert more things in test suite (#654) + + * Use CHECK to assert more things in test suite + + * Use snprintf instead of sprintf + + * Fix va_struct1 and va_struct3 + +commit a541fc600f4418441f91073a0834ea47b0989de9 +Author: Anthony Green +Date: Fri Jul 16 08:56:30 2021 -0400 + + Update README for next release. + +commit b4cf80ab54b6d9d31ef2135036e471388cf026df +Author: Anthony Green +Date: Fri Jul 16 08:55:02 2021 -0400 + + Trigger actions on master branch + +commit d1eef904766dbd647de6c240a57dbc98d46e33dd +Author: Anthony Green +Date: Fri Jul 16 08:29:08 2021 -0400 + + Migrate from travis-ci to github actions. + +commit f9ea41683444ebe11cfa45b05223899764df28fb +Author: Anthony Green +Date: Mon Jun 28 21:10:49 2021 -0400 + + Update version to 3.4.2 + +commit 2bdc8e52efb78d939f23efb4f9c515355610bff5 +Author: Anthony Green +Date: Mon Jun 28 19:50:29 2021 -0400 + + Version 3.4.1 + +commit c1d09bf08c2859abb40c476c57ae521d208f92a8 +Author: Anthony Green +Date: Mon Jun 28 18:50:31 2021 -0400 + + Update version to 3.4.0 + +commit 1ed0aa73806872f0c31dccf2c689c762239d3353 +Author: Anthony Green +Date: Mon Jun 28 18:45:11 2021 -0400 + + Fix warnings + +commit 0a2cc2ec2893821f62b36b269da1dbc0442a5617 +Author: Anthony Green +Date: Mon Jun 28 14:59:07 2021 -0400 + + Add missing test cases to distribution + +commit ee3ef737857e13cc01a15dbef298478d90188805 +Author: Hood Chatham +Date: Mon Jun 28 11:51:35 2021 -0700 + + Add tests for single entry structs (#653) + +commit f08c5ace5750f1e1f234f52f4d3d772bb8d276a0 +Author: Hood Chatham +Date: Mon Jun 28 07:24:19 2021 -0700 + + Fix the assertions in cls-24byte (#652) + + * Fix the assertions in cls-24byte + + * Update print statement too + +commit 4557f232926353f5cdec0f2f459e4d59ce8f19e4 +Author: Anthony Green +Date: Mon Jun 28 09:53:01 2021 -0400 + + 3.4.0 release candidate 2 + +commit cd4428911d5c4d25ce2c24e6728124792124bba2 +Author: Jeremy Huddleston Sequoia +Date: Mon Jun 28 04:56:30 2021 -0700 + + Add missing FFI_HIDDEN to ffi_tramp_is_present declaration (#651) + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 9fa94c607852081adce33547bde292fe4313cff7 +Author: Hood Chatham +Date: Sun Jun 27 11:02:33 2021 -0700 + + Print more information when an assertion fails in test suite (#649) + +commit 91eaadfb2e4b79d12a45d24002b06563e5905e5d +Author: Hood Chatham +Date: Sun Jun 27 09:49:31 2021 -0700 + + Fix signature of function pointer in cls_dbls_struct (#648) + +commit 132699b95d3ee4d889ea2a80540acf3300987dad +Author: Sergei Trofimovich +Date: Sun Jun 27 16:50:20 2021 +0100 + + configure.ac: add --disable-exec-static-tramp flag (#647) + + Some projects like GHC (Glasgow Haskell Compiler) and + gobject-introspection use `ffi_closure_alloc()` as a way + to allocate executable memory. exec static tramp + interferes with it (unclear how exactly yet). + + GHC symptom: ffi closure freeing cimplains about unexpected + trampoline (GHC manually fills one): + + ``` + $ ghci + GHCi, version 8.10.5: https://www.haskell.org/ghc/ :? for help + ghc: freeHaskellFunctionPtr: not for me, guv! 0x7f0417a1efe8 + ghc: freeHaskellFunctionPtr: not for me, guv! 0x7f0417a1efc8 + ``` + + gobject-introspection symptom: + + ``` + $ meld + Segmentation fault (core dumped) + + $ gdb --args /usr/bin/python3.9 /usr/bin/meld + (gdb) run + ... + Thread 1 "python3.9" received signal SIGSEGV, Segmentation fault. + 0x00007fffe9ac1ae8 in g_callable_info_free_closure ( + callable_info=0x555555d45990, closure=0x7fffe9e70c20) + at ../gobject-introspection-1.68.0/girepository/girffi.c:428 + 428 g_free (wrapper->ffi_closure.cif->arg_types); + (gdb) bt + callable_info=0x555555d45990, closure=0x7fffe9e70c20) + at ../gobject-introspection-1.68.0/girepository/girffi.c:428 + data=0x555555d252d0) + at ../pygobject-3.40.1/gi/pygi-closure.c:635 + ... + ``` + + To ease downstreams narrowing down the actual problem let's + provide a knob to disable exec static trampolines. + + The change for not affect current default. + + Signed-off-by: Sergei Trofimovich + +commit 4e07374c2773711902ec12905d5c64d95d22d050 +Author: Anthony Green +Date: Sun Jun 27 11:25:06 2021 -0400 + + Remove caveat about varargs support + +commit 11f9713887e1d8e9bdf861c1555de55aba9fc46c +Author: Anthony Green +Date: Sun Jun 27 07:46:12 2021 -0400 + + Update contact info + +commit f792adb61a27aa2a7d24573b956ce29ebdb82e03 +Author: Sergei Trofimovich +Date: Sat Jun 26 22:26:52 2021 +0100 + + configure.ac: allow user to specify READELF (#646) + + Before the change with x86_64-pc-linux-gnu cross-compiler + installed the configure was not able to find cross-readelf: + + ``` + $ ./configure --host=x86_64-pc-linux-gnu + ... + checking whether .eh_frame section should be read-only... .././configure: line 19540: readelf: command not found + yes + ... + ``` + + The change uses AC_CHECK_TOOL to automatically seatch for ${host}-readelf, + readelf. And as a bonus it also allows user to override readelf with + something like READELF=llvm-readelf. + + Signed-off-by: Sergei Trofimovich + +commit 9cf15b3a284d8e79f3673b8743d4157739df5d36 +Author: Anthony Green +Date: Sat Jun 26 12:12:06 2021 -0400 + + Make 3.4 release candidate 1 + +commit 1e5dc8de825d03f5493884a45e1edeacda2106c5 +Author: Anthony Green +Date: Sat Jun 26 12:08:35 2021 -0400 + + Add missing file from make dist. Add missing license info. + +commit c0b210c7fd1e5b4a17e9fc839a4cf1d75483d591 +Author: Anthony Green +Date: Sat Jun 26 10:55:57 2021 -0400 + + Remove test case + +commit 87429ce726ead7bb789d194c6d979c5b0c4086e9 +Author: Matthew Green <85970515+squidhacks@users.noreply.github.com> +Date: Sat Jun 26 08:49:45 2021 -0400 + + This test includes a closure and must live in the closures test directory. (#645) + + Co-authored-by: Matthew Green + +commit 8d83c7c1fa331b93e58967979c59c38600df1ee9 +Author: Hood Chatham +Date: Fri Jun 25 19:50:33 2021 -0700 + + Make test methods static (#644) + +commit becae7397873d6bb85a271b16961f055e71f42a6 +Author: Anthony Green +Date: Tue Jun 22 13:01:06 2021 -0400 + + Switch from travis-ci.org to travis-ci.com. + +commit fa1ef887d4dc5d18696517e32e2ae98310f0040d +Author: Anthony Green +Date: Tue Jun 22 08:48:24 2021 -0400 + + Avoid undefined behaviour + +commit 84bb56914756845371be62e2753041521fd5d261 +Author: Tres Finocchiaro +Date: Tue Jun 22 07:33:46 2021 -0400 + + Remove libtool-ldflags file from .gitignore (#600) + + This is correct. Thank you! + +commit 5651bea284ad0822eafe768e3443c2f4d7da2c8f +Author: Jakub Jelinek +Date: Tue Jun 15 15:19:26 2021 -0400 + + 2021-06-15 Jakub Jelinek + + * src/x86/ffi64.c (classify_argument): For FFI_TYPE_STRUCT set words + to number of words needed for type->size + byte_offset bytes rather + than just type->size bytes. Compute pos before the loop and check + total size of the structure. + * testsuite/libffi.call/nested_struct12.c: New test. + +commit f56eb85227bbcc7bd81232a338655146385a77ca +Author: DJ Delorie +Date: Tue Jun 15 08:50:20 2021 -0400 + + Don't stop test on copy failure (#636) + + * Don't stop test on copy failure + + Static-library tests were failing only because there were + no DLLs to copy. This change makes a copy failure not stop + the build; if a failed copy would otherwise be relevent, the + later tests would fail anyway. + + While there are more clever ways to solve this, a brute force + fix is sufficient. + + * [TEST] Try cygwin64; install more packages explicitly + + * use correct cygwin64 directory name + + appveyor has cygwin64 pre-installed in /cygwin64, and 32-bit cygwin + in /cygwin + + * More testing - revert VS change, bump travis timeout + + * Add -g to update the rest of perl + + * Skip execution tests on non-native platforms + + Special site.exp that skips the unix_load() command for arm platforms. + + Unset TERM to avoid cruft in stdout + + Try harder to find the libffi libraries + +commit ff059dd96af6ba4daf7bc9ddf22d1d2dbf6a177b +Author: vhankala <81743325+vhankala@users.noreply.github.com> +Date: Thu Jun 10 18:41:02 2021 +0000 + + Fix build on OpenBSD/mips64 (#638) + + The build fails on OpenBSD/mips64 because clang 11's integrated + assembler expects read-only .eh_frame: + + ../src/mips/n32.S:585:9: error: changed section flags for .eh_frame, expected: 0x2 + .section .eh_frame,"aw",@progbits + ^ + + Use EH_FRAME_FLAGS to get matching flags for the section. + +commit e6eb59cde6580607544160f8e7dedc326b4799fd +Author: Cheng Jin +Date: Wed Jun 9 16:00:10 2021 -0400 + + Add struct test to verify a nested float struct (#640) + + The test aims to check a nested float struct + [float, [float,float]] to see whether it works good + with libffi. + + Signed-off-by: Cheng Jin + +commit 6eb38863bc0b21854959ebf845f8672c44a99684 +Author: Anthony Green +Date: Wed Jun 9 15:45:31 2021 -0400 + + Remove reference to old test case + +commit ca2235ecfe717ecaed6abbef3a2ca2918a91c60b +Author: Anthony Green +Date: Fri Jun 4 18:20:24 2021 -0400 + + Revert appveyor changes + +commit 243004cc4c8be552503a5d10710ebb252b406064 +Author: Anthony Green +Date: Tue Jun 1 23:00:29 2021 -0400 + + Update vs version + +commit 04c157f49a1b83798c102f3259bc397b9b7f7266 +Author: Anthony Green +Date: Tue Jun 1 22:57:47 2021 -0400 + + Upgrade to vs2019 + +commit 03a78e88402fff424426a1968e014be93666b86f +Author: Anthony Green +Date: Tue Jun 1 22:53:44 2021 -0400 + + Try updating automake + +commit 1f1829bd4ce19b58d0354db3bef21cb8402cdf82 +Author: Anthony Green +Date: Tue Jun 1 22:34:37 2021 -0400 + + Bring in the latest version of perl + +commit dd5bd03075149d7cf8441875c1a344e8beb57dde +Author: Martin Storsjö +Date: Wed Apr 7 05:42:10 2021 +0300 + + Fix building for arm windows with mingw toolchains (#631) + + * arm: Check _WIN32 instead of _M_ARM or _MSC_VER for detecting windows + + This matches what was done for ARM64 in + c06468fa6674d3783a0edb1d0fae9afc8bc28513. + + * arm: Only use armasm source when building with MSVC + + When building for windows/arm with clang, the normal gas style .S + source works fine (if fixed up to support thumb and other windows + specifics). + + This matches what was done for ARM64 in + c06468fa6674d3783a0edb1d0fae9afc8bc28513. + + * arm: Fix sysv.S to work in thumb mode + + Align cases in jump tables (adding nop padding to make sure each + case starts where expected). + + Rewrite instructions that add directly to the pc register. + + For ffi_closure_ret, factor out a call_epilogue subroutine that + restores both sp and pc from the stack; the thumb version of ldm + can't load into the sp register. To avoid excessive ifdeffing, keep + using call_epilogue in arm mode, but keep the shorter "ldm sp, {sp, pc}" + epilogue in that case. + + * arm: Add win32 version of trampoline to sysv.S + + This matches the version of it in sysv_msvc_arm32.S. The calling + C code expects a specific form of the trampoline on windows; make + sure these work the same on windows regardless of the form of + assembly used. + + * arm: Avoid optimizing out clearing the thumb bit of ffi_arm_trampoline + + We clear the thumb bit of ffi_arm_trampoline with a bitmask before + memcpying its instructions into closure->tramp. + + If the bit isn't cleared, the memcpy of the trampoline function + copies the wrong instructions. + + If the ffi_arm_trampoline symbol is declared as an array of int, + the compiler can assume that it is aligned to a 4 byte boundary + and the bitmask operation is a no-op, and optimize it out. + + See https://godbolt.org/z/dE3jE1WTz; both Clang and GCC optimize + out the bitmask as it is, while MSVC doesn't. By declaring the + trampoline as an array of unsigned char, the bitmask works as + intended. + +commit 95ef857d5c6ed15c6c6ba5f8a5b26c0a38b417ab +Author: Anthony Green +Date: Thu Mar 25 10:43:05 2021 -0400 + + Verbose brew update. + +commit 78c97c9ff4491e14e78992ffabdd043674c05e15 +Author: Anthony Green +Date: Thu Mar 25 09:15:37 2021 -0400 + + Move container images to quay.io. + +commit 58dfdf6a84b98296ceb2b8b4237d37aa75bb2cd4 +Author: Sergei Trofimovich +Date: Wed Mar 24 23:19:54 2021 +0000 + + testsuite: fix compiler vendor detection on dash as /bin/sh (#594) + + In https://bugs.gentoo.org/753299 Paolo Pedroni reported + a single test failure out of all libffi. Here is the minimal + reproducer: + + ``` + $ ./autogen + $ CONFIG_SHELL=/bin/dash ./configure --host=x86_64-pc-linux-gnu + $ make check RUNTESTFLAGS='complex.exp' + ... + FAIL: libffi.complex/cls_align_complex_float.c (test for excess errors) + ``` + + This happens because under 'dash' shell autoconf generates slightly + different style of string quotation in `config.log`: + + - on bash: `ax_cv_c_compiler_vendor=gnu` + - on dash: `ax_cv_c_compiler_vendor='gnu'` + + To avoid shell quotation parsing the change just embeds + `compiler_vendor` into `local.exp` at configure time. + + Reported-by: Paolo Pedroni + Bug: https://bugs.gentoo.org/753299 + Signed-off-by: Sergei Trofimovich + +commit eafab2356e8dcf5f01d2bcfa311cafba3b395a7e +Author: Jeremy Huddleston Sequoia +Date: Wed Mar 24 11:38:36 2021 -0700 + + arm64e: Pull in pointer authentication code from Apple's arm64e libffi port (#565) + + NOTES: This changes the ptrauth support from #548 to match what Apple is + shipping in its libffi-27 tag. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 01b56f4b3e89a349228c4ccf55061d847153c8d6 +Author: ericLemanissier +Date: Wed Mar 24 12:20:27 2021 +0100 + + fix windows tests (#595) + + * Update .appveyor.yml + + * add (debug+release)*(shared+static) CI + + * fix libversion + +commit 1aeb26714ec30649f5d9de5b4884a4ac46f5f474 +Author: Ole André Vadla Ravnås +Date: Wed Mar 24 12:16:12 2021 +0100 + + x86: Fix thiscall and fastcall stack cleanup behavior (#611) + + These are meant to use callee clean-up. + +commit e92c81a549924c80d70666ecbe5ed0c2fcd7963a +Author: Anthony Green +Date: Wed Mar 24 07:07:53 2021 -0400 + + Mention MSVC runtime stack checking improvement + +commit f88add14e40de398706c732e578620e8106062c7 +Author: Ole André Vadla Ravnås +Date: Wed Mar 24 12:04:51 2021 +0100 + + x86: Fix MSVC runtime checks interop (#612) + + MSVC can add runtime code that checks if a stack frame is mismanaged, + however our custom assembly deliberately accesses and modifies the parent + stack frame. Fortunately we can disable that specific check for the + function call so do that. + + Co-authored-by: Matthew Waters + +commit aa4dafb159a2e0f74aa39353a1bf23a943f36656 +Author: Anthony Green +Date: Tue Mar 23 19:06:08 2021 -0400 + + Mention LIBFFI_TMPDIR + +commit 70ea259c603e0f84eda766be29d4259f1e8fe5b7 +Author: DJ Delorie +Date: Tue Mar 23 19:03:45 2021 -0400 + + Search $LIBFFI_TMPDIR also (#605) + + Most temp file directories need to be hardened against execution, but + libffi needs execute privileges. Add a libffi-specific temp directory + that can be set up by sysadmins as needed with suitable permissions. + This both ensures that libffi will have a valid temp directory to use + as well as preventing attempts to access other directories. + +commit f58e5ee63263657a7e8f2892d27c012a16facc1a +Author: AndreRH +Date: Tue Mar 23 23:54:00 2021 +0100 + + aarch64: Fix closures for win64 (#606) + +commit 5865450decd13275b2bde064bd4a0f79bca6dba2 +Author: Francisco Boni +Date: Tue Mar 23 19:50:09 2021 -0300 + + Update ax_cc_maxopt m4 macro (#617) + + Keeps libffi's specific changes + (https://github.com/libffi/libffi/commit/cec3a3a201f17a7f018f25e1a0917bd5206e5a5a#diff-2396a1256ac4b1c6849c931ddb8018bdd984bb2383be21bb819a33b95d8d603f) + and updates to the latest ax_cc_maxopt.m4 + (http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commit;h=73ee1b396c21062ee8eeb8721ba5323322110fb5): + + ax_cc_maxopt.m4: retain setting of CFLAGS by configure + + AX_CC_MAXOPT checks whether CFLAGS was set by the user; if so, the user’s + setting is respected. This behavior is retained, of course. + + However, AX_CC_MAXOPT was then setting CFLAGS="". This overrode the default + setting by configure, which usually includes -g. Hence, if CFLAGS was not + set by the user, retain the default setting, to preserve the ability to + debug. + + A typical default setting from configure is "-g -O2". This means that + AX_CC_MAXOPT might typically set CFLAGS to "-g -O2 -O3". This is fine, + because the later -O3 will override the earlier -O2. (The only assumption is + that all compilers that AX_CC_MAXOPT knows behave in this sane way.) + +commit 8f44384df17b536615caef951a615655a967103f +Author: Anthony Green +Date: Tue Mar 23 14:24:54 2021 -0400 + + Fix formatting + +commit 9d491b5e21ffd7fcf2370d998a4832b755d1c9e9 +Author: Anthony Green +Date: Tue Mar 23 12:26:37 2021 -0400 + + Mention KVX + +commit 205cf01b57972fdc8c090fc79192b464dc43fc0d +Author: Anthony Green +Date: Tue Mar 23 11:31:08 2021 -0400 + + Bug #680. Don't accept floats or small ints as var args. (#628) + + * Bug #680. Don't accept floats or small ints as var args. + + * Bug #680. Don't accept floats or small ints as var args. + + * Bug #680. Don't accept floats or small ints as var args. + +commit d271dbe0a8b230e566fa3385babdc9cc0ca214ea +Author: Jeremy Huddleston Sequoia +Date: Sat Mar 20 06:06:28 2021 -0700 + + Add some missing #if conditionals from Apple's code drop (#620) + + * arm/aarch64: Add FFI_CLOSURES conditionals where appropriate + + Signed-off-by: Jeremy Huddleston Sequoia + + * aarch64: Don't emit the do_closure label when building without FFI_GO_CLOSURES + + Signed-off-by: Jeremy Huddleston Sequoia + +commit bae695da367b6abd83152f8f1e9b1a8b79794c8d +Author: Russell Keith-Magee +Date: Sat Mar 6 00:09:17 2021 +0800 + + Add configuration generator for tvOS and watchOS. (#625) + +commit 9ba559217bea0803263a9a9a0bafcf9203606f5b +Author: Madhavan T. Venkataraman <75220914+madvenka786@users.noreply.github.com> +Date: Fri Mar 5 10:07:30 2021 -0600 + + Static tramp v5 (#624) + + * Static Trampolines + + Closure Trampoline Security Issue + ================================= + + Currently, the trampoline code used in libffi is not statically defined in + a source file (except for MACH). The trampoline is either pre-defined + machine code in a data buffer. Or, it is generated at runtime. In order to + execute a trampoline, it needs to be placed in a page with executable + permissions. + + Executable data pages are attack surfaces for attackers who may try to + inject their own code into the page and contrive to have it executed. The + security settings in a system may prevent various tricks used in user land + to write code into a page and to have it executed somehow. On such systems, + libffi trampolines would not be able to run. + + Static Trampoline + ================= + + To solve this problem, the trampoline code needs to be defined statically + in a source file, compiled and placed in the text segment so it can be + mapped and executed naturally without any tricks. However, the trampoline + needs to be able to access the closure pointer at runtime. + + PC-relative data referencing + ============================ + + The solution implemented in this patch set uses PC-relative data references. + The trampoline is mapped in a code page. Adjacent to the code page, a data + page is mapped that contains the parameters of the trampoline: + + - the closure pointer + - pointer to the ABI handler to jump to + + The trampoline code uses an offset relative to its current PC to access its + data. + + Some architectures support PC-relative data references in the ISA itself. + E.g., X64 supports RIP-relative references. For others, the PC has to + somehow be loaded into a general purpose register to do PC-relative data + referencing. To do this, we need to define a get_pc() kind of function and + call it to load the PC in a desired register. + + There are two cases: + + 1. The call instruction pushes the return address on the stack. + + In this case, get_pc() will extract the return address from the stack + and load it in the desired register and return. + + 2. The call instruction stores the return address in a designated register. + + In this case, get_pc() will copy the return address to the desired + register and return. + + Either way, the PC next to the call instruction is obtained. + + Scratch register + ================ + + In order to do its job, the trampoline code would need to use a scratch + register. Depending on the ABI, there may not be a register available for + scratch. This problem needs to be solved so that all ABIs will work. + + The trampoline will save two values on the stack: + + - the closure pointer + - the original value of the scratch register + + This is what the stack will look like: + + sp before trampoline ------> -------------------- + | closure pointer | + -------------------- + | scratch register | + sp after trampoline -------> -------------------- + + The ABI handler can do the following as needed by the ABI: + + - the closure pointer can be loaded in a desired register + + - the scratch register can be restored to its original value + + - the stack pointer can be restored to its original value + (the value when the trampoline was invoked) + + To do this, I have defined prolog code for each ABI handler. The legacy + trampoline jumps to the ABI handler directly. But the static trampoline + defined in this patch jumps tp the prolog code which performs the above + actions before jumping to the ABI handler. + + Trampoline Table + ================ + + In order to reduce the trampoline memory footprint, the trampoline code + would be defined as a code array in the text segment. This array would be + mapped into the address space of the caller. The mapping would, therefore, + contain a trampoline table. + + Adjacent to the trampoline table mapping, there will be a data mapping that + contains a parameter table, one parameter block for each trampoline. The + parameter block will contain: + + - a pointer to the closure + - a pointer to the ABI handler + + The static trampoline code would finally look like this: + + - Make space on the stack for the closure and the scratch register + by moving the stack pointer down + - Store the original value of the scratch register on the stack + - Using PC-relative reference, get the closure pointer + - Store the closure pointer on the stack + - Using PC-relative reference, get the ABI handler pointer + - Jump to the ABI handler + + Mapping size + ============ + + The size of the code mapping that contains the trampoline table needs to be + determined on a per architecture basis. If a particular architecture + supports multiple base page sizes, then the largest supported base page size + needs to be chosen. E.g., we choose 16K for ARM64. + + Trampoline allocation and free + ============================== + + Static trampolines are allocated in ffi_closure_alloc() and freed in + ffi_closure_free(). + + Normally, applications use these functions. But there are some cases out + there where the user of libffi allocates and manages its own closure + memory. In such cases, static trampolines cannot be used. These will + fall back to using legacy trampolines. The user has to make sure that + the memory is executable. + + ffi_closure structure + ===================== + + I did not want to make any changes to the size of the closure structure for + this feature to guarantee compatibility. But the opaque static trampoline + handle needs to be stored in the closure. I have defined it as follows: + + - char tramp[FFI_TRAMPOLINE_SIZE]; + + union { + + char tramp[FFI_TRAMPOLINE_SIZE]; + + void *ftramp; + + }; + + If static trampolines are used, then tramp[] is not needed to store a + dynamic trampoline. That space can be reused to store the handle. Hence, + the union. + + Architecture Support + ==================== + + Support has been added for x64, i386, aarch64 and arm. Support for other + architectures can be added very easily in the future. + + OS Support + ========== + + Support has been added for Linux. Support for other OSes can be added very + easily. + + Signed-off-by: Madhavan T. Venkataraman + + * x86: Support for Static Trampolines + + - Define the arch-specific initialization function ffi_tramp_arch () + that returns trampoline size information to common code. + + - Define the trampoline code mapping and data mapping sizes. + + - Define the trampoline code table statically. Define two tables, + actually, one with CET and one without. + + - Introduce a tiny prolog for each ABI handling function. The ABI + handlers addressed are: + + - ffi_closure_unix64 + - ffi_closure_unix64_sse + - ffi_closure_win64 + + The prolog functions are called: + + - ffi_closure_unix64_alt + - ffi_closure_unix64_sse_alt + - ffi_closure_win64_alt + + The legacy trampoline jumps to the ABI handler. The static + trampoline jumps to the prolog function. The prolog function uses + the information provided by the static trampoline, sets things up + for the ABI handler and then jumps to the ABI handler. + + - Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to + initialize static trampoline parameters. + + Signed-off-by: Madhavan T. Venkataraman + + * i386: Support for Static Trampolines + + - Define the arch-specific initialization function ffi_tramp_arch () + that returns trampoline size information to common code. + + - Define the trampoline code table statically. Define two tables, + actually, one with CET and one without. + + - Define the trampoline code table statically. + + - Introduce a tiny prolog for each ABI handling function. The ABI + handlers addressed are: + + - ffi_closure_i386 + - ffi_closure_STDCALL + - ffi_closure_REGISTER + + The prolog functions are called: + + - ffi_closure_i386_alt + - ffi_closure_STDCALL_alt + - ffi_closure_REGISTER_alt + + The legacy trampoline jumps to the ABI handler. The static + trampoline jumps to the prolog function. The prolog function uses + the information provided by the static trampoline, sets things up + for the ABI handler and then jumps to the ABI handler. + + - Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to + initialize static trampoline parameters. + + Signed-off-by: Madhavan T. Venkataraman + + * arm64: Support for Static Trampolines + + - Define the arch-specific initialization function ffi_tramp_arch () + that returns trampoline size information to common code. + + - Define the trampoline code mapping and data mapping sizes. + + - Define the trampoline code table statically. + + - Introduce a tiny prolog for each ABI handling function. The ABI + handlers addressed are: + + - ffi_closure_SYSV + - ffi_closure_SYSV_V + + The prolog functions are called: + + - ffi_closure_SYSV_alt + - ffi_closure_SYSV_V_alt + + The legacy trampoline jumps to the ABI handler. The static + trampoline jumps to the prolog function. The prolog function uses + the information provided by the static trampoline, sets things up + for the ABI handler and then jumps to the ABI handler. + + - Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to + initialize static trampoline parameters. + + Signed-off-by: Madhavan T. Venkataraman + + * arm: Support for Static Trampolines + + - Define the arch-specific initialization function ffi_tramp_arch () + that returns trampoline size information to common code. + + - Define the trampoline code mapping and data mapping sizes. + + - Define the trampoline code table statically. + + - Introduce a tiny prolog for each ABI handling function. The ABI + handlers addressed are: + + - ffi_closure_SYSV + - ffi_closure_VFP + + The prolog functions are called: + + - ffi_closure_SYSV_alt + - ffi_closure_VFP_alt + + The legacy trampoline jumps to the ABI handler. The static + trampoline jumps to the prolog function. The prolog function uses + the information provided by the static trampoline, sets things up + for the ABI handler and then jumps to the ABI handler. + + - Call ffi_tramp_set_parms () in ffi_prep_closure_loc () to + initialize static trampoline parameters. + + Signed-off-by: Madhavan T. Venkataraman + +commit 5c63b463b87d3c06102a4a7f05f395929d9ea79b +Author: DJ Delorie +Date: Wed Dec 2 16:14:27 2020 -0500 + + Use memfd_create() (#604) + + memfd_create creates a file in a memory-only filesystem that may + bypass strict security protocols in filesystem-based temporary + files. + +commit cb8474368cdef3207638d047bd6c707ad8fcb339 +Author: hjl-tools +Date: Wed Dec 2 12:52:12 2020 -0800 + + libffi/x86: Always check __x86_64__ for x32 hosts (#601) (#602) + + Since for x86_64-*x32 and x86_64-x32-* hosts, -m32 generates ia32 codes. + We should always check __x86_64__ for x32 hosts. + +commit e70bf987daa7b7b5df2de7579d5c51a888e8bf7d +Author: Tres Finocchiaro +Date: Tue Nov 24 19:13:57 2020 -0500 + + Properly quote and resolve msvcc.sh params (#596) + +commit 8cc8f446f5aac13e107161dffbc15d1ee1a58878 +Author: Mike Hommey +Date: Tue Nov 10 20:41:33 2020 +0900 + + Allow to build with mingw-clang (#579) + + For some reason, compiling sysv.S with mingw-clang fails with: + ``` + error: invalid variant 'ffi_closure_inner@8' + ``` + + This can be fixed (worked around?) by quoting the symbol. This works + fine with mingw-gcc too. + +commit d817d0daa312c58548d7a081aa876027ca103766 +Author: Mike Hommey +Date: Tue Nov 10 20:39:25 2020 +0900 + + Don't use FFI_TYPE_LONGDOUBLE in the jump table in win64*.S (#580) + + It may have the same value as FFI_TYPE_DOUBLE per ffi.h, which + possibly can make things go wrong with .org/ORG. + + For instance, GCC complains about "Error: attempt to move .org + backwards" + +commit 56f7df711f70414d4f3663b34e54b122b38bab88 +Author: AndreRH +Date: Tue Nov 10 12:27:59 2020 +0100 + + aarch64: Allow FFI_WIN64 for winelib (#593) + +commit 8111cd06921e80d5d7192ce8d1f64733072fdbcd +Author: Brandon Bergren +Date: Tue Oct 27 09:07:38 2020 -0500 + + Add support for powerpc64le-*-freebsd*. (#581) + + Tests pass with no additional changes needed, tested on hardware. + +commit 484c1a0d7536be60002473f7bb82223efe139883 +Author: Ken <21211439+kencu@users.noreply.github.com> +Date: Tue Oct 27 07:07:07 2020 -0700 + + darwin powerpc: use go closures only if enabled (#583) + + SHA: 0ff9419f2e75652426469e256cb7d0748064ad58 added go closures for darwin powerpc AIX, but + these have not yet been implemented for non-AIX systems + + use the go closures only if enabled + +commit 032b3cd6f7850f3ebc1269eeab7d1db3ea518d29 +Author: Jeremy Huddleston Sequoia +Date: Tue Oct 27 07:06:21 2020 -0700 + + Support building x86 and arm64 without FFI_GO_CLOSURES (#586) + + * x86: Support building without FFI_GO_CLOSURES + + Signed-off-by: Jeremy Huddleston Sequoia + + * arm: Support building without FFI_GO_CLOSURES + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 93cf288ddd59c7cb203c1aba25de5e5b8f308da6 +Author: Jeremy Huddleston Sequoia +Date: Tue Oct 27 07:05:28 2020 -0700 + + testsuite: Add a missing include of to fix build failure in test suite (#587) + + Signed-off-by: Jeremy Huddleston Sequoia + +commit c78fcf88ab13a5cc414826a018dd46c3f886adee +Author: petersn +Date: Tue Oct 27 07:02:36 2020 -0700 + + Removing unnecessary instruction from ffi_call_unix64 (#588) + + unix64.S's `ffi_call_unix64` looks like it used to take six parameters, + where the sixth said the number of SSE register arguments. However, + currently the function only takes five parameters, and the number of SSE + register arguments is encoded in the `struct register_args *` passed as + the first parameter to `ffi_call_unix64`. This change removes an + instruction that tries to use this missing sixth parameter as the number + of SSE arguments. + + This fix should not change any behavior, nor fix any bugs, because a few + instructions later the value moved from %r9d into %eax is overwritten by + the correct value anyway. This change merely makes the code a tad less + confusing, because currently the assembly moves from a register (r9) + whose value is never set. + +commit 2d86809db6d1d626a9df40c283ec564ac98ff85d +Author: jacobly0 +Date: Tue Oct 27 10:00:03 2020 -0400 + + Fix read-only .eh_frame section test when CFLAGS contains -flto. (#590) + +commit f4435980fa2da335fe388db431d4a7946a99a2b9 +Author: Alan Modra +Date: Tue Oct 27 23:36:21 2020 +1030 + + Power10 libffi fixes (#585) + + Power10 pc-relative code doesn't use or preserve r2 as a TOC pointer. + That means calling between pc-relative and TOC using code can't be + done without intervening linker stubs, and a call from TOC code to + pc-relative code must have a nop after the bl in order to restore r2. + + Now the PowerPC libffi assembly code doesn't use r2 except for the + implicit use when making calls back to C, ffi_closure_helper_LINUX64 + and ffi_prep_args64. So changing the assembly to interoperate with + pc-relative code without stubs is easily done. + + * src/powerpc/linux64.S (ffi_call_LINUX64): Don't emit global + entry when __PCREL__. Call using @notoc. Add nops. + * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise. + (ffi_go_closure_linux64): Likewise. + +commit 407394c0aac2db4a1978a7691035889db9924a01 +Author: Tim Gates +Date: Sun Oct 11 15:07:40 2020 +1100 + + docs: fix simple typo, paramters -> parameters (#589) + + There is a small typo in src/x86/ffi.c. + + Should read `parameters` rather than `paramters`. + +commit ead65ca8711aa07efc0453f67136aff82f33c01f +Author: Anthony Green +Date: Wed Aug 19 08:34:09 2020 -0400 + + Re-enable s390x testing + +commit 8276f812a99b10d1f2c387dbd6ef2ca4f597c733 +Author: Niclas Zeising +Date: Fri Aug 7 21:05:23 2020 +0200 + + Upstream local FreeBSD patches (#567) + + * Add support for FreeBSD mips + + Add support for FreeBSD mips, this has been a local patch in the FreeBSD + ports tree for quite some time. + + Originally submitted by sson, and committed by sbruno AT FreeBSD DOT org + See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191909 for + background details. + + Signed-off-by: Niclas Zeising + + * Add support for FreeBSD powerpcspe + + Add support for powerpcspe on FreeBSD + This has been in the FreeBSD ports tree for some time. + Originally submitted by jhibbits AT FreeBSD DOT org. + + Signed-off-by: Niclas Zeising + + * Fix abort() on FreeBSD arm related to __clear_cache() + + This patch has been in the FreeBSD ports tree for a number of years. + Original commit by koobs AT FreeBSD DOT org + + Original commit message: + > devel/libffi: Fix abort() on ARM related to __clear_cache() + > + > The current FreeBSD/ARM __clear_cache() implementation does nothing #if + > __i386__ || __x86_64__ #else abort(); + > + > cognet@ advises this is an issue for anything !Apple that is using the + > libcompiler_rt provided by Clang on ARM, and requires upstreaming. + + See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=149167 for some + background details. + + Signed-off-by: Niclas Zeising + +commit 392afbaf60663e530bd740da0b5a39ee9f4ba052 +Author: Anthony Green +Date: Wed Aug 5 21:38:51 2020 -0400 + + Don't test s390. Travis-ci is broken. + +commit e08eb1ced18598a26cd7f14fea05693e89638ed2 +Author: Anthony Green +Date: Wed Aug 5 17:59:59 2020 -0400 + + Add support for eabisim back. This was removed upstream. + +commit 4661ba7928b49588aec9e6976673208c8cbf0295 +Merge: 45875da 1a4b786 +Author: Tom Tromey +Date: Tue Aug 4 11:08:19 2020 -0600 + + Merge pull request #576 from froydnj/config-updates + + update config.{guess,sub} + +commit 1a4b786df34b61af7b6738a2ce7b8d34f5377a71 +Author: Nathan Froyd +Date: Tue Aug 4 12:17:04 2020 -0400 + + update config.{guess,sub} + + This change is primarily for aarch64 macOS support, since that configuration + is now properly supported upstream. + +commit 45875da4bc71578f6f45471141c14e1743239b7e +Merge: fbd1de8 8e58f88 +Author: Tom Tromey +Date: Wed Jul 1 09:32:37 2020 -0600 + + Merge pull request #570 from jwilk-forks/spelling + + aarch64: Fix typo + +commit 8e58f88d33eb878b0fbca1433f83bbf872d5d0f3 +Author: Jakub Wilk +Date: Tue Jun 30 22:59:28 2020 +0200 + + aarch64: Fix typo + +commit fbd1de85f6532f8a8f61abbd7892f8cb58b233d0 +Author: Ma Jun +Date: Mon Jun 29 08:02:20 2020 -0400 + + Add support for csky + +commit 0027b072627aa9d3ada71c4374561966064ecd5a +Author: M. Herdiansyah +Date: Thu Jun 11 19:40:24 2020 +0700 + + Makefile: increase compatibility with bmake (#551) + +commit b7af8f47d5fff2957521dc269637c00b8a4b6c75 +Author: Andre Miras +Date: Thu Jun 11 14:38:59 2020 +0200 + + Fixes macOS build on Python 3 (#563) + + The error was: + ``` + Traceback (most recent call last): + File "_generate-darwin-source-and-headers.py", line 209, in + generate_source_and_headers(generate_osx=not args.only_ios, generate_ios=not args.only_osx) + File "_generate-darwin-source-and-headers.py", line 197, in generate_source_and_headers + for header_name, tag_tuples in platform_headers.iteritems(): + AttributeError: 'collections.defaultdict' object has no attribute 'iteritems' + ``` + +commit 5c45c40c04f89cf67ade3fdfa99915ca5409e51a +Author: Kentaro Hayashi +Date: Thu Jun 11 21:37:41 2020 +0900 + + Fix Free software foundation address (#564) + + ref. https://www.fsf.org/about/contact/ + +commit 2e90bb5577ea1fe3bc1716954e790999bc3549f7 +Author: Anthony Green +Date: Sun Jun 7 14:31:06 2020 -0400 + + Add gcc bug tests back + +commit 5e6ca054148dfb4d78e6f79457d48b745f919def +Author: Yann Sionneau +Date: Fri May 1 13:59:11 2020 +0200 + + Add support for Kalray KVX architecture (#559) + +commit 4f9e20ac51ce13d46fed3c869e1deb6d9bb89444 +Author: Andrew Geissler +Date: Fri May 1 06:58:30 2020 -0500 + + ffi_powerpc.h: fix build failure with powerpc7 (#561) + + This is a patch pulled down from the following: + https://github.com/buildroot/buildroot/blob/78926f610b1411b03464152472fd430012deb9ac/package/libffi/0004-ffi_powerpc.h-fix-build-failure-with-powerpc7.patch + + This issue is being hit on OpenBMC code when pulling the latest + libffi tag and building on a P8 ppc64le machine. I verified this + patch fixes the issue we are seeing. + + Below is the original commit message: + + Sicne commit 73dd43afc8a447ba98ea02e9aad4c6898dc77fb0, build on powerpc7 + fails on: + + In file included from ../src/powerpc/ffi.c:33:0: + ../src/powerpc/ffi_powerpc.h:61:9: error: '_Float128' is not supported on this target + typedef _Float128 float128; + ^~~~~~~~~ + + Fix this build failure by checking for __HAVE_FLOAT128 before using + _Float128, as _Float128 is enabled only on specific conditions, see + output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/bits/floatn.h: + + /* Defined to 1 if the current compiler invocation provides a + floating-point type with the IEEE 754 binary128 format, and this glibc + includes corresponding *f128 interfaces for it. */ + #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \ + && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH + # define __HAVE_FLOAT128 1 + #else + # define __HAVE_FLOAT128 0 + #endif + + Fixes: + - http://autobuild.buildroot.org/results/5c9dd8fb3b6a128882b6250f197c80232d8a3b53 + + Signed-off-by: Fabrice Fontaine + Signed-off-by: Andrew Geissler + + Co-authored-by: Fabrice Fontaine + +commit 053b04c525a00abdc25ec646096a44208a1b9423 +Author: Martin Storsjö +Date: Sun Apr 26 05:02:14 2020 +0300 + + arm: Fix the clang specific version of the assembly (#556) + + Also fix the same error in the comment for the non-clang case. + That typo there seems to have existed since the code was written + in that form, in e7f15f60e86 - and when the clang specific codepath + was added in e3d2812ce43, the typo in the comment made it into the + actual code. + +commit c543849c3767cc0f0a84e3ed7b664a63724ed516 +Author: Martin Storsjö +Date: Sun Apr 26 05:01:03 2020 +0300 + + win64_armasm: Fix the spelling of ALIGN (#553) + +commit 15d3ea31a53bd0e5b828c90a9f7c4285c58f73e1 +Author: Martin Storsjö +Date: Sun Apr 26 04:59:35 2020 +0300 + + Use __builtin_ffs instead of ffs (#554) + + USE_BUILTIN_FFS is defined to 1 within __GNUC__, and the __builtin_ffs + function is available since GCC 3.x at least, while the ffs function + only exists on some OSes. + + This fixes compilation for non-x86 mingw platforms. For x86, + USE_BUILTIN_FFS is explicitly disabled for windows targets - but + if USE_BUILTIN_FFS is enabled based on __GNUC__, it should also use + the builtin which actually is available correspondingly, not dependent + on the target OS. + +commit c06468fa6674d3783a0edb1d0fae9afc8bc28513 +Author: Martin Storsjö +Date: Sun Apr 26 04:58:33 2020 +0300 + + Fix building for aarch64 windows with mingw toolchains (#555) + + * aarch64: Check _WIN32 instead of _M_ARM64 for detecting windows + + This fixes building for aarch64 with mingw toolchains. _M_ARM64 is + predefined by MSVC, while mingw compilers predefine __aarch64__. + + In aarch64 specific code, change checks for _M_ARM64 into checks for + _WIN32. + + In arch independent code, check for + (defined(_M_ARM64) || defined(__aarch64__)) && defined(_WIN32) + instead of just _M_ARM64. + + In src/closures.c, coalesce checks like + defined(X86_WIN32) || defined(X86_WIN64) || defined(_M_ARM64) + into plain defined(_WIN32). Technically, this enables code for + ARM32 windows where it wasn't, but as far as I can see it, those + codepaths should be fine for that architecture variant as well. + + * aarch64: Only use armasm source when building with MSVC + + When building for windows/arm64 with clang, the normal gas style .S + source works fine. sysv.S and win64_armasm.S seem to be functionally + equivalent, with only differences being due to assembler syntax. + +commit 8c50837f0b58ba5b2bcb1b424a2a4bfa01559fb2 +Author: Fangrui Song +Date: Tue Mar 10 04:36:09 2020 -0700 + + Improve read-write .eh_frame check (#546) + + llvm-objdump -h does not print BFD SEC_* constants like "READONLY", + so the check will consider .eh_frame writable. + clang 11 (since https://reviews.llvm.org/D73999) will error for mismatching section flags. + + Use readelf -S and check "WA" instead. + +commit 4a6414f2785a60f455c91fdd04f7745fe7fc11e0 +Author: Moxie Bot +Date: Mon Mar 9 21:10:53 2020 -0400 + + Mention ARM Pointer Authentication + +commit 909b37ffffe2a0bb08947b07508a3a4eed5f36a8 +Author: Moxie Bot +Date: Mon Mar 9 21:10:33 2020 -0400 + + Test on aarch64 Linux with clang + +commit 4c7bde32ea3af479babdf527d94f241282951cb9 +Author: Ole André Vadla Ravnås +Date: Tue Mar 10 02:05:42 2020 +0100 + + Port to iOS/arm64e (#548) + +commit 211e929df4388a6724b0dba4df4e3a1283dc49e9 +Author: Anthony Green +Date: Mon Mar 9 12:39:22 2020 -0400 + + Try to fix RLGL_KEY nonsense (#547) + + * Try to fix RLGL_KEY nonsense + + * Hard code policy bound API key + + Co-authored-by: Anthony Green + +commit 8eb2d2b05626b1cbbed100725bc440709499e8a6 +Author: Moxie Bot +Date: Mon Feb 24 10:29:20 2020 -0500 + + Revamp PA_LINUX and PA_HPUX target closures to use function descriptors. + + 2020-02-23 John David Anglin + + * include/ffi.h.in (FFI_CLOSURE_PTR, FFI_RESTORE_PTR): Define. + * src/closures.c (ffi_closure_alloc): Convert closure pointer + return by malloc to function pointer. + (ffi_closure_free): Convert function pointer back to malloc pointer. + * src/pa/ffi.c (ffi_closure_inner_pa32): Use union to double word + align return address on stack. Adjust statements referencing return + address. Convert closure argument from function pointer to standard + closure pointer. + (ffi_prep_closure_loc): Likewise convert closure argument back to + closure pointer. Remove assembler trampolines. Setup simulated + function descriptor as on ia64. + src/pa/ffitarget.h (FFI_TRAMPOLINE_SIZE): Reduce to 12. + src/pa/hpux32.S (ffi_closure_pa32): Retrieve closure pointer and real + gp from fake gp value in register %r19. + src/pa/linux.S (ffi_closure_pa32): Likewise. + +commit be815544c1588c6ca70120361c168b196376aa56 +Author: hjl-tools +Date: Sun Feb 23 07:45:42 2020 -0800 + + Update the ABI version to LIBFFI_BASE_8.0 (#544) + + Since x86 and x86-64 FFI_TRAMPOLINE_SIZE have been increased, we must + bump the ABI version. This fixes: + + https://github.com/libffi/libffi/issues/543 + +commit d9abffeabe4f38bac12b864146cf974ede814411 +Author: hjl-tools +Date: Sat Feb 22 06:32:22 2020 -0800 + + x86: Fix ffi_prep_closure_loc (#542) + + Since FFI_TRAMPOLINE_SIZE is increased by 4 bytes to add ENDBR32, adjust + jump displacement by 4 bytes. + +commit 624c7a35f7e1d12f917453d6c657cd5947ac57f7 +Merge: 4c775d7 7855656 +Author: Moxie Bot +Date: Fri Feb 21 22:13:14 2020 -0500 + + Merge branch 'master' of github.com:/libffi/libffi + +commit 4c775d7cd6e914c6a2f66465497106cff360aeb5 +Author: Moxie Bot +Date: Fri Feb 21 22:12:34 2020 -0500 + + Update for pending 3.4 release. + +commit 7855656148b96c7070ec362d2a73af840025a2b7 +Author: hjl-tools +Date: Fri Feb 21 19:08:06 2020 -0800 + + x86: Add indirect branch tracking support (#540) + + Intel Control-flow Enforcement Technology (CET): + + https://software.intel.com/en-us/articles/intel-sdm + + contains shadow stack (SHSTK) and indirect branch tracking (IBT). When + CET is enabled, ELF object files must be marked with .note.gnu.property + section. When Intel CET is enabled, include in assembly codes + to mark Intel CET support. + + Also when IBT is enabled, all indirect branch targets must start with + ENDBR instruction and notrack prefix can be used to disable IBT on + indirect branch. defines _CET_ENDBR which can be used in + assembly codes for ENDBR instruction. If isn't included, + define _CET_ENDBR as empty so that _CET_ENDBR can be used in assembly + codes. + + Trampoline must be enlarged to add ENDBR instruction unconditionally, + which is NOP on non-CET processors. This is required regardless if + libffi is enabled with CET since libffi.so will be marked in legacy + bitmap, but trampoline won't. Update library version for larger + FFI_TRAMPOLINE_SIZE. + + This fixed: + + https://github.com/libffi/libffi/issues/474 + + Tested with + + $ CC="gcc -Wl,-z,cet-report=error -fcf-protection" CXX="g++ -Wl,-z,cet-report=error -fcf-protection" .../configure + + on Linux CET machines in i686, x32 and x86-64 modes. + +commit 4d6d2866ae43e55325e8ee96561221804602cd7a +Author: Samuel Holland +Date: Fri Feb 21 21:06:15 2020 -0600 + + Update powerpc sysv assembly for ffi_powerpc.h changes (#541) + + Some of the flag bits were moved when adding powerpc64 vector support. + + Fixes #536 + +commit b844a9c7f1ca792a1dfb0c09d5dae576178e6729 +Author: Anthony Green +Date: Fri Jan 10 10:22:10 2020 -0500 + + Update copyright year. + +commit 81b5491a4ef46103f2e1be79d368e76dba021ffa +Author: Anthony Green +Date: Sun Jan 5 21:37:05 2020 -0500 + + Fix script + +commit 1e08a45535d929915e14e48af38e45f8c8e4f8de +Author: Anthony Green +Date: Sun Jan 5 21:18:23 2020 -0500 + + Use rlgl API key on login + +commit e50b9ef8b910fa642ef158f6642e60d54d7ad740 +Author: Khem Raj +Date: Sat Dec 7 02:34:14 2019 -0800 + + powerpc64: Use memcpy to help platforms with no __int128. (#534) + + Signed-off-by: Khem Raj + +commit f9da75e157ab089363d079a781644c3e6f7db2c3 +Author: Anthony Green +Date: Sat Nov 30 07:37:19 2019 -0500 + + Remove 32-bit x86 file references to fix macosx builds + +commit 76c0cfea70f78586231d7994492396eebfb12d5f +Author: Carl Hurd +Date: Fri Nov 29 14:46:11 2019 -0500 + + Fixed missed #ifndef for __mips_soft_float (#442) + + Thank you! + +commit 98da256096c63406ef77f92369ada622c50ce388 +Author: Anthony Green +Date: Fri Nov 29 14:29:51 2019 -0500 + + Clean up macosx builds + +commit 6663047f56c2932a6b10a790f4ac6666dd181326 +Author: Anthony Green +Date: Fri Nov 29 07:00:35 2019 -0500 + + Address platforms with no __int128. + +commit 0069526c5adea9e6268b8a0087a6120c9c5c89fa +Author: Anthony Green +Date: Thu Nov 28 18:58:40 2019 -0500 + + Make build errors easier to debug + +commit 43887a9108f10124d05c8e0e67f3942cd980cb86 +Author: Anthony Green +Date: Thu Nov 28 17:44:51 2019 -0500 + + Add powerpc-eabi + +commit 29297445da5c2c9437de0e20f3189799a27f0301 +Author: Anthony Green +Date: Thu Nov 28 17:31:44 2019 -0500 + + Test on powerpc-eabisim + +commit 01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd +Author: Sergei Trofimovich +Date: Thu Nov 28 12:42:41 2019 +0000 + + powerpc: fix build failure on power7 and older (#532) + + Build failure looks as: + ``` + libtool: compile: powerpc-unknown-linux-gnu-gcc \ + -O2 -mcpu=powerpc -mtune=powerpc -pipe ... -c src/powerpc/ffi.c ... + In file included from src/powerpc/ffi.c:33: + src/powerpc/ffi_powerpc.h:65:9: error: '__int128' is not supported on this target + 65 | typedef __int128 float128; + | ^~~~~~~~ + ``` + + The fix avoids using __int128 in favour of aligned char[16]. + + Closes: https://github.com/libffi/libffi/issues/531 + Signed-off-by: Sergei Trofimovich + +commit 1ec01ea81cf18e12748082f48f7c279a3fdd505d +Author: Anthony Green +Date: Sun Nov 24 22:47:48 2019 -0500 + + Run aarch64-linux-gnu tests on travi-ci directly + +commit 66022e52ec0409f9170eb0884c6d0bdd048bc04e +Author: Anthony Green +Date: Sun Nov 24 16:52:14 2019 -0500 + + Fixes for ppc64le and s390x travis testing + +commit 932e5bb68a603885e4bd9cf1bd5146542f736ccf +Author: Anthony Green +Date: Sun Nov 24 16:26:14 2019 -0500 + + Force the use of docker + +commit 803db14c5a0aeb52ee521fe4fe4a7919926373de +Merge: 86be66c fb914c3 +Author: Anthony Green +Date: Sun Nov 24 16:10:22 2019 -0500 + + Merge branch 'master' of github.com:libffi/libffi + +commit 86be66c8f608a84caea2ef724698093d2da2e5e2 +Author: Anthony Green +Date: Sun Nov 24 16:09:44 2019 -0500 + + Try travis-ci's new ppc64le and s390x support + +commit fb914c366fabb29ac373050ca0bfa4d9c1fef149 +Author: Panayotis +Date: Sun Nov 24 18:25:13 2019 +0200 + + disable obsolete 32-bit targets in macOS (#511) + +commit fd99c95f90f85963f5ec88630c0428a8132012db +Author: Anthony Green +Date: Sun Nov 24 11:11:25 2019 -0500 + + Minor clean-up + commit 5dcb741f1544c5e18c9dbf96aeb8b61cc556a616 Author: Anthony Green Date: Sat Nov 23 10:24:58 2019 -0500 diff --git a/LICENSE b/LICENSE index acb2f7a..75d1bce 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -libffi - Copyright (c) 1996-2019 Anthony Green, Red Hat, Inc and others. +libffi - Copyright (c) 1996-2022 Anthony Green, Red Hat, Inc and others. See source files for details. Permission is hereby granted, free of charge, to any person obtaining diff --git a/Makefile.am b/Makefile.am index 4fd6193..a4a4887 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,8 +20,9 @@ EXTRA_DIST = LICENSE ChangeLog.old \ m4/ltversion.m4 src/debug.c msvcc.sh \ generate-darwin-source-and-headers.py \ libffi.xcodeproj/project.pbxproj \ + src/powerpc/t-aix \ libtool-ldflags libtool-version configure.host README.md \ - libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl + libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl # local.exp is generated by configure DISTCLEANFILES = local.exp @@ -38,71 +39,63 @@ toolexeclib_LTLIBRARIES = libffi.la noinst_LTLIBRARIES = libffi_convenience.la libffi_la_SOURCES = src/prep_cif.c src/types.c \ - src/raw_api.c src/java_raw_api.c src/closures.c + src/raw_api.c src/java_raw_api.c src/closures.c \ + src/tramp.c if FFI_DEBUG libffi_la_SOURCES += src/debug.c endif -noinst_HEADERS = \ - src/aarch64/ffitarget.h src/aarch64/internal.h \ +noinst_HEADERS = src/aarch64/ffitarget.h src/aarch64/internal.h \ src/alpha/ffitarget.h src/alpha/internal.h \ - src/arc/ffitarget.h \ - src/arm/ffitarget.h src/arm/internal.h \ - src/avr32/ffitarget.h \ - src/bfin/ffitarget.h \ - src/cris/ffitarget.h \ - src/frv/ffitarget.h \ + src/arc/ffitarget.h src/arm/ffitarget.h src/arm/internal.h \ + src/avr32/ffitarget.h src/bfin/ffitarget.h \ + src/cris/ffitarget.h src/csky/ffitarget.h src/frv/ffitarget.h \ src/ia64/ffitarget.h src/ia64/ia64_flags.h \ - src/m32r/ffitarget.h \ - src/m68k/ffitarget.h \ - src/m88k/ffitarget.h \ - src/metag/ffitarget.h \ - src/microblaze/ffitarget.h \ - src/mips/ffitarget.h \ - src/moxie/ffitarget.h \ - src/nios2/ffitarget.h \ - src/or1k/ffitarget.h \ - src/pa/ffitarget.h \ - src/powerpc/ffitarget.h src/powerpc/asm.h src/powerpc/ffi_powerpc.h \ - src/riscv/ffitarget.h \ - src/s390/ffitarget.h src/s390/internal.h \ - src/sh/ffitarget.h \ - src/sh64/ffitarget.h \ - src/sparc/ffitarget.h src/sparc/internal.h \ - src/tile/ffitarget.h \ - src/vax/ffitarget.h \ - src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h src/x86/asmnames.h \ - src/xtensa/ffitarget.h \ - src/dlmalloc.c + src/m32r/ffitarget.h src/m68k/ffitarget.h \ + src/m88k/ffitarget.h src/metag/ffitarget.h \ + src/microblaze/ffitarget.h src/mips/ffitarget.h \ + src/moxie/ffitarget.h src/nios2/ffitarget.h \ + src/or1k/ffitarget.h src/pa/ffitarget.h \ + src/powerpc/ffitarget.h src/powerpc/asm.h \ + src/powerpc/ffi_powerpc.h src/riscv/ffitarget.h \ + src/s390/ffitarget.h src/s390/internal.h src/sh/ffitarget.h \ + src/sh64/ffitarget.h src/sparc/ffitarget.h \ + src/sparc/internal.h src/tile/ffitarget.h src/vax/ffitarget.h \ + src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h \ + src/x86/asmnames.h src/xtensa/ffitarget.h src/dlmalloc.c \ + src/kvx/ffitarget.h src/kvx/asm.h \ + src/loongarch64/ffitarget.h -EXTRA_libffi_la_SOURCES = src/aarch64/ffi.c src/aarch64/sysv.S \ - src/aarch64/win64_armasm.S src/alpha/ffi.c src/alpha/osf.S \ - src/arc/ffi.c src/arc/arcompact.S src/arm/ffi.c \ - src/arm/sysv.S src/arm/ffi.c src/arm/sysv_msvc_arm32.S \ - src/avr32/ffi.c src/avr32/sysv.S src/bfin/ffi.c \ - src/bfin/sysv.S src/cris/ffi.c src/cris/sysv.S src/frv/ffi.c \ - src/frv/eabi.S src/ia64/ffi.c src/ia64/unix.S src/m32r/ffi.c \ - src/m32r/sysv.S src/m68k/ffi.c src/m68k/sysv.S src/m88k/ffi.c \ - src/m88k/obsd.S src/metag/ffi.c src/metag/sysv.S \ - src/microblaze/ffi.c src/microblaze/sysv.S src/mips/ffi.c \ - src/mips/o32.S src/mips/n32.S src/moxie/ffi.c \ - src/moxie/eabi.S src/nios2/ffi.c src/nios2/sysv.S \ - src/or1k/ffi.c src/or1k/sysv.S src/pa/ffi.c src/pa/linux.S \ - src/pa/hpux32.S src/powerpc/ffi.c src/powerpc/ffi_sysv.c \ - src/powerpc/ffi_linux64.c src/powerpc/sysv.S \ - src/powerpc/linux64.S src/powerpc/linux64_closure.S \ - src/powerpc/ppc_closure.S src/powerpc/aix.S \ - src/powerpc/darwin.S src/powerpc/aix_closure.S \ - src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \ - src/riscv/ffi.c src/riscv/sysv.S src/s390/ffi.c \ - src/s390/sysv.S src/sh/ffi.c src/sh/sysv.S src/sh64/ffi.c \ - src/sh64/sysv.S src/sparc/ffi.c src/sparc/ffi64.c \ - src/sparc/v8.S src/sparc/v9.S src/tile/ffi.c src/tile/tile.S \ - src/vax/ffi.c src/vax/elfbsd.S src/x86/ffi.c src/x86/sysv.S \ - src/x86/ffiw64.c src/x86/win64.S src/x86/ffi64.c \ - src/x86/unix64.S src/x86/sysv_intel.S src/x86/win64_intel.S \ - src/xtensa/ffi.c src/xtensa/sysv.S +EXTRA_libffi_la_SOURCES = src/aarch64/ffi.c src/aarch64/sysv.S \ + src/aarch64/win64_armasm.S src/alpha/ffi.c src/alpha/osf.S \ + src/arc/ffi.c src/arc/arcompact.S src/arm/ffi.c \ + src/arm/sysv.S src/arm/ffi.c src/arm/sysv_msvc_arm32.S \ + src/avr32/ffi.c src/avr32/sysv.S src/bfin/ffi.c \ + src/bfin/sysv.S src/cris/ffi.c src/cris/sysv.S src/frv/ffi.c \ + src/csky/ffi.c src/csky/sysv.S src/frv/eabi.S src/ia64/ffi.c \ + src/ia64/unix.S src/m32r/ffi.c src/m32r/sysv.S src/m68k/ffi.c \ + src/m68k/sysv.S src/m88k/ffi.c src/m88k/obsd.S \ + src/metag/ffi.c src/metag/sysv.S src/microblaze/ffi.c \ + src/microblaze/sysv.S src/mips/ffi.c src/mips/o32.S \ + src/mips/n32.S src/moxie/ffi.c src/moxie/eabi.S \ + src/nios2/ffi.c src/nios2/sysv.S src/or1k/ffi.c \ + src/or1k/sysv.S src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \ + src/powerpc/ffi.c src/powerpc/ffi_sysv.c \ + src/powerpc/ffi_linux64.c src/powerpc/sysv.S \ + src/powerpc/linux64.S src/powerpc/linux64_closure.S \ + src/powerpc/ppc_closure.S src/powerpc/aix.S \ + src/powerpc/darwin.S src/powerpc/aix_closure.S \ + src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \ + src/riscv/ffi.c src/riscv/sysv.S src/s390/ffi.c \ + src/s390/sysv.S src/sh/ffi.c src/sh/sysv.S src/sh64/ffi.c \ + src/sh64/sysv.S src/sparc/ffi.c src/sparc/ffi64.c \ + src/sparc/v8.S src/sparc/v9.S src/tile/ffi.c src/tile/tile.S \ + src/vax/ffi.c src/vax/elfbsd.S src/x86/ffi.c src/x86/sysv.S \ + src/x86/ffiw64.c src/x86/win64.S src/x86/ffi64.c \ + src/x86/unix64.S src/x86/sysv_intel.S src/x86/win64_intel.S \ + src/xtensa/ffi.c src/xtensa/sysv.S src/kvx/ffi.c \ + src/kvx/sysv.S src/loongarch64/ffi.c src/loongarch64/sysv.S TARGET_OBJ = @TARGET_OBJ@ libffi_la_LIBADD = $(TARGET_OBJ) @@ -144,7 +137,8 @@ endif libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version` libffi.map: $(top_srcdir)/libffi.map.in - $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $< + $(COMPILE) -D$(TARGET) -DGENERATE_LIBFFI_MAP \ + -E -x assembler-with-cpp -o $@ $(top_srcdir)/libffi.map.in libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS) libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep) @@ -157,3 +151,5 @@ dist-hook: 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 +# target overrides +-include $(tmake_file) diff --git a/Makefile.in b/Makefile.in index adce607..86eb4a5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -99,7 +99,6 @@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cc_maxopt.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ @@ -108,6 +107,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ $(top_srcdir)/m4/ax_enable_builddir.m4 \ $(top_srcdir)/m4/ax_gcc_archflag.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ + $(top_srcdir)/m4/ax_prepend_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ @@ -155,11 +155,12 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \ LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) am__DEPENDENCIES_1 = am__libffi_la_SOURCES_DIST = src/prep_cif.c src/types.c src/raw_api.c \ - src/java_raw_api.c src/closures.c src/debug.c + src/java_raw_api.c src/closures.c src/tramp.c src/debug.c am__dirstamp = $(am__leading_dot)dirstamp @FFI_DEBUG_TRUE@am__objects_1 = src/debug.lo am_libffi_la_OBJECTS = src/prep_cif.lo src/types.lo src/raw_api.lo \ - src/java_raw_api.lo src/closures.lo $(am__objects_1) + src/java_raw_api.lo src/closures.lo src/tramp.lo \ + $(am__objects_1) libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -170,9 +171,11 @@ libffi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(libffi_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) am__libffi_convenience_la_SOURCES_DIST = src/prep_cif.c src/types.c \ - src/raw_api.c src/java_raw_api.c src/closures.c src/debug.c + src/raw_api.c src/java_raw_api.c src/closures.c src/tramp.c \ + src/debug.c am__objects_2 = src/prep_cif.lo src/types.lo src/raw_api.lo \ - src/java_raw_api.lo src/closures.lo $(am__objects_1) + src/java_raw_api.lo src/closures.lo src/tramp.lo \ + $(am__objects_1) am_libffi_convenience_la_OBJECTS = $(am__objects_2) nodist_libffi_convenience_la_OBJECTS = libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \ @@ -195,8 +198,8 @@ am__maybe_remake_depfiles = depfiles am__depfiles_remade = src/$(DEPDIR)/closures.Plo \ src/$(DEPDIR)/debug.Plo src/$(DEPDIR)/java_raw_api.Plo \ src/$(DEPDIR)/prep_cif.Plo src/$(DEPDIR)/raw_api.Plo \ - src/$(DEPDIR)/types.Plo src/aarch64/$(DEPDIR)/ffi.Plo \ - src/aarch64/$(DEPDIR)/sysv.Plo \ + src/$(DEPDIR)/tramp.Plo src/$(DEPDIR)/types.Plo \ + src/aarch64/$(DEPDIR)/ffi.Plo src/aarch64/$(DEPDIR)/sysv.Plo \ src/aarch64/$(DEPDIR)/win64_armasm.Plo \ src/alpha/$(DEPDIR)/ffi.Plo src/alpha/$(DEPDIR)/osf.Plo \ src/arc/$(DEPDIR)/arcompact.Plo src/arc/$(DEPDIR)/ffi.Plo \ @@ -205,13 +208,16 @@ am__depfiles_remade = src/$(DEPDIR)/closures.Plo \ src/avr32/$(DEPDIR)/ffi.Plo src/avr32/$(DEPDIR)/sysv.Plo \ src/bfin/$(DEPDIR)/ffi.Plo src/bfin/$(DEPDIR)/sysv.Plo \ src/cris/$(DEPDIR)/ffi.Plo src/cris/$(DEPDIR)/sysv.Plo \ + src/csky/$(DEPDIR)/ffi.Plo src/csky/$(DEPDIR)/sysv.Plo \ src/frv/$(DEPDIR)/eabi.Plo src/frv/$(DEPDIR)/ffi.Plo \ src/ia64/$(DEPDIR)/ffi.Plo src/ia64/$(DEPDIR)/unix.Plo \ - src/m32r/$(DEPDIR)/ffi.Plo src/m32r/$(DEPDIR)/sysv.Plo \ - src/m68k/$(DEPDIR)/ffi.Plo src/m68k/$(DEPDIR)/sysv.Plo \ - src/m88k/$(DEPDIR)/ffi.Plo src/m88k/$(DEPDIR)/obsd.Plo \ - src/metag/$(DEPDIR)/ffi.Plo src/metag/$(DEPDIR)/sysv.Plo \ - src/microblaze/$(DEPDIR)/ffi.Plo \ + src/kvx/$(DEPDIR)/ffi.Plo src/kvx/$(DEPDIR)/sysv.Plo \ + src/loongarch64/$(DEPDIR)/ffi.Plo \ + src/loongarch64/$(DEPDIR)/sysv.Plo src/m32r/$(DEPDIR)/ffi.Plo \ + src/m32r/$(DEPDIR)/sysv.Plo src/m68k/$(DEPDIR)/ffi.Plo \ + src/m68k/$(DEPDIR)/sysv.Plo src/m88k/$(DEPDIR)/ffi.Plo \ + src/m88k/$(DEPDIR)/obsd.Plo src/metag/$(DEPDIR)/ffi.Plo \ + src/metag/$(DEPDIR)/sysv.Plo src/microblaze/$(DEPDIR)/ffi.Plo \ src/microblaze/$(DEPDIR)/sysv.Plo src/mips/$(DEPDIR)/ffi.Plo \ src/mips/$(DEPDIR)/n32.Plo src/mips/$(DEPDIR)/o32.Plo \ src/moxie/$(DEPDIR)/eabi.Plo src/moxie/$(DEPDIR)/ffi.Plo \ @@ -303,8 +309,8 @@ am__recursive_targets = \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)fficonfig.h.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + fficonfig.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -321,13 +327,10 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope DIST_SUBDIRS = include testsuite man doc am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/fficonfig.h.in \ - $(srcdir)/libffi.pc.in compile config.guess config.sub depcomp \ - install-sh ltmain.sh missing + $(srcdir)/libffi.pc.in README.md compile config.guess \ + config.sub depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -366,6 +369,8 @@ am__relativize = \ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -387,8 +392,9 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -403,9 +409,11 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@ @@ -444,6 +452,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ +READELF = @READELF@ SECTION_LDFLAGS = @SECTION_LDFLAGS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -499,6 +508,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -509,6 +519,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +tmake_file = @tmake_file@ toolexecdir = @toolexecdir@ toolexeclibdir = @toolexeclibdir@ top_build_prefix = @top_build_prefix@ @@ -523,8 +534,9 @@ EXTRA_DIST = LICENSE ChangeLog.old \ m4/ltversion.m4 src/debug.c msvcc.sh \ generate-darwin-source-and-headers.py \ libffi.xcodeproj/project.pbxproj \ + src/powerpc/t-aix \ libtool-ldflags libtool-version configure.host README.md \ - libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl + libffi.map.in LICENSE-BUILDTOOLS msvc_build make_sunver.pl # local.exp is generated by configure @@ -538,66 +550,57 @@ pkgconfig_DATA = libffi.pc toolexeclib_LTLIBRARIES = libffi.la noinst_LTLIBRARIES = libffi_convenience.la libffi_la_SOURCES = src/prep_cif.c src/types.c src/raw_api.c \ - src/java_raw_api.c src/closures.c $(am__append_2) -noinst_HEADERS = \ - src/aarch64/ffitarget.h src/aarch64/internal.h \ + src/java_raw_api.c src/closures.c src/tramp.c $(am__append_2) +noinst_HEADERS = src/aarch64/ffitarget.h src/aarch64/internal.h \ src/alpha/ffitarget.h src/alpha/internal.h \ - src/arc/ffitarget.h \ - src/arm/ffitarget.h src/arm/internal.h \ - src/avr32/ffitarget.h \ - src/bfin/ffitarget.h \ - src/cris/ffitarget.h \ - src/frv/ffitarget.h \ + src/arc/ffitarget.h src/arm/ffitarget.h src/arm/internal.h \ + src/avr32/ffitarget.h src/bfin/ffitarget.h \ + src/cris/ffitarget.h src/csky/ffitarget.h src/frv/ffitarget.h \ src/ia64/ffitarget.h src/ia64/ia64_flags.h \ - src/m32r/ffitarget.h \ - src/m68k/ffitarget.h \ - src/m88k/ffitarget.h \ - src/metag/ffitarget.h \ - src/microblaze/ffitarget.h \ - src/mips/ffitarget.h \ - src/moxie/ffitarget.h \ - src/nios2/ffitarget.h \ - src/or1k/ffitarget.h \ - src/pa/ffitarget.h \ - src/powerpc/ffitarget.h src/powerpc/asm.h src/powerpc/ffi_powerpc.h \ - src/riscv/ffitarget.h \ - src/s390/ffitarget.h src/s390/internal.h \ - src/sh/ffitarget.h \ - src/sh64/ffitarget.h \ - src/sparc/ffitarget.h src/sparc/internal.h \ - src/tile/ffitarget.h \ - src/vax/ffitarget.h \ - src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h src/x86/asmnames.h \ - src/xtensa/ffitarget.h \ - src/dlmalloc.c + src/m32r/ffitarget.h src/m68k/ffitarget.h \ + src/m88k/ffitarget.h src/metag/ffitarget.h \ + src/microblaze/ffitarget.h src/mips/ffitarget.h \ + src/moxie/ffitarget.h src/nios2/ffitarget.h \ + src/or1k/ffitarget.h src/pa/ffitarget.h \ + src/powerpc/ffitarget.h src/powerpc/asm.h \ + src/powerpc/ffi_powerpc.h src/riscv/ffitarget.h \ + src/s390/ffitarget.h src/s390/internal.h src/sh/ffitarget.h \ + src/sh64/ffitarget.h src/sparc/ffitarget.h \ + src/sparc/internal.h src/tile/ffitarget.h src/vax/ffitarget.h \ + src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h \ + src/x86/asmnames.h src/xtensa/ffitarget.h src/dlmalloc.c \ + src/kvx/ffitarget.h src/kvx/asm.h \ + src/loongarch64/ffitarget.h -EXTRA_libffi_la_SOURCES = src/aarch64/ffi.c src/aarch64/sysv.S \ - src/aarch64/win64_armasm.S src/alpha/ffi.c src/alpha/osf.S \ - src/arc/ffi.c src/arc/arcompact.S src/arm/ffi.c \ - src/arm/sysv.S src/arm/ffi.c src/arm/sysv_msvc_arm32.S \ - src/avr32/ffi.c src/avr32/sysv.S src/bfin/ffi.c \ - src/bfin/sysv.S src/cris/ffi.c src/cris/sysv.S src/frv/ffi.c \ - src/frv/eabi.S src/ia64/ffi.c src/ia64/unix.S src/m32r/ffi.c \ - src/m32r/sysv.S src/m68k/ffi.c src/m68k/sysv.S src/m88k/ffi.c \ - src/m88k/obsd.S src/metag/ffi.c src/metag/sysv.S \ - src/microblaze/ffi.c src/microblaze/sysv.S src/mips/ffi.c \ - src/mips/o32.S src/mips/n32.S src/moxie/ffi.c \ - src/moxie/eabi.S src/nios2/ffi.c src/nios2/sysv.S \ - src/or1k/ffi.c src/or1k/sysv.S src/pa/ffi.c src/pa/linux.S \ - src/pa/hpux32.S src/powerpc/ffi.c src/powerpc/ffi_sysv.c \ - src/powerpc/ffi_linux64.c src/powerpc/sysv.S \ - src/powerpc/linux64.S src/powerpc/linux64_closure.S \ - src/powerpc/ppc_closure.S src/powerpc/aix.S \ - src/powerpc/darwin.S src/powerpc/aix_closure.S \ - src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \ - src/riscv/ffi.c src/riscv/sysv.S src/s390/ffi.c \ - src/s390/sysv.S src/sh/ffi.c src/sh/sysv.S src/sh64/ffi.c \ - src/sh64/sysv.S src/sparc/ffi.c src/sparc/ffi64.c \ - src/sparc/v8.S src/sparc/v9.S src/tile/ffi.c src/tile/tile.S \ - src/vax/ffi.c src/vax/elfbsd.S src/x86/ffi.c src/x86/sysv.S \ - src/x86/ffiw64.c src/x86/win64.S src/x86/ffi64.c \ - src/x86/unix64.S src/x86/sysv_intel.S src/x86/win64_intel.S \ - src/xtensa/ffi.c src/xtensa/sysv.S +EXTRA_libffi_la_SOURCES = src/aarch64/ffi.c src/aarch64/sysv.S \ + src/aarch64/win64_armasm.S src/alpha/ffi.c src/alpha/osf.S \ + src/arc/ffi.c src/arc/arcompact.S src/arm/ffi.c \ + src/arm/sysv.S src/arm/ffi.c src/arm/sysv_msvc_arm32.S \ + src/avr32/ffi.c src/avr32/sysv.S src/bfin/ffi.c \ + src/bfin/sysv.S src/cris/ffi.c src/cris/sysv.S src/frv/ffi.c \ + src/csky/ffi.c src/csky/sysv.S src/frv/eabi.S src/ia64/ffi.c \ + src/ia64/unix.S src/m32r/ffi.c src/m32r/sysv.S src/m68k/ffi.c \ + src/m68k/sysv.S src/m88k/ffi.c src/m88k/obsd.S \ + src/metag/ffi.c src/metag/sysv.S src/microblaze/ffi.c \ + src/microblaze/sysv.S src/mips/ffi.c src/mips/o32.S \ + src/mips/n32.S src/moxie/ffi.c src/moxie/eabi.S \ + src/nios2/ffi.c src/nios2/sysv.S src/or1k/ffi.c \ + src/or1k/sysv.S src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S \ + src/powerpc/ffi.c src/powerpc/ffi_sysv.c \ + src/powerpc/ffi_linux64.c src/powerpc/sysv.S \ + src/powerpc/linux64.S src/powerpc/linux64_closure.S \ + src/powerpc/ppc_closure.S src/powerpc/aix.S \ + src/powerpc/darwin.S src/powerpc/aix_closure.S \ + src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c \ + src/riscv/ffi.c src/riscv/sysv.S src/s390/ffi.c \ + src/s390/sysv.S src/sh/ffi.c src/sh/sysv.S src/sh64/ffi.c \ + src/sh64/sysv.S src/sparc/ffi.c src/sparc/ffi64.c \ + src/sparc/v8.S src/sparc/v9.S src/tile/ffi.c src/tile/tile.S \ + src/vax/ffi.c src/vax/elfbsd.S src/x86/ffi.c src/x86/sysv.S \ + src/x86/ffiw64.c src/x86/win64.S src/x86/ffi64.c \ + src/x86/unix64.S src/x86/sysv_intel.S src/x86/win64_intel.S \ + src/xtensa/ffi.c src/xtensa/sysv.S src/kvx/ffi.c \ + src/kvx/sysv.S src/loongarch64/ffi.c src/loongarch64/sysv.S libffi_la_LIBADD = $(TARGET_OBJ) libffi_convenience_la_SOURCES = $(libffi_la_SOURCES) @@ -730,6 +733,7 @@ src/types.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/raw_api.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/java_raw_api.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/closures.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/tramp.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/debug.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/aarch64/$(am__dirstamp): @$(MKDIR_P) src/aarch64 @@ -813,6 +817,16 @@ src/frv/$(DEPDIR)/$(am__dirstamp): @: > src/frv/$(DEPDIR)/$(am__dirstamp) src/frv/ffi.lo: src/frv/$(am__dirstamp) \ src/frv/$(DEPDIR)/$(am__dirstamp) +src/csky/$(am__dirstamp): + @$(MKDIR_P) src/csky + @: > src/csky/$(am__dirstamp) +src/csky/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/csky/$(DEPDIR) + @: > src/csky/$(DEPDIR)/$(am__dirstamp) +src/csky/ffi.lo: src/csky/$(am__dirstamp) \ + src/csky/$(DEPDIR)/$(am__dirstamp) +src/csky/sysv.lo: src/csky/$(am__dirstamp) \ + src/csky/$(DEPDIR)/$(am__dirstamp) src/frv/eabi.lo: src/frv/$(am__dirstamp) \ src/frv/$(DEPDIR)/$(am__dirstamp) src/ia64/$(am__dirstamp): @@ -1063,6 +1077,26 @@ src/xtensa/ffi.lo: src/xtensa/$(am__dirstamp) \ src/xtensa/$(DEPDIR)/$(am__dirstamp) src/xtensa/sysv.lo: src/xtensa/$(am__dirstamp) \ src/xtensa/$(DEPDIR)/$(am__dirstamp) +src/kvx/$(am__dirstamp): + @$(MKDIR_P) src/kvx + @: > src/kvx/$(am__dirstamp) +src/kvx/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/kvx/$(DEPDIR) + @: > src/kvx/$(DEPDIR)/$(am__dirstamp) +src/kvx/ffi.lo: src/kvx/$(am__dirstamp) \ + src/kvx/$(DEPDIR)/$(am__dirstamp) +src/kvx/sysv.lo: src/kvx/$(am__dirstamp) \ + src/kvx/$(DEPDIR)/$(am__dirstamp) +src/loongarch64/$(am__dirstamp): + @$(MKDIR_P) src/loongarch64 + @: > src/loongarch64/$(am__dirstamp) +src/loongarch64/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/loongarch64/$(DEPDIR) + @: > src/loongarch64/$(DEPDIR)/$(am__dirstamp) +src/loongarch64/ffi.lo: src/loongarch64/$(am__dirstamp) \ + src/loongarch64/$(DEPDIR)/$(am__dirstamp) +src/loongarch64/sysv.lo: src/loongarch64/$(am__dirstamp) \ + src/loongarch64/$(DEPDIR)/$(am__dirstamp) libffi.la: $(libffi_la_OBJECTS) $(libffi_la_DEPENDENCIES) $(EXTRA_libffi_la_DEPENDENCIES) $(AM_V_CCLD)$(libffi_la_LINK) -rpath $(toolexeclibdir) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS) @@ -1088,10 +1122,16 @@ mostlyclean-compile: -rm -f src/bfin/*.lo -rm -f src/cris/*.$(OBJEXT) -rm -f src/cris/*.lo + -rm -f src/csky/*.$(OBJEXT) + -rm -f src/csky/*.lo -rm -f src/frv/*.$(OBJEXT) -rm -f src/frv/*.lo -rm -f src/ia64/*.$(OBJEXT) -rm -f src/ia64/*.lo + -rm -f src/kvx/*.$(OBJEXT) + -rm -f src/kvx/*.lo + -rm -f src/loongarch64/*.$(OBJEXT) + -rm -f src/loongarch64/*.lo -rm -f src/m32r/*.$(OBJEXT) -rm -f src/m32r/*.lo -rm -f src/m68k/*.$(OBJEXT) @@ -1141,6 +1181,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/java_raw_api.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/prep_cif.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/raw_api.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/tramp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/types.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/aarch64/$(DEPDIR)/ffi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/aarch64/$(DEPDIR)/sysv.Plo@am__quote@ # am--include-marker @@ -1158,10 +1199,16 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@src/bfin/$(DEPDIR)/sysv.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/cris/$(DEPDIR)/ffi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/cris/$(DEPDIR)/sysv.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/csky/$(DEPDIR)/ffi.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/csky/$(DEPDIR)/sysv.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/frv/$(DEPDIR)/eabi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/frv/$(DEPDIR)/ffi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/ia64/$(DEPDIR)/ffi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/ia64/$(DEPDIR)/unix.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/kvx/$(DEPDIR)/ffi.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/kvx/$(DEPDIR)/sysv.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/loongarch64/$(DEPDIR)/ffi.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/loongarch64/$(DEPDIR)/sysv.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/m32r/$(DEPDIR)/ffi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/m32r/$(DEPDIR)/sysv.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/ffi.Plo@am__quote@ # am--include-marker @@ -1290,8 +1337,11 @@ clean-libtool: -rm -rf src/avr32/.libs src/avr32/_libs -rm -rf src/bfin/.libs src/bfin/_libs -rm -rf src/cris/.libs src/cris/_libs + -rm -rf src/csky/.libs src/csky/_libs -rm -rf src/frv/.libs src/frv/_libs -rm -rf src/ia64/.libs src/ia64/_libs + -rm -rf src/kvx/.libs src/kvx/_libs + -rm -rf src/loongarch64/.libs src/loongarch64/_libs -rm -rf src/m32r/.libs src/m32r/_libs -rm -rf src/m68k/.libs src/m68k/_libs -rm -rf src/m88k/.libs src/m88k/_libs @@ -1442,7 +1492,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -1529,6 +1578,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -1571,6 +1624,8 @@ distcheck: dist eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -1586,7 +1641,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -1687,10 +1742,16 @@ distclean-generic: -rm -f src/bfin/$(am__dirstamp) -rm -f src/cris/$(DEPDIR)/$(am__dirstamp) -rm -f src/cris/$(am__dirstamp) + -rm -f src/csky/$(DEPDIR)/$(am__dirstamp) + -rm -f src/csky/$(am__dirstamp) -rm -f src/frv/$(DEPDIR)/$(am__dirstamp) -rm -f src/frv/$(am__dirstamp) -rm -f src/ia64/$(DEPDIR)/$(am__dirstamp) -rm -f src/ia64/$(am__dirstamp) + -rm -f src/kvx/$(DEPDIR)/$(am__dirstamp) + -rm -f src/kvx/$(am__dirstamp) + -rm -f src/loongarch64/$(DEPDIR)/$(am__dirstamp) + -rm -f src/loongarch64/$(am__dirstamp) -rm -f src/m32r/$(DEPDIR)/$(am__dirstamp) -rm -f src/m32r/$(am__dirstamp) -rm -f src/m68k/$(DEPDIR)/$(am__dirstamp) @@ -1748,6 +1809,7 @@ distclean: distclean-recursive -rm -f src/$(DEPDIR)/java_raw_api.Plo -rm -f src/$(DEPDIR)/prep_cif.Plo -rm -f src/$(DEPDIR)/raw_api.Plo + -rm -f src/$(DEPDIR)/tramp.Plo -rm -f src/$(DEPDIR)/types.Plo -rm -f src/aarch64/$(DEPDIR)/ffi.Plo -rm -f src/aarch64/$(DEPDIR)/sysv.Plo @@ -1765,10 +1827,16 @@ distclean: distclean-recursive -rm -f src/bfin/$(DEPDIR)/sysv.Plo -rm -f src/cris/$(DEPDIR)/ffi.Plo -rm -f src/cris/$(DEPDIR)/sysv.Plo + -rm -f src/csky/$(DEPDIR)/ffi.Plo + -rm -f src/csky/$(DEPDIR)/sysv.Plo -rm -f src/frv/$(DEPDIR)/eabi.Plo -rm -f src/frv/$(DEPDIR)/ffi.Plo -rm -f src/ia64/$(DEPDIR)/ffi.Plo -rm -f src/ia64/$(DEPDIR)/unix.Plo + -rm -f src/kvx/$(DEPDIR)/ffi.Plo + -rm -f src/kvx/$(DEPDIR)/sysv.Plo + -rm -f src/loongarch64/$(DEPDIR)/ffi.Plo + -rm -f src/loongarch64/$(DEPDIR)/sysv.Plo -rm -f src/m32r/$(DEPDIR)/ffi.Plo -rm -f src/m32r/$(DEPDIR)/sysv.Plo -rm -f src/m68k/$(DEPDIR)/ffi.Plo @@ -1881,6 +1949,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f src/$(DEPDIR)/java_raw_api.Plo -rm -f src/$(DEPDIR)/prep_cif.Plo -rm -f src/$(DEPDIR)/raw_api.Plo + -rm -f src/$(DEPDIR)/tramp.Plo -rm -f src/$(DEPDIR)/types.Plo -rm -f src/aarch64/$(DEPDIR)/ffi.Plo -rm -f src/aarch64/$(DEPDIR)/sysv.Plo @@ -1898,10 +1967,16 @@ maintainer-clean: maintainer-clean-recursive -rm -f src/bfin/$(DEPDIR)/sysv.Plo -rm -f src/cris/$(DEPDIR)/ffi.Plo -rm -f src/cris/$(DEPDIR)/sysv.Plo + -rm -f src/csky/$(DEPDIR)/ffi.Plo + -rm -f src/csky/$(DEPDIR)/sysv.Plo -rm -f src/frv/$(DEPDIR)/eabi.Plo -rm -f src/frv/$(DEPDIR)/ffi.Plo -rm -f src/ia64/$(DEPDIR)/ffi.Plo -rm -f src/ia64/$(DEPDIR)/unix.Plo + -rm -f src/kvx/$(DEPDIR)/ffi.Plo + -rm -f src/kvx/$(DEPDIR)/sysv.Plo + -rm -f src/loongarch64/$(DEPDIR)/ffi.Plo + -rm -f src/loongarch64/$(DEPDIR)/sysv.Plo -rm -f src/m32r/$(DEPDIR)/ffi.Plo -rm -f src/m32r/$(DEPDIR)/sysv.Plo -rm -f src/m68k/$(DEPDIR)/ffi.Plo @@ -1987,20 +2062,21 @@ uninstall-am: uninstall-pkgconfigDATA uninstall-toolexeclibLTLIBRARIES clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-toolexeclibLTLIBRARIES cscope cscopelist-am ctags \ ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ - dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-compile distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkgconfigDATA install-ps \ - install-ps-am install-strip install-toolexeclibLTLIBRARIES \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-pkgconfigDATA uninstall-toolexeclibLTLIBRARIES + dist-lzip dist-shar dist-tarZ dist-xz dist-zip dist-zstd \ + distcheck distclean distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-pkgconfigDATA \ + install-ps install-ps-am install-strip \ + install-toolexeclibLTLIBRARIES installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-pkgconfigDATA \ + uninstall-toolexeclibLTLIBRARIES .PRECIOUS: Makefile @@ -2012,13 +2088,17 @@ uninstall-am: uninstall-pkgconfigDATA uninstall-toolexeclibLTLIBRARIES @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@ > $@ || (rm -f $@ ; exit 1) libffi.map: $(top_srcdir)/libffi.map.in - $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $< + $(COMPILE) -D$(TARGET) -DGENERATE_LIBFFI_MAP \ + -E -x assembler-with-cpp -o $@ $(top_srcdir)/libffi.map.in 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 +# target overrides +-include $(tmake_file) + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/README.md b/README.md index 737fd41..f24a0f7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -libffi-3.3 was released on November 23, 2019. Check the libffi web +libffi-3.4.4 was released on October 23, 2022. Check the libffi web page for updates: . @@ -23,7 +23,7 @@ bridge from the interpreter program to compiled code. The libffi library provides a portable, high level programming interface to various calling conventions. This allows a programmer to call any function specified by a call interface description at run -time. +time. FFI stands for Foreign Function Interface. A foreign function interface is the popular name for the interface that allows code @@ -55,8 +55,11 @@ tested: | ARM | Windows | MSVC | | AVR32 | Linux | GCC | | Blackfin | uClinux | GCC | +| CSKY | Linux | GCC | | HPPA | HPUX | GCC | +| KVX | Linux | GCC | | IA-64 | Linux | GCC | +| LoongArch64 | Linux | GCC | | M68K | FreeMiNT | GCC | | M68K | Linux | GCC | | M68K | RTEMS | GCC | @@ -70,6 +73,7 @@ tested: | Moxie | Bare metal | GCC | | Nios II | Linux | GCC | | OpenRISC | Linux | GCC | +| PowerPC 32-bit | AIX | GCC | | PowerPC 32-bit | AIX | IBM XL C | | PowerPC 64-bit | AIX | IBM XL C | | PowerPC | AMIGA | GCC | @@ -96,7 +100,6 @@ tested: | X86 | Interix | GCC | | X86 | kFreeBSD | GCC | | X86 | Linux | GCC | -| X86 | Mac OSX | GCC | | X86 | OpenBSD | GCC | | X86 | OS/2 | GCC | | X86 | Solaris | GCC | @@ -131,15 +134,15 @@ install autoconf, automake and libtool. You may want to tell configure where to install the libffi library and header files. To do that, use the ``--prefix`` configure switch. Libffi -will install under /usr/local by default. +will install under /usr/local by default. If you want to enable extra run-time debugging checks use the the ``--enable-debug`` configure switch. This is useful when your program dies -mysteriously while using libffi. +mysteriously while using libffi. Another useful configure switch is ``--enable-purify-safety``. Using this will add some extra code which will suppress certain warnings when you -are using Purify with libffi. Only use this switch when using +are using Purify with libffi. Only use this switch when using Purify, as it will slow down the library. If you don't want to build documentation, use the ``--disable-docs`` @@ -158,7 +161,7 @@ For 64-bit Windows builds, use ``CC="path/to/msvcc.sh -m64"`` and It is also possible to build libffi on Windows platforms with the LLVM project's clang-cl compiler, like below: - path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP" + path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP" When building with MSVC under a MingW environment, you may need to remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath' @@ -192,7 +195,35 @@ History See the git log for details at http://github.com/libffi/libffi. - 3.3 Nov-23-19 + 3.4.4 Oct-23-2022 + Important aarch64 fixes, including support for linux builds + with Link Time Optimization (-flto). + Fix x86 stdcall stack alignment. + Fix x86 Windows msvc assembler compatibility. + Fix moxie and or1k small structure args. + + 3.4.3 Sep-19-2022 + All struct args are passed by value, regardless of size, as per ABIs. + Enable static trampolines for Cygwin. + Add support for Loongson's LoongArch64 architecture. + Fix x32 static trampolines. + Fix 32-bit x86 stdcall stack corruption. + Fix ILP32 aarch64 support. + + 3.4.2 Jun-28-2021 + Add static trampoline support for Linux on x86_64 and ARM64. + Add support for Alibaba's CSKY architecture. + Add support for Kalray's KVX architecture. + Add support for Intel Control-flow Enforcement Technology (CET). + Add support for ARM Pointer Authentication (PA). + Fix 32-bit PPC regression. + Fix MIPS soft-float problem. + Enable tmpdir override with the $LIBFFI_TMPDIR environment variable. + Enable compatibility with MSVC runtime stack checking. + Reject float and small integer argument in ffi_prep_cif_var(). + Callers must promote these types themselves. + + 3.3 Nov-23-2019 Add RISC-V support. New API in support of GO closures. Add IEEE754 binary128 long double support for 64-bit Power @@ -201,21 +232,21 @@ See the git log for details at http://github.com/libffi/libffi. Add Windows on ARM64 (WOA) support. Add Windows 32-bit ARM support. Raw java (gcj) API deprecated. - Add pre-built PDF documentation to source distribution. - Many new tests cases and bug fixes. - - 3.2.1 Nov-12-14 + Add pre-built PDF documentation to source distribution. + Many new test cases and bug fixes. + + 3.2.1 Nov-12-2014 Build fix for non-iOS AArch64 targets. - - 3.2 Nov-11-14 + + 3.2 Nov-11-2014 Add C99 Complex Type support (currently only supported on s390). Add support for PASCAL and REGISTER calling conventions on x86 Windows/Linux. Add OpenRISC and Cygwin-64 support. Bug fixes. - - 3.1 May-19-14 + + 3.1 May-19-2014 Add AArch64 (ARM64) iOS support. Add Nios II support. Add m88k and DEC VAX support. @@ -227,8 +258,8 @@ See the git log for details at http://github.com/libffi/libffi. failures, and respect the $CC and $CXX environment variables. Archive off the manually maintained ChangeLog in favor of git log. - - 3.0.13 Mar-17-13 + + 3.0.13 Mar-17-2013 Add Meta support. Add missing Moxie bits. Fix stack alignment bug on 32-bit x86. @@ -237,8 +268,8 @@ See the git log for details at http://github.com/libffi/libffi. Fix the install dir location for some platforms when building with GCC (OS X, Solaris). Fix Cygwin regression. - - 3.0.12 Feb-11-13 + + 3.0.12 Feb-11-2013 Add Moxie support. Add AArch64 support. Add Blackfin support. @@ -249,8 +280,8 @@ See the git log for details at http://github.com/libffi/libffi. Add support for native vendor compilers on Solaris and AIX. Work around LLVM/GCC interoperability issue on x86_64. - - 3.0.11 Apr-11-12 + + 3.0.11 Apr-11-2012 Lots of build fixes. Add support for variadic functions (ffi_prep_cif_var). Add Linux/x32 support. @@ -260,8 +291,8 @@ See the git log for details at http://github.com/libffi/libffi. Integration with iOS' xcode build tools. Fix Octeon and MC68881 support. Fix code pessimizations. - - 3.0.10 Aug-23-11 + + 3.0.10 Aug-23-2011 Add support for Apple's iOS. Add support for ARM VFP ABI. Add RTEMS support for MIPS and M68K. @@ -274,129 +305,129 @@ See the git log for details at http://github.com/libffi/libffi. Solaris compiler. Testsuite fixes for Tru64 Unix. Additional platform support. - - 3.0.9 Dec-31-09 + + 3.0.9 Dec-31-2009 Add AVR32 and win64 ports. Add ARM softfp support. Many fixes for AIX, Solaris, HP-UX, *BSD. Several PowerPC and x86-64 bug fixes. Build DLL for windows. - - 3.0.8 Dec-19-08 + + 3.0.8 Dec-19-2008 Add *BSD, BeOS, and PA-Linux support. - - 3.0.7 Nov-11-08 + + 3.0.7 Nov-11-2008 Fix for ppc FreeBSD. (thanks to Andreas Tobler) - - 3.0.6 Jul-17-08 + + 3.0.6 Jul-17-2008 Fix for closures on sh. Mark the sh/sh64 stack as non-executable. (both thanks to Kaz Kojima) - - 3.0.5 Apr-3-08 + + 3.0.5 Apr-3-2008 Fix libffi.pc file. Fix #define ARM for IcedTea users. Fix x86 closure bug. - - 3.0.4 Feb-24-08 + + 3.0.4 Feb-24-2008 Fix x86 OpenBSD configury. - - 3.0.3 Feb-22-08 + + 3.0.3 Feb-22-2008 Enable x86 OpenBSD thanks to Thomas Heller, and x86-64 FreeBSD thanks to Björn König and Andreas Tobler. Clean up test instruction in README. - - 3.0.2 Feb-21-08 + + 3.0.2 Feb-21-2008 Improved x86 FreeBSD support. Thanks to Björn König. - - 3.0.1 Feb-15-08 + + 3.0.1 Feb-15-2008 Fix instruction cache flushing bug on MIPS. Thanks to David Daney. - - 3.0.0 Feb-15-08 + + 3.0.0 Feb-15-2008 Many changes, mostly thanks to the GCC project. Cygnus Solutions is now Red Hat. - + [10 years go by...] - - 1.20 Oct-5-98 + + 1.20 Oct-5-1998 Raffaele Sena produces ARM port. - - 1.19 Oct-5-98 + + 1.19 Oct-5-1998 Fixed x86 long double and long long return support. m68k bug fixes from Andreas Schwab. Patch for DU assembler compatibility for the Alpha from Richard Henderson. - - 1.18 Apr-17-98 + + 1.18 Apr-17-1998 Bug fixes and MIPS configuration changes. - - 1.17 Feb-24-98 + + 1.17 Feb-24-1998 Bug fixes and m68k port from Andreas Schwab. PowerPC port from Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes. - - 1.16 Feb-11-98 + + 1.16 Feb-11-1998 Richard Henderson produces Alpha port. - - 1.15 Dec-4-97 + + 1.15 Dec-4-1997 Fixed an n32 ABI bug. New libtool, auto* support. - + 1.14 May-13-97 libtool is now used to generate shared and static libraries. Fixed a minor portability problem reported by Russ McManus . - - 1.13 Dec-2-96 + + 1.13 Dec-2-1996 Added --enable-purify-safety to keep Purify from complaining about certain low level code. Sparc fix for calling functions with < 6 args. Linux x86 a.out fix. - - 1.12 Nov-22-96 - Added missing ffi_type_void, needed for supporting void return - types. Fixed test case for non MIPS machines. Cygnus Support - is now Cygnus Solutions. - - 1.11 Oct-30-96 + + 1.12 Nov-22-1996 + Added missing ffi_type_void, needed for supporting void return + types. Fixed test case for non MIPS machines. Cygnus Support + is now Cygnus Solutions. + + 1.11 Oct-30-1996 Added notes about GNU make. - - 1.10 Oct-29-96 + + 1.10 Oct-29-1996 Added configuration fix for non GNU compilers. - - 1.09 Oct-29-96 - Added --enable-debug configure switch. Clean-ups based on LCLint - feedback. ffi_mips.h is always installed. Many configuration + + 1.09 Oct-29-1996 + Added --enable-debug configure switch. Clean-ups based on LCLint + feedback. ffi_mips.h is always installed. Many configuration fixes. Fixed ffitest.c for sparc builds. - - 1.08 Oct-15-96 + + 1.08 Oct-15-1996 Fixed n32 problem. Many clean-ups. - - 1.07 Oct-14-96 + + 1.07 Oct-14-1996 Gordon Irlam rewrites v8.S again. Bug fixes. - - 1.06 Oct-14-96 - Gordon Irlam improved the sparc port. - - 1.05 Oct-14-96 + + 1.06 Oct-14-1996 + Gordon Irlam improved the sparc port. + + 1.05 Oct-14-1996 Interface changes based on feedback. - - 1.04 Oct-11-96 + + 1.04 Oct-11-1996 Sparc port complete (modulo struct passing bug). - - 1.03 Oct-10-96 + + 1.03 Oct-10-1996 Passing struct args, and returning struct values works for all architectures/calling conventions. Expanded tests. - - 1.02 Oct-9-96 + + 1.02 Oct-9-1996 Added SGI n32 support. Fixed bugs in both o32 and Linux support. Added "make test". - - 1.01 Oct-8-96 + + 1.01 Oct-8-1996 Fixed float passing bug in mips version. Restructured some of the code. Builds cleanly with SGI tools. - - 1.00 Oct-7-96 + + 1.00 Oct-7-1996 First release. No public announcement. Authors & Credits @@ -424,8 +455,12 @@ developers: avr32 Bradley Smith blackfin Alexandre Keunecke I. de Mendonca cris Simon Posnjak, Hans-Peter Nilsson + csky Ma Jun, Zhang Wenmeng frv Anthony Green ia64 Hans Boehm + kvx Yann Sionneau + loongarch64 Cheng Lulu, Xi Ruoyao, Xu Hao, + Zhang Wenlong, Pan Xuefeng m32r Kazuhiro Inaoka m68k Andreas Schwab m88k Miod Vallat @@ -467,6 +502,11 @@ Alex Oliva solved the executable page problem for SElinux. The list above is almost certainly incomplete and inaccurate. I'm happy to make corrections or additions upon request. -If you have a problem, or have found a bug, please send a note to the -author at green@moxielogic.com, or the project mailing list at -libffi-discuss@sourceware.org. +If you have a problem, or have found a bug, please file an issue on +our issue tracker at https://github.com/libffi/libffi/issues. + +The author can be reached at green@moxielogic.com. + +To subscribe/unsubscribe to our mailing lists, visit: +https://sourceware.org/mailman/listinfo/libffi-announce +https://sourceware.org/mailman/listinfo/libffi-discuss diff --git a/acinclude.m4 b/acinclude.m4 index 1a70efb..9ef93a8 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -45,16 +45,16 @@ else # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. AC_CACHE_CHECK([for MAP_ANON(YMOUS)], ac_cv_decl_map_anon, - [AC_TRY_COMPILE( -[#include + [AC_COMPILE_IFELSE( +[AC_LANG_PROGRAM([[#include #include #include #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS MAP_ANON #endif -], -[int n = MAP_ANONYMOUS;], +]], +[[int n = MAP_ANONYMOUS;]])], ac_cv_decl_map_anon=yes, ac_cv_decl_map_anon=no)]) @@ -104,7 +104,7 @@ dnl See docs/html/17_intro/configury.html#enable for documentation. dnl m4_define([LIBFFI_ENABLE],[dnl m4_define([_g_switch],[--enable-$1])dnl -m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl +m4_define([_g_help],[AS_HELP_STRING([_g_switch$3],[$4 @<:@default=$2@:>@])])dnl AC_ARG_ENABLE($1,_g_help, m4_bmatch([$5], [^permit ], @@ -152,109 +152,7 @@ AC_DEFUN([LIBFFI_CHECK_LINKER_FEATURES], [ # by now (in libtool), but require it now just to be safe... test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS='' test -z "$OPT_LDFLAGS" && OPT_LDFLAGS='' - AC_REQUIRE([AC_PROG_LD]) - AC_REQUIRE([AC_PROG_AWK]) - - # The name set by libtool depends on the version of libtool. Shame on us - # for depending on an impl detail, but c'est la vie. Older versions used - # ac_cv_prog_gnu_ld, but now it's lt_cv_prog_gnu_ld, and is copied back on - # top of with_gnu_ld (which is also set by --with-gnu-ld, so that actually - # makes sense). We'll test with_gnu_ld everywhere else, so if that isn't - # set (hence we're using an older libtool), then set it. - if test x${with_gnu_ld+set} != xset; then - if test x${ac_cv_prog_gnu_ld+set} != xset; then - # We got through "ac_require(ac_prog_ld)" and still not set? Huh? - with_gnu_ld=no - else - with_gnu_ld=$ac_cv_prog_gnu_ld - fi - fi - - # Start by getting the version number. I think the libtool test already - # does some of this, but throws away the result. - libat_ld_is_gold=no - if $LD --version 2>/dev/null | grep 'GNU gold'> /dev/null 2>&1; then - libat_ld_is_gold=yes - fi - changequote(,) - ldver=`$LD --version 2>/dev/null | - sed -e 's/GNU gold /GNU ld /;s/GNU ld version /GNU ld /;s/GNU ld ([^)]*) /GNU ld /;s/GNU ld \([0-9.][0-9.]*\).*/\1/; q'` - changequote([,]) - libat_gnu_ld_version=`echo $ldver | \ - $AWK -F. '{ if (NF<3) [$]3=0; print ([$]1*100+[$]2)*100+[$]3 }'` - - # Set --gc-sections. - if test "$with_gnu_ld" = "notbroken"; then - # GNU ld it is! Joy and bunny rabbits! - - # All these tests are for C++; save the language and the compiler flags. - # Need to do this so that g++ won't try to link in libstdc++ - ac_test_CFLAGS="${CFLAGS+set}" - ac_save_CFLAGS="$CFLAGS" - CFLAGS='-x c++ -Wl,--gc-sections' - - # Check for -Wl,--gc-sections - # XXX This test is broken at the moment, as symbols required for linking - # are now in libsupc++ (not built yet). In addition, this test has - # cored on solaris in the past. In addition, --gc-sections doesn't - # really work at the moment (keeps on discarding used sections, first - # .eh_frame and now some of the glibc sections for iconv). - # Bzzzzt. Thanks for playing, maybe next time. - AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections]) - AC_TRY_RUN([ - int main(void) - { - try { throw 1; } - catch (...) { }; - return 0; - } - ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes]) - if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" - else - # this is the suspicious part - CFLAGS='' - fi - if test "$ac_sectionLDflags" = "yes"; then - SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS" - fi - AC_MSG_RESULT($ac_sectionLDflags) - fi - - # Set linker optimization flags. - if test x"$with_gnu_ld" = x"yes"; then - OPT_LDFLAGS="-Wl,-O1 $OPT_LDFLAGS" - fi - - AC_SUBST(SECTION_LDFLAGS) - AC_SUBST(OPT_LDFLAGS) -]) - - -dnl -dnl If GNU ld is in use, check to see if tricky linker opts can be used. If -dnl the native linker is in use, all variables will be defined to something -dnl safe (like an empty string). -dnl -dnl Defines: -dnl SECTION_LDFLAGS='-Wl,--gc-sections' if possible -dnl OPT_LDFLAGS='-Wl,-O1' if possible -dnl LD (as a side effect of testing) -dnl Sets: -dnl with_gnu_ld -dnl libat_ld_is_gold (possibly) -dnl libat_gnu_ld_version (possibly) -dnl -dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will -dnl set libat_gnu_ld_version to 12345. Zeros cause problems. -dnl -AC_DEFUN([LIBFFI_CHECK_LINKER_FEATURES], [ - # If we're not using GNU ld, then there's no point in even trying these - # tests. Check for that first. We should have already tested for gld - # by now (in libtool), but require it now just to be safe... - test -z "$SECTION_LDFLAGS" && SECTION_LDFLAGS='' - test -z "$OPT_LDFLAGS" && OPT_LDFLAGS='' - AC_REQUIRE([AC_PROG_LD]) + AC_REQUIRE([LT_PATH_LD]) AC_REQUIRE([AC_PROG_AWK]) # The name set by libtool depends on the version of libtool. Shame on us @@ -307,14 +205,14 @@ AC_DEFUN([LIBFFI_CHECK_LINKER_FEATURES], [ # .eh_frame and now some of the glibc sections for iconv). # Bzzzzt. Thanks for playing, maybe next time. AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections]) - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main(void) { try { throw 1; } catch (...) { }; return 0; } - ], [ac_sectionLDflags=yes],[ac_sectionLDflags=no], [ac_sectionLDflags=yes]) + ]])],[ac_sectionLDflags=yes],[ac_sectionLDflags=no],[ac_sectionLDflags=yes]) if test "$ac_test_CFLAGS" = set; then CFLAGS="$ac_save_CFLAGS" else @@ -401,7 +299,7 @@ if test $enable_symvers != no; then AC_MSG_CHECKING([for shared libgcc]) ac_save_CFLAGS="$CFLAGS" CFLAGS=' -lgcc_s' - AC_TRY_LINK(, [return 0;], libat_shared_libgcc=yes, libat_shared_libgcc=no) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[libat_shared_libgcc=yes],[libat_shared_libgcc=no]) CFLAGS="$ac_save_CFLAGS" if test $libat_shared_libgcc = no; then cat > conftest.c <`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1546,7 +1567,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1568,7 +1589,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1603,7 +1624,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1646,7 +1667,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1667,12 +1688,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -1685,7 +1701,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1714,7 +1730,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1761,7 +1777,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1780,7 +1796,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1861,7 +1877,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1921,7 +1937,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1949,7 +1965,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1968,7 +1984,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -2100,7 +2116,6 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/asmcfi.m4]) -m4_include([m4/ax_append_flag.m4]) m4_include([m4/ax_cc_maxopt.m4]) m4_include([m4/ax_cflags_warn_all.m4]) m4_include([m4/ax_check_compile_flag.m4]) @@ -2109,6 +2124,7 @@ m4_include([m4/ax_configure_args.m4]) m4_include([m4/ax_enable_builddir.m4]) m4_include([m4/ax_gcc_archflag.m4]) m4_include([m4/ax_gcc_x86_cpuid.m4]) +m4_include([m4/ax_prepend_flag.m4]) m4_include([m4/ax_require_defined.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) diff --git a/compile b/compile index 99e5052..df363c8 100755 --- a/compile +++ b/compile @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ func_file_conv () MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ func_file_conv () mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff --git a/config.guess b/config.guess index faa63aa..7f76b62 100644 --- a/config.guess +++ b/config.guess @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2017-05-11' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,7 +17,7 @@ timestamp='2017-05-11' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,11 +29,19 @@ timestamp='2017-05-11' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -39,7 +49,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,7 +94,8 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 +# Just in case it came from the environment. +GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -96,66 +107,90 @@ trap 'exit 1' 1 2 15 # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -167,32 +202,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -208,10 +243,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -219,47 +254,68 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -273,7 +329,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -310,126 +366,121 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build + set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -439,44 +490,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -485,95 +536,96 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux${UNAME_RELEASE} + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux${UNAME_RELEASE} + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -584,77 +636,77 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -687,13 +739,13 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -712,15 +764,15 @@ EOF HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -745,38 +797,38 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -784,140 +836,148 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case $UNAME_MACHINE in x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -928,183 +988,225 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi + fi + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1112,12 +1214,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1127,11 +1229,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1139,31 +1241,31 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1171,9 +1273,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1182,252 +1284,437 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv${UNAME_RELEASE} + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/config.sub b/config.sub index 40ea5df..dba16e8 100644 --- a/config.sub +++ b/config.sub @@ -1,12 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2017-04-02' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,7 +17,7 @@ timestamp='2017-04-02' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +35,7 @@ timestamp='2017-04-02' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,6 +52,13 @@ timestamp='2017-04-02' # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -57,7 +66,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +76,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -89,12 +98,12 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -110,1252 +119,1186 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 ;; - -bluegene*) - os=-cnk + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia16 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | wasm32 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - c54x) - basic_machine=tic54x-unknown + op50n) + cpu=hppa1.1 + vendor=oki ;; - c55x) - basic_machine=tic55x-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - c6x) - basic_machine=tic6x-unknown + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none ;; leon|leon[3-9]) - basic_machine=sparc-$basic_machine + cpu=sparc + vendor=$basic_machine ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - strongarm | thumb | xscale) - basic_machine=arm-unknown + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | wasm32-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 + cpu=$basic_machine + vendor=pc ;; + # These rules are duplicated from below for sake of the special case above; + # i.e. things that normalized to x86 arches should also default to "pc" pc98) - basic_machine=i386-pc + cpu=i386 + vendor=pc ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + x64 | amd64) + cpu=x86_64 + vendor=pc ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc + # Recognize the basic CPU types without company name. + *) + cpu=$basic_machine + vendor=unknown ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc +esac + +unset -v basic_machine + +# Decode basic machines in the full and proper CPU-Company form. +case $cpu-$vendor in + # Here we handle the default manufacturer of certain CPU types in canonical form. It is in + # some cases the only manufacturer, in others, it is the most popular. + craynv-unknown) + vendor=cray + basic_os=${basic_os:-unicosmp} ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc + c90-unknown | c90-cray) + vendor=cray + basic_os=${Basic_os:-unicos} ;; - pentium4) - basic_machine=i786-pc + fx80-unknown) + vendor=alliant ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + romp-unknown) + vendor=ibm ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + mmix-unknown) + vendor=knuth ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + microblaze-unknown | microblazeel-unknown) + vendor=xilinx ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + rs6000-unknown) + vendor=ibm ;; - pn) - basic_machine=pn-gould + vax-unknown) + vendor=dec ;; - power) basic_machine=power-ibm + pdp11-unknown) + vendor=dec ;; - ppc | ppcbe) basic_machine=powerpc-unknown + we32k-unknown) + vendor=att ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + cydra-unknown) + vendor=cydrome ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown + i370-ibm*) + vendor=ibm ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + orion-unknown) + vendor=highlevel ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - wasm32) - basic_machine=wasm32-unknown - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none + xps-unknown | xps100-unknown) + cpu=xps100 + vendor=honeywell ;; -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond + # Here we normalize CPU types with a missing or matching vendor + armh-unknown | armh-alt) + cpu=armv7l + vendor=alt + basic_os=${basic_os:-linux-gnueabihf} ;; - op50n) - basic_machine=hppa1.1-oki + dpx20-unknown | dpx20-bull) + cpu=rs6000 + vendor=bull + basic_os=${basic_os:-bosx} ;; - op60c) - basic_machine=hppa1.1-oki + + # Here we normalize CPU types irrespective of the vendor + amd64-*) + cpu=x86_64 ;; - romp) - basic_machine=romp-ibm + blackfin-*) + cpu=bfin + basic_os=linux ;; - mmix) - basic_machine=mmix-knuth + c54x-*) + cpu=tic54x ;; - rs6000) - basic_machine=rs6000-ibm + c55x-*) + cpu=tic55x ;; - vax) - basic_machine=vax-dec + c6x-*) + cpu=tic6x ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown + e500v[12]-*) + cpu=powerpc + basic_os=${basic_os}"spe" ;; - pdp11) - basic_machine=pdp11-dec + mips3*-*) + cpu=mips64 ;; - we32k) - basic_machine=we32k-att + ms1-*) + cpu=mt ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown + m68knommu-*) + cpu=m68k + basic_os=linux ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun + m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) + cpu=s12z ;; - cydra) - basic_machine=cydra-cydrome + openrisc-*) + cpu=or32 ;; - orion) - basic_machine=orion-highlevel + parisc-*) + cpu=hppa + basic_os=linux ;; - orion105) - basic_machine=clipper-highlevel + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + cpu=i586 ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple + pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) + cpu=i686 ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + cpu=i686 ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. + pentium4-*) + cpu=i786 ;; + pc98-*) + cpu=i386 + ;; + ppc-* | ppcbe-*) + cpu=powerpc + ;; + ppcle-* | powerpclittle-*) + cpu=powerpcle + ;; + ppc64-*) + cpu=powerpc64 + ;; + ppc64le-* | powerpc64little-*) + cpu=powerpc64le + ;; + sb1-*) + cpu=mipsisa64sb1 + ;; + sb1el-*) + cpu=mipsisa64sb1el + ;; + sh5e[lb]-*) + cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` + ;; + spur-*) + cpu=spur + ;; + strongarm-* | thumb-*) + cpu=arm + ;; + tx39-*) + cpu=mipstx39 + ;; + tx39el-*) + cpu=mipstx39el + ;; + x64-*) + cpu=x86_64 + ;; + xscale-* | xscalee[bl]-*) + cpu=`echo "$cpu" | sed 's/^xscale/arm/'` + ;; + arm64-* | aarch64le-*) + cpu=aarch64 + ;; + + # Recognize the canonical CPU Types that limit and/or modify the + # company names they are paired with. + cr16-*) + basic_os=${basic_os:-elf} + ;; + crisv32-* | etraxfs*-*) + cpu=crisv32 + vendor=axis + ;; + cris-* | etrax*-*) + cpu=cris + vendor=axis + ;; + crx-*) + basic_os=${basic_os:-elf} + ;; + neo-tandem) + cpu=neo + vendor=tandem + ;; + nse-tandem) + cpu=nse + vendor=tandem + ;; + nsr-tandem) + cpu=nsr + vendor=tandem + ;; + nsv-tandem) + cpu=nsv + vendor=tandem + ;; + nsx-tandem) + cpu=nsx + vendor=tandem + ;; + mipsallegrexel-sony) + cpu=mipsallegrexel + vendor=sony + ;; + tile*-*) + basic_os=${basic_os:-linux-gnu} + ;; + *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb | arc32 | arc64 \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r3 | mipsisa32r3el \ + | mipsisa32r5 | mipsisa32r5el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r3 | mipsisa64r3el \ + | mipsisa64r5 | mipsisa64r5el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ + | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ + | score \ + | sh | shl \ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | thumbv7* \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1363,203 +1306,215 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if test x$basic_os != x then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1572,264 +1527,363 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +kernel= +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + kernel=linux + os=gnu ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; pru-*) - os=-elf + os=elf ;; *-be) - os=-beos - ;; - *-haiku) - os=-haiku + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs + os=luna ;; *-next) - os=-nextstep3 + os=nextstep + ;; + *-sequent) + os=ptx + ;; + *-crds) + os=unos + ;; + *-ns) + os=genix + ;; + i370-*) + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - -sunos*) + *-sunos*) vendor=sun ;; - -cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - -beos*) + *-beos*) vendor=be ;; - -hpux*) + *-hpux*) vendor=hp ;; - -mpeix*) + *-mpeix*) vendor=hp ;; - -hiux*) + *-hiux*) vendor=hitachi ;; - -unos*) + *-unos*) vendor=crds ;; - -dgux*) + *-dgux*) vendor=dg ;; - -luna*) + *-luna*) vendor=omron ;; - -genix*) + *-genix*) vendor=ns ;; - -mvs* | -opened*) + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) vendor=ibm ;; - -os400*) + *-os400*) vendor=ibm ;; - -ptx*) + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) vendor=sequent ;; - -tpf*) + *-tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - -aux*) + *-aux*) vendor=apple ;; - -hms*) + *-hms*) vendor=hitachi ;; - -mpw* | -macos*) + *-mpw* | *-macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - -vos*) + *-vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/configure b/configure index 823f5bc..a43e342 100755 --- a/configure +++ b/configure @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libffi 3.3. +# Generated by GNU Autoconf 2.71 for libffi 3.4.4. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,17 +169,21 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' @@ -205,32 +191,39 @@ test -x / || exit 1" ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -238,14 +231,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -263,18 +263,19 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: http://github.com/libffi/libffi/issues about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run @@ -302,6 +303,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -319,6 +321,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -333,7 +343,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -342,7 +352,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -381,12 +391,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -398,18 +409,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -421,9 +441,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -450,7 +470,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -494,7 +514,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -508,6 +528,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -521,6 +545,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -590,47 +621,43 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libffi' PACKAGE_TARNAME='libffi' -PACKAGE_VERSION='3.3' -PACKAGE_STRING='libffi 3.3' +PACKAGE_VERSION='3.4.4' +PACKAGE_STRING='libffi 3.4.4' PACKAGE_BUGREPORT='http://github.com/libffi/libffi/issues' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -643,6 +670,7 @@ LIBFFI_BUILD_VERSIONED_SHLIB_FALSE LIBFFI_BUILD_VERSIONED_SHLIB_TRUE OPT_LDFLAGS SECTION_LDFLAGS +tmake_file toolexeclibdir toolexecdir FFI_DEBUG_FALSE @@ -667,8 +695,8 @@ MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE PRTDIAG +READELF CXXCPP -CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL @@ -681,16 +709,17 @@ ac_ct_AR AR DLLTOOL OBJDUMP +FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP -EGREP -GREP SED LIBTOOL +EGREP +GREP am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE CCASDEPMODE @@ -722,6 +751,9 @@ AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -777,6 +809,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -819,6 +852,7 @@ enable_docs enable_debug enable_structs enable_raw_api +enable_exec_static_tramp enable_purify_safety enable_multi_os_directory enable_symvers @@ -829,9 +863,8 @@ target_alias CCAS CCASFLAGS LT_SYS_LIBRARY_PATH -CPP -CPPFLAGS -CXXCPP' +CXXCPP +CPPFLAGS' # Initialize some variables set by options. @@ -870,6 +903,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -899,8 +933,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -941,9 +973,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -967,9 +999,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1122,6 +1154,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1171,9 +1212,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1187,9 +1228,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1233,9 +1274,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1251,7 +1292,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1259,7 +1300,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1315,7 +1356,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1372,7 +1413,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libffi 3.3 to adapt to many kinds of systems. +\`configure' configures libffi 3.4.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,6 +1453,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1443,7 +1485,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libffi 3.3:";; + short | recursive ) echo "Configuration of libffi 3.4.4:";; esac cat <<\_ACEOF @@ -1470,11 +1512,12 @@ Optional Features: --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer - --enable-pax_emutramp enable pax emulated trampolines, for we can't use PROT_EXEC + --enable-pax_emutramp enable pax emulated trampolines (experimental) --disable-docs Disable building of docs (default: no) --enable-debug debugging mode --disable-structs omit code for struct support --disable-raw-api make the raw api unavailable + --disable-exec-static-tramp disable use of static exec trampolines (enabled by default) --enable-purify-safety purify-safe mode --disable-multi-os-directory disable use of gcc --print-multi-os-directory to change the library installation directory @@ -1509,7 +1552,6 @@ Some influential environment variables: CCASFLAGS assembler compiler flags (defaults to CFLAGS) LT_SYS_LIBRARY_PATH User-defined run-time library search path. - CPP C preprocessor CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help @@ -1531,9 +1573,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1561,7 +1603,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1569,7 +1612,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1578,10 +1621,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libffi configure 3.3 -generated by GNU Autoconf 2.69 +libffi configure 3.4.4 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1598,14 +1641,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1613,14 +1656,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1636,14 +1680,14 @@ fi ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1651,14 +1695,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1674,14 +1719,14 @@ fi ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1689,17 +1734,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1721,120 +1767,44 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1842,16 +1812,9 @@ else #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1869,24 +1832,25 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -1903,7 +1867,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1911,14 +1875,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1934,14 +1899,14 @@ fi ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1949,17 +1914,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1974,6 +1940,49 @@ fi } # ac_fn_cxx_try_link +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes @@ -1988,7 +1997,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; @@ -1998,14 +2007,15 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2015,9 +2025,10 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid; break -else +else $as_nop as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -2025,14 +2036,14 @@ else fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; @@ -2042,14 +2053,15 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; @@ -2059,9 +2071,10 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=$ac_mid; break -else +else $as_nop as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -2069,14 +2082,14 @@ else fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else +else $as_nop ac_lo= ac_hi= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val @@ -2084,7 +2097,7 @@ while test "x$ac_lo" != "x$ac_hi"; do /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2094,12 +2107,13 @@ return test_array [0]; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid -else +else $as_nop as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; @@ -2109,12 +2123,12 @@ esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } #include #include int -main () +main (void) { FILE *f = fopen ("conftest.val", "w"); @@ -2142,9 +2156,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : echo >>conftest.val; read $3 &5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ----------------------------------------------------- ## -## Report this to http://github.com/libffi/libffi/issues ## -## ----------------------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -2255,17 +2179,18 @@ fi ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -2273,12 +2198,13 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2286,29 +2212,50 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libffi $as_me 3.3, which was -generated by GNU Autoconf 2.69. Invocation command line was +It was created by libffi $as_me 3.4.4, which was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2341,8 +2288,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2377,7 +2328,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2412,11 +2363,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2427,8 +2380,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2452,7 +2405,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2460,14 +2413,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2475,15 +2428,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2491,8 +2444,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2506,63 +2459,48 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2572,19 +2510,650 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="ltmain.sh compile missing install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -2595,12 +3164,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2609,24 +3178,24 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -2636,11 +3205,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2656,55 +3226,30 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers fficonfig.h" -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2723,21 +3268,22 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2756,21 +3302,22 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if ${ac_cv_target+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +printf %s "checking target system type... " >&6; } +if test ${ac_cv_target+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 + ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +printf "%s\n" "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; @@ -2795,7 +3342,6 @@ test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- - target_alias=${target_alias-$host_alias} case "${host}" in @@ -2813,23 +3359,25 @@ esac done fi + # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ax_enable_builddir="." # Check whether --enable-builddir was given. -if test "${enable_builddir+set}" = set; then : +if test ${enable_builddir+y} +then : enableval=$enable_builddir; ax_enable_builddir="$enableval" -else +else $as_nop ax_enable_builddir="auto" fi if test ".$ac_srcdir_defaulted" != ".no" ; then if test ".$srcdir" = ".." ; then if test -f config.status ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: toplevel srcdir already configured... skipping subdir build" >&5 -$as_echo "$as_me: toplevel srcdir already configured... skipping subdir build" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: toplevel srcdir already configured... skipping subdir build" >&5 +printf "%s\n" "$as_me: toplevel srcdir already configured... skipping subdir build" >&6;} else test ".$ax_enable_builddir" = "." && ax_enable_builddir="." test ".$ax_enable_builddir" = ".no" && ax_enable_builddir="." @@ -2841,8 +3389,8 @@ $as_echo "$as_me: toplevel srcdir already configured... skipping subdir build" > cd $ax_enable_builddir if grep __.$ax_enable_builddir.__ conftest.tmp >/dev/null 2>/dev/null ; then rm conftest.tmp - { $as_echo "$as_me:${as_lineno-$LINENO}: result: continue configure in default builddir \"./$ax_enable_builddir\"" >&5 -$as_echo "continue configure in default builddir \"./$ax_enable_builddir\"" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: continue configure in default builddir \"./$ax_enable_builddir\"" >&5 +printf "%s\n" "continue configure in default builddir \"./$ax_enable_builddir\"" >&6; } else as_fn_error $? "could not change to default builddir \"./$ax_enable_builddir\"" "$LINENO" 5 fi @@ -2853,8 +3401,8 @@ $as_echo "continue configure in default builddir \"./$ax_enable_builddir\"" >&6; test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h . test -f $srcdir/conftest.log && mv $srcdir/conftest.log . test -f $srcdir/$cache_file && mv $srcdir/$cache_file . - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&5 -$as_echo "....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&5 +printf "%s\n" "....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&6; } case "$0" in # restart [\\/]* | ?:[\\/]*) # Absolute name eval $SHELL "'$0'" "'--srcdir=$srcdir'" "'--enable-builddir=$ax_enable_builddir'" $ac_configure_args ;; @@ -2866,11 +3414,12 @@ fi fi test ".$ax_enable_builddir" = ".auto" && ax_enable_builddir="." # Extract the first word of "gsed sed", so it can be a program name with args. set dummy gsed sed; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ax_enable_builddir_sed+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ax_enable_builddir_sed+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ax_enable_builddir_sed in [\\/]* | ?:[\\/]*) ac_cv_path_ax_enable_builddir_sed="$ax_enable_builddir_sed" # Let the user override the test with a path. @@ -2880,11 +3429,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ax_enable_builddir_sed="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ax_enable_builddir_sed="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2897,11 +3450,11 @@ esac fi ax_enable_builddir_sed=$ac_cv_path_ax_enable_builddir_sed if test -n "$ax_enable_builddir_sed"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_enable_builddir_sed" >&5 -$as_echo "$ax_enable_builddir_sed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_enable_builddir_sed" >&5 +printf "%s\n" "$ax_enable_builddir_sed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2911,7 +3464,8 @@ ac_config_commands="$ac_config_commands buildir" am__api_version='1.16' -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -2925,20 +3479,25 @@ am__api_version='1.16' # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -2948,13 +3507,13 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -2962,12 +3521,12 @@ case $as_dir/ in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -2983,7 +3542,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -2993,8 +3552,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -3004,8 +3563,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -3059,8 +3618,8 @@ else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= @@ -3079,23 +3638,19 @@ test "$program_suffix" != NONE && # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then @@ -3115,11 +3670,12 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -3127,11 +3683,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3142,11 +3702,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3155,11 +3715,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -3167,11 +3728,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3182,11 +3747,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -3194,8 +3759,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -3207,25 +3772,31 @@ fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done @@ -3236,7 +3807,7 @@ IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then + if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -3246,18 +3817,19 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -3265,11 +3837,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3280,24 +3856,25 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -3313,12 +3890,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -3332,7 +3909,8 @@ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -3342,12 +3920,13 @@ case $enable_silent_rules in # ((( *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3359,8 +3938,8 @@ else am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -3392,17 +3971,13 @@ fi # Define the identity of the package. PACKAGE='libffi' - VERSION='3.3' + VERSION='3.4.4' -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. @@ -3442,6 +4017,20 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -3496,6 +4085,15 @@ fi save_CFLAGS=$CFLAGS + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3504,11 +4102,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3516,11 +4115,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3531,11 +4134,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3544,11 +4147,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3556,11 +4160,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3571,11 +4179,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3583,8 +4191,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3597,11 +4205,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3609,11 +4218,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3624,11 +4237,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3637,11 +4250,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3650,15 +4264,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3674,18 +4292,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3696,11 +4314,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3708,11 +4327,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3723,11 +4346,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3740,11 +4363,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3752,11 +4376,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3767,11 +4395,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3783,8 +4411,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3792,25 +4420,129 @@ esac fi fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3820,7 +4552,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3828,7 +4560,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3840,9 +4572,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3863,11 +4595,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3884,7 +4617,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3900,44 +4633,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3951,15 +4686,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3968,7 +4703,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3980,8 +4715,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3989,10 +4724,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -4000,39 +4735,40 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4046,11 +4782,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -4059,31 +4796,32 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -4093,29 +4831,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -4124,57 +4866,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -4189,94 +4934,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -4285,21 +5080,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4327,8 +5124,8 @@ _ACEOF rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -4347,8 +5144,8 @@ DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out @@ -4384,11 +5181,12 @@ esac fi done rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : +if test ${enable_dependency_tracking+y} +then : enableval=$enable_dependency_tracking; fi @@ -4409,11 +5207,12 @@ fi depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -4520,8 +5319,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -4535,6 +5334,12 @@ else fi + + + + + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4545,15 +5350,16 @@ if test -z "$CXX"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -4561,11 +5367,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4576,11 +5386,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4589,15 +5399,16 @@ fi fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -4605,11 +5416,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4620,11 +5435,11 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4636,8 +5451,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -4647,7 +5462,7 @@ fi fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -4657,7 +5472,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -4667,20 +5482,21 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -4690,29 +5506,33 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no @@ -4721,57 +5541,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes -else +else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then @@ -4786,6 +5609,100 @@ else CXXFLAGS= fi fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4794,11 +5711,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CXX_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -4905,8 +5823,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if @@ -4935,11 +5853,12 @@ test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CCAS_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -5044,8 +5963,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if @@ -5060,16 +5979,159 @@ fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + case `pwd` in *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' + @@ -5106,8 +6168,8 @@ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then @@ -5133,12 +6195,12 @@ func_echo_all () } case $ECHO in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; esac @@ -5154,11 +6216,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -5172,10 +6235,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -5184,13 +6252,13 @@ case `"$ac_path_SED" --version 2>&1` in ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -5218,8 +6286,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -5236,141 +6304,12 @@ Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else @@ -5381,10 +6320,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP @@ -5393,13 +6337,13 @@ case `"$ac_path_FGREP" --version 2>&1` in ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -5428,8 +6372,8 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -5454,17 +6398,18 @@ test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw @@ -5493,15 +6438,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -5530,18 +6476,19 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -5564,11 +6511,12 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM @@ -5593,13 +6541,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -5618,8 +6566,8 @@ else : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else @@ -5632,11 +6580,12 @@ else do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else @@ -5644,11 +6593,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5659,11 +6612,11 @@ fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5676,11 +6629,12 @@ if test -z "$DUMPBIN"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else @@ -5688,11 +6642,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5703,11 +6661,11 @@ fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5719,15 +6677,15 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -5748,11 +6706,12 @@ test -z "$NM" && NM=nm -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) @@ -5768,26 +6727,27 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop i=0 teststring=ABCD @@ -5829,7 +6789,7 @@ else lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5872,7 +6832,7 @@ else sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -5914,11 +6874,11 @@ else fi if test -n "$lt_cv_sys_max_cmd_len"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -5962,11 +6922,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $host in *-*-mingw* ) case $build in @@ -6002,18 +6963,19 @@ esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in @@ -6029,22 +6991,23 @@ esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -6074,14 +7037,123 @@ esac +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -6089,11 +7161,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6104,11 +7180,11 @@ fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6117,11 +7193,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -6129,11 +7206,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6144,11 +7225,11 @@ fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -6156,8 +7237,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -6176,11 +7257,12 @@ test -z "$OBJDUMP" && OBJDUMP=objdump -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' @@ -6206,7 +7288,7 @@ beos*) bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -6240,14 +7322,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -6261,7 +7343,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' @@ -6308,7 +7390,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -6376,8 +7458,8 @@ os2*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no @@ -6421,11 +7503,12 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -6433,11 +7516,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6448,11 +7535,11 @@ fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6461,11 +7548,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -6473,11 +7561,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6488,11 +7580,11 @@ fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -6500,8 +7592,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -6521,11 +7613,12 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in @@ -6548,8 +7641,8 @@ cygwin* | mingw* | pw32* | cegcc*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -6565,11 +7658,12 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -6577,11 +7671,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6592,11 +7690,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6609,11 +7707,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -6621,11 +7720,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6636,11 +7739,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6652,8 +7755,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -6661,42 +7764,60 @@ esac fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. @@ -6704,7 +7825,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ @@ -6713,11 +7834,11 @@ if ac_fn_c_try_compile "$LINENO"; then : rm -f conftest.* libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= @@ -6734,11 +7855,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -6746,11 +7868,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6761,11 +7887,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6774,11 +7900,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -6786,11 +7913,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6801,11 +7932,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -6813,8 +7944,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6833,11 +7964,12 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -6845,11 +7977,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6860,11 +7996,11 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6873,11 +8009,12 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -6885,11 +8022,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6900,11 +8041,11 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -6912,8 +8053,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -7002,11 +8143,12 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -7061,7 +8203,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -7079,20 +8221,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -7116,7 +8258,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -7134,9 +8276,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -7158,14 +8300,14 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -7234,7 +8376,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi @@ -7269,11 +8411,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } fi # Response file support. @@ -7319,13 +8461,14 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : +if test ${with_sysroot+y} +then : withval=$with_sysroot; -else +else $as_nop with_sysroot=no fi @@ -7338,29 +8481,30 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -$as_echo_n "checking for a working dd... " >&6; } -if ${ac_cv_path_lt_DD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} @@ -7371,10 +8515,15 @@ if test -z "$lt_DD"; then for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in dd; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ @@ -7394,15 +8543,16 @@ fi rm -f conftest.i conftest2.i conftest.out fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -$as_echo "$ac_cv_path_lt_DD" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -$as_echo_n "checking how to truncate binary pipes... " >&6; } -if ${lt_cv_truncate_bin+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= @@ -7413,8 +8563,8 @@ fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -$as_echo "$lt_cv_truncate_bin" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -7437,7 +8587,8 @@ func_cc_basename () } # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : +if test ${enable_libtool_lock+y} +then : enableval=$enable_libtool_lock; fi @@ -7453,9 +8604,9 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -7473,10 +8624,10 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -7488,7 +8639,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -7511,10 +8662,10 @@ mips64*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -7522,7 +8673,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -7530,7 +8681,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -7552,16 +8703,16 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -7615,11 +8766,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7630,19 +8782,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_cc_needs_belf=yes -else +else $as_nop lt_cv_cc_needs_belf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -7651,8 +8804,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS @@ -7665,9 +8818,9 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -7702,11 +8855,12 @@ need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else @@ -7714,11 +8868,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7729,11 +8887,11 @@ fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7742,11 +8900,12 @@ if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else @@ -7754,11 +8913,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7769,11 +8932,11 @@ fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then @@ -7781,8 +8944,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL @@ -7792,11 +8955,12 @@ else fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out @@ -7806,8 +8970,8 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -7822,11 +8986,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else @@ -7834,11 +8999,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7849,11 +9018,11 @@ fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7862,11 +9031,12 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else @@ -7874,11 +9044,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7889,11 +9063,11 @@ fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then @@ -7901,8 +9075,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL @@ -7914,11 +9088,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else @@ -7926,11 +9101,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7941,11 +9120,11 @@ fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7954,11 +9133,12 @@ if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else @@ -7966,11 +9146,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7981,11 +9165,11 @@ fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then @@ -7993,8 +9177,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT @@ -8006,11 +9190,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else @@ -8018,11 +9203,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8033,11 +9222,11 @@ fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8046,11 +9235,12 @@ if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else @@ -8058,11 +9248,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8073,11 +9267,11 @@ fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then @@ -8085,8 +9279,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO @@ -8098,11 +9292,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else @@ -8110,11 +9305,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8125,11 +9324,11 @@ fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8138,11 +9337,12 @@ if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else @@ -8150,11 +9350,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8165,11 +9369,11 @@ fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then @@ -8177,8 +9381,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL @@ -8190,11 +9394,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else @@ -8202,11 +9407,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8217,11 +9426,11 @@ fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8230,11 +9439,12 @@ if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else @@ -8242,11 +9452,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8257,11 +9471,11 @@ fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then @@ -8269,8 +9483,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 @@ -8305,11 +9519,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override @@ -8338,14 +9553,15 @@ else rm -f conftest.* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym @@ -8354,39 +9570,41 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_ld_exported_symbols_list=yes -else +else $as_nop lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -8406,24 +9624,19 @@ _LT_EOF rm -rf conftest.dSYM fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -8478,286 +9691,43 @@ func_munge_path_list () esac } -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes +ac_header= ac_cache= +for ac_item in $ac_header_c_list do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - done - ac_cv_prog_CPP=$CPP + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - @@ -8784,7 +9754,8 @@ func_stripname_cnf () # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -8802,7 +9773,7 @@ if test "${enable_shared+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_shared=yes fi @@ -8815,7 +9786,8 @@ fi # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : +if test ${enable_static+y} +then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; @@ -8833,7 +9805,7 @@ if test "${enable_static+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_static=yes fi @@ -8847,7 +9819,8 @@ fi # Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : +if test ${with_pic+y} +then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; @@ -8864,7 +9837,7 @@ if test "${with_pic+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop pic_mode=default fi @@ -8876,7 +9849,8 @@ fi # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : +if test ${enable_fast_install+y} +then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -8894,7 +9868,7 @@ if test "${enable_fast_install+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_fast_install=yes fi @@ -8908,11 +9882,12 @@ fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. -if test "${with_aix_soname+set}" = set; then : +if test ${with_aix_soname+y} +then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; @@ -8921,18 +9896,19 @@ if test "${with_aix_soname+set}" = set; then : ;; esac lt_cv_with_aix_soname=$with_aix_soname -else - if ${lt_cv_with_aix_soname+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -$as_echo "$with_aix_soname" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', @@ -9014,11 +9990,12 @@ if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -9029,17 +10006,15 @@ else fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h @@ -9060,8 +10035,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -9085,11 +10060,12 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -9138,11 +10114,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9151,11 +10127,12 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -9204,11 +10181,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9293,11 +10270,12 @@ if test yes = "$GCC"; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -9328,8 +10306,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -9570,7 +10548,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -9686,26 +10664,28 @@ case $host_os in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -9736,8 +10716,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in @@ -9765,11 +10745,12 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -9793,8 +10774,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : @@ -9808,11 +10789,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -9855,19 +10837,20 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -9910,8 +10893,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -9919,19 +10902,19 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -9943,8 +10926,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -9988,15 +10971,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -10048,7 +11031,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -10160,6 +11143,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -10174,7 +11158,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -10217,7 +11201,7 @@ _LT_EOF compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -10229,7 +11213,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -10245,7 +11229,7 @@ _LT_EOF archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -10377,7 +11361,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10499,21 +11483,23 @@ _LT_EOF if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10528,7 +11514,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -10552,21 +11538,23 @@ fi if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10581,7 +11569,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -10644,12 +11632,12 @@ fi cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10690,7 +11678,7 @@ fi fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -10731,8 +11719,8 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10766,7 +11754,7 @@ fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -10832,11 +11820,12 @@ fi # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" @@ -10860,8 +11849,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -10901,28 +11890,30 @@ fi # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_irix_exported_symbol=yes -else +else $as_nop lt_cv_irix_exported_symbol=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi @@ -11014,6 +12005,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -11202,8 +12194,8 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -11239,18 +12231,19 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -11268,7 +12261,7 @@ else if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no @@ -11282,8 +12275,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac @@ -11442,8 +12435,8 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in @@ -11705,7 +12698,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; @@ -11715,14 +12708,14 @@ cygwin* | mingw* | pw32* | cegcc*) ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -11741,7 +12734,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -11778,7 +12771,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -11811,7 +12804,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -12004,9 +12997,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -12016,19 +13010,21 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -12263,8 +13259,8 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -12385,8 +13381,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || @@ -12410,8 +13406,8 @@ else # directories. hardcode_action=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then @@ -12455,11 +13451,12 @@ else darwin*) # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12468,32 +13465,31 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else +else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= @@ -12513,14 +13509,16 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = xyes +then : lt_cv_dlopen=shl_load -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12529,41 +13527,42 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char shl_load (); int -main () +main (void) { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_shl_load=yes -else +else $as_nop ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else +else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = xyes +then : lt_cv_dlopen=dlopen -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12572,37 +13571,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12611,37 +13610,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_svld_dlopen=yes -else +else $as_nop ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12650,30 +13649,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dld_link (); int -main () +main (void) { return dld_link (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_dld_link=yes -else +else $as_nop ac_cv_lib_dld_dld_link=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -12712,11 +13710,12 @@ fi save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else @@ -12795,7 +13794,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -12813,16 +13812,17 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else @@ -12901,7 +13901,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -12919,8 +13919,8 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS @@ -12958,32 +13958,43 @@ fi striplib= old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + fi fi @@ -12998,13 +14009,13 @@ fi # Report what library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -13028,15 +14039,15 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } @@ -13058,36 +14069,32 @@ ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -13099,10 +14106,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -13112,7 +14120,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -13124,29 +14133,24 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf "%s\n" "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -13158,10 +14162,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -13171,11 +14176,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -13311,17 +14317,18 @@ cc_basename=$func_cc_basename_result # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw @@ -13350,15 +14357,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -13387,18 +14395,19 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -13464,8 +14473,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld fi # PORTME: fill in a description of your system's C++ link characteristics - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) @@ -13603,21 +14612,23 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -13632,7 +14643,7 @@ if ac_fn_cxx_try_link "$LINENO"; then : lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib @@ -13657,21 +14668,23 @@ fi if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -13686,7 +14699,7 @@ if ac_fn_cxx_try_link "$LINENO"; then : lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib @@ -13751,8 +14764,8 @@ fi cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' @@ -13843,11 +14856,11 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else @@ -13882,6 +14895,7 @@ fi emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes + file_list_spec_CXX='@' ;; dgux*) @@ -13912,7 +14926,7 @@ fi archive_cmds_need_lc_CXX=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes @@ -14049,7 +15063,7 @@ fi # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -14189,13 +15203,13 @@ fi archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' @@ -14537,8 +15551,8 @@ fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX @@ -14576,7 +15590,7 @@ esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. @@ -14852,7 +15866,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -14935,7 +15949,7 @@ lt_prog_compiler_static_CXX= lt_prog_compiler_static_CXX='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' @@ -15057,26 +16071,28 @@ case $host_os in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -15107,8 +16123,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in @@ -15130,11 +16146,12 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -15158,8 +16175,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : @@ -15170,11 +16187,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest @@ -15217,16 +16235,17 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest @@ -15269,8 +16288,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } @@ -15278,19 +16297,19 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -15299,8 +16318,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' @@ -15317,7 +16336,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -15325,7 +16344,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -15339,8 +16358,8 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld @@ -15367,18 +16386,19 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -15396,7 +16416,7 @@ else if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no @@ -15410,8 +16430,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac @@ -15480,8 +16500,8 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' @@ -15672,7 +16692,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) @@ -15681,14 +16701,14 @@ cygwin* | mingw* | pw32* | cegcc*) ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -15707,7 +16727,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -15744,7 +16764,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -15776,7 +16796,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -15969,9 +16989,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -15981,19 +17002,21 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_cxx_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -16228,8 +17251,8 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -16293,8 +17316,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || @@ -16318,8 +17341,8 @@ else # directories. hardcode_action_CXX=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 -$as_echo "$hardcode_action_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +printf "%s\n" "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then @@ -16381,22 +17404,127 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. +set dummy ${ac_tool_prefix}readelf; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_READELF+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$READELF"; then + ac_cv_prog_READELF="$READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_READELF="${ac_tool_prefix}readelf" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +READELF=$ac_cv_prog_READELF +if test -n "$READELF"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 +printf "%s\n" "$READELF" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_READELF"; then + ac_ct_READELF=$READELF + # Extract the first word of "readelf", so it can be a program name with args. +set dummy readelf; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_READELF+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_READELF"; then + ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_READELF="readelf" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_READELF=$ac_cv_prog_ac_ct_READELF +if test -n "$ac_ct_READELF"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 +printf "%s\n" "$ac_ct_READELF" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_READELF" = x; then + READELF="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + READELF=$ac_ct_READELF + fi +else + READELF="$ac_cv_prog_READELF" +fi + + # Test for 64-bit build. # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 -$as_echo_n "checking size of size_t... " >&6; } -if ${ac_cv_sizeof_size_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +printf %s "checking size of size_t... " >&6; } +if test ${ac_cv_sizeof_size_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_size_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -16405,75 +17533,86 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 -$as_echo "$ac_cv_sizeof_size_t" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +printf "%s\n" "$ac_cv_sizeof_size_t" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t -_ACEOF +printf "%s\n" "#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 -$as_echo_n "checking for C compiler vendor... " >&6; } -if ${ax_cv_c_compiler_vendor+:} false; then : - $as_echo_n "(cached) " >&6 -else - # note: don't check for gcc first since some other compilers define __GNUC__ - vendors="intel: __ICC,__ECC,__INTEL_COMPILER - ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ - pathscale: __PATHCC__,__PATHSCALE__ - clang: __clang__ - cray: _CRAYC - fujitsu: __FUJITSU - sdcc: SDCC, __SDCC - gnu: __GNUC__ - sun: __SUNPRO_C,__SUNPRO_CC - hp: __HP_cc,__HP_aCC - dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER - borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ - comeau: __COMO__ - kai: __KCC - lcc: __LCC__ - sgi: __sgi,sgi - microsoft: _MSC_VER - metrowerks: __MWERKS__ - watcom: __WATCOMC__ - portland: __PGI - tcc: __TINYC__ - unknown: UNKNOWN" - for ventest in $vendors; do - case $ventest in - *:) vendor=$ventest; continue ;; - *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; - esac - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 +printf %s "checking for C compiler vendor... " >&6; } +if test ${ax_cv_c_compiler_vendor+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + vendors=" + intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + sdcc: SDCC,__SDCC + sx: _SX + nvhpc: __NVCOMPILER + portland: __PGI + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + tcc: __TINYC__ + unknown: UNKNOWN + " + for ventest in $vendors; do + case $ventest in + *:) + vendor=$ventest + continue + ;; + *) + vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" + ;; + esac + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { - #if !($vencpp) - thisisanerror; - #endif +#if !($vencpp) + thisisanerror; +#endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done - ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + + ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 -$as_echo "$ax_cv_c_compiler_vendor" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 +printf "%s\n" "$ax_cv_c_compiler_vendor" >&6; } @@ -16481,28 +17620,28 @@ $as_echo "$ax_cv_c_compiler_vendor" >&6; } # Check whether --enable-portable-binary was given. -if test "${enable_portable_binary+set}" = set; then : +if test ${enable_portable_binary+y} +then : enableval=$enable_portable_binary; acx_maxopt_portable=$enableval -else +else $as_nop acx_maxopt_portable=no fi # Try to determine "good" native compiler flags if none specified via CFLAGS -if test "$ac_test_CFLAGS" != "set"; then - CFLAGS="" +if test "x$ac_test_CFLAGS" = "x"; then case $ax_cv_c_compiler_vendor in - dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" + dec) CFLAGS="$CFLAGS -newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" if test "x$acx_maxopt_portable" = xno; then CFLAGS="$CFLAGS -arch host" fi;; - sun) CFLAGS="-native -fast -xO5 -dalign" + sun) CFLAGS="$CFLAGS -native -fast -xO5 -dalign" if test "x$acx_maxopt_portable" = xyes; then CFLAGS="$CFLAGS -xarch=generic" fi;; - hp) CFLAGS="+Oall +Optrs_ansi +DSnative" + hp) CFLAGS="$CFLAGS +Oall +Optrs_ansi +DSnative" if test "x$acx_maxopt_portable" = xyes; then CFLAGS="$CFLAGS +DAportable" fi;; @@ -16512,12 +17651,13 @@ if test "$ac_test_CFLAGS" != "set"; then else xlc_opt="-qtune=auto" fi - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$xlc_opt" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $xlc_opt" >&5 -$as_echo_n "checking whether C compiler accepts $xlc_opt... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$xlc_opt" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $xlc_opt" >&5 +printf %s "checking whether C compiler accepts $xlc_opt... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $xlc_opt" @@ -16525,28 +17665,30 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : - CFLAGS="-O3 -qansialias -w $xlc_opt" -else - CFLAGS="-O3 -qansialias -w" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + CFLAGS="$CFLAGS -O3 -qansialias -w $xlc_opt" +else $as_nop + CFLAGS="$CFLAGS -O3 -qansialias -w" echo "******************************************************" echo "* You seem to have the IBM C compiler. It is *" echo "* recommended for best performance that you use: *" @@ -16561,7 +17703,7 @@ fi ;; - intel) CFLAGS="-O3 -ansi_alias" + intel) CFLAGS="$CFLAGS -O3 -ansi_alias" if test "x$acx_maxopt_portable" = xno; then icc_archflag=unknown icc_flags="" @@ -16575,19 +17717,21 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 -$as_echo_n "checking for x86 cpuid 0 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_0+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 +printf %s "checking for x86 cpuid 0 output... " >&6; } +if test ${ax_cv_gcc_x86_cpuid_0+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ax_cv_gcc_x86_cpuid_0=unknown -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int op = 0, level = 0, eax, ebx, ecx, edx; @@ -16607,9 +17751,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid -else +else $as_nop ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16617,8 +17762,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 +printf "%s\n" "$ax_cv_gcc_x86_cpuid_0" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -16634,19 +17779,21 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5 -$as_echo_n "checking for x86 cpuid 1 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_1+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5 +printf %s "checking for x86 cpuid 1 output... " >&6; } +if test ${ax_cv_gcc_x86_cpuid_1+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ax_cv_gcc_x86_cpuid_1=unknown -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int op = 1, level = 0, eax, ebx, ecx, edx; @@ -16666,9 +17813,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid -else +else $as_nop ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16676,8 +17824,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5 +printf "%s\n" "$ax_cv_gcc_x86_cpuid_1" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -16705,12 +17853,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu esac if test "x$icc_flags" != x; then for flag in $icc_flags; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" @@ -16718,56 +17867,65 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : icc_archflag=$flag; break -else +else $as_nop : fi done fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icc architecture flag" >&5 -$as_echo_n "checking for icc architecture flag... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $icc_archflag" >&5 -$as_echo "$icc_archflag" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for icc architecture flag" >&5 +printf %s "checking for icc architecture flag... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $icc_archflag" >&5 +printf "%s\n" "$icc_archflag" >&6; } if test "x$icc_archflag" != xunknown; then CFLAGS="$CFLAGS $icc_archflag" fi fi ;; + nvhpc) + # default optimization flags for nvhpc + CFLAGS="$CFLAGS -O3" + ;; + gnu) # default optimization flags for gcc on all systems - CFLAGS="-O3 -fomit-frame-pointer" + CFLAGS="$CFLAGS -O3 -fomit-frame-pointer" # -malign-double for x86 systems - # libffi local change -- don't align double, as it changes the ABI + # LIBFFI_LOCAL: don't do this. + # The testsuite doesn't use these flags and we'll get test failures. # AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double") # -fstrict-aliasing for gcc-2.95+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5 -$as_echo_n "checking whether C compiler accepts -fstrict-aliasing... " >&6; } -if ${ax_cv_check_cflags___fstrict_aliasing+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5 +printf %s "checking whether C compiler accepts -fstrict-aliasing... " >&6; } +if test ${ax_cv_check_cflags___fstrict_aliasing+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fstrict-aliasing" @@ -16775,36 +17933,39 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ax_cv_check_cflags___fstrict_aliasing=yes -else +else $as_nop ax_cv_check_cflags___fstrict_aliasing=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstrict_aliasing" >&5 -$as_echo "$ax_cv_check_cflags___fstrict_aliasing" >&6; } -if test "x$ax_cv_check_cflags___fstrict_aliasing" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstrict_aliasing" >&5 +printf "%s\n" "$ax_cv_check_cflags___fstrict_aliasing" >&6; } +if test "x$ax_cv_check_cflags___fstrict_aliasing" = xyes +then : CFLAGS="$CFLAGS -fstrict-aliasing" -else +else $as_nop : fi # note that we enable "unsafe" fp optimization with other compilers, too - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5 -$as_echo_n "checking whether C compiler accepts -ffast-math... " >&6; } -if ${ax_cv_check_cflags___ffast_math+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5 +printf %s "checking whether C compiler accepts -ffast-math... " >&6; } +if test ${ax_cv_check_cflags___ffast_math+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -ffast-math" @@ -16812,26 +17973,28 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ax_cv_check_cflags___ffast_math=yes -else +else $as_nop ax_cv_check_cflags___ffast_math=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ffast_math" >&5 -$as_echo "$ax_cv_check_cflags___ffast_math" >&6; } -if test "x$ax_cv_check_cflags___ffast_math" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ffast_math" >&5 +printf "%s\n" "$ax_cv_check_cflags___ffast_math" >&6; } +if test "x$ax_cv_check_cflags___ffast_math" = xyes +then : CFLAGS="$CFLAGS -ffast-math" -else +else $as_nop : fi @@ -16843,20 +18006,22 @@ fi # Check whether --with-gcc-arch was given. -if test "${with_gcc_arch+set}" = set; then : +if test ${with_gcc_arch+y} +then : withval=$with_gcc_arch; ax_gcc_arch=$withval -else +else $as_nop ax_gcc_arch=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 -$as_echo_n "checking for gcc architecture flag... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 -$as_echo "" >&6; } -if ${ax_cv_gcc_archflag+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 +printf %s "checking for gcc architecture flag... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: " >&5 +printf "%s\n" "" >&6; } +if test ${ax_cv_gcc_archflag+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_cv_gcc_archflag="unknown" @@ -16874,19 +18039,21 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 -$as_echo_n "checking for x86 cpuid 0 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_0+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5 +printf %s "checking for x86 cpuid 0 output... " >&6; } +if test ${ax_cv_gcc_x86_cpuid_0+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ax_cv_gcc_x86_cpuid_0=unknown -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int op = 0, level = 0, eax, ebx, ecx, edx; @@ -16906,9 +18073,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid -else +else $as_nop ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16916,8 +18084,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5 +printf "%s\n" "$ax_cv_gcc_x86_cpuid_0" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -16933,19 +18101,21 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5 -$as_echo_n "checking for x86 cpuid 1 output... " >&6; } -if ${ax_cv_gcc_x86_cpuid_1+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5 +printf %s "checking for x86 cpuid 1 output... " >&6; } +if test ${ax_cv_gcc_x86_cpuid_1+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ax_cv_gcc_x86_cpuid_1=unknown -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int op = 1, level = 0, eax, ebx, ecx, edx; @@ -16965,9 +18135,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid -else +else $as_nop ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16975,8 +18146,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5 -$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5 +printf "%s\n" "$ax_cv_gcc_x86_cpuid_1" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -17059,11 +18230,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu sparc*) # Extract the first word of "prtdiag", so it can be a program name with args. set dummy prtdiag; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PRTDIAG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PRTDIAG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PRTDIAG in [\\/]* | ?:[\\/]*) ac_cv_path_PRTDIAG="$PRTDIAG" # Let the user override the test with a path. @@ -17074,11 +18246,15 @@ as_dummy="$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/" for as_dir in $as_dummy do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PRTDIAG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PRTDIAG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -17091,11 +18267,11 @@ esac fi PRTDIAG=$ac_cv_path_PRTDIAG if test -n "$PRTDIAG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRTDIAG" >&5 -$as_echo "$PRTDIAG" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PRTDIAG" >&5 +printf "%s\n" "$PRTDIAG" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -17180,12 +18356,13 @@ fi for flag_prefix in $flag_prefixes; do for arch in $ax_gcc_arch; do flag="$flag_prefix$arch" - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $flag" @@ -17193,31 +18370,33 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : if test "x$ax_cv_c_compiler_vendor" = xclang; then if test "x$acx_maxopt_portable" = xyes; then if test "x$flag" = "x-march=$arch"; then flag=-mtune=$arch; fi fi fi; ax_cv_gcc_archflag=$flag; break -else +else $as_nop : fi @@ -17230,10 +18409,10 @@ fi # $GCC=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 -$as_echo_n "checking for gcc architecture flag... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_archflag" >&5 -$as_echo "$ax_cv_gcc_archflag" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5 +printf %s "checking for gcc architecture flag... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_archflag" >&5 +printf "%s\n" "$ax_cv_gcc_archflag" >&6; } if test "x$ax_cv_gcc_archflag" = xunknown; then : else @@ -17244,7 +18423,7 @@ fi microsoft) # default optimization flags for MSVC opt builds - CFLAGS="-O2" + CFLAGS="$CFLAGS -O2" ;; esac @@ -17256,15 +18435,16 @@ fi echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" echo "********************************************************" echo "" - CFLAGS="-O3" + CFLAGS="$CFLAGS -O3" fi - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CFLAGS" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS" >&5 -$as_echo_n "checking whether C compiler accepts $CFLAGS... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS" >&5 +printf %s "checking whether C compiler accepts $CFLAGS... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CFLAGS" @@ -17272,27 +18452,29 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : : -else +else $as_nop echo "" echo "********************************************************" @@ -17301,7 +18483,6 @@ else echo "* Use ./configure CFLAGS=... to specify your own flags *" echo "********************************************************" echo "" - CFLAGS="" fi @@ -17311,82 +18492,133 @@ fi # The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro # compiler. if test "$ax_cv_c_compiler_vendor" != "sun"; then - ac_ext=c + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5 -$as_echo_n "checking CFLAGS for maximum warnings... " >&6; } -if ${ac_cv_cflags_warn_all+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_cflags_warn_all="no, unknown" -ac_save_CFLAGS="$CFLAGS" -for ac_arg in "-warn all % -warn all" "-pedantic % -Wall" "-xstrconst % -v" "-std1 % -verbose -w0 -warnprotos" "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" "-ansi -ansiE % -fullwarn" "+ESlit % +w1" "-Xc % -pvctl,fullmsg" "-h conform % -h msglevel 2" # -do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -CFLAGS="$ac_save_CFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 -$as_echo "$ac_cv_cflags_warn_all" >&6; } -case ".$ac_cv_cflags_warn_all" in - .ok|.ok,*) ;; - .|.no|.no,*) ;; - *) -if ${CFLAGS+:} false; then : + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CFLAGS for most reasonable warnings" >&5 +printf %s "checking CFLAGS for most reasonable warnings... " >&6; } +if test ${ac_cv_cflags_warn_all+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_cv_cflags_warn_all="" + ac_save_cflags_warn_all_found="yes" + case "$ax_cv_c_compiler_vendor" in #( + intel) : + ac_cv_cflags_warn_all="-w2" ;; #( + ibm) : + ac_cv_cflags_warn_all="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" ;; #( + pathscale) : + ;; #( + clang) : + ac_cv_cflags_warn_all="-Wall" ;; #( + cray) : + ac_cv_cflags_warn_all="-h msglevel 2" ;; #( + fujitsu) : + ;; #( + sdcc) : + ;; #( + sx) : + ac_cv_cflags_warn_all="-pvctl,fullmsg" ;; #( + portland) : + ;; #( + gnu) : + ac_cv_cflags_warn_all="-Wall" ;; #( + sun) : + ac_cv_cflags_warn_all="-v" ;; #( + hp) : + ac_cv_cflags_warn_all="+w1" ;; #( + dec) : + ac_cv_cflags_warn_all="-verbose -w0 -warnprotos" ;; #( + borland) : + ;; #( + comeau) : + ;; #( + kai) : + ;; #( + lcc) : + ;; #( + sgi) : + ac_cv_cflags_warn_all="-fullwarn" ;; #( + microsoft) : + ;; #( + metrowerks) : + ;; #( + watcom) : + ;; #( + tcc) : + ;; #( + unknown) : + + ac_cv_cflags_warn_all="" + ac_save_cflags_warn_all_found="no" + ;; #( + *) : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Unknown compiler vendor returned by AX_COMPILER_VENDOR" >&5 +printf "%s\n" "$as_me: WARNING: Unknown compiler vendor returned by AX_COMPILER_VENDOR" >&2;} + ac_cv_cflags_warn_all="" + ac_save_cflags_warn_all_found="no" + + ;; +esac + + if test "x$ac_save_cflags_warn_all_found" = "xyes" +then : + if test "x$ac_cv_cflags_warn_all" != "x" +then : + +if test ${CFLAGS+y} +then : case " $CFLAGS " in #( *" $ac_cv_cflags_warn_all "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$ac_cv_cflags_warn_all"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$ac_cv_cflags_warn_all"; } >&5 (: CFLAGS already contains $ac_cv_cflags_warn_all) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : - as_fn_append CFLAGS " $ac_cv_cflags_warn_all" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 + CFLAGS="$ac_cv_cflags_warn_all $CFLAGS" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop CFLAGS=$ac_cv_cflags_warn_all - { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS\""; } >&5 (: CFLAGS="$CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi - ;; -esac -ac_ext=c +fi + +else $as_nop + true + +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5 +printf "%s\n" "$ac_cv_cflags_warn_all" >&6; } + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -17402,20 +18634,22 @@ fi cat > local.exp <&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : +if test ${enable_maintainer_mode+y} +then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else +else $as_nop USE_MAINTAINER_MODE=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' @@ -17428,43 +18662,61 @@ fi -for ac_header in sys/mman.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mman_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_MMAN_H 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/memfd.h" "ac_cv_header_sys_memfd_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_memfd_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MEMFD_H 1" >>confdefs.h fi -done - -for ac_func in mmap mkostemp -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "memfd_create" "ac_cv_func_memfd_create" +if test "x$ac_cv_func_memfd_create" = xyes +then : + printf "%s\n" "#define HAVE_MEMFD_CREATE 1" >>confdefs.h fi -done -ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mman_h" = xyes; then : +ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkostemp" "ac_cv_func_mkostemp" +if test "x$ac_cv_func_mkostemp" = xyes +then : + printf "%s\n" "#define HAVE_MKOSTEMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" +if test "x$ac_cv_func_mkstemp" = xyes +then : + printf "%s\n" "#define HAVE_MKSTEMP 1" >>confdefs.h + +fi + + +ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes +then : libffi_header_sys_mman_h=yes -else +else $as_nop libffi_header_sys_mman_h=no fi - ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" -if test "x$ac_cv_func_mmap" = xyes; then : +if test "x$ac_cv_func_mmap" = xyes +then : libffi_func_mmap=yes -else +else $as_nop libffi_func_mmap=no fi @@ -17474,11 +18726,12 @@ if test "$libffi_header_sys_mman_h" != yes \ ac_cv_func_mmap_dev_zero=no ac_cv_func_mmap_anon=no else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether read-only mmap of a plain file works" >&5 -$as_echo_n "checking whether read-only mmap of a plain file works... " >&6; } -if ${ac_cv_func_mmap_file+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether read-only mmap of a plain file works" >&5 +printf %s "checking whether read-only mmap of a plain file works... " >&6; } +if test ${ac_cv_func_mmap_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop # Add a system to this blacklist if # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a # memory area containing the same data that you'd get if you applied @@ -17491,13 +18744,14 @@ else ac_cv_func_mmap_file=yes;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_file" >&5 -$as_echo "$ac_cv_func_mmap_file" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mmap from /dev/zero works" >&5 -$as_echo_n "checking whether mmap from /dev/zero works... " >&6; } -if ${ac_cv_func_mmap_dev_zero+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_file" >&5 +printf "%s\n" "$ac_cv_func_mmap_file" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mmap from /dev/zero works" >&5 +printf %s "checking whether mmap from /dev/zero works... " >&6; } +if test ${ac_cv_func_mmap_dev_zero+y} +then : + printf %s "(cached) " >&6 +else $as_nop # Add a system to this blacklist if it has mmap() but /dev/zero # does not exist, or if mmapping /dev/zero does not give anonymous # zeroed pages with both the following properties: @@ -17515,15 +18769,16 @@ else ac_cv_func_mmap_dev_zero=yes;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_dev_zero" >&5 -$as_echo "$ac_cv_func_mmap_dev_zero" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_dev_zero" >&5 +printf "%s\n" "$ac_cv_func_mmap_dev_zero" >&6; } # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANON(YMOUS)" >&5 -$as_echo_n "checking for MAP_ANON(YMOUS)... " >&6; } -if ${ac_cv_decl_map_anon+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANON(YMOUS)" >&5 +printf %s "checking for MAP_ANON(YMOUS)... " >&6; } +if test ${ac_cv_decl_map_anon+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -17535,31 +18790,33 @@ else #endif int -main () +main (void) { int n = MAP_ANONYMOUS; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_decl_map_anon=yes -else +else $as_nop ac_cv_decl_map_anon=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_decl_map_anon" >&5 -$as_echo "$ac_cv_decl_map_anon" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_decl_map_anon" >&5 +printf "%s\n" "$ac_cv_decl_map_anon" >&6; } if test $ac_cv_decl_map_anon = no; then ac_cv_func_mmap_anon=no else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mmap with MAP_ANON(YMOUS) works" >&5 -$as_echo_n "checking whether mmap with MAP_ANON(YMOUS) works... " >&6; } -if ${ac_cv_func_mmap_anon+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mmap with MAP_ANON(YMOUS) works" >&5 +printf %s "checking whether mmap with MAP_ANON(YMOUS) works... " >&6; } +if test ${ac_cv_func_mmap_anon+y} +then : + printf %s "(cached) " >&6 +else $as_nop # Add a system to this blacklist if it has mmap() and MAP_ANON or # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) # doesn't give anonymous zeroed pages with the same properties listed @@ -17572,24 +18829,24 @@ else ac_cv_func_mmap_anon=yes;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_anon" >&5 -$as_echo "$ac_cv_func_mmap_anon" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_anon" >&5 +printf "%s\n" "$ac_cv_func_mmap_anon" >&6; } fi fi if test $ac_cv_func_mmap_file = yes; then -$as_echo "#define HAVE_MMAP_FILE 1" >>confdefs.h +printf "%s\n" "#define HAVE_MMAP_FILE 1" >>confdefs.h fi if test $ac_cv_func_mmap_dev_zero = yes; then -$as_echo "#define HAVE_MMAP_DEV_ZERO 1" >>confdefs.h +printf "%s\n" "#define HAVE_MMAP_DEV_ZERO 1" >>confdefs.h fi if test $ac_cv_func_mmap_anon = yes; then -$as_echo "#define HAVE_MMAP_ANON 1" >>confdefs.h +printf "%s\n" "#define HAVE_MMAP_ANON 1" >>confdefs.h fi @@ -17615,152 +18872,113 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - + ac_cv_path_EGREP=$EGREP fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no + fi fi -rm -f conftest* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy" +if test "x$ac_cv_func_memcpy" = xyes +then : + printf "%s\n" "#define HAVE_MEMCPY 1" >>confdefs.h fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -for ac_func in memcpy -do : - ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy" -if test "x$ac_cv_func_memcpy" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MEMCPY 1 -_ACEOF - -fi -done - ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if ${ac_cv_working_alloca_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; @@ -17768,52 +18986,52 @@ char *p = (char *) alloca (2 * sizeof (int)); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_working_alloca_h=yes -else +else $as_nop ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if ${ac_cv_func_alloca_works+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER # include # define alloca _alloca # else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (size_t); -# endif -# endif +# ifdef __cplusplus +extern "C" # endif +void *alloca (size_t); # endif #endif int -main () +main (void) { char *p = (char *) alloca (1); if (p) return 0; @@ -17821,20 +19039,22 @@ char *p = (char *) alloca (1); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_func_alloca_works=yes -else +else $as_nop ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi if test $ac_cv_func_alloca_works = yes; then -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -17844,58 +19064,19 @@ else ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -$as_echo "#define C_ALLOCA 1" >>confdefs.h +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if ${ac_cv_os_cray+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if ${ac_cv_c_stack_direction+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_c_stack_direction=0 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -17916,9 +19097,10 @@ main (int argc, char **argv) return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_stack_direction=1 -else +else $as_nop ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17926,11 +19108,9 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h fi @@ -17940,17 +19120,19 @@ fi # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 -$as_echo_n "checking size of double... " >&6; } -if ${ac_cv_sizeof_double+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 +printf %s "checking size of double... " >&6; } +if test ${ac_cv_sizeof_double+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_double" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (double) See \`config.log' for more details" "$LINENO" 5; } else @@ -17959,31 +19141,31 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 -$as_echo "$ac_cv_sizeof_double" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 +printf "%s\n" "$ac_cv_sizeof_double" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_DOUBLE $ac_cv_sizeof_double -_ACEOF +printf "%s\n" "#define SIZEOF_DOUBLE $ac_cv_sizeof_double" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 -$as_echo_n "checking size of long double... " >&6; } -if ${ac_cv_sizeof_long_double+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 +printf %s "checking size of long double... " >&6; } +if test ${ac_cv_sizeof_long_double+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default" +then : -else +else $as_nop if test "$ac_cv_type_long_double" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long double) See \`config.log' for more details" "$LINENO" 5; } else @@ -17992,14 +19174,12 @@ See \`config.log' for more details" "$LINENO" 5; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 -$as_echo "$ac_cv_sizeof_long_double" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 +printf "%s\n" "$ac_cv_sizeof_long_double" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double -_ACEOF +printf "%s\n" "#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double" >>confdefs.h @@ -18009,14 +19189,14 @@ if test -z "$HAVE_LONG_DOUBLE"; then if test $ac_cv_sizeof_long_double != 0; then if test $HAVE_LONG_DOUBLE_VARIANT != 0; then -$as_echo "#define HAVE_LONG_DOUBLE_VARIANT 1" >>confdefs.h +printf "%s\n" "#define HAVE_LONG_DOUBLE_VARIANT 1" >>confdefs.h HAVE_LONG_DOUBLE=1 else if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then HAVE_LONG_DOUBLE=1 -$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LONG_DOUBLE 1" >>confdefs.h fi fi @@ -18025,11 +19205,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18040,7 +19221,8 @@ else typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -18064,7 +19246,7 @@ if ac_fn_c_try_compile "$LINENO"; then : fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18073,7 +19255,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -18085,7 +19267,8 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18093,7 +19276,7 @@ if ac_fn_c_try_compile "$LINENO"; then : #include int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -18103,14 +19286,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -18119,7 +19303,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -18129,14 +19313,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -18146,31 +19331,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = +unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = + unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - short int ebcdic_ii[] = + unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = + unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; @@ -18178,14 +19365,15 @@ short int ascii_mm[] = extern int foo; int -main () +main (void) { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -18198,13 +19386,13 @@ if ac_fn_c_try_compile "$LINENO"; then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Are we little or big endian? From Harbison&Steele. */ @@ -18220,9 +19408,10 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_bigendian=no -else +else $as_nop ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18231,17 +19420,17 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) @@ -18250,48 +19439,51 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .cfi pseudo-op support" >&5 -$as_echo_n "checking assembler .cfi pseudo-op support... " >&6; } -if ${gcc_cv_as_cfi_pseudo_op+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking assembler .cfi pseudo-op support" >&5 +printf %s "checking assembler .cfi pseudo-op support... " >&6; } +if test ${gcc_cv_as_cfi_pseudo_op+y} +then : + printf %s "(cached) " >&6 +else $as_nop gcc_cv_as_cfi_pseudo_op=unknown cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ asm (".cfi_sections\n\t.cfi_startproc\n\t.cfi_endproc"); int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : gcc_cv_as_cfi_pseudo_op=yes -else +else $as_nop gcc_cv_as_cfi_pseudo_op=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_cfi_pseudo_op" >&5 -$as_echo "$gcc_cv_as_cfi_pseudo_op" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_cfi_pseudo_op" >&5 +printf "%s\n" "$gcc_cv_as_cfi_pseudo_op" >&6; } if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then -$as_echo "#define HAVE_AS_CFI_PSEUDO_OP 1" >>confdefs.h +printf "%s\n" "#define HAVE_AS_CFI_PSEUDO_OP 1" >>confdefs.h fi case "$TARGET" in SPARC) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler and linker support unaligned pc related relocs" >&5 -$as_echo_n "checking assembler and linker support unaligned pc related relocs... " >&6; } -if ${libffi_cv_as_sparc_ua_pcrel+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking assembler and linker support unaligned pc related relocs" >&5 +printf %s "checking assembler and linker support unaligned pc related relocs... " >&6; } +if test ${libffi_cv_as_sparc_ua_pcrel+y} +then : + printf %s "(cached) " >&6 +else $as_nop save_CFLAGS="$CFLAGS" save_LDFLAGS="$LDFLAGS" @@ -18301,36 +19493,38 @@ else /* end confdefs.h. */ asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text"); int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : libffi_cv_as_sparc_ua_pcrel=yes -else +else $as_nop libffi_cv_as_sparc_ua_pcrel=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_sparc_ua_pcrel" >&5 -$as_echo "$libffi_cv_as_sparc_ua_pcrel" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_sparc_ua_pcrel" >&5 +printf "%s\n" "$libffi_cv_as_sparc_ua_pcrel" >&6; } if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then -$as_echo "#define HAVE_AS_SPARC_UA_PCREL 1" >>confdefs.h +printf "%s\n" "#define HAVE_AS_SPARC_UA_PCREL 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .register pseudo-op support" >&5 -$as_echo_n "checking assembler .register pseudo-op support... " >&6; } -if ${libffi_cv_as_register_pseudo_op+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking assembler .register pseudo-op support" >&5 +printf %s "checking assembler .register pseudo-op support... " >&6; } +if test ${libffi_cv_as_register_pseudo_op+y} +then : + printf %s "(cached) " >&6 +else $as_nop libffi_cv_as_register_pseudo_op=unknown # Check if we have .register @@ -18338,36 +19532,38 @@ else /* end confdefs.h. */ int -main () +main (void) { asm (".register %g2, #scratch"); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : libffi_cv_as_register_pseudo_op=yes -else +else $as_nop libffi_cv_as_register_pseudo_op=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_register_pseudo_op" >&5 -$as_echo "$libffi_cv_as_register_pseudo_op" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_register_pseudo_op" >&5 +printf "%s\n" "$libffi_cv_as_register_pseudo_op" >&6; } if test "x$libffi_cv_as_register_pseudo_op" = xyes; then -$as_echo "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h +printf "%s\n" "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h fi ;; X86*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports pc related relocs" >&5 -$as_echo_n "checking assembler supports pc related relocs... " >&6; } -if ${libffi_cv_as_x86_pcrel+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking assembler supports pc related relocs" >&5 +printf %s "checking assembler supports pc related relocs... " >&6; } +if test ${libffi_cv_as_x86_pcrel+y} +then : + printf %s "(cached) " >&6 +else $as_nop libffi_cv_as_x86_pcrel=no echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s @@ -18376,21 +19572,22 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_pcrel" >&5 -$as_echo "$libffi_cv_as_x86_pcrel" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_pcrel" >&5 +printf "%s\n" "$libffi_cv_as_x86_pcrel" >&6; } if test "x$libffi_cv_as_x86_pcrel" = xyes; then -$as_echo "#define HAVE_AS_X86_PCREL 1" >>confdefs.h +printf "%s\n" "#define HAVE_AS_X86_PCREL 1" >>confdefs.h fi ;; S390) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler uses zarch features" >&5 -$as_echo_n "checking compiler uses zarch features... " >&6; } -if ${libffi_cv_as_s390_zarch+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking compiler uses zarch features" >&5 +printf %s "checking compiler uses zarch features... " >&6; } +if test ${libffi_cv_as_s390_zarch+y} +then : + printf %s "(cached) " >&6 +else $as_nop libffi_cv_as_s390_zarch=no echo 'void foo(void) { bar(); bar(); }' > conftest.c @@ -18401,32 +19598,86 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_s390_zarch" >&5 -$as_echo "$libffi_cv_as_s390_zarch" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_s390_zarch" >&5 +printf "%s\n" "$libffi_cv_as_s390_zarch" >&6; } if test "x$libffi_cv_as_s390_zarch" = xyes; then -$as_echo "#define HAVE_AS_S390_ZARCH 1" >>confdefs.h +printf "%s\n" "#define HAVE_AS_S390_ZARCH 1" >>confdefs.h fi ;; esac -# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. -# Check whether --enable-pax_emutramp was given. -if test "${enable_pax_emutramp+set}" = set; then : - enableval=$enable_pax_emutramp; if test "$enable_pax_emutramp" = "yes"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports pointer authentication" >&5 +printf %s "checking whether compiler supports pointer authentication... " >&6; } +if test ${libffi_cv_as_ptrauth+y} +then : + printf %s "(cached) " >&6 +else $as_nop -$as_echo "#define FFI_MMAP_EXEC_EMUTRAMP_PAX 1" >>confdefs.h + libffi_cv_as_ptrauth=unknown + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifdef __clang__ +# if __has_feature(ptrauth_calls) +# define HAVE_PTRAUTH 1 +# endif +#endif + +#ifndef HAVE_PTRAUTH +# error Pointer authentication not supported +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + libffi_cv_as_ptrauth=yes +else $as_nop + libffi_cv_as_ptrauth=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_ptrauth" >&5 +printf "%s\n" "$libffi_cv_as_ptrauth" >&6; } +if test "x$libffi_cv_as_ptrauth" = xyes; then + +printf "%s\n" "#define HAVE_PTRAUTH 1" >>confdefs.h + +fi + +# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC; +# if EMUTRAMP is active too ffi could try mapping without PROT_EXEC, +# but the kernel needs to recognize the trampoline generated by ffi. +# Otherwise fallback to double mmap trick. +# Check whether --enable-pax_emutramp was given. +if test ${enable_pax_emutramp+y} +then : + enableval=$enable_pax_emutramp; if test "$enable_pax_emutramp" = "yes"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: EMUTRAMP is experimental only. Use --enable-pax_emutramp=experimental to enforce." >&5 +printf "%s\n" "$as_me: WARNING: EMUTRAMP is experimental only. Use --enable-pax_emutramp=experimental to enforce." >&2;} + elif test "$enable_pax_emutramp" = "experimental"; then + +printf "%s\n" "#define FFI_MMAP_EXEC_EMUTRAMP_PAX 1" >>confdefs.h fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 -$as_echo_n "checking for _ prefix in compiled symbols... " >&6; } -if ${lt_cv_sys_symbol_underscore+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 +printf %s "checking for _ prefix in compiled symbols... " >&6; } +if test ${lt_cv_sys_symbol_underscore+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} @@ -18435,14 +19686,14 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then @@ -18464,14 +19715,14 @@ _LT_EOF rm -rf conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 -$as_echo "$lt_cv_sys_symbol_underscore" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 +printf "%s\n" "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test "x$sys_symbol_underscore" = xyes; then -$as_echo "#define SYMBOL_UNDERSCORE 1" >>confdefs.h +printf "%s\n" "#define SYMBOL_UNDERSCORE 1" >>confdefs.h fi @@ -18480,12 +19731,12 @@ case "$target" in *arm*-apple-* | aarch64-apple-*) FFI_EXEC_TRAMPOLINE_TABLE=1 -$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h +printf "%s\n" "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h ;; *-apple-* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris* | *-linux-android*) -$as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h +printf "%s\n" "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h ;; esac @@ -18500,11 +19751,12 @@ fi if test x$TARGET = xX86_64; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking toolchain supports unwind section type" >&5 -$as_echo_n "checking toolchain supports unwind section type... " >&6; } -if ${libffi_cv_as_x86_64_unwind_section_type+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking toolchain supports unwind section type" >&5 +printf %s "checking toolchain supports unwind section type... " >&6; } +if test ${libffi_cv_as_x86_64_unwind_section_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat > conftest1.s << EOF .text @@ -18529,58 +19781,93 @@ EOF fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_64_unwind_section_type" >&5 -$as_echo "$libffi_cv_as_x86_64_unwind_section_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_64_unwind_section_type" >&5 +printf "%s\n" "$libffi_cv_as_x86_64_unwind_section_type" >&6; } if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then -$as_echo "#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1" >>confdefs.h +printf "%s\n" "#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1" >>confdefs.h fi fi if test "x$GCC" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether .eh_frame section should be read-only" >&5 -$as_echo_n "checking whether .eh_frame section should be read-only... " >&6; } -if ${libffi_cv_ro_eh_frame+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-lto" >&5 +printf %s "checking whether C compiler accepts -fno-lto... " >&6; } +if test ${ax_cv_check_cflags___fno_lto+y} +then : + printf %s "(cached) " >&6 +else $as_nop - libffi_cv_ro_eh_frame=no + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -fno-lto" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ax_cv_check_cflags___fno_lto=yes +else $as_nop + ax_cv_check_cflags___fno_lto=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_lto" >&5 +printf "%s\n" "$ax_cv_check_cflags___fno_lto" >&6; } +if test "x$ax_cv_check_cflags___fno_lto" = xyes +then : + libffi_cv_no_lto=-fno-lto +else $as_nop + : +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether .eh_frame section should be read-only" >&5 +printf %s "checking whether .eh_frame section should be read-only... " >&6; } +if test ${libffi_cv_ro_eh_frame+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + libffi_cv_ro_eh_frame=yes echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c - if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then - objdump -h conftest.o > conftest.dump 2>&1 - libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1` - if test "x$libffi_eh_frame_line" != "x"; then - libffi_test_line=`expr $libffi_eh_frame_line + 1`p - sed -n $libffi_test_line conftest.dump > conftest.line - if grep READONLY conftest.line > /dev/null; then - libffi_cv_ro_eh_frame=yes - fi + if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then + if $READELF -WS conftest.o 2>/dev/null | grep -q -n 'eh_frame .* WA'; then + libffi_cv_ro_eh_frame=no fi fi rm -f conftest.* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_ro_eh_frame" >&5 -$as_echo "$libffi_cv_ro_eh_frame" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_ro_eh_frame" >&5 +printf "%s\n" "$libffi_cv_ro_eh_frame" >&6; } if test "x$libffi_cv_ro_eh_frame" = xyes; then -$as_echo "#define HAVE_RO_EH_FRAME 1" >>confdefs.h +printf "%s\n" "#define HAVE_RO_EH_FRAME 1" >>confdefs.h -$as_echo "#define EH_FRAME_FLAGS \"a\"" >>confdefs.h +printf "%s\n" "#define EH_FRAME_FLAGS \"a\"" >>confdefs.h else -$as_echo "#define EH_FRAME_FLAGS \"aw\"" >>confdefs.h +printf "%s\n" "#define EH_FRAME_FLAGS \"aw\"" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__((visibility(\"hidden\")))" >&5 -$as_echo_n "checking for __attribute__((visibility(\"hidden\")))... " >&6; } -if ${libffi_cv_hidden_visibility_attribute+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __attribute__((visibility(\"hidden\")))" >&5 +printf %s "checking for __attribute__((visibility(\"hidden\")))... " >&6; } +if test ${libffi_cv_hidden_visibility_attribute+y} +then : + printf %s "(cached) " >&6 +else $as_nop echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c libffi_cv_hidden_visibility_attribute=no @@ -18588,28 +19875,29 @@ else { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then - if egrep '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; then + if $EGREP '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; then libffi_cv_hidden_visibility_attribute=yes fi fi rm -f conftest.* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_hidden_visibility_attribute" >&5 -$as_echo "$libffi_cv_hidden_visibility_attribute" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_hidden_visibility_attribute" >&5 +printf "%s\n" "$libffi_cv_hidden_visibility_attribute" >&6; } if test $libffi_cv_hidden_visibility_attribute = yes; then -$as_echo "#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1" >>confdefs.h +printf "%s\n" "#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1" >>confdefs.h fi fi # Check whether --enable-docs was given. -if test "${enable_docs+set}" = set; then : +if test ${enable_docs+y} +then : enableval=$enable_docs; enable_docs=no -else +else $as_nop enable_docs=yes fi @@ -18638,10 +19926,11 @@ done # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : +if test ${enable_debug+y} +then : enableval=$enable_debug; if test "$enable_debug" = "yes"; then -$as_echo "#define FFI_DEBUG 1" >>confdefs.h +printf "%s\n" "#define FFI_DEBUG 1" >>confdefs.h fi fi @@ -18656,10 +19945,11 @@ fi # Check whether --enable-structs was given. -if test "${enable_structs+set}" = set; then : +if test ${enable_structs+y} +then : enableval=$enable_structs; if test "$enable_structs" = "no"; then -$as_echo "#define FFI_NO_STRUCTS 1" >>confdefs.h +printf "%s\n" "#define FFI_NO_STRUCTS 1" >>confdefs.h fi fi @@ -18674,27 +19964,56 @@ fi # Check whether --enable-raw-api was given. -if test "${enable_raw_api+set}" = set; then : +if test ${enable_raw_api+y} +then : enableval=$enable_raw_api; if test "$enable_raw_api" = "no"; then -$as_echo "#define FFI_NO_RAW_API 1" >>confdefs.h +printf "%s\n" "#define FFI_NO_RAW_API 1" >>confdefs.h fi fi +# Check whether --enable-exec-static-tramp was given. +if test ${enable_exec_static_tramp+y} +then : + enableval=$enable_exec_static_tramp; +fi + + +if test "$enable_exec_static_tramp" != no; then +case "$target" in + *-cygwin* | *-msys*) + # Only define static trampolines if we are using the cygwin runtime. + # Will this need to be changed for mingw? + if test "x$GCC" = "xyes"; then + +printf "%s\n" "#define FFI_EXEC_STATIC_TRAMP 1" >>confdefs.h + + fi + ;; + *arm*-*-linux-* | aarch64*-*-linux-* | i*86-*-linux-* | x86_64-*-linux-* | loongarch*-*-linux-*) + +printf "%s\n" "#define FFI_EXEC_STATIC_TRAMP 1" >>confdefs.h + + ;; +esac +fi + # Check whether --enable-purify-safety was given. -if test "${enable_purify_safety+set}" = set; then : +if test ${enable_purify_safety+y} +then : enableval=$enable_purify_safety; if test "$enable_purify_safety" = "yes"; then -$as_echo "#define USING_PURIFY 1" >>confdefs.h +printf "%s\n" "#define USING_PURIFY 1" >>confdefs.h fi fi # Check whether --enable-multi-os-directory was given. -if test "${enable_multi_os_directory+set}" = set; then : +if test ${enable_multi_os_directory+y} +then : enableval=$enable_multi_os_directory; fi @@ -18723,118 +20042,18 @@ else fi +# Conditionalize the makefile for this target machine. +tmake_file_= +for f in ${tmake_file}; do + if test -f ${srcdir}/src/$TARGETDIR/$f; then + tmake_file_="${tmake_file_} \$(srcdir)/src/$TARGETDIR/$f" + fi +done +tmake_file="${tmake_file_}" + + # Check linker support. - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - # If we're not using GNU ld, then there's no point in even trying these # tests. Check for that first. We should have already tested for gld # by now (in libtool), but require it now just to be safe... @@ -18892,11 +20111,12 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # really work at the moment (keeps on discarding used sections, first # .eh_frame and now some of the glibc sections for iconv). # Bzzzzt. Thanks for playing, maybe next time. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,--gc-sections" >&5 -$as_echo_n "checking for ld that supports -Wl,--gc-sections... " >&6; } - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld that supports -Wl,--gc-sections" >&5 +printf %s "checking for ld that supports -Wl,--gc-sections... " >&6; } + if test "$cross_compiling" = yes +then : ac_sectionLDflags=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18908,9 +20128,10 @@ else } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_sectionLDflags=yes -else +else $as_nop ac_sectionLDflags=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18926,8 +20147,8 @@ fi if test "$ac_sectionLDflags" = "yes"; then SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_sectionLDflags" >&5 -$as_echo "$ac_sectionLDflags" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_sectionLDflags" >&5 +printf "%s\n" "$ac_sectionLDflags" >&6; } fi # Set linker optimization flags. @@ -18941,14 +20162,15 @@ $as_echo "$ac_sectionLDflags" >&6; } # Check whether --enable-symvers was given. -if test "${enable_symvers+set}" = set; then : +if test ${enable_symvers+y} +then : enableval=$enable_symvers; case "$enableval" in yes|no|gnu*|sun) ;; *) as_fn_error $? "Unknown argument to enable/disable symvers" "$LINENO" 5 ;; esac -else +else $as_nop enable_symvers=yes fi @@ -18986,12 +20208,12 @@ if test x$enable_symvers = xsun ; then ;; *) # Unlikely to work. - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested Sun symbol versioning, but" >&5 -$as_echo "$as_me: WARNING: === You have requested Sun symbol versioning, but" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === you are not targetting Solaris 2." >&5 -$as_echo "$as_me: WARNING: === you are not targetting Solaris 2." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5 -$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested Sun symbol versioning, but" >&5 +printf "%s\n" "$as_me: WARNING: === You have requested Sun symbol versioning, but" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === you are not targetting Solaris 2." >&5 +printf "%s\n" "$as_me: WARNING: === you are not targetting Solaris 2." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5 +printf "%s\n" "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} enable_symvers=no ;; esac @@ -18999,27 +20221,28 @@ fi # Check to see if libgcc_s exists, indicating that shared libgcc is possible. if test $enable_symvers != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared libgcc" >&5 -$as_echo_n "checking for shared libgcc... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared libgcc" >&5 +printf %s "checking for shared libgcc... " >&6; } ac_save_CFLAGS="$CFLAGS" CFLAGS=' -lgcc_s' cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { return 0; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : libat_shared_libgcc=yes -else +else $as_nop libat_shared_libgcc=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" if test $libat_shared_libgcc = no; then @@ -19037,23 +20260,24 @@ EOF /* end confdefs.h. */ int -main () +main (void) { return 0; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : libat_shared_libgcc=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libat_shared_libgcc" >&5 -$as_echo "$libat_shared_libgcc" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libat_shared_libgcc" >&5 +printf "%s\n" "$libat_shared_libgcc" >&6; } fi # For GNU ld, we need at least this version. The format is described in @@ -19073,23 +20297,23 @@ if test $enable_symvers != no && test $libat_shared_libgcc = yes; then enable_symvers=gnu else # The right tools, the right setup, but too old. Fallbacks? - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Linker version $libat_gnu_ld_version is too old for" >&5 -$as_echo "$as_me: WARNING: === Linker version $libat_gnu_ld_version is too old for" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === full symbol versioning support in this release of GCC." >&5 -$as_echo "$as_me: WARNING: === full symbol versioning support in this release of GCC." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You would need to upgrade your binutils to version" >&5 -$as_echo "$as_me: WARNING: === You would need to upgrade your binutils to version" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === $libat_min_gnu_ld_version or later and rebuild GCC." >&5 -$as_echo "$as_me: WARNING: === $libat_min_gnu_ld_version or later and rebuild GCC." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === Linker version $libat_gnu_ld_version is too old for" >&5 +printf "%s\n" "$as_me: WARNING: === Linker version $libat_gnu_ld_version is too old for" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === full symbol versioning support in this release of GCC." >&5 +printf "%s\n" "$as_me: WARNING: === full symbol versioning support in this release of GCC." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === You would need to upgrade your binutils to version" >&5 +printf "%s\n" "$as_me: WARNING: === You would need to upgrade your binutils to version" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === $libat_min_gnu_ld_version or later and rebuild GCC." >&5 +printf "%s\n" "$as_me: WARNING: === $libat_min_gnu_ld_version or later and rebuild GCC." >&2;} if test $libat_gnu_ld_version -ge 21200 ; then # Globbing fix is present, proper block support is not. - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5 -$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5 +printf "%s\n" "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} enable_symvers=no else # 2.11 or older. - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5 -$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5 +printf "%s\n" "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} enable_symvers=no fi fi @@ -19097,20 +20321,20 @@ $as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} : All interesting versions of Sun ld support sun style symbol versioning. else # just fail for now - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested some kind of symbol versioning, but" >&5 -$as_echo "$as_me: WARNING: === You have requested some kind of symbol versioning, but" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === either you are not using a supported linker, or you are" >&5 -$as_echo "$as_me: WARNING: === either you are not using a supported linker, or you are" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === not building a shared libgcc_s (which is required)." >&5 -$as_echo "$as_me: WARNING: === not building a shared libgcc_s (which is required)." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5 -$as_echo "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === You have requested some kind of symbol versioning, but" >&5 +printf "%s\n" "$as_me: WARNING: === You have requested some kind of symbol versioning, but" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === either you are not using a supported linker, or you are" >&5 +printf "%s\n" "$as_me: WARNING: === either you are not using a supported linker, or you are" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === not building a shared libgcc_s (which is required)." >&5 +printf "%s\n" "$as_me: WARNING: === not building a shared libgcc_s (which is required)." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: === Symbol versioning will be disabled." >&5 +printf "%s\n" "$as_me: WARNING: === Symbol versioning will be disabled." >&2;} enable_symvers=no fi fi if test $enable_symvers = gnu; then -$as_echo "#define LIBFFI_GNU_SYMBOL_VERSIONING 1" >>confdefs.h +printf "%s\n" "#define LIBFFI_GNU_SYMBOL_VERSIONING 1" >>confdefs.h fi @@ -19138,8 +20362,8 @@ else LIBFFI_BUILD_VERSIONED_SHLIB_SUN_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: versioning on shared library symbols is $enable_symvers" >&5 -$as_echo "$as_me: versioning on shared library symbols is $enable_symvers" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: versioning on shared library symbols is $enable_symvers" >&5 +printf "%s\n" "$as_me: versioning on shared library symbols is $enable_symvers" >&6;} ac_config_commands="$ac_config_commands include" @@ -19177,8 +20401,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -19208,15 +20432,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -19230,8 +20454,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -19248,7 +20472,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -19259,14 +20483,14 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -19333,8 +20557,8 @@ fi ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -19357,14 +20581,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -19374,46 +20600,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -19422,13 +20648,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -19437,8 +20656,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -19450,30 +20673,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -19486,13 +20689,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -19519,18 +20723,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -19542,12 +20748,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -19578,7 +20785,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -19600,6 +20807,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -19613,6 +20824,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -19654,7 +20871,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -19663,7 +20880,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -19725,8 +20942,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libffi $as_me 3.3, which was -generated by GNU Autoconf 2.69. Invocation command line was +This file was extended by libffi $as_me 3.4.4, which was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -19788,14 +21005,16 @@ $config_commands Report bugs to ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -libffi config.status 3.3 -configured by $0, generated by GNU Autoconf 2.69, +libffi config.status 3.4.4 +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -19835,15 +21054,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -19851,7 +21070,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -19860,7 +21079,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -19888,7 +21107,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -19902,7 +21121,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -19962,6 +21181,7 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' @@ -19970,6 +21190,7 @@ want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -20144,6 +21365,7 @@ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ @@ -20152,7 +21374,6 @@ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -20334,9 +21555,9 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -20672,7 +21893,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -20680,17 +21901,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -20707,7 +21928,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20731,9 +21952,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -20795,8 +22016,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -20840,9 +22061,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -20858,20 +22079,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -20891,7 +22112,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | +printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20911,8 +22132,8 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -20921,11 +22142,11 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} "buildir":C) ac_top_srcdir="$ax_enable_builddir_srcdir" if test ".$ax_enable_builddir" = ".." ; then if test -f "$top_srcdir/Makefile" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - left untouched" >&5 -$as_echo "$as_me: skipping top_srcdir/Makefile - left untouched" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - left untouched" >&5 +printf "%s\n" "$as_me: skipping top_srcdir/Makefile - left untouched" >&6;} else - { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - not created" >&5 -$as_echo "$as_me: skipping top_srcdir/Makefile - not created" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - not created" >&5 +printf "%s\n" "$as_me: skipping top_srcdir/Makefile - not created" >&6;} fi else if test -f "$ac_top_srcdir/Makefile" ; then @@ -20941,8 +22162,8 @@ $as_echo "$as_me: skipping top_srcdir/Makefile - not created" >&6;} cp $tmp/conftemp.mk $ac_top_srcdir/makefiles.mk~ ## DEBUGGING fi if test ! -f "$ac_top_srcdir/Makefile" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: create top_srcdir/Makefile guessed from local Makefile" >&5 -$as_echo "$as_me: create top_srcdir/Makefile guessed from local Makefile" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: create top_srcdir/Makefile guessed from local Makefile" >&5 +printf "%s\n" "$as_me: create top_srcdir/Makefile guessed from local Makefile" >&6;} x='`' ; cat >$tmp/conftemp.sed <<_EOF /^\$/n x @@ -21026,15 +22247,15 @@ _EOF cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefile.sed~" ## DEBUGGING $ax_enable_builddir_sed -f $tmp/conftemp.sed Makefile >$ac_top_srcdir/Makefile if test -f "$ac_top_srcdir/Makefile.mk" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&5 -$as_echo "$as_me: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&5 +printf "%s\n" "$as_me: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&6;} cat $ac_top_srcdir/Makefile.mk >>$ac_top_srcdir/Makefile fi ; xxxx="####" echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$ac_top_srcdir/Makefile # sanity check if grep '^; echo "MAKE ' $ac_top_srcdir/Makefile >/dev/null ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: buggy sed found - it deletes tab in \"a\" text parts" >&5 -$as_echo "$as_me: buggy sed found - it deletes tab in \"a\" text parts" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: buggy sed found - it deletes tab in \"a\" text parts" >&5 +printf "%s\n" "$as_me: buggy sed found - it deletes tab in \"a\" text parts" >&6;} $ax_enable_builddir_sed -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $ac_top_srcdir/Makefile \ >$ac_top_srcdir/Makefile~ (test -s $ac_top_srcdir/Makefile~ && mv $ac_top_srcdir/Makefile~ $ac_top_srcdir/Makefile) 2>/dev/null @@ -21047,17 +22268,17 @@ $as_echo "$as_me: buggy sed found - it deletes tab in \"a\" text parts" >&6;} cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefiles.sed~" ## DEBUGGING cp "$tmp/mkfile.tmp" "$ac_top_srcdir/makefiles.out~" ## DEBUGGING if cmp -s "$ac_top_srcdir/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: keeping top_srcdir/Makefile from earlier configure" >&5 -$as_echo "$as_me: keeping top_srcdir/Makefile from earlier configure" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: keeping top_srcdir/Makefile from earlier configure" >&5 +printf "%s\n" "$as_me: keeping top_srcdir/Makefile from earlier configure" >&6;} rm "$tmp/mkfile.tmp" else - { $as_echo "$as_me:${as_lineno-$LINENO}: reusing top_srcdir/Makefile from earlier configure" >&5 -$as_echo "$as_me: reusing top_srcdir/Makefile from earlier configure" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: reusing top_srcdir/Makefile from earlier configure" >&5 +printf "%s\n" "$as_me: reusing top_srcdir/Makefile from earlier configure" >&6;} mv "$tmp/mkfile.tmp" "$ac_top_srcdir/Makefile" fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&5 -$as_echo "$as_me: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&5 +printf "%s\n" "$as_me: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&6;} xxxx="####" echo "$xxxx" "$ax_enable_builddir_host" "|$ax_enable_builddir" >>$ac_top_srcdir/Makefile fi @@ -21082,7 +22303,7 @@ esac for am_mf do # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line @@ -21094,7 +22315,7 @@ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | +printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -21116,7 +22337,7 @@ $as_echo X"$am_mf" | $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | +printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -21141,10 +22362,12 @@ $as_echo X/"$am_mf" | (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } @@ -21291,6 +22514,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # An object symbol dumper. OBJDUMP=$lt_OBJDUMP @@ -21315,8 +22541,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -21698,6 +22927,7 @@ _LT_EOF esac + ltmain=$ac_aux_dir/ltmain.sh @@ -21705,7 +22935,7 @@ ltmain=$ac_aux_dir/ltmain.sh # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -21905,11 +23135,12 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi # 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 + diff --git a/configure.ac b/configure.ac index b764368..7e8cd98 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ dnl Process this with autoconf to create configure -AC_PREREQ(2.68) +AC_PREREQ([2.71]) -AC_INIT([libffi], [3.3], [http://github.com/libffi/libffi/issues]) +AC_INIT([libffi],[3.4.4],[http://github.com/libffi/libffi/issues]) AC_CONFIG_HEADERS([fficonfig.h]) -AC_CANONICAL_SYSTEM +AC_CANONICAL_TARGET target_alias=${target_alias-$host_alias} case "${host}" in @@ -38,9 +38,12 @@ AC_SUBST(CFLAGS) AM_PROG_AS AM_PROG_CC_C_O -AC_PROG_LIBTOOL +AC_PROG_EGREP +LT_INIT AC_CONFIG_MACRO_DIR([m4]) +AC_CHECK_TOOL(READELF, readelf) + # Test for 64-bit build. AC_CHECK_SIZEOF([size_t]) @@ -59,12 +62,16 @@ fi cat > local.exp < conftest.c - if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then - objdump -h conftest.o > conftest.dump 2>&1 - libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1` - if test "x$libffi_eh_frame_line" != "x"; then - libffi_test_line=`expr $libffi_eh_frame_line + 1`p - sed -n $libffi_test_line conftest.dump > conftest.line - if grep READONLY conftest.line > /dev/null; then - libffi_cv_ro_eh_frame=yes - fi + if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then + if $READELF -WS conftest.o 2>/dev/null | grep -q -n 'eh_frame .* WA'; then + libffi_cv_ro_eh_frame=no fi fi rm -f conftest.* @@ -270,7 +302,7 @@ if test "x$GCC" = "xyes"; then echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c libffi_cv_hidden_visibility_attribute=no if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then - if egrep '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; then + if $EGREP '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; then libffi_cv_hidden_visibility_attribute=yes fi fi @@ -283,8 +315,7 @@ if test "x$GCC" = "xyes"; then fi AC_ARG_ENABLE(docs, - AC_HELP_STRING([--disable-docs], - [Disable building of docs (default: no)]), + AS_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]) @@ -342,6 +373,26 @@ AC_ARG_ENABLE(raw-api, AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.]) fi) +AC_ARG_ENABLE(exec-static-tramp, +[ --disable-exec-static-tramp disable use of static exec trampolines (enabled by default)]) + +if test "$enable_exec_static_tramp" != no; then +case "$target" in + *-cygwin* | *-msys*) + # Only define static trampolines if we are using the cygwin runtime. + # Will this need to be changed for mingw? + if test "x$GCC" = "xyes"; then + AC_DEFINE(FFI_EXEC_STATIC_TRAMP, 1, + [Define this if you want statically defined trampolines]) + fi + ;; + *arm*-*-linux-* | aarch64*-*-linux-* | i*86-*-linux-* | x86_64-*-linux-* | loongarch*-*-linux-*) + AC_DEFINE(FFI_EXEC_STATIC_TRAMP, 1, + [Define this if you want statically defined trampolines]) + ;; +esac +fi + AC_ARG_ENABLE(purify-safety, [ --enable-purify-safety purify-safe mode], if test "$enable_purify_safety" = "yes"; then @@ -351,7 +402,7 @@ AC_ARG_ENABLE(purify-safety, 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 @@ -376,6 +427,16 @@ else fi AC_SUBST(toolexeclibdir) +# Conditionalize the makefile for this target machine. +tmake_file_= +for f in ${tmake_file}; do + if test -f ${srcdir}/src/$TARGETDIR/$f; then + tmake_file_="${tmake_file_} \$(srcdir)/src/$TARGETDIR/$f" + fi +done +tmake_file="${tmake_file_}" +AC_SUBST(tmake_file) + # Check linker support. LIBFFI_ENABLE_SYMVERS diff --git a/configure.host b/configure.host index 9a72cda..f23716f 100644 --- a/configure.host +++ b/configure.host @@ -6,9 +6,11 @@ # THIS TABLE IS SORTED. KEEP IT THAT WAY. # Most of the time we can define all the variables all at once... case "${host}" in - aarch64*-*-cygwin* | aarch64*-*-mingw* | aarch64*-*-win* ) + aarch64*-*-cygwin* | aarch64*-*-msys* | aarch64*-*-mingw* | aarch64*-*-win* ) TARGET=ARM_WIN64; TARGETDIR=aarch64 - MSVC=1 + if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then + MSVC=1 + fi ;; aarch64*-*-*) @@ -28,9 +30,11 @@ case "${host}" in SOURCES="ffi.c arcompact.S" ;; - arm*-*-cygwin* | arm*-*-mingw* | arm*-*-win* ) + arm*-*-cygwin* | arm*-*-msys* | arm*-*-mingw* | arm*-*-win* ) TARGET=ARM_WIN32; TARGETDIR=arm - MSVC=1 + if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then + MSVC=1 + fi ;; arm*-*-*) @@ -53,6 +57,11 @@ case "${host}" in SOURCES="ffi.c sysv.S" ;; + csky-*-*) + TARGET=CSKY; TARGETDIR=csky + SOURCES="ffi.c sysv.S" + ;; + frv-*-*) TARGET=FRV; TARGETDIR=frv SOURCES="ffi.c eabi.S" @@ -74,8 +83,8 @@ case "${host}" in TARGET=X86_FREEBSD; TARGETDIR=x86 ;; - i?86-*-cygwin* | i?86-*-mingw* | i?86-*-win* | i?86-*-os2* | i?86-*-interix* \ - | x86_64-*-cygwin* | x86_64-*-mingw* | x86_64-*-win* ) + i?86-*-cygwin* | i?86-*-msys* | i?86-*-mingw* | i?86-*-win* | i?86-*-os2* | i?86-*-interix* \ + | x86_64-*-cygwin* | x86_64-*-msys* | x86_64-*-mingw* | x86_64-*-win* ) TARGETDIR=x86 if test $ac_cv_sizeof_size_t = 4; then TARGET=X86_WIN32 @@ -108,22 +117,14 @@ case "${host}" in i?86-*-* | x86_64-*-* | amd64-*) TARGETDIR=x86 if test $ac_cv_sizeof_size_t = 4; then - case "$host" in - x86_64-*x32|x86_64-x32-*) - TARGET_X32=yes - TARGET=X86_64 - ;; - *) - echo 'int foo (void) { return __x86_64__; }' > conftest.c - if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then - TARGET_X32=yes - TARGET=X86_64 - else - TARGET=X86; - fi - rm -f conftest.* - ;; - esac + echo 'int foo (void) { return __x86_64__; }' > conftest.c + if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then + TARGET_X32=yes + TARGET=X86_64 + else + TARGET=X86; + fi + rm -f conftest.* else TARGET=X86_64; fi @@ -134,6 +135,16 @@ case "${host}" in SOURCES="ffi.c unix.S" ;; + kvx-*-*) + TARGET=KVX; TARGETDIR=kvx + SOURCES="ffi.c sysv.S" + ;; + + loongarch64-*-*) + TARGET=LOONGARCH64; TARGETDIR=loongarch64 + SOURCES="ffi.c sysv.S" + ;; + m32r*-*-*) TARGET=M32R; TARGETDIR=m32r SOURCES="ffi.c sysv.S" @@ -167,7 +178,7 @@ case "${host}" in mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) TARGET=MIPS; TARGETDIR=mips ;; - mips*-*linux* | mips*-*-openbsd*) + mips*-*linux* | mips*-*-openbsd* | mips*-*-freebsd*) # Support 128-bit long double for NewABI. HAVE_LONG_DOUBLE='defined(__mips64)' TARGET=MIPS; TARGETDIR=mips @@ -190,6 +201,9 @@ case "${host}" in powerpc-*-amigaos*) TARGET=POWERPC; TARGETDIR=powerpc ;; + powerpc-*-eabi*) + TARGET=POWERPC; TARGETDIR=powerpc + ;; powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc ;; @@ -198,12 +212,18 @@ case "${host}" in ;; powerpc-*-aix* | rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc + # Create AIX-style "FAT" libraries. + tmake_file="t-aix" ;; powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*) TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc HAVE_LONG_DOUBLE_VARIANT=1 ;; - powerpc64-*-freebsd*) + powerpcspe-*-freebsd*) + TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc + CFLAGS="$CFLAGS -D__NO_FPRS__" + ;; + powerpc64-*-freebsd* | powerpc64le-*-freebsd*) TARGET=POWERPC; TARGETDIR=powerpc ;; powerpc*-*-rtems*) @@ -253,10 +273,18 @@ esac # ... but some of the cases above share configury. case "${TARGET}" in ARM_WIN32) - SOURCES="ffi.c sysv_msvc_arm32.S" + if test "$MSVC" = 1; then + SOURCES="ffi.c sysv_msvc_arm32.S" + else + SOURCES="ffi.c sysv.S" + fi ;; ARM_WIN64) - SOURCES="ffi.c win64_armasm.S" + if test "$MSVC" = 1; then + SOURCES="ffi.c win64_armasm.S" + else + SOURCES="ffi.c sysv.S" + fi ;; MIPS) SOURCES="ffi.c o32.S n32.S" diff --git a/debian/changelog b/debian/changelog index 4d79a44..a5c1aac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libffi (3.4.4-ok1) yangtze; urgency=medium + + * New upstream version 3.4.4 + + -- zhouganqing Mon, 09 Jan 2023 14:29:07 +0800 + libffi (3.3-ok1) yangtze; urgency=medium * Build for openKylin. diff --git a/debian/patches/no-toolexeclibdir.diff b/debian/patches/no-toolexeclibdir.diff new file mode 100644 index 0000000..b682bdb --- /dev/null +++ b/debian/patches/no-toolexeclibdir.diff @@ -0,0 +1,25 @@ +From: Debian GCC Maintainers +Date: Sat, 14 May 2022 00:48:30 +0800 +Subject: no-toolexeclibdir + +--- + libffi.pc.in | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/libffi.pc.in b/libffi.pc.in +index 6fad83b..9bd7704 100644 +--- a/libffi.pc.in ++++ b/libffi.pc.in +@@ -1,11 +1,10 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ + libdir=@libdir@ +-toolexeclibdir=@toolexeclibdir@ + includedir=@includedir@ + + Name: @PACKAGE_NAME@ + Description: Library supporting Foreign Function Interfaces + Version: @PACKAGE_VERSION@ +-Libs: -L${toolexeclibdir} -lffi ++Libs: -lffi + Cflags: -I${includedir} diff --git a/debian/patches/powerpc-fix-2.diff b/debian/patches/powerpc-fix-2.diff new file mode 100644 index 0000000..f0eee99 --- /dev/null +++ b/debian/patches/powerpc-fix-2.diff @@ -0,0 +1,50 @@ +From: Samuel Holland +Date: Fri, 21 Feb 2020 21:06:15 -0600 +Subject: [PATCH] Update powerpc sysv assembly for ffi_powerpc.h changes + (#541) + +Some of the flag bits were moved when adding powerpc64 vector support. + +Fixes #536 +--- + src/powerpc/sysv.S | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/src/powerpc/sysv.S b/src/powerpc/sysv.S +index 1474ce7..df97734 100644 +--- a/src/powerpc/sysv.S ++++ b/src/powerpc/sysv.S +@@ -104,17 +104,16 @@ ENTRY(ffi_call_SYSV) + bctrl + + /* Now, deal with the return value. */ +- mtcrf 0x01,%r31 /* cr7 */ ++ mtcrf 0x03,%r31 /* cr6-cr7 */ + bt- 31,L(small_struct_return_value) + bt- 30,L(done_return_value) + #ifndef __NO_FPRS__ + bt- 29,L(fp_return_value) + #endif + stw %r3,0(%r30) +- bf+ 28,L(done_return_value) ++ bf+ 27,L(done_return_value) + stw %r4,4(%r30) +- mtcrf 0x02,%r31 /* cr6 */ +- bf 27,L(done_return_value) ++ bf 26,L(done_return_value) + stw %r5,8(%r30) + stw %r6,12(%r30) + /* Fall through... */ +@@ -145,10 +144,9 @@ L(done_return_value): + #ifndef __NO_FPRS__ + L(fp_return_value): + .cfi_restore_state +- bf 28,L(float_return_value) ++ bf 27,L(float_return_value) + stfd %f1,0(%r30) +- mtcrf 0x02,%r31 /* cr6 */ +- bf 27,L(done_return_value) ++ bf 26,L(done_return_value) + stfd %f2,8(%r30) + b L(done_return_value) + L(float_return_value): diff --git a/debian/patches/powerpc-fix.diff b/debian/patches/powerpc-fix.diff new file mode 100644 index 0000000..075d24d --- /dev/null +++ b/debian/patches/powerpc-fix.diff @@ -0,0 +1,21 @@ +From: Debian GCC Maintainers +Date: Sat, 14 May 2022 00:48:30 +0800 +Subject: powerpc-fix + +--- + src/powerpc/ffi_powerpc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h +index 5ee2a70..8e2f2f0 100644 +--- a/src/powerpc/ffi_powerpc.h ++++ b/src/powerpc/ffi_powerpc.h +@@ -62,7 +62,7 @@ typedef _Float128 float128; + #elif defined(__FLOAT128__) + typedef __float128 float128; + #else +-typedef __int128 float128; ++typedef char float128[16] __attribute__((aligned(16))); + #endif + + void FFI_HIDDEN ffi_closure_SYSV (void); diff --git a/debian/patches/powerpc64-fix-2.diff b/debian/patches/powerpc64-fix-2.diff new file mode 100644 index 0000000..2e9d480 --- /dev/null +++ b/debian/patches/powerpc64-fix-2.diff @@ -0,0 +1,36 @@ +From: Debian GCC Maintainers +Date: Sat, 14 May 2022 00:48:30 +0800 +Subject: powerpc64-fix-2 + +--- + src/powerpc/ffi_linux64.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c +index 7364770..4d50878 100644 +--- a/src/powerpc/ffi_linux64.c ++++ b/src/powerpc/ffi_linux64.c +@@ -680,9 +680,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) + { + if (vecarg_count < NUM_VEC_ARG_REGISTERS64 + && i < nfixedargs) +- *vec_base.f128++ = *arg.f128++; ++ memcpy (vec_base.f128++, arg.f128, sizeof (float128)); + else +- *next_arg.f128 = *arg.f128++; ++ memcpy (next_arg.f128, arg.f128++, sizeof (float128)); + if (++next_arg.f128 == gpr_end.f128) + next_arg.f128 = rest.f128; + vecarg_count++; +@@ -986,9 +986,9 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif, + do + { + if (pvec < end_pvec && i < nfixedargs) +- *to.f128 = *pvec++; ++ memcpy (to.f128, pvec++, sizeof (float128)); + else +- *to.f128 = *from.f128; ++ memcpy (to.f128, from.f128, sizeof (float128)); + to.f128++; + from.f128++; + } diff --git a/debian/patches/powerpc64-fix.diff b/debian/patches/powerpc64-fix.diff new file mode 100644 index 0000000..2a2bc8b --- /dev/null +++ b/debian/patches/powerpc64-fix.diff @@ -0,0 +1,24 @@ +From: Debian GCC Maintainers +Date: Sat, 14 May 2022 00:48:30 +0800 +Subject: powerpc64-fix + +--- + src/powerpc/ffi_linux64.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c +index de0d033..7364770 100644 +--- a/src/powerpc/ffi_linux64.c ++++ b/src/powerpc/ffi_linux64.c +@@ -547,9 +547,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) + if (next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs) +- *vec_base.f128++ = **p_argv.f128; ++ memcpy (vec_base.f128++, *p_argv.f128, sizeof (float128)); + else +- *next_arg.f128 = **p_argv.f128; ++ memcpy (next_arg.f128, *p_argv.f128, sizeof (float128)); + if (++next_arg.f128 == gpr_end.f128) + next_arg.f128 = rest.f128; + vecarg_count++; diff --git a/depcomp b/depcomp index 65cbf70..715e343 100755 --- a/depcomp +++ b/depcomp @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/doc/Makefile.in b/doc/Makefile.in index dcee846..bccd187 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,7 +91,6 @@ target_triplet = @target@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cc_maxopt.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ @@ -100,6 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ $(top_srcdir)/m4/ax_enable_builddir.m4 \ $(top_srcdir)/m4/ax_gcc_archflag.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ + $(top_srcdir)/m4/ax_prepend_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ @@ -220,8 +220,9 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -236,9 +237,11 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@ @@ -277,6 +280,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ +READELF = @READELF@ SECTION_LDFLAGS = @SECTION_LDFLAGS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -332,6 +336,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -342,6 +347,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +tmake_file = @tmake_file@ toolexecdir = @toolexecdir@ toolexeclibdir = @toolexeclibdir@ top_build_prefix = @top_build_prefix@ @@ -554,7 +560,6 @@ ctags CTAGS: cscope cscopelist: - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/doc/libffi.info b/doc/libffi.info index afd17e7..6b9580a 100644 --- a/doc/libffi.info +++ b/doc/libffi.info @@ -1,9 +1,9 @@ -This is libffi.info, produced by makeinfo version 6.6 from libffi.texi. +This is libffi.info, produced by makeinfo version 6.8 from libffi.texi. This manual is for libffi, a portable foreign function interface library. - Copyright (C) 2008-2019 Anthony Green and Red Hat, Inc. + Copyright (C) 2008-2019, 2021, 2022 Anthony Green and Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -38,7 +38,7 @@ libffi This manual is for libffi, a portable foreign function interface library. - Copyright (C) 2008-2019 Anthony Green and Red Hat, Inc. + Copyright (C) 2008-2019, 2021, 2022 Anthony Green and Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -63,6 +63,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Introduction:: What is libffi? * Using libffi:: How to use libffi. +* Memory Usage:: Where memory for closures comes from. * Missing Features:: Things libffi can't do. * Index:: Index. @@ -84,7 +85,7 @@ is found. The calling convention is also sometimes called the "ABI" or Some programs may not know at the time of compilation what arguments are to be passed to a function. For instance, an interpreter may be told at run-time about the number and types of arguments used to call a -given function. 'Libffi' can be used in such programs to provide a +given function. 'libffi' can be used in such programs to provide a bridge from the interpreter program to compiled code. The 'libffi' library provides a portable, high level programming @@ -100,7 +101,7 @@ fully featured foreign function interface. A layer must exist above languages.  -File: libffi.info, Node: Using libffi, Next: Missing Features, Prev: Introduction, Up: Top +File: libffi.info, Node: Using libffi, Next: Memory Usage, Prev: Introduction, Up: Top 2 Using libffi ************** @@ -121,7 +122,7 @@ File: libffi.info, Node: The Basics, Next: Simple Example, Up: Using libffi 2.1 The Basics ============== -'Libffi' assumes that you have a pointer to the function you wish to +'libffi' assumes that you have a pointer to the function you wish to call and that you know the number and types of arguments to pass it, as well as the return type of the function. @@ -167,6 +168,11 @@ prepare a call interface object, use the function 'ffi_prep_cif'. NTOTALARGS the total number of arguments, including variadic and fixed arguments. ARGTYPES must have this many elements. + 'ffi_prep_cif_var' will return 'FFI_BAD_ARGTYPE' if any of the + variable argument types are 'ffi_type_float' (promote to + 'ffi_type_double' first), or any integer type small than an int + (promote to an int-sized type first). + Note that, different cif's must be prepped for calls to the same function when different numbers of arguments are passed. @@ -207,9 +213,7 @@ function: AVALUES is a vector of 'void *' pointers that point to the memory locations holding the argument values for a call. If CIF declares that the function has no arguments (i.e., NARGS was 0), then - AVALUES is ignored. Note that argument values may be modified by - the callee (for instance, structs passed by value); the burden of - copying pass-by-value arguments is placed on the caller. + AVALUES is ignored. Note that while the return value must be register-sized, arguments should exactly match their declared type. For example, if an @@ -910,9 +914,46 @@ program. affected type is 'long double'.  -File: libffi.info, Node: Missing Features, Next: Index, Prev: Using libffi, Up: Top +File: libffi.info, Node: Memory Usage, Next: Missing Features, Prev: Using libffi, Up: Top -3 Missing Features +3 Memory Usage +************** + +Note that memory allocated by 'ffi_closure_alloc' and freed by +'ffi_closure_free' does not come from the same general pool of memory +that 'malloc' and 'free' use. To accomodate security settings, 'libffi' +may aquire memory, for example, by mapping temporary files into multiple +places in the address space (once to write out the closure, a second to +execute it). The search follows this list, using the first that works: + + * A anonymous mapping (i.e. not file-backed) + + * 'memfd_create()', if the kernel supports it. + + * A file created in the directory referenced by the environment + variable 'LIBFFI_TMPDIR'. + + * Likewise for the environment variable 'TMPDIR'. + + * A file created in '/tmp'. + + * A file created in '/var/tmp'. + + * A file created in '/dev/shm'. + + * A file created in the user's home directory ('$HOME'). + + * A file created in any directory listed in '/etc/mtab'. + + * A file created in any directory listed in '/proc/mounts'. + + If security settings prohibit using any of these for closures, +'ffi_closure_alloc' will fail. + + +File: libffi.info, Node: Missing Features, Next: Index, Prev: Memory Usage, Up: Top + +4 Missing Features ****************** 'libffi' is missing a few features. We welcome patches to add support @@ -926,9 +967,6 @@ for these. * The Go API is undocumented. - Note that variadic support is very new and tested on a relatively -small number of platforms. -  File: libffi.info, Node: Index, Prev: Missing Features, Up: Top @@ -945,7 +983,7 @@ Index * closure API: The Closure API. (line 13) * closures: The Closure API. (line 13) * FFI: Introduction. (line 31) -* ffi_call: The Basics. (line 67) +* ffi_call: The Basics. (line 72) * FFI_CLOSURES: The Closure API. (line 13) * ffi_closure_alloc: The Closure API. (line 19) * ffi_closure_free: The Closure API. (line 26) @@ -986,31 +1024,37 @@ Index * ffi_type_ushort: Primitive Types. (line 53) * ffi_type_void: Primitive Types. (line 10) * Foreign Function Interface: Introduction. (line 31) -* void: The Basics. (line 67) +* void: The Basics. (line 72) * void <1>: The Closure API. (line 19) * void <2>: The Closure API. (line 26)  Tag Table: -Node: Top1388 -Node: Introduction2841 -Node: Using libffi4473 -Node: The Basics5006 -Node: Simple Example9870 -Node: Types10901 -Node: Primitive Types11412 -Node: Structures13533 -Node: Size and Alignment14572 -Node: Arrays Unions Enums16769 -Node: Type Example19698 -Node: Complex20989 -Node: Complex Type Example22407 -Node: Multiple ABIs25459 -Node: The Closure API25830 -Node: Closure Example29656 -Node: Thread Safety31288 -Node: Missing Features32089 -Node: Index32551 +Node: Top1400 +Node: Introduction2935 +Node: Using libffi4567 +Node: The Basics5096 +Node: Simple Example10024 +Node: Types11055 +Node: Primitive Types11566 +Node: Structures13687 +Node: Size and Alignment14726 +Node: Arrays Unions Enums16923 +Node: Type Example19852 +Node: Complex21143 +Node: Complex Type Example22561 +Node: Multiple ABIs25613 +Node: The Closure API25984 +Node: Closure Example29810 +Node: Thread Safety31442 +Node: Memory Usage32243 +Node: Missing Features33438 +Node: Index33803  End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/doc/libffi.pdf b/doc/libffi.pdf index 8aa035fe934dcb23290bd5957e1b62ea8ecb4494..0831f17a7fc2928ece1efee68fa1b9ac3fe8c456 100644 GIT binary patch delta 47212 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 z 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

bdb|ucvia#>{g>~VXa@FDtMc)uCv3n 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

0lk;|=(iP8VU~m7j#OJ(``@j9$TNly zEGNJ1&(TqFlCLj1jdAedSsc+JEO{zg&Q3Q6zV+qrfOE9Gz`xXQh$_3jYCljOf((qR*GeYP={672IZ4)CX`M3Zg|tK-SsS; z3PLCJ9#j7UJWzY|3(XY*Pf#1^8EudZZq*OOBs>N*K)X{+&|iAmlxkHk^|012UO&q$ znF6ReTtF4&w*tn%vu&BT&gpvT-UK0mzCP%0G!*}MX252!SO*856}_~tHB36q4W?u9 ze)D^1#>)-7g+>t{`0*32cc+7TU<%c(VFpGqjRZ(^fMN?6?LR_>rfSZBJ_iHl-kHx~8v7>Frtm3L z`ha)TCwEH{Oj06rA-lMg4;wH}xIyIV{ChY#$5!fbGQ<;BKXLalyhX?xa5{o0YY zr!icg%Qea>xZ*#eBF{z3{QBQ@9jaJ@mix(7@sPZYP@}S(N6sbW`!grypWXcijWFRT z_AUIczk71eb0KxJZ89r;Cu;#W*j>z@FY~DoA#*GSn$9=34ms%S?qYmgRV)?kcQ1aQ zI4BphtgK@foAE^CL*kDK>3$JkV5qMsko`^xaAb^`kSgRHHJ@?VY9<2(wLZ;r&kBl$ z4Jg{K)y3Y7vq@nh68(W`vgM@_62Dh1e+(~vX`Z!YuNhtNX=^No{d3tB6jW8fyxNadPuL+>HAO1!;uiCmjxvx zyC{8P*IbjYNng&&-y)KOH0H*X_p%_Dsp_m6t<}-Nim8p;i&E-M3zV+ydThNdM5I3K z0zI{WT?>M`z6h#}<$8Oo+)mYx7BSSNNYDAe?np*ju1m}l%PPM%)-gFdG0s0GpE*ZK z9v`U<@YIUf$T;R1F1~3sN|XMaM%w!=VEbqtwR{r~_BpQh<0dmTK@vgIiQ$Cpr?P;M zO*0@)H=|8bQXsPE0CdD~HQiF`NUbr%pyxlyU}l`ZW_Plr3h}q;aCUXoX{*uSUSR9GcMh{=QdN=#iPaj9MQhfLa42%N zTJFw450+T@Kdt9vq*G~A58P}aZWzj!goro}2@5_~i^;$C(AU+bZ?fW`z9fRGnnQ^$gVIPsHinpk;d(a{Sf#ei?F?2zz3Xq<_bM*_WguKn)s)q0#I(MLM<$|^(1g;CSRgzu$@5QZ96_D>C|-fH@hi=zTio*!~U6d-(3 zkzXK7CZ7<44Jab9SXAC~@>pTuER!cc;MIhvFb(lfOTe=YG`mVlEvg)f%(r1?*yWXUK47>y8wNnt-*uSgOdj3XG;I-QGY+ zd}-fq$v4I4i5_Lf)Fux71tXi1VchJyx*giiAe)_wBwX0JBF%JUA{Va4_ zSwqrhwX)r}Yx>;#>*9K27n9s)t|P?8YN_{6wF~1NP$YdTTK*EPsHiXw-fb+USZ1u< z1hZP>1tM{LoUzpNFYMCNa?$?P!B;y=OziPf8SbXdCvW1j3Cfy6M&Zr4Y~IV2y*kv2 zy7p)bI&uC(OPA=-LSBvmq@?^Th}Kh)@m{53Y@zBS+LZ7fbx!>I3hfY2i}z;AZ6j%{ zJkMqr(#vCAviqDmmp_9icI06aCZ<+`yW{tlE0WYWO1h zkKWt#=r~Qt*9>=P3->uK@k#9x(VF2E^&ye{8xZxkd{gc&lJzz5i#fnR7(jPxlmuZF zm7%2-bo90J6(24Wh_e~}gXMu4VFafvq*<@lZ;duPSxN4zlP$ zoYpH2mvIaT$M8wr;vpJiRYi{?AOF`-*P1@2wvBWRw(g;TbKt6}kQ=A0 zXQek@gls(!elzvc|0CkPo@qeoiFX7CXR%zebIyzr?E<=s(DA}OAtG1m1zyFP4JoWF z@;K>Kp&XWorn9Vg=n{Ub-|jD;(Xb+sd*W_{abTlxB>3H`)k*Va>F00%xxdK+wO!@- zMmEwyo`vX=j!86yS~siISiqs5DVtGDnGHIbOGR-&%un#lj`>Bwg?A9ib*w*LeMOw) z56_)!{eM`gxoA3yW3E~Sw_;k-fFzG_dT|AHujHfwqF3r!1l3^f^-Ga0wGSb-M?IPv zg*?aU-vZV+e;EuDf_CdZKkW5+H})qc4RY(xNTF2Xlf|hRBKse(Z_^+G2y-K=7Y&!E zTOw(Ia{uzl;IM0x6LqTV!gsWf8$1TOIaB0jXfL%qmz@e9c4tA4HY8#pW|e#?>6u@9 zvg(pG2;px7PFJ^!h2s(ZcU)EO3OJIu6(qXlO3m^Y+t*Pgy8W92MNeUkX8YnDTFzS8 zU;mN4a5*)55tzl6n27Ji#(Y0t)At+7N1o__$pka)y`nuebE^%ZF34k&YbR5M7Z+S; ztqcD~yGMwC-0adn1TrCuTv(MdL!dOCOZyq(x z+dsG3u7xKq)p;?SeWf~X=b72URG$;z@+n8(n)Ri}<1AGJN?*-JEsJ8-N`RFQmdwaN zik$weW(v&r33ev0WjiTKQLU0{`Dge)M7n)(7R{&2R7(eoRbDB@Jf>ja{7K?unQDt< z=j>MVgz8IM)?$p+hQbl13Y`MMeO@@KE%nj-bh&5R?wGCJB%ynTiWwvU>CH}`)y ze}Lq=&9(N!qFx>JA1*N-BQq?rhl{GIFUf9j$2&TR-Tw+alMj_+$q1Fr8I@dv+0T;f zXt`?!mOwgoniLiC^43qOl(`@nuqEU)yLS$q=I5mvDM@a5Hm~L1OdCHfCB9yfy++T^ z3C$kTJc>Cuf_^6|DAcb!PTcDPduS@=#j0N9+J6gI&=$NOwRP^)2IoQ0qlpWMy zdXBKvV)xo?d`-(L8jTsQxP3_=2v2AgM7zo9>MhhtpN`{Z+>3-dJar~<8Zn5N^=men z^3Lzs>N&0Vnz>{&F3DCV7HUTl|AaE=Lg+v7Brsbkvd#vkmSC#Y{5Vhmg1lw6#F!ow z*cx>P{{@Q9xaT7L=vSADnwZsT0k>BR@vbO0x%5;wtGU)xz|k>bua zJG#lw*(49ISm)zI;0#hKHa_7Y#G0u0)L_QCNPDCuhJsHMx~sn+Y*B(V6nnCr#O`7c%ru z&R8JYrDB3zmFKi%HufPwEu6EFrD;VXTUTv|cq8?oYu{$+IMBNUi=N||+b@%38EL%d zfJ%M3$kxC(FhzeJ2>CrK)BY(TIHvug3$iIa(cnj?0DE_a?4<7!V(KC$C}*0^4UU!Q zVeX%~)qeEwGLgrMk&z zZPi{&98r{op{=BTLO&e^+R@&KG=WAbxJneIVB$;Ba@x5N@C#iexWaVa@eyK*O;_&1 zlh18)r5vS2Z2QvjrPtnm^J^Q5xEPVe`-BgK&_U!R2B#2z%yk|~9rE5Nq%&$*#xA$< z(Yh?KmCh9_qC7_FAFUZKPb1ha+T%-YJaN=mqQMq6oT*NN<)pAloOE~CvPaesqD5I4 z%}~}txjUB)Y+EEL@S3`yl7)3Xt}vRC+VDOi;g86A3l^Si=%*f7J;eNojAQsv&-7>7 zNDl_YU%cZT%F0ZB1OP3{4WE&~x1?G6KF(^zScC^HKeaA6O_M1t^FmP+y>6x5Pkx#h z_OYV6HaQ>0f9oJGfg#$Ty($e#@#RK{RYaO2drd(HmPGJATwgM%lm&ChP$)|?!V4{S zD843PFLcCa^mHEltWQ+_6->zct4T+6%7xG(X?(?KWm<^%(64^uJAS^i4$aS|!Zzy< z_4b;4E26rUczzMf%&2~-WBd=yXEz)-?|^#t8!{$r;YBKMGiDcLOZcjMUYTL zZpnl++&!1s^hfmp4>OxuSvS0Y4~F|CaYo??7}T z3@cwB>{+pk&#Q|;-Cc&~V-*mXiWw=VXlS!5(jQ&?qiET!5knB0^YOW=ZXNN0!qHE2 zk{e8KV7((x@ijMqt7 zAl~~#tC%p-me|rjq$10LNB|9DfJyjz;y-HDc<0RR?o3zu%hR-0lyM(6coONRY)bl< zFl!nDtK8q%$fKu9k14lS$BLHcX#hUQ#BQ5=a-KmDl1v$o<+H^qLZAL(*(smvEAkrC zuf@ak8DwYef=}ZBSW;{Qg-!PsGxQuipgny(?*Xx2F%KxU-9IfXn1eupmw|km({~Jm zDj6wA$NXW73-yJ~V=G@`hXhZbYdBoHY&(btYv|~jkv|Ua_Zoth{18Ae+ko$v{j@z0 zSzY(_4Fc5nlX8cZy5v5OBFfjPQLr<>$t=mM*t3>u^!RQ>K}bl{YfW zuuZot1c7Z0n!~c~-EPNzyVcFi9>yz_JtNDIV#= zXs@j=Pea7#z4_WEpwY|jZ`xL%|0Lh9tACoxsD8`ygm6Z`-3acdhjG2&5kiz4ARa|? z=E(#7K*m3;-@RqK>O+%?fl7|uV&q7<&(-?@$;|Zdv;W}sp-=qDyY>Ld2J8p%_I+yb z31amIbX2mHeirsxV@`u!KO6VUx6VGk<%<*W0uX0hB=_da=Fjk`D5*SK4P7S{?!vhN z-ze2n(wS*{3Wrx1Rx1B^uaCAO)^sDeP_lgW`>Yp3$JLm`2SvKIfRE8Ik1~#yPAww> zQLfGMta}FRG3Kd}^^L0G=hE-Euei|yW-*%8Y_HH0H|MTxyE_+LUDQn$=s3YdzdG3A z!)#*&N_u5Qd6C^maU4pDMYJFz^TvDd@SgPy43mexXm!iPS0D%PAPkLSRg87V8!MaF zWh+m&)QeWrKiLxNKw0vQhW!-B3Vp0!!eX!C7u{bgCU%>~d!F~#Sfnn|X0qE&iv%&~ zNzu)C5duflBQ4eazrP0KD*kHxHSTMe5|*Ca!PRjlrB&O456+iwa)I!@OdxYuk^bDV zmnkj1oldQExy(o(aoO-SKZm$ij8ZTYP-S&eGBXgYJ#0(62Etk}Q3t7}re{aWX8S^r z1`J`9F*WD}?$@N#nZ=z!=Kd<)q+v{kf+Q63*FV#7o$pXtg-?ua&gy-XE~Qpc49Z@^ z7J!rN@2Xk)`L6<3zb4*%tLhJNJyeP_wi-RBLE|80;xm zIR3A6G~Ze{S75xEGbviJraOCrI+*Vst-+YEGsMLF9nlB*ujK+(l36NnAGw(mSu9`W z=N;u7Eh(%T$c)oLa1b+f$}no<<3K~;$4{4& zrIdQ8z}}W_^#ywr25T-x!=|iVJoj%`mmFXjNydF6w!kx@J)F?FXKK-oI-M`DnXjuh z&lY`Pn6=Ir9hN8mxxToGo4_9KbyZmEZSsSi9BGNbUKz?{q6ZU1Oj&q2n=paNp zIHt@Tg5a2t&%{an7k|HBnPhZuaor(M650jd?k^bG@W95@?LvTYG?pFV#wK#H%rFKY%6?yu_9eUC#Q(CKQMeuupm-gmM{dNv zUGlv{8+`2Twd#j~F&a{{~3#rk$+G@EX(W- zt5uxQ_*3n?!WE|&JepA`a><(4jrVV-Q~g~OG*v_tXQ#sp+lhc%tY08|nvK zj_0IM+M7WXJw+kHhq$`m0tVt;iV@jSwNk_+>Sz03o3x)q#_LUGbC1`ycaG$eLSl6% ztU#vqp5f_lTH)ivRmrs@Y=Hc0(F{PV;N_V~ht6opd1-KFf1oIC}-S;+Qa zLSoaO#{O71NqHf&Y*|$F*#(mdB~Vk?v`9{+Am_rTX@&S?9=V7Jg!FBnhLKw~fq|7w z`ED`lXVbuOQd$sYfVO?4YRDfVS0NZ*76(j0$Z1LVX2L#^=6m+-i11Ty-qCWSMNbob z=&hEsQlZR7!q1S7r^6Y4hAh-A&#Zk5o$-UoWt##SM)*>^+Ko%lhTY_Wd2ubNTb2JS z&2!&jIF}H=S_FHqc5szvISas`Vw5%L@GQ%BeyXeRkd=fc)$8{dBLhn> z9KAO*2l}9PRG)XIK_xzXx)wddhm{rwLS2`6e~uHU-$-eRoi9bRDg88`-Y&5}Yrf+X zkXx3u@-pKJa=C=FkQt#(O?UaS;>O~2W5ff12tO!P9r8`j&?;iVZi6V6gPoeJxO0%q z463Zd`6y_U)yfL5-j8^WrqBz%zXL_qBa8F1T?1wjjzbpXvL3NX<>W$VGYSh!v}Ieg&NRJHdT;r*ZDpC#OA+>2y_ zFAlO`_f_u=G&>8{NW%8roNT)yrR@ekehE1X4%k| z^8L;_8?!ksJG0okVHrNN>lE$*C-*rwzjoW2klieIvkNtiXmi2vVxj!L_e>&%(faBs zrSWCTq7LxP=u}!80umfEKY;D*v04^Cp1YWY#U;aS{t$YBL}N5axN^rb&!>ckThJW1 z{^HS3qg!2YV`Twgf(>W6=Ww=U|VqryX~wz7H~T8Wncw<2=y1Va{) zk@VmDY>re~Uh}a_Ih>E7rHD|GR0ays6M5^dudOH$NHmJ!T>b^yw4`;w=x>kr#IqH) zY^&j7tB^Bad~KTb_5igH#EpDCViRW1s<@zK<7ZCvIID<%pGiVIay|Y$rDb<6t=`B< zd0zaUt;?HTNoB|q^{vOb`D|n3I#+B!ZX_JM+H#HCgLAp_W`!W9THr-tF>l6GX+EnI zJjlDEJp+*EmaR`??$jE(Dbp4RK=3nuj0v(L_ql|EghEQ8+6AWh+7{49-nsQc;(%jx zyFy-2q$1%MGKi#ue1c&W=5hQWc^*{qPdkW3)2N_wI^fDjE*58eR&KJYf9u@j8(1`DdpD>|x54{3Ys{w;ym!51E^k=n9T*%LxEEch#;f{HQ z@p6Ou;|1#0NuV{3sR3h1^OY^SGxiBvJ=IKP*#Vx&03^R5Gq*MKush%w$__84h5^c9 z_B%=7;yjBx^&3sSFboGuD=3616`_V`0xYM>OnwJM$cALcyaBXcbi6*)@h zr3vD=xM^Gd3HXV>KjL#Zs1U78Hgt>NsRpvsZqk~wA%J^T=h?IJ;@xl;J)9u3+%5S* zS?S5_lT(ydxHozs{8@x6_0O4UCAzCKQe0r5M_XkUT9)`x`=1Pb&I7g5&7OOx^X;s_ zM=0dP6m|`Daqqy@AqkMF3M>#^Zer<%7N2Q+;>k~wE=J?LPh&GW0sL8SJ-Ab5!AHWc zSl$6y1IUe0t}pibOy?uPp2X(8|He~;tYV|=GGRF%C{8Uz!K=bmcPa!tYrJ|xy!}DU zUyri|_2!oaA-1^xz!xk1(Jp$DclZtJBv%{GNUJxaHAJ$YQjz^KF^G!XKe`e6J=TqR z#C5wcOF|W$4Kd}tT+P<8M&7U*(|C*k$TggD3v5!_U92QJ(P;JJRBH9z)ZlxufVcNZ z1kkO7pr_0%FKtWQip*%oO!A8=jVkX#v{L|h;cMGx?a+J?xF8vfi?vha97bImZlRs4 zcjN5AQkS3TgR7rQZ-YE(Rl3WpmaM{qW?W71(Pic+Z<7ZiuJ1P|JZwfc5zpmrk7>7P zfU(U1Mt+qwQ^w-X`^a52B=z&Tokv3kC8sP#Xw`!3Ak55gAYOrIUX=7@MnKm5F!gl$}k<6aPXj_B9ZDkLR!3buErcb9xcu$m$?E(d33?dknMeT56$>Fn2JRWDRlcA1Ga!ev1%lIQ;(rf6UVXu2qrG7oWU#537jsbQ@NwIP? zl5$BmMCfI3(?%)V%0 zoJfm+JnNRnlBu~^IDB!&KGU0wNsHh_@{}sECvaxM_r3WAbf-}U(3tA*_V+05}`Wcic)be9ZB=G;4@NghC;7GtnAxkFT=7+LM zAXe}ZhBk|ZrlOw*#OsMhi}?0Q6!C`t4#l-e7)IZ7Y&RQ3AasJzHxU3=VhLJj*@ZeJ z0!n8mTa{2N>L>*Rrs1xb(R3k~ad!n?^wDQ#<-ZF!?Pp>#Lx&p=(r<^)tpARM6f08U zP}U8H8X-OvrH2b}C(b@Y8U*k9CxST~RCqN=@iGq%&JIE4g*LztCWMN>GSb(F3wJLT~x#*JWh#Y zs`aIjTJ{xLlK&+jwmus1v2vGiCYxO}+d(L(W`RNNcMO!{y1Cex7FL<|u(rO7n2xspu0~G8sV>E7@l>>KH`pu((9u@)8ySH8UQJ`)-I38XsY><+TRWui#+7^Y{rUgXeI^l*WFClad z3gEp%2Ivp%FK;W~U19yZNyZj^-i{2OmbayT*xw}*6%atIW!{q&WCka=DGa#d01_qu z-c%7?W*$E|KlAv~`j3BkQL9EEnPRTv-!uT1Id7~DYaa15?eW?CI){mEfI1f7QP>tb zv*0h_|EQwzaGkX?cHTs&#T|Fqh%LlRa4bA1seE=jM|ll7rHq>NR-ggjz_I2Big*ePDlZBVY#I+WcPf z#EB?m4@I^d-tT-X-hrvLK(_*iW&G4%o&Ao`Ub`CFh#tud(QGYOmjG#e9(=k%^Z^M# zKV7fR(^4#&IFJ!`Ck2T3M2^!aO4}3y=4Q)itC_Sr9E{Hu4IDrW)Uhts6RJ*>i z=V{2rTesuXM@uiU;#iM)3fTmeN8-hOLl9IVqAfmbvwrDihAC#nM-D&tKu!cV%AWH1 z{MA;#-yL+$znU7zNIE$n3YCpsi-BNJElois9CWUsRVL7)f?CxJ$u#NW#)eYv_Zd*d4%VH-)jmA(T-OHOc-k4TBDwiyqPbvi}* zo?P2%wAP+Qy%?{8JqP3b_;w;1tKtsv<_pJORF|{LqeqM&kd@A4Gnp%vKE{hCeMdFf z!fZ~wKBqRkacvCo3)SqoQ5PAeqBArwKGWrm3*zy5eC+|gtZdF*@Zzwr9BnL1NJegK z+$89C2Lx>rfJ>vt*2$ZI?><*u96J1EC8l}wLcP4%eLx}33Aj}y9@%st6d=5Zkpxtf-chX)Wz{0S*aN-3f!4k_mtrvpx zIr{aocPC|(9WUTk(F#Wy_uWBhKKBrgRq9^k<~+adEO=L$xbD1D`U31ryq2V=!YA(G zeYyV{R*iKIa4f8eiTF4?_M%dttVmdnuhi&>+_w;D)LMj!f-sw%Nel!g$;glx}s&#h0l0=h%i!YtEWx~ll6kSBF|h&-Q#>*D9+cH;+&#JBSc zBpRuJWctAiqrhtVChJTl@qj6_2`<06fC`q9cP#Bc@g0)o@D4&`p-Ot&|AjsOu=3c^hhME|WGN>h|$Dr}|eCH4Rq?H%Ob1l1DU+K1%iu7v9DUl#b0=BIc>fDP77 z3+1gLgcK-FADOd_5w8<_b6O<|NEeXEyy7^G%R%pblw9g-qqwqi=J~B8WTuP2~LK zxWws+Flr}xbejf3_P7XF>ypGP7FxE&&*)zHon+o4Qt*|6zx&xtWP^F`may?!Hkl$e z`Cz7HXS+PQcl1$~l~rYvIV{9uAn+mDu^{I;2pwYjWWPwj)sIu#aK)ta7hX@u6Qcs_ zZYwX+G=%h+Zy)TFAy815HuElv-ZxU>x6v^+_hOH=$RS8Rr*$3alTI4CEH~R?=KH3Z z%V51Nt^N*;&-N>BD?F88pLz>6qV#^wU}T%p2YGXb#$a+?7oMQr_&r~#H&6bt%HsEP zulK$tp45xc#|o(0Z}ji5ZqQ3PDUASL5Z`>?ATXRM5g2u1r8n-MD63$mOq^mjl?iz^ z1I~8X+qSl9Y(j#jeuP&z#IM{lkf4k_YUP_d^1oU9lxS5@{WoB&uY|dmDc?p0%cQp% zbv$d=bWZZ=b@$;Qy!}H`hy$KVRwR6*(WHTjU^wv^t@oO>celEJXQ*wXx;7S=b~wnJ zCfI^ete1d{-*aJ1ebn}+>h|i-Xupctbp4JE?2qrLk(I;+=1?miVVnQJH*WMC1>36z zs4)T_ngj^M{?&;VP2F3k9NW6e>k*yfpKK3E5Y%wtY|>Ty>E8%se#&P4F@W<1?Zaxc z-rQ7QT@#ZThh+aG*5l809#~lejC%@o$CsJ=fWFhIwphn!G+sGP!Ov)sa&nGYzn9d@ zgT69-$UZ5`1aD;C&UcfX)wD#PZa6015Mh6XMFge%)|=me@Y&CHnM14FK!hqw!CgOL z$k%#Ksrvqb>>BIc>WMs-PiXe@xYs!(0;;DAA!!R|g%gByiqSTr_ZFZF9Hz#b6;tB78YQii+s!1uE`g7Lg~cER#dhcp3Bts;(F{ua9ZNsEB7rg-wiCo(1UIH;27jS& ze05R7UG%bTli=2$%tfQ|nxLDg-<`5NGS+|c`!L|H&Z7?bvdR)VT8UyfBwRlN-zFug zLVL-5t$vpjWOz++MR?Nz*Bbs%*gYuV^&-MxOYr0?EC{S7-u#ZDXXA3v8@;$rm@g}J+-n#fR? z#nLY#j;};8v6QO5bqx7tvU5tmwD5lKq8vm_b&0AA0Q-5HKMFR!oMIbjPJ#??{POi*95{5>>ixAsp00N2A} zu&VaxrR<;9n$uP=$yIDc|5$O*KS%yI^;jndNEip>&|i_TV8pY`d+{IWIxj~WRu%*R z$jZxUfWWL~?PdPOLgz$a)&l6U0@wkpUrtqfdzUXK8-N9%iopEc&cgo7V*jrt0nihW zVB--N6J?haXJL_)l#=3gsG?ch71^%a*>D7!2v;S8NeSyHXLpD$RNr(-mwP0&V*C^5Eobc^}DBaDV^ z`qed@?MjiLNWJs^CB%D}%ReLFeqld3`7vI-`Q!K;A4Dr>kzrg@<0pN}U!e5xPyDNO zR~tkzfp2CT&jq{m8@}>~>yXDL%;+kxmEd81xmRi(d{w-I7^M%pJWN-|k1AIcR$&%! zY82fpwTh%?!p|`Q0~~T8_?9oJ>4k2?4?wN)v5%<4T>r7JR9`~G=bvOLI7^wO9b?Ts zc=|9-wKbwkau(>fovialajl0uN*8Bll-&sjn@^GTjvw^S0wLZIqFPN9Y+?vxD=kt^ z-S`?RWFZVNb5M7?G(#FTCZyVi$_`d@z@P5bNe^~*AZF^7ObIO*Lw4se{t>?D3DLi=AyS;J%>!}@{D)4lyN6EFaL|lq!o%bp zKXf}9l|*U}W;YBXXQmVUB+|2ziB0097E)~M#QQo?*@KJid9E#lUDs=_9j>Tg{n+Y} zT%w9ul2~He_{7u*yDP=eD7)KNQ8$>6`?T4R1*MdGB_EU)oj^D2h>JjF3kOT1z=fxM pffntyq*HR=IZD#%&PYP5Oc>Mt, June 1995 # # This program is free software; you can redistribute it and/or modify diff --git a/doc/stamp-vti b/doc/stamp-vti index d9d5094..6056fad 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 22 November 2019 -@set UPDATED-MONTH November 2019 -@set EDITION 3.3 -@set VERSION 3.3 +@set UPDATED 23 October 2022 +@set UPDATED-MONTH October 2022 +@set EDITION 3.4.4 +@set VERSION 3.4.4 diff --git a/doc/texinfo.tex b/doc/texinfo.tex index ac5c1d9..e48383d 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -1,14 +1,11 @@ % texinfo.tex -- TeX macros to handle Texinfo files. -% +% % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2018-02-12.17} +\def\texinfoversion{2021-04-25.21} % -% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, -% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 -% Free Software Foundation, Inc. +% Copyright 1985, 1986, 1988, 1990-2021 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -36,7 +33,7 @@ % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % -% Send bug reports to bug-texinfo@gnu.org. Please include including a +% Send bug reports to bug-texinfo@gnu.org. Please include a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % @@ -182,7 +179,7 @@ % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script - auto-ma-ti-cal-ly ap-pen-dix bit-map bit-maps + ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces @@ -221,7 +218,7 @@ % @errormsg{MSG}. Do the index-like expansions on MSG, but if things % aren't perfect, it's not the end of the world, being an error message, % after all. -% +% \def\errormsg{\begingroup \indexnofonts \doerrormsg} \def\doerrormsg#1{\errmessage{#1}} @@ -244,17 +241,7 @@ % \def\finalout{\overfullrule=0pt } -% Do @cropmarks to get crop marks. -% -\newif\ifcropmarks -\let\cropmarks = \cropmarkstrue -% -% Dimensions to add cropmarks at corners. -% Added by P. A. MacKay, 12 Nov. 1986 -% \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines -\newdimen\cornerlong \cornerlong=1pc -\newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. @@ -270,8 +257,8 @@ % \domark is called twice inside \chapmacro, to add one % mark before the section break, and one after. -% In the second call \prevchapterdefs is the same as \lastchapterdefs, -% and \prevsectiondefs is the same as \lastsectiondefs. +% In the second call \prevchapterdefs is the same as \currentchapterdefs, +% and \prevsectiondefs is the same as \currentsectiondefs. % Then if the page is not broken at the mark, some of the previous % section appears on the page, and we can get the name of this section % from \firstmark for @everyheadingmarks top. @@ -279,11 +266,11 @@ % % See page 260 of The TeXbook. \def\domark{% - \toks0=\expandafter{\lastchapterdefs}% - \toks2=\expandafter{\lastsectiondefs}% + \toks0=\expandafter{\currentchapterdefs}% + \toks2=\expandafter{\currentsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% - \toks8=\expandafter{\lastcolordefs}% + \toks8=\expandafter{\currentcolordefs}% \mark{% \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom @@ -300,19 +287,19 @@ % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% - \ifcase0\topmark\fi + \ifcase0\the\savedtopmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} -\def\getcolormarks{\ifcase2\topmark\fi} +\def\getcolormarks{\ifcase2\the\savedtopmark\fi} % Avoid "undefined control sequence" errors. -\def\lastchapterdefs{} -\def\lastsectiondefs{} -\def\lastsection{} +\def\currentchapterdefs{} +\def\currentsectiondefs{} +\def\currentsection{} \def\prevchapterdefs{} \def\prevsectiondefs{} -\def\lastcolordefs{} +\def\currentcolordefs{} % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset @@ -322,51 +309,61 @@ % Main output routine. % \chardef\PAGE = 255 -\output = {\onepageout{\pagecontents\PAGE}} +\newtoks\defaultoutput +\defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}} +\output=\expandafter{\the\defaultoutput} \newbox\headlinebox \newbox\footlinebox +% When outputting the double column layout for indices, an output routine +% is run several times, which hides the original value of \topmark. This +% can lead to a page heading being output and duplicating the chapter heading +% of the index. Hence, save the contents of \topmark at the beginning of +% the output routine. The saved contents are valid until we actually +% \shipout a page. +% +% (We used to run a short output routine to actually set \topmark and +% \firstmark to the right values, but if this was called with an empty page +% containing whatsits for writing index entries, the whatsits would be thrown +% away and the index auxiliary file would remain empty.) +% +\newtoks\savedtopmark +\newif\iftopmarksaved +\topmarksavedtrue +\def\savetopmark{% + \iftopmarksaved\else + \global\savedtopmark=\expandafter{\topmark}% + \global\topmarksavedtrue + \fi +} + % \onepageout takes a vbox as an argument. -% \shipout a vbox for a single page, adding an optional header, footer, -% cropmarks, and footnote. This also causes index entries for this page -% to be written to the auxiliary files. +% \shipout a vbox for a single page, adding an optional header, footer +% and footnote. This also causes index entries for this page to be written +% to the auxiliary files. % \def\onepageout#1{% - \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + \hoffset=\normaloffset % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % - % Common context changes for both heading and footing. - % Do this outside of the \shipout so @code etc. will be expanded in - % the headline as they should be, not taken literally (outputting ''code). - \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars} + \checkchapterpage % % Retrieve the information for the headings from the marks in the page, % and call Plain TeX's \makeheadline and \makefootline, which use the % values in \headline and \footline. % - % This is used to check if we are on the first page of a chapter. - \ifcase1\topmark\fi - \let\prevchaptername\thischaptername - \ifcase0\firstmark\fi - \let\curchaptername\thischaptername + % Common context changes for both heading and footing. + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars} % \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi - % - \ifx\curchaptername\prevchaptername - \let\thischapterheading\thischapter - \else - % \thischapterheading is the same as \thischapter except it is blank - % for the first page of a chapter. This is to prevent the chapter name - % being shown twice. - \def\thischapterheading{}% - \fi - % - \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% - \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% + \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}% % {% % Set context for writing to auxiliary files like index files. @@ -374,37 +371,12 @@ % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % - \indexdummies % don't expand commands in the output. - \normalturnoffactive % \ in index entries must not stay \, e.g., if - % the page break happens to be in the middle of an example. - % We don't want .vr (or whatever) entries like this: - % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}} - % "\acronym" won't work when it's read back in; - % it needs to be - % {\code {{\backslashcurfont }acronym} + \atdummies % don't expand commands in the output. + \turnoffactive \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % - \ifcropmarks \vbox to \outervsize\bgroup - \hsize = \outerhsize - \vskip-\topandbottommargin - \vtop to0pt{% - \line{\ewtop\hfil\ewtop}% - \nointerlineskip - \line{% - \vbox{\moveleft\cornerthick\nstop}% - \hfill - \vbox{\moveright\cornerthick\nstop}% - }% - \vss}% - \vskip\topandbottommargin - \line\bgroup - \hfil % center the page within the outer (page) hsize. - \ifodd\pageno\hskip\bindingoffset\fi - \vbox\bgroup - \fi - % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt @@ -415,24 +387,9 @@ \unvbox\footlinebox \fi % - \ifcropmarks - \egroup % end of \vbox\bgroup - \hfil\egroup % end of (centering) \line\bgroup - \vskip\topandbottommargin plus1fill minus1fill - \boxmaxdepth = \cornerthick - \vbox to0pt{\vss - \line{% - \vbox{\moveleft\cornerthick\nsbot}% - \hfill - \vbox{\moveright\cornerthick\nsbot}% - }% - \nointerlineskip - \line{\ewbot\hfil\ewbot}% - }% - \egroup % \vbox from first cropmarks clause - \fi - }% end of \shipout\vbox - }% end of group with \indexdummies + }% + }% + \global\topmarksavedfalse \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } @@ -451,17 +408,22 @@ \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } -% Here are the rules for the cropmarks. Note that they are -% offset so that the space between them is truly \outerhsize or \outervsize -% (P. A. MacKay, 12 November, 1986) -% -\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} -\def\nstop{\vbox - {\hrule height\cornerthick depth\cornerlong width\cornerthick}} -\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} -\def\nsbot{\vbox - {\hrule height\cornerlong depth\cornerthick width\cornerthick}} - +% Check if we are on the first page of a chapter. Used for printing headings. +\newif\ifchapterpage +\def\checkchapterpage{% + % Get the chapter that was current at the end of the last page + \ifcase1\the\savedtopmark\fi + \let\prevchaptername\thischaptername + % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \let\curchaptername\thischaptername + % + \ifx\curchaptername\prevchaptername + \chapterpagefalse + \else + \chapterpagetrue + \fi +} % Argument parsing @@ -487,11 +449,10 @@ }% } -% First remove any @comment, then any @c comment. Also remove a @texinfoc -% comment (see \scanmacro for details). Pass the result on to \argcheckspaces. +% First remove any @comment, then any @c comment. Pass the result on to +% \argcheckspaces. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} -\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm} -\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % @@ -611,9 +572,8 @@ \fi } -% @end foo executes the definition of \Efoo. -% But first, it executes a specialized version of \checkenv -% + +% @end foo calls \checkenv and executes the definition of \Efoo. \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else @@ -1042,6 +1002,14 @@ where each line of input produces a line of output.} \global\everypar = {}% } +% leave vertical mode without cancelling any first paragraph indent +\gdef\imageindent{% + \toks0=\everypar + \everypar={}% + \ptexnoindent + \global\everypar=\toks0 +} + % @refill is a no-op. \let\refill=\relax @@ -1050,7 +1018,7 @@ where each line of input produces a line of output.} \let\setfilename=\comment % @bye. -\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} +\outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend} \message{pdf,} @@ -1092,7 +1060,7 @@ where each line of input produces a line of output.} tex.sprint( string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. string.char(0x5c) .. string.char(0x25) .. '03o', - (c / 256), (c % 256))) + math.floor(c / 256), math.floor(c % 256))) else c = c - 0x10000 local c_hi = c / 1024 + 0xd800 @@ -1102,8 +1070,8 @@ where each line of input produces a line of output.} string.char(0x5c) .. string.char(0x25) .. '03o' .. string.char(0x5c) .. string.char(0x25) .. '03o' .. string.char(0x5c) .. string.char(0x25) .. '03o', - (c_hi / 256), (c_hi % 256), - (c_lo / 256), (c_lo % 256))) + math.floor(c_hi / 256), math.floor(c_hi % 256), + math.floor(c_lo / 256), math.floor(c_lo % 256))) end end end @@ -1116,15 +1084,19 @@ where each line of input produces a line of output.} function PDFescstr(str) for c in string.bytes(str) do if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then - tex.sprint( + tex.sprint(-2, string.format(string.char(0x5c) .. string.char(0x25) .. '03o', c)) else - tex.sprint(string.char(c)) + tex.sprint(-2, string.char(c)) end end end } + % The -2 in the arguments here gives all the input to TeX catcode 12 + % (other) or 10 (space), preventing undefined control sequence errors. See + % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html + % \endgroup \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} \ifnum\luatexversion>84 @@ -1163,11 +1135,60 @@ where each line of input produces a line of output.} \fi \fi +\newif\ifpdforxetex +\pdforxetexfalse +\ifpdf + \pdforxetextrue +\fi +\ifx\XeTeXrevision\thisisundefined\else + \pdforxetextrue +\fi + + +% Output page labels information. +% See PDF reference v.1.7 p.594, section 8.3.1. +\ifpdf +\def\pagelabels{% + \def\title{0 << /P (T-) /S /D >>}% + \edef\roman{\the\romancount << /S /r >>}% + \edef\arabic{\the\arabiccount << /S /D >>}% + % + % Page label ranges must be increasing. Remove any duplicates. + % (There is a slight chance of this being wrong if e.g. there is + % a @contents but no @titlepage, etc.) + % + \ifnum\romancount=0 \def\roman{}\fi + \ifnum\arabiccount=0 \def\title{}% + \else + \ifnum\romancount=\arabiccount \def\roman{}\fi + \fi + % + \ifnum\romancount<\arabiccount + \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax + \else + \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax + \fi +} +\else + \let\pagelabels\relax +\fi + +\newcount\pagecount \pagecount=0 +\newcount\romancount \romancount=0 +\newcount\arabiccount \arabiccount=0 +\ifpdf + \let\ptxadvancepageno\advancepageno + \def\advancepageno{% + \ptxadvancepageno\global\advance\pagecount by 1 + } +\fi + + % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. -% +% % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user % to double the backslashes and otherwise make the string valid, so @@ -1219,7 +1240,7 @@ output) for that.)} % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% - \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } @@ -1227,7 +1248,7 @@ output) for that.)} \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} - \def\lastcolordefs{} + \def\currentcolordefs{} % \def\makefootline{% \baselineskip24pt @@ -1453,7 +1474,13 @@ output) for that.)} % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. + % + % Currently we prefix the section name with the section number + % for chapter and appendix headings only in order to avoid too much + % horizontal space being required in the PDF viewer. \def\numchapentry##1##2##3##4{% + \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\unnchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% @@ -1472,7 +1499,7 @@ output) for that.)} % their "best" equivalent, based on the @documentencoding. Too % much work for too little return. Just use the ASCII equivalents % we use for the index sort strings. - % + % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike @@ -1528,6 +1555,9 @@ output) for that.)} \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} + % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may + % be a simple number, or a list of numbers in the case of an index + % entry. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} @@ -1602,7 +1632,7 @@ output) for that.)} % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% - \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } @@ -1610,7 +1640,7 @@ output) for that.)} \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} - \def\lastcolordefs{} + \def\currentcolordefs{} % \def\makefootline{% \baselineskip24pt @@ -1692,9 +1722,13 @@ output) for that.)} % Therefore, we read toc only once. % % We use node names as destinations. + % + % Currently we prefix the section name with the section number + % for chapter and appendix headings only in order to avoid too much + % horizontal space being required in the PDF viewer. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% - \dopdfoutline{##1}{1}{##3}{##4}}% + \dopdfoutline{##2 ##1}{1}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{2}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% @@ -1706,7 +1740,8 @@ output) for that.)} \let\appsecentry\numsecentry% \let\appsubsecentry\numsubsecentry% \let\appsubsubsecentry\numsubsubsecentry% - \let\unnchapentry\numchapentry% + \def\unnchapentry##1##2##3##4{% + \dopdfoutline{##1}{1}{##3}{##4}}% \let\unnsecentry\numsecentry% \let\unnsubsecentry\numsubsecentry% \let\unnsubsubsecentry\numsubsubsecentry% @@ -1835,19 +1870,23 @@ output) for that.)} \closein 1 \endgroup % - \def\xetexpdfext{pdf}% - \ifx\xeteximgext\xetexpdfext - \XeTeXpdffile "#1".\xeteximgext "" - \else - \def\xetexpdfext{PDF}% + % Putting an \hbox around the image can prevent an over-long line + % after the image. + \hbox\bgroup + \def\xetexpdfext{pdf}% \ifx\xeteximgext\xetexpdfext \XeTeXpdffile "#1".\xeteximgext "" \else - \XeTeXpicfile "#1".\xeteximgext "" + \def\xetexpdfext{PDF}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \XeTeXpicfile "#1".\xeteximgext "" + \fi \fi - \fi - \ifdim \wd0 >0pt width \xeteximagewidth \fi - \ifdim \wd2 >0pt height \xeteximageheight \fi \relax + \ifdim \wd0 >0pt width \xeteximagewidth \fi + \ifdim \wd2 >0pt height \xeteximageheight \fi \relax + \egroup } \fi @@ -2202,7 +2241,7 @@ end % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} -\setfont\defsl\slshape{10}{\magstep1}{OT1TT} +\setfont\defsl\slshape{10}{\magstep1}{OT1} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\ttfont=\deftt \let\bffont = \defbf \let\ttslfont=\defttsl \let\slfont=\defsl \bf} @@ -2350,7 +2389,7 @@ end % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} -\setfont\defsl\slshape{10}{\magstephalf}{OT1TT} +\setfont\defsl\slshape{10}{\magstephalf}{OT1} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\ttfont=\deftt \let\bffont = \defbf \let\slfont=\defsl \let\ttslfont=\defttsl \bf} @@ -2519,7 +2558,7 @@ end \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} -\def\tt{\fam=\ttfam \setfontstyle{tt}} +\def\tt{\fam=\ttfam \setfontstyle{tt}}\def\ttstylename{tt} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. @@ -2645,8 +2684,6 @@ end \definetextfontsizexi -\message{markup,} - % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have @@ -2654,68 +2691,14 @@ end % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } -% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will -% define and register \INITMACRO to be called on markup style changes. -% \INITMACRO can check \currentmarkupstyle for the innermost -% style. - -\let\currentmarkupstyle\empty - -\def\setupmarkupstyle#1{% - \def\currentmarkupstyle{#1}% - \markupstylesetup -} - -\let\markupstylesetup\empty - -\def\defmarkupstylesetup#1{% - \expandafter\def\expandafter\markupstylesetup - \expandafter{\markupstylesetup #1}% - \def#1% -} - -% Markup style setup for left and right quotes. -\defmarkupstylesetup\markupsetuplq{% - \expandafter\let\expandafter \temp - \csname markupsetuplq\currentmarkupstyle\endcsname - \ifx\temp\relax \markupsetuplqdefault \else \temp \fi -} - -\defmarkupstylesetup\markupsetuprq{% - \expandafter\let\expandafter \temp - \csname markupsetuprq\currentmarkupstyle\endcsname - \ifx\temp\relax \markupsetuprqdefault \else \temp \fi -} - { \catcode`\'=\active \catcode`\`=\active -\gdef\markupsetuplqdefault{\let`\lq} -\gdef\markupsetuprqdefault{\let'\rq} - -\gdef\markupsetcodequoteleft{\let`\codequoteleft} -\gdef\markupsetcodequoteright{\let'\codequoteright} +\gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright} +\gdef\setregularquotes{\let`\lq \let'\rq} } -\let\markupsetuplqcode \markupsetcodequoteleft -\let\markupsetuprqcode \markupsetcodequoteright -% -\let\markupsetuplqexample \markupsetcodequoteleft -\let\markupsetuprqexample \markupsetcodequoteright -% -\let\markupsetuplqkbd \markupsetcodequoteleft -\let\markupsetuprqkbd \markupsetcodequoteright -% -\let\markupsetuplqsamp \markupsetcodequoteleft -\let\markupsetuprqsamp \markupsetcodequoteright -% -\let\markupsetuplqverb \markupsetcodequoteleft -\let\markupsetuprqverb \markupsetcodequoteright -% -\let\markupsetuplqverbatim \markupsetcodequoteleft -\let\markupsetuprqverbatim \markupsetcodequoteright - % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it @@ -2753,7 +2736,7 @@ end } % Commands to set the quote options. -% +% \parseargdef\codequoteundirected{% \def\temp{#1}% \ifx\temp\onword @@ -2794,7 +2777,7 @@ end % If we are in a monospaced environment, however, 1) always use \ttsl, % and 2) do not add an italic correction. \def\dosmartslant#1#2{% - \ifusingtt + \ifusingtt {{\ttsl #2}\let\next=\relax}% {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% \next @@ -2873,12 +2856,12 @@ end % @t, explicit typewriter. \def\t#1{% - {\tt \rawbackslash \plainfrenchspacing #1}% + {\tt \plainfrenchspacing #1}% \null } % @samp. -\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} +\def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}} % @indicateurl is \samp, that is, with quotes. \let\indicateurl=\samp @@ -2900,7 +2883,6 @@ end % Turn off hyphenation. \nohyphenation % - \rawbackslash \plainfrenchspacing #1% }% @@ -2922,8 +2904,7 @@ end \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup - \setupmarkupstyle{code}% - % The following should really be moved into \setupmarkupstyle handlers. + \setcodequotes \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash @@ -2942,14 +2923,14 @@ end \gdef\codedash{\futurelet\next\codedashfinish} \gdef\codedashfinish{% \normaldash % always output the dash character itself. - % + % % Now, output a discretionary to allow a line break, unless % (a) the next character is a -, or % (b) the preceding character is a -. % E.g., given --posix, we do not want to allow a break after either -. % Given --foo-bar, we do want to allow a break between the - and the b. \ifx\next\codedash \else - \ifx\codedashprev\codedash + \ifx\codedashprev\codedash \else \discretionary{}{}{}\fi \fi % we need the space after the = for the case when \next itself is a @@ -3011,10 +2992,18 @@ end % arg (if given), and not the url (which is then just the link target). \newif\ifurefurlonlylink +% The default \pretolerance setting stops the penalty inserted in +% \urefallowbreak being a discouragement to line breaking. Set it to +% a negative value for this paragraph only. Hopefully this does not +% conflict with redefinitions of \par done elsewhere. +\def\nopretolerance{% +\pretolerance=-1 +\def\par{\endgraf\pretolerance=100 \let\par\endgraf}% +} + % The main macro is \urefbreak, which allows breaking at expected -% places within the url. (There used to be another version, which -% didn't support automatic breaking.) -\def\urefbreak{\begingroup \urefcatcodes \dourefbreak} +% places within the url. +\def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak % \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} @@ -3031,7 +3020,7 @@ end % For pdfTeX and LuaTeX \ifurefurlonlylink % PDF plus option to not display url, show just arg - \unhbox0 + \unhbox0 \else % PDF, normally display both arg and url for consistency, % visibility, if the pdf is eventually used to print, etc. @@ -3044,7 +3033,7 @@ end % For XeTeX \ifurefurlonlylink % PDF plus option to not display url, show just arg - \unhbox0 + \unhbox0 \else % PDF, normally display both arg and url for consistency, % visibility, if the pdf is eventually used to print, etc. @@ -3069,7 +3058,7 @@ end \urefcatcodes % \global\def\urefcode{\begingroup - \setupmarkupstyle{code}% + \setcodequotes \urefcatcodes \let&\urefcodeamp \let.\urefcodedot @@ -3087,41 +3076,33 @@ end \global\def/{\normalslash} } -% we put a little stretch before and after the breakable chars, to help -% line breaking of long url's. The unequal skips make look better in -% cmtt at least, especially for dots. -\def\urefprestretchamount{.13em} -\def\urefpoststretchamount{.1em} -\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax} -\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax} -% -\def\urefcodeamp{\urefprestretch \&\urefpoststretch} -\def\urefcodedot{\urefprestretch .\urefpoststretch} -\def\urefcodehash{\urefprestretch \#\urefpoststretch} -\def\urefcodequest{\urefprestretch ?\urefpoststretch} +\def\urefcodeamp{\urefprebreak \&\urefpostbreak} +\def\urefcodedot{\urefprebreak .\urefpostbreak} +\def\urefcodehash{\urefprebreak \#\urefpostbreak} +\def\urefcodequest{\urefprebreak ?\urefpostbreak} \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} { \catcode`\/=\active \global\def\urefcodeslashfinish{% - \urefprestretch \slashChar + \urefprebreak \slashChar % Allow line break only after the final / in a sequence of % slashes, to avoid line break between the slashes in http://. - \ifx\next/\else \urefpoststretch \fi + \ifx\next/\else \urefpostbreak \fi } } -% One more complication: by default we'll break after the special -% characters, but some people like to break before the special chars, so -% allow that. Also allow no breaking at all, for manual control. -% +% By default we'll break after the special characters, but some people like to +% break before the special chars, so allow that. Also allow no breaking at +% all, for manual control. +% \parseargdef\urefbreakstyle{% \def\txiarg{#1}% \ifx\txiarg\wordnone \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordbefore - \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} + \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordafter - \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} + \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak} \else \errhelp = \EMsimple \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% @@ -3131,6 +3112,19 @@ end \def\wordbefore{before} \def\wordnone{none} +% Allow a ragged right output to aid breaking long URL's. There can +% be a break at the \allowbreak with no extra glue (if the existing stretch in +% the line is sufficient), a break at the \penalty with extra glue added +% at the end of the line, or no break at all here. +% Changing the value of the penalty and/or the amount of stretch affects how +% preferable one choice is over the other. +\def\urefallowbreak{% + \penalty0\relax + \hskip 0pt plus 2 em\relax + \penalty1000\relax + \hskip 0pt plus -2 em\relax +} + \urefbreakstyle after % @url synonym for @uref, since that's how everyone uses it. @@ -3141,7 +3135,7 @@ end % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} -\ifpdf +\ifpdforxetex \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces @@ -3151,18 +3145,7 @@ end \endlink \endgroup} \else - \ifx\XeTeXrevision\thisisundefined - \let\email=\uref - \else - \def\email#1{\doemail#1,,\finish} - \def\doemail#1,#2,#3\finish{\begingroup - \unsepspaces - \pdfurl{mailto:#1}% - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi - \endlink - \endgroup} - \fi + \let\email=\uref \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), @@ -3196,8 +3179,8 @@ end \def\kbdsub#1#2#3\par{% \def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% - \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi - \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi + \else{\tclose{\kbdfont\setcodequotes\look}}\fi + \else{\tclose{\kbdfont\setcodequotes\look}}\fi } % definition of @key that produces a lozenge. Doesn't adjust to text size. @@ -3214,7 +3197,7 @@ end % monospace, don't change it; that way, we respect @kbdinputstyle. But % if it isn't monospace, then use \tt. % -\def\key#1{{\setupmarkupstyle{key}% +\def\key#1{{\setregularquotes \nohyphenation \ifmonospace\else\tt\fi #1}\null} @@ -3335,10 +3318,33 @@ end \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% +% provide this command from LaTeX as it is very common +\def\frac#1#2{{{#1}\over{#2}}} + +% @displaymath. +% \globaldefs is needed to recognize the end lines in \tex and +% \end tex. Set \thisenv as @end displaymath is seen before @end tex. +{\obeylines +\globaldefs=1 +\envdef\displaymath{% +\tex% +\def\thisenv{\displaymath}% +\begingroup\let\end\displaymathend% +$$% +} + +\def\displaymathend{$$\endgroup\end}% + +\def\Edisplaymath{% +\def\thisenv{\tex}% +\end tex +}} + + % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. -% +% \def\outfmtnametex{tex} % \long\def\inlinefmt#1{\doinlinefmt #1,\finish} @@ -3346,7 +3352,7 @@ end \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } -% +% % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if % FMTNAME is tex, else ELSE-TEXT. \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} @@ -3362,7 +3368,7 @@ end % *right* brace they would have to use a command anyway, so they may as % well use a command to get a left brace too. We could re-use the % delimiter character idea from \verb, but it seems like overkill. -% +% \long\def\inlineraw{\tex \doinlineraw} \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} \def\doinlinerawtwo#1,#2,\finish{% @@ -3539,7 +3545,7 @@ end % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % -\def\pounds{{\it\$}} +\def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik @@ -3639,7 +3645,7 @@ end % for non-CM glyphs. That is ec* for regular text and tc* for the text % companion symbols (LaTeX TS1 encoding). Both are part of the ec % package and follow the same conventions. -% +% \def\ecfont{\etcfont{e}} \def\tcfont{\etcfont{t}} % @@ -3688,11 +3694,19 @@ end \fi % Quotes. -\chardef\quotedblleft="5C -\chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' +% only change font for tt for correct kerning and to avoid using +% \ecfont unless necessary. +\def\quotedblleft{% + \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi +} + +\def\quotedblright{% + \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi +} + \message{page headings,} @@ -3711,7 +3725,7 @@ end after the title page.}}% \def\setshortcontentsaftertitlepage{% \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo - command; move your @shortcontents and @contents commands if you + command; move your @shortcontents and @contents commands if you want the contents after the title page.}}% \parseargdef\shorttitlepage{% @@ -3766,7 +3780,7 @@ end % don't worry much about spacing, ragged right. This should be used % inside a \vbox, and fonts need to be set appropriately first. \par should % be specified before the end of the \vbox, since a vbox is a group. -% +% \def\raggedtitlesettings{% \rm \hyphenpenalty=10000 @@ -3814,12 +3828,19 @@ end \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages +\newtoks\evenchapheadline% headline on even pages with a new chapter +\newtoks\oddchapheadline % headline on odd pages with a new chapter \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make \makeheadline and \makefootline in Plain TeX use those variables -\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline - \else \the\evenheadline \fi}} +\headline={{\textfonts\rm + \ifchapterpage + \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi + \else + \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi + \fi}} + \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax @@ -3835,12 +3856,14 @@ end \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% -\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} + \global\evenchapheadline=\evenheadline} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% -\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}% + \global\oddchapheadline=\oddheadline} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% @@ -3907,37 +3930,34 @@ end \parseargdef\headings{\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination - \evenheadline={\hfil}\evenfootline={\hfil}% - \oddheadline={\hfil}\oddfootline={\hfil}% + \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting \HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. +\def\pageone{ + \global\pageno=1 + \global\arabiccount = \pagecount +} + % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} -\global\let\contentsalignmacro = \chapoddpage +\pageone +\HEADINGSdoublex } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapterheading\hfil\folio}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} -\global\let\contentsalignmacro = \chappager +\pageone +\HEADINGSsinglex } \def\HEADINGSon{\HEADINGSdouble} @@ -3947,7 +3967,9 @@ end \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenchapheadline={\line{\folio\hfil}} +\global\oddchapheadline={\line{\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } @@ -3955,8 +3977,22 @@ end \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapterheading\hfil\folio}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenchapheadline={\line{\hfil\folio}} +\global\oddchapheadline={\line{\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% for @setchapternewpage off +\def\HEADINGSsinglechapoff{% +\pageone +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenchapheadline=\evenheadline +\global\oddchapheadline=\oddheadline \global\let\contentsalignmacro = \chappager } @@ -4265,82 +4301,8 @@ end \doitemize{#1.}\flushcr } -% @alphaenumerate and @capsenumerate are abbreviations for giving an arg -% to @enumerate. -% -\def\alphaenumerate{\enumerate{a}} -\def\capsenumerate{\enumerate{A}} -\def\Ealphaenumerate{\Eenumerate} -\def\Ecapsenumerate{\Eenumerate} - % @multitable macros -% Amy Hendrickson, 8/18/94, 3/6/96 -% -% @multitable ... @end multitable will make as many columns as desired. -% Contents of each column will wrap at width given in preamble. Width -% can be specified either with sample text given in a template line, -% or in percent of \hsize, the current width of text on page. - -% Table can continue over pages but will only break between lines. - -% To make preamble: -% -% Either define widths of columns in terms of percent of \hsize: -% @multitable @columnfractions .25 .3 .45 -% @item ... -% -% Numbers following @columnfractions are the percent of the total -% current hsize to be used for each column. You may use as many -% columns as desired. - - -% Or use a template: -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item ... -% using the widest term desired in each column. - -% Each new table line starts with @item, each subsequent new column -% starts with @tab. Empty columns may be produced by supplying @tab's -% with nothing between them for as many times as empty columns are needed, -% ie, @tab@tab@tab will produce two empty columns. - -% @item, @tab do not need to be on their own lines, but it will not hurt -% if they are. - -% Sample multitable: - -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item first col stuff @tab second col stuff @tab third col -% @item -% first col stuff -% @tab -% second col stuff -% @tab -% third col -% @item first col stuff @tab second col stuff -% @tab Many paragraphs of text may be used in any column. -% -% They will wrap at the width determined by the template. -% @item@tab@tab This will be in third column. -% @end multitable - -% Default dimensions may be reset by user. -% @multitableparskip is vertical space between paragraphs in table. -% @multitableparindent is paragraph indent in table. -% @multitablecolmargin is horizontal space to be left between columns. -% @multitablelinespace is space to leave between table items, baseline -% to baseline. -% 0pt means it depends on current normal line spacing. -% -\newskip\multitableparskip -\newskip\multitableparindent -\newdimen\multitablecolspace -\newskip\multitablelinespace -\multitableparskip=0pt -\multitableparindent=6pt -\multitablecolspace=12pt -\multitablelinespace=0pt % Macros used to set up halign preamble: % @@ -4388,8 +4350,6 @@ end \go } -% multitable-only commands. -% % @headitem starts a heading row, which we typeset in bold. Assignments % have to be global since we are inside the implicit group of an % alignment entry. \everycr below resets \everytab so we don't have to @@ -4406,14 +4366,8 @@ end % default for tables with no headings. \let\headitemcrhook=\relax % -% A \tab used to include \hskip1sp. But then the space in a template -% line is not enough. That is bad. So let's go back to just `&' until -% we again encounter the problem the 1sp was intended to solve. -% --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% -% @multitable ... @end multitable definitions: -% \newtoks\everytab % insert after every tab. % \envdef\multitable{% @@ -4428,9 +4382,8 @@ end % \tolerance=9500 \hbadness=9500 - \setmultitablespacing - \parskip=\multitableparskip - \parindent=\multitableparindent + \parskip=0pt + \parindent=6pt \overfullrule=0pt \global\colcount=0 % @@ -4460,47 +4413,24 @@ end % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 - \multistrut + \strut \vtop{% - % Use the current \colcount to find the correct column width: + \advance\hsize by -1\leftskip + % Find the correct column width \hsize=\expandafter\csname col\the\colcount\endcsname % - % In order to keep entries from bumping into each other - % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - % - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % - % If the user has set preamble in terms of percent of \hsize we will - % use that dimension as the width of the column, and the \leftskip - % will keep entries from bumping into each other. Table will start at - % left margin and final column will justify at right margin. - % - % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 - % The first column will be indented with the surrounding text. - \advance\hsize by\leftskip + \advance\hsize by\leftskip % Add indent of surrounding text \else - \ifsetpercent \else - % If user has not set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace. - \advance\hsize by \multitablecolspace - \fi - % In either case we will make \leftskip=\multitablecolspace: - \leftskip=\multitablecolspace + % In order to keep entries from bumping into each other. + \leftskip=12pt + \ifsetpercent \else + % If a template has been used + \advance\hsize by \leftskip + \fi \fi - % Ignoring space at the beginning and end avoids an occasional spurious - % blank line, when TeX decides to break the line at the space before the - % box from the multistrut, so the strut ends up on a line by itself. - % For example: - % @multitable @columnfractions .11 .89 - % @item @code{#} - % @tab Legal holiday which is valid in major parts of the whole country. - % Is automatically provided with highlighting sequences respectively - % marking characters. - \noindent\ignorespaces##\unskip\multistrut + \noindent\ignorespaces##\unskip\strut }\cr } \def\Emultitable{% @@ -4509,31 +4439,6 @@ end \global\setpercentfalse } -\def\setmultitablespacing{% - \def\multistrut{\strut}% just use the standard line spacing - % - % Compute \multitablelinespace (if not defined by user) for use in - % \multitableparskip calculation. We used define \multistrut based on - % this, but (ironically) that caused the spacing to be off. - % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. -\ifdim\multitablelinespace=0pt -\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip -\global\advance\multitablelinespace by-\ht0 -\fi -% Test to see if parskip is larger than space between lines of -% table. If not, do nothing. -% If so, set to same dimension as multitablelinespace. -\ifdim\multitableparskip>\multitablelinespace -\global\multitableparskip=\multitablelinespace -\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller - % than skip between lines in the table. -\fi% -\ifdim\multitableparskip=0pt -\global\multitableparskip=\multitablelinespace -\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller - % than skip between lines in the table. -\fi} - \message{conditionals,} @@ -4696,19 +4601,6 @@ end } } -% We have this subroutine so that we can handle at least some @value's -% properly in indexes (we call \makevalueexpandable in \indexdummies). -% The command has to be fully expandable (if the variable is set), since -% the result winds up in the index file. This means that if the -% variable's value contains other Texinfo commands, it's almost certain -% it will fail (although perhaps we could fix that with sufficient work -% to do a one-level expansion on the result, instead of complete). -% -% Unfortunately, this has the consequence that when _ is in the *value* -% of an @set, it does not print properly in the roman fonts (get the cmr -% dot accent at position 126 instead). No fix comes to mind, and it's -% been this way since 2003 or earlier, so just ignore it. -% \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% @@ -4721,13 +4613,13 @@ end % Like \expandablevalue, but completely expandable (the \message in the % definition above operates at the execution level of TeX). Used when % writing to auxiliary files, due to the expansion that \write does. -% If flag is undefined, pass through an unexpanded @value command: maybe it +% If flag is undefined, pass through an unexpanded @value command: maybe it % will be set by the time it is read back in. % % NB flag names containing - or _ may not work here. \def\dummyvalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax - \noexpand\value{#1}% + \string\value{#1}% \else \csname SET#1\endcsname \fi @@ -4737,7 +4629,7 @@ end % if possible, otherwise sort late. \def\indexnofontsvalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax - ZZZZZZZ + ZZZZZZZ% \else \csname SET#1\endcsname \fi @@ -4745,7 +4637,7 @@ end % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. -% +% % To get the special treatment we need for `@end ifset,' we call % \makecond and then redefine. % @@ -4778,7 +4670,7 @@ end % without the @) is in fact defined. We can only feasibly check at the % TeX level, so something like `mathcode' is going to considered % defined even though it is not a Texinfo command. -% +% \makecond{ifcommanddefined} \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} % @@ -4884,32 +4776,18 @@ end % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} -\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} +\def\docodeindexxxx #1{\docind{\indexname}{#1}} - -% Used when writing an index entry out to an index file to prevent -% expansion of Texinfo commands that can appear in an index entry. -% -\def\indexdummies{% - \escapechar = `\\ % use backslash in output files. - \definedummyletter\@% - \definedummyletter\ % - % - % For texindex which always views { and } as separators. - \def\{{\lbracechar{}}% - \def\}{\rbracechar{}}% - % - % Do the redefinitions. - \definedummies -} -% Used for the aux and toc files, where @ is the escape character. +% Used for the aux, toc and index files to prevent expansion of Texinfo +% commands. % \def\atdummies{% \definedummyletter\@% \definedummyletter\ % \definedummyletter\{% \definedummyletter\}% + \definedummyletter\&% % % Do the redefinitions. \definedummies @@ -4933,8 +4811,7 @@ end \def\definedummyletter#1{\def#1{\string#1}}% \let\definedummyaccent\definedummyletter -% Called from \indexdummies and \atdummies, to effectively prevent -% the expansion of commands. +% Called from \atdummies to prevent the expansion of commands. % \def\definedummies{% % @@ -4981,8 +4858,10 @@ end \definedummyword\TeX % % Assorted special characters. + \definedummyword\ampchar \definedummyword\atchar \definedummyword\arrow + \definedummyword\backslashchar \definedummyword\bullet \definedummyword\comma \definedummyword\copyright @@ -5019,6 +4898,8 @@ end \definedummyword\sup \definedummyword\textdegree % + \definedummyword\subentry + % % We want to disable all macros so that they are not expanded by \write. \macrolist \let\value\dummyvalue @@ -5099,11 +4980,10 @@ end \commondummyword\xref } -% For testing: output @{ and @} in index sort strings as \{ and \}. -\newif\ifusebracesinindexes - \let\indexlbrace\relax \let\indexrbrace\relax +\let\indexatchar\relax +\let\indexbackslash\relax {\catcode`\@=0 \catcode`\\=13 @@ -5137,10 +5017,8 @@ end } \gdef\indexnonalnumreappear{% - \useindexbackslash \let-\normaldash \let<\normalless - \def\@{@}% } } @@ -5195,43 +5073,44 @@ end \def\ss{ss}% \def\th{th}% % - \def\LaTeX{LaTeX}% - \def\TeX{TeX}% + \let\do\indexnofontsdef % - % Assorted special characters. \defglyph gives the control sequence a - % definition that removes the {} that follows its use. - \defglyph\atchar{@}% - \defglyph\arrow{->}% - \defglyph\bullet{bullet}% - \defglyph\comma{,}% - \defglyph\copyright{copyright}% - \defglyph\dots{...}% - \defglyph\enddots{...}% - \defglyph\equiv{==}% - \defglyph\error{error}% - \defglyph\euro{euro}% - \defglyph\expansion{==>}% - \defglyph\geq{>=}% - \defglyph\guillemetleft{<<}% - \defglyph\guillemetright{>>}% - \defglyph\guilsinglleft{<}% - \defglyph\guilsinglright{>}% - \defglyph\leq{<=}% - \defglyph\lbracechar{\{}% - \defglyph\minus{-}% - \defglyph\point{.}% - \defglyph\pounds{pounds}% - \defglyph\print{-|}% - \defglyph\quotedblbase{"}% - \defglyph\quotedblleft{"}% - \defglyph\quotedblright{"}% - \defglyph\quoteleft{`}% - \defglyph\quoteright{'}% - \defglyph\quotesinglbase{,}% - \defglyph\rbracechar{\}}% - \defglyph\registeredsymbol{R}% - \defglyph\result{=>}% - \defglyph\textdegree{o}% + \do\LaTeX{LaTeX}% + \do\TeX{TeX}% + % + % Assorted special characters. + \do\atchar{@}% + \do\arrow{->}% + \do\bullet{bullet}% + \do\comma{,}% + \do\copyright{copyright}% + \do\dots{...}% + \do\enddots{...}% + \do\equiv{==}% + \do\error{error}% + \do\euro{euro}% + \do\expansion{==>}% + \do\geq{>=}% + \do\guillemetleft{<<}% + \do\guillemetright{>>}% + \do\guilsinglleft{<}% + \do\guilsinglright{>}% + \do\leq{<=}% + \do\lbracechar{\{}% + \do\minus{-}% + \do\point{.}% + \do\pounds{pounds}% + \do\print{-|}% + \do\quotedblbase{"}% + \do\quotedblleft{"}% + \do\quotedblright{"}% + \do\quoteleft{`}% + \do\quoteright{'}% + \do\quotesinglbase{,}% + \do\rbracechar{\}}% + \do\registeredsymbol{R}% + \do\result{=>}% + \do\textdegree{o}% % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. @@ -5246,41 +5125,38 @@ end \macrolist \let\value\indexnofontsvalue } -\def\defglyph#1#2{\def#1##1{#2}} % see above - +% Give the control sequence a definition that removes the {} that follows +% its use, e.g. @AA{} -> AA +\def\indexnofontsdef#1#2{\def#1##1{#2}}% + -\let\SETmarginindex=\relax % put index entries in margin (undocumented)? -% Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. -\def\doind#1#2{\dosubind{#1}{#2}{}} - -% There is also \dosubind {index}{topic}{subtopic} -% which makes an entry in a two-level index such as the operation index. -% TODO: Two-level index? Operation index? - -% Workhorse for all indexes. -% #1 is name of index, #2 is stuff to put there, #3 is subentry -- -% empty if called from \doind, as we usually are (the main exception -% is with most defuns, which call us directly). -% -\def\dosubind#1#2#3{% +\def\doind#1#2{% \iflinks {% - \requireopenindexfile{#1}% - % Store the main index entry text (including the third arg). - \toks0 = {#2}% - % If third arg is present, precede it with a space. - \def\thirdarg{#3}% - \ifx\thirdarg\empty \else - \toks0 = \expandafter{\the\toks0 \space #3}% - \fi % + \requireopenindexfile{#1}% \edef\writeto{\csname#1indfile\endcsname}% % - \safewhatsit\dosubindwrite + \def\indextext{#2}% + \safewhatsit\doindwrite + }% + \fi +} + +% Same as \doind, but for code indices +\def\docind#1#2{% + \iflinks + {% + % + \requireopenindexfile{#1}% + \edef\writeto{\csname#1indfile\endcsname}% + % + \def\indextext{#2}% + \safewhatsit\docindwrite }% \fi } @@ -5295,28 +5171,14 @@ end \ifx\suffix\indexisfl\def\suffix{f1}\fi % Open the file \immediate\openout\csname#1indfile\endcsname \jobname.\suffix - % Using \immediate above here prevents an object entering into the current + % Using \immediate above here prevents an object entering into the current % box, which could confound checks such as those in \safewhatsit for % preceding skips. \typeout{Writing index file \jobname.\suffix}% \fi} \def\indexisfl{fl} -% Output \ as {\indexbackslash}, because \ is an escape character in -% the index files. -\let\indexbackslash=\relax -{\catcode`\@=0 \catcode`\\=\active - @gdef@useindexbackslash{@def\{{@indexbackslash}}} -} - -% Definition for writing index entry text. -\def\sortas#1{\ignorespaces}% - -% Definition for writing index entry sort key. Should occur at the at -% the beginning of the index entry, like -% @cindex @sortas{september} \september -% The \ignorespaces takes care of following space, but there's no way -% to remove space before it. +% Definition for writing index entry sort key. { \catcode`\-=13 \gdef\indexwritesortas{% @@ -5327,51 +5189,158 @@ end \xdef\indexsortkey{#1}\endgroup} } +\def\indexwriteseealso#1{ + \gdef\pagenumbertext{\string\seealso{#1}}% +} +\def\indexwriteseeentry#1{ + \gdef\pagenumbertext{\string\seeentry{#1}}% +} -% Write the entry in \toks0 to the index file. +% The default definitions +\def\sortas#1{}% +\def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only +\def\putwordSeeAlso{See also} +\def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only + + +% Given index entry text like "aaa @subentry bbb @sortas{ZZZ}": +% * Set \bracedtext to "{aaa}{bbb}" +% * Set \fullindexsortkey to "aaa @subentry ZZZ" +% * If @seealso occurs, set \pagenumbertext % -\def\dosubindwrite{% - % Put the index entry in the margin if desired. - \ifx\SETmarginindex\relax\else - \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% +\def\splitindexentry#1{% + \gdef\fullindexsortkey{}% + \xdef\bracedtext{}% + \def\sep{}% + \def\seealso##1{}% + \def\seeentry##1{}% + \expandafter\doindexsegment#1\subentry\finish\subentry +} + +% append the results from the next segment +\def\doindexsegment#1\subentry{% + \def\segment{#1}% + \ifx\segment\isfinish + \else + % + % Fully expand the segment, throwing away any @sortas directives, and + % trim spaces. + \edef\trimmed{\segment}% + \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% + \ifincodeindex + \edef\trimmed{\noexpand\code{\trimmed}}% + \fi + % + \xdef\bracedtext{\bracedtext{\trimmed}}% + % + % Get the string to sort by. Process the segment with all + % font commands turned off. + \bgroup + \let\sortas\indexwritesortas + \let\seealso\indexwriteseealso + \let\seeentry\indexwriteseeentry + \indexnofonts + % The braces around the commands are recognized by texindex. + \def\lbracechar{{\string\indexlbrace}}% + \def\rbracechar{{\string\indexrbrace}}% + \let\{=\lbracechar + \let\}=\rbracechar + \def\@{{\string\indexatchar}}% + \def\atchar##1{\@}% + \def\backslashchar{{\string\indexbackslash}}% + \uccode`\~=`\\ \uppercase{\let~\backslashchar}% + % + \let\indexsortkey\empty + \global\let\pagenumbertext\empty + % Execute the segment and throw away the typeset output. This executes + % any @sortas or @seealso commands in this segment. + \setbox\dummybox = \hbox{\segment}% + \ifx\indexsortkey\empty{% + \indexnonalnumdisappear + \xdef\trimmed{\segment}% + \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% + \xdef\indexsortkey{\trimmed}% + \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi + }\fi + % + % Append to \fullindexsortkey. + \edef\tmp{\gdef\noexpand\fullindexsortkey{% + \fullindexsortkey\sep\indexsortkey}}% + \tmp + \egroup + \def\sep{\subentry}% + % + \expandafter\doindexsegment + \fi +} +\def\isfinish{\finish}% +\newbox\dummybox % used above + +\let\subentry\relax + +% Use \ instead of @ in index files. To support old texi2dvi and texindex. +% This works without changing the escape character used in the toc or aux +% files because the index entries are fully expanded here, and \string uses +% the current value of \escapechar. +\def\escapeisbackslash{\escapechar=`\\} + +% Use \ in index files by default. texi2dvi didn't support @ as the escape +% character (as it checked for "\entry" in the files, and not "@entry"). When +% the new version of texi2dvi has had a chance to become more prevalent, then +% the escape character can change back to @ again. This should be an easy +% change to make now because both @ and \ are only used as escape characters in +% index files, never standing for themselves. +% +\set txiindexescapeisbackslash + +% Write the entry in \indextext to the index file. +% + +\newif\ifincodeindex +\def\doindwrite{\incodeindexfalse\doindwritex} +\def\docindwrite{\incodeindextrue\doindwritex} + +\def\doindwritex{% + \maybemarginindex + % + \atdummies + % + \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else + \escapeisbackslash \fi % - % Remember, we are within a group. - \indexdummies % Must do this here, since \bf, etc expand at this stage - \useindexbackslash % \indexbackslash isn't defined now so it will be output - % as is; and it will print as backslash. - % The braces around \indexbrace are recognized by texindex. + % For texindex which always views { and } as separators. + \def\{{\lbracechar{}}% + \def\}{\rbracechar{}}% + \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}% % - % Get the string to sort by, by processing the index entry with all - % font commands turned off. - {\indexnofonts - \def\lbracechar{{\indexlbrace}}% - \def\rbracechar{{\indexrbrace}}% - \let\{=\lbracechar - \let\}=\rbracechar - \indexnonalnumdisappear - \xdef\indexsortkey{}% - \let\sortas=\indexwritesortas - \edef\temp{\the\toks0}% - \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas - \ifx\indexsortkey\empty - \xdef\indexsortkey{\temp}% - \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi - \fi - }% + % Split the entry into primary entry and any subentries, and get the index + % sort key. + \splitindexentry\indextext % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. + % \edef\temp{% \write\writeto{% - \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% + \string\entry{\fullindexsortkey}% + {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}% + \bracedtext}% }% \temp } -\newbox\dummybox % used above + +% Put the index entry in the margin if desired (undocumented). +\def\maybemarginindex{% + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}% + \fi +} +\let\SETmarginindex=\relax + % Take care of unwanted page breaks/skips around a whatsit: % @@ -5459,9 +5428,14 @@ end % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} +% \entry {topic}{} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. +% \secondary {subtopic}{} +% for a subtopic with sub-subtopics +% \tertiary {subtopic}{subsubtopic}{pagelist} +% for each sub-subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. @@ -5473,11 +5447,6 @@ end \def\tindex {\tpindex} \def\pindex {\pgindex} -\def\cindexsub {\begingroup\obeylines\cindexsub} -{\obeylines % -\gdef\cindexsub "#1" #2^^M{\endgroup % -\dosubind{cp}{#2}{#1}}} - % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. @@ -5491,14 +5460,10 @@ end \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % - % See if the index file exists and is nonempty. - % Change catcode of @ here so that if the index file contains - % \initial {@} - % as its first line, TeX doesn't complain about mismatched braces - % (because it thinks @} is a control sequence). - \catcode`\@ = 12 % See comment in \requireopenindexfile. \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi + % + % See if the index file exists and is nonempty. \openin 1 \jobname.\indexname s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, @@ -5508,8 +5473,6 @@ end \putwordIndexNonexistent \typeout{No file \jobname.\indexname s.}% \else - \catcode`\\ = 0 - % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. @@ -5517,47 +5480,55 @@ end \ifeof 1 \putwordIndexIsEmpty \else - % Index files are almost Texinfo source, but we use \ as the escape - % character. It would be better to use @, but that's too big a change - % to make right now. - \def\indexbackslash{\ttbackslash}% - \let\indexlbrace\{ % Likewise, set these sequences for braces - \let\indexrbrace\} % used in the sort key. - \begindoublecolumns - \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty - % - % Read input from the index file line by line. - \loopdo - \ifeof1 \else - \read 1 to \nextline - \fi - % - \indexinputprocessing - \thisline - % - \ifeof1\else - \let\thisline\nextline - \repeat - %% - \enddoublecolumns + \expandafter\printindexzz\thisline\relax\relax\finish% \fi \fi \closein 1 \endgroup} -\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx} -\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next} -\def\indexinputprocessing{% - \ifeof1 - \let\firsttoken\relax +% If the index file starts with a backslash, forgo reading the index +% file altogether. If somebody upgrades texinfo.tex they may still have +% old index files using \ as the escape character. Reading this would +% at best lead to typesetting garbage, at worst a TeX syntax error. +\def\printindexzz#1#2\finish{% + \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax + \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1 + \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax +\errmessage{% +ERROR: A sorted index file in an obsolete format was skipped. +To fix this problem, please upgrade your version of 'texi2dvi' +or 'texi2pdf' to that at . +If you are using an old version of 'texindex' (part of the Texinfo +distribution), you may also need to upgrade to a newer version (at least 6.0). +You may be able to typeset the index if you run +'texindex \jobname.\indexname' yourself. +You could also try setting the 'txiindexescapeisbackslash' flag by +running a command like +'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do +this, Texinfo will try to use index files in the old format. +If you continue to have problems, deleting the index files and starting again +might help (with 'rm \jobname.?? \jobname.??s')% +}% + \else + (Skipped sorted index file in obsolete format) + \fi + \else + \begindoublecolumns + \input \jobname.\indexname s + \enddoublecolumns + \fi \else - \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}% - \act + \begindoublecolumns + \catcode`\\=0\relax + % + % Make @ an escape character to give macros a chance to work. This + % should work because we (hopefully) don't otherwise use @ in index files. + %\catcode`\@=12\relax + \catcode`\@=0\relax + \input \jobname.\indexname s + \enddoublecolumns \fi } -\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken} -\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1} - % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. @@ -5566,12 +5537,19 @@ end \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 \catcode`\$=3 \gdef\initialglyphs{% + % special control sequences used in the index sort key + \let\indexlbrace\{% + \let\indexrbrace\}% + \let\indexatchar\@% + \def\indexbackslash{\math{\backslash}}% + % % Some changes for non-alphabetic characters. Using the glyphs from the % math fonts looks more consistent than the typewriter font used elsewhere % for these characters. - \def\indexbackslash{\math{\backslash}}% - \let\\=\indexbackslash + \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}} % + % In case @\ is used for backslash + \uppercase{\let\\=~} % Can't get bold backslash so don't use bold forward slash \catcode`\/=13 \def/{{\secrmnotbold \normalslash}}% @@ -5601,7 +5579,7 @@ end % bottom of a column to reduce an increase in inter-line spacing. \nobreak \vskip 0pt plus 5\baselineskip - \penalty -300 + \penalty -300 \vskip 0pt plus -5\baselineskip % % Typeset the initial. Making this add up to a whole number of @@ -5630,12 +5608,6 @@ end % \def\entry{% \begingroup - % - % For pdfTeX and XeTeX. - % The redefinition of \domark stops marks being added in \pdflink to - % preserve coloured links across page boundaries. Otherwise the marks - % would get in the way of \lastbox in \insertentrybox. - \let\domark\relax % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. @@ -5669,35 +5641,31 @@ end \gdef\finishentry#1{% \egroup % end box A \dimen@ = \wd\boxA % Length of text of entry - \global\setbox\boxA=\hbox\bgroup\unhbox\boxA - % #1 is the page number. - % - % Get the width of the page numbers, and only use - % leaders if they are present. - \global\setbox\boxB = \hbox{#1}% - \ifdim\wd\boxB = 0pt - \null\nobreak\hfill\ % - \else + \global\setbox\boxA=\hbox\bgroup + \unhbox\boxA + % #1 is the page number. % - \null\nobreak\indexdotfill % Have leaders before the page number. - % - \ifpdf - \pdfgettoks#1.% - \hskip\skip\thinshrinkable\the\toksA + % Get the width of the page numbers, and only use + % leaders if they are present. + \global\setbox\boxB = \hbox{#1}% + \ifdim\wd\boxB = 0pt + \null\nobreak\hfill\ % \else - \ifx\XeTeXrevision\thisisundefined - \hskip\skip\thinshrinkable #1% - \else + % + \null\nobreak\indexdotfill % Have leaders before the page number. + % + \ifpdforxetex \pdfgettoks#1.% \hskip\skip\thinshrinkable\the\toksA + \else + \hskip\skip\thinshrinkable #1% \fi \fi - \fi \egroup % end \boxA \ifdim\wd\boxB = 0pt - \global\setbox\entrybox=\vbox{\unhbox\boxA}% - \else - \global\setbox\entrybox=\vbox\bgroup + \noindent\unhbox\boxA\par + \nobreak + \else\bgroup % We want the text of the entries to be aligned to the left, and the % page numbers to be aligned to the right. % @@ -5727,7 +5695,7 @@ end \advance\dimen@ii by 1\dimen@i \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line \ifdim\dimen@ > 0.8\dimen@ii % due to long index text - % Try to split the text roughly evenly. \dimen@ will be the length of + % Try to split the text roughly evenly. \dimen@ will be the length of % the first line. \dimen@ = 0.7\dimen@ \dimen@ii = \hsize @@ -5763,55 +5731,11 @@ end \egroup % The \vbox \fi \endgroup - \dotheinsertentrybox }} \newskip\thinshrinkable \skip\thinshrinkable=.15em minus .15em -\newbox\entrybox -\def\insertentrybox{% - \ourunvbox\entrybox -} - -% default definition -\let\dotheinsertentrybox\insertentrybox - -% Use \lastbox to take apart vbox box by box, and add each sub-box -% to the current vertical list. -\def\ourunvbox#1{% -\bgroup % for local binding of \delayedbox - % Remove the last box from box #1 - \global\setbox#1=\vbox{% - \unvbox#1% - \unskip % remove any glue - \unpenalty - \global\setbox\interbox=\lastbox - }% - \setbox\delayedbox=\box\interbox - \ifdim\ht#1=0pt\else - \ourunvbox#1 % Repeat on what's left of the box - \nobreak - \fi - \box\delayedbox -\egroup -} -\newbox\delayedbox -\newbox\interbox - -% Used from \printindex. \firsttoken should be the first token -% after the \entry. If it's not another \entry, we are at the last -% line of a group of index entries, so insert a penalty to discourage -% widowed index entries. -\def\dotheinsertentryboxwithpenalty{% - \ifx\firsttoken\isentry - \else - \penalty 9000 - \fi - \insertentrybox -} -\def\isentry{\entry}% - % Like plain.tex's \dotfill, except uses up at least 1 em. % The filll stretch here overpowers both the fil and fill stretch to push % the page number to the right. @@ -5821,24 +5745,15 @@ end \def\primary #1{\line{#1\hfil}} -\newskip\secondaryindent \secondaryindent=0.5cm -\def\secondary#1#2{{% - \parfillskip=0in - \parskip=0in - \hangindent=1in - \hangafter=1 - \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill - \ifpdf - \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. - \else - \ifx\XeTeXrevision\thisisundefined - #2 - \else - \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. - \fi - \fi - \par -}} +\def\secondary{\indententry{0.5cm}} +\def\tertiary{\indententry{1cm}} + +\def\indententry#1#2#3{% + \bgroup + \leftskip=#1 + \entry{#2}{#3}% + \egroup +} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, @@ -5848,60 +5763,21 @@ end \newbox\partialpage \newdimen\doublecolumnhsize -% Use inside an output routine to save \topmark and \firstmark -\def\savemarks{% - \global\savedtopmark=\expandafter{\topmark }% - \global\savedfirstmark=\expandafter{\firstmark }% -} -\newtoks\savedtopmark -\newtoks\savedfirstmark - -% Set \topmark and \firstmark for next time \output runs. -% Can't be run from withinside \output (because any material -% added while an output routine is active, including -% penalties, is saved for after it finishes). The page so far -% should be empty, otherwise what's on it will be thrown away. -\def\restoremarks{% - \mark{\the\savedtopmark}% - \bgroup\output = {% - \setbox\dummybox=\box\PAGE - }abc\eject\egroup - % "abc" because output routine doesn't fire for a completely empty page. - \mark{\the\savedfirstmark}% -} - \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % If not much space left on page, start a new page. \ifdim\pagetotal>0.8\vsize\vfill\eject\fi % % Grab any single-column material above us. \output = {% - % - % Here is a possibility not foreseen in manmac: if we accumulate a - % whole lot of material, we might end up calling this \output - % routine twice in a row (see the doublecol-lose test, which is - % essentially a couple of indexes with @setchapternewpage off). In - % that case we just ship out what is in \partialpage with the normal - % output routine. Generally, \partialpage will be empty when this - % runs and this will be a no-op. See the indexspread.tex test case. - \ifvoid\partialpage \else - \onepageout{\pagecontents\partialpage}% - \fi + \savetopmark % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% - \savemarks }% \eject % run that output routine to set \partialpage - \restoremarks - % - % We recover the two marks that the last output routine saved in order - % to propagate the information in marks added around a chapter heading, - % which could be otherwise be lost by the time the final page is output. - % % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% @@ -5927,7 +5803,9 @@ end \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % - % Double the \vsize as well. + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. \advance\vsize by -\ht\partialpage \vsize = 2\vsize % @@ -5940,17 +5818,15 @@ end % \def\doublecolumnout{% % + \savetopmark \splittopskip=\topskip \splitmaxdepth=\maxdepth - % Get the available space for the double columns -- the normal - % (undoubled) page height minus any material left over from the - % previous page. \dimen@ = \vsize \divide\dimen@ by 2 % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@ \global\advance\vsize by 2\ht\partialpage - \onepageout\pagesofar + \onepageout\pagesofar % empty except for the first time we are called \unvbox\PAGE \penalty\outputpenalty } @@ -5966,7 +5842,7 @@ end } -% Finished with with double columns. +% Finished with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the @@ -5998,7 +5874,7 @@ end % \output = {% % Split the last of the double-column material. - \savemarks + \savetopmark \balancecolumns }% \eject % call the \output just set @@ -6006,10 +5882,9 @@ end % Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. - \global\output = {\onepageout{\pagecontents\PAGE}}% + \global\output=\expandafter{\the\defaultoutput} % \endgroup % started in \begindoublecolumns - \restoremarks % Leave the double-column material on the current page, no automatic % page break. \box\balancedcolumns @@ -6028,18 +5903,19 @@ end \newbox\balancedcolumns \setbox\balancedcolumns=\vbox{shouldnt see this}% % -% Only called for the last of the double column material. \doublecolumnout +% Only called for the last of the double column material. \doublecolumnout % does the others. \def\balancecolumns{% \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 - \advance\dimen@ by \topskip - \advance\dimen@ by-\baselineskip - \ifdim\dimen@<5\baselineskip + \ifdim\dimen@<7\baselineskip % Don't split a short final column in two. \setbox2=\vbox{}% \global\setbox\balancedcolumns=\vbox{\pagesofar}% \else + % double the leading vertical space + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to \dimen@ii = \dimen@ \splittopskip = \topskip @@ -6055,7 +5931,7 @@ end }% % Now the left column is in box 1, and the right column in box 3. % - % Check whether the left column has come out higher than the page itself. + % Check whether the left column has come out higher than the page itself. % (Note that we have doubled \vsize for the double columns, so % the actual height of the page is 0.5\vsize). \ifdim2\ht1>\vsize @@ -6174,11 +6050,9 @@ end % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} -\let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} -\let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 @@ -6354,7 +6228,7 @@ end \let\top\unnumbered % Sections. -% +% \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 @@ -6377,7 +6251,7 @@ end } % Subsections. -% +% % normally calls numberedsubseczzz: \outer\parseargdef\numberedsubsec{\numhead2{#1}} \def\numberedsubseczzz#1{% @@ -6402,7 +6276,7 @@ end } % Subsubsections. -% +% % normally numberedsubsubseczzz: \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} \def\numberedsubsubseczzz#1{% @@ -6492,18 +6366,16 @@ end \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak -\global\let\pagealignmacro=\chappager} +\global\def\HEADINGSon{\HEADINGSsinglechapoff}} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager -\global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage -\global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon @@ -6523,27 +6395,22 @@ end \expandafter\ifx\thisenv\titlepage\else \checkenv{}% chapters, etc., should not start inside an environment. \fi - % FIXME: \chapmacro is currently called from inside \titlepage when - % \setcontentsaftertitlepage to print the "Table of Contents" heading, but - % this should probably be done by \sectionheading with an option to print - % in chapter size. - % % Insert the first mark before the heading break (see notes for \domark). - \let\prevchapterdefs=\lastchapterdefs - \let\prevsectiondefs=\lastsectiondefs - \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \let\prevchapterdefs=\currentchapterdefs + \let\prevsectiondefs=\currentsectiondefs + \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword - \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword - \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% - \xdef\lastchapterdefs{% + \xdef\currentchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible @@ -6554,7 +6421,7 @@ end }% \else \toks0={#1}% - \xdef\lastchapterdefs{% + \xdef\currentchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible @@ -6574,18 +6441,18 @@ end % % Now the second mark, after the heading break. No break points % between here and the heading. - \let\prevchapterdefs=\lastchapterdefs - \let\prevsectiondefs=\lastsectiondefs + \let\prevchapterdefs=\currentchapterdefs + \let\prevsectiondefs=\currentsectiondefs \domark % {% \chapfonts \rm \let\footnote=\errfootnoteheading % give better error message % - % Have to define \lastsection before calling \donoderef, because the + % Have to define \currentsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. - \gdef\lastsection{#1}% + \gdef\currentsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. @@ -6674,10 +6541,10 @@ end \csname #2fonts\endcsname \rm % % Insert first mark before the heading break (see notes for \domark). - \let\prevsectiondefs=\lastsectiondefs + \let\prevsectiondefs=\currentsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword - \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword @@ -6685,7 +6552,7 @@ end \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% - \xdef\lastsectiondefs{% + \xdef\currentsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible @@ -6698,7 +6565,7 @@ end \else \ifx\sectionlevel\seckeyword \toks0={#1}% - \xdef\lastsectiondefs{% + \xdef\currentsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible @@ -6724,28 +6591,28 @@ end % % Now the second mark, after the heading break. No break points % between here and the heading. - \global\let\prevsectiondefs=\lastsectiondefs + \global\let\prevsectiondefs=\currentsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% - \gdef\lastsection{#1}% + \gdef\currentsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, - % and don't redefine \lastsection. + % and don't redefine \currentsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% - \gdef\lastsection{#1}% + \gdef\currentsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% - \gdef\lastsection{#1}% + \gdef\currentsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. @@ -6835,13 +6702,8 @@ end % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. - \ifpdf + \ifpdforxetex \global\pdfmakepagedesttrue - \else - \ifx\XeTeXrevision\thisisundefined - \else - \global\pdfmakepagedesttrue - \fi \fi } @@ -6878,9 +6740,7 @@ end % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should - % start on an odd page, unlike chapters. Thus, we maintain - % \contentsalignmacro in parallel with \pagealignmacro. - % From: Torbjorn Granlund + % start on an odd page, unlike chapters. \contentsalignmacro \immediate\closeout\tocfile % @@ -6895,6 +6755,9 @@ end % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi + \def\thistitle{}% no title in double-sided headings + % Record where the Roman numerals started. + \ifnum\romancount=0 \global\romancount=\pagecount \fi } % redefined for the two-volume lispref. We always output on @@ -6917,8 +6780,7 @@ end \fi \closein 1 \endgroup - \lastnegativepageno = \pageno - \global\pageno = \savepageno + \contentsendroman } % And just the chapters. @@ -6953,11 +6815,21 @@ end \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup - \lastnegativepageno = \pageno - \global\pageno = \savepageno + \contentsendroman } \let\shortcontents = \summarycontents +% Get ready to use Arabic numerals again +\def\contentsendroman{% + \lastnegativepageno = \pageno + \global\pageno = \savepageno + % + % If \romancount > \arabiccount, the contents are at the end of the + % document. Otherwise, advance where the Arabic numerals start for + % the page numbers. + \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi +} + % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % @@ -7098,7 +6970,7 @@ end % But \@ or @@ will get a plain @ character. \envdef\tex{% - \setupmarkupstyle{tex}% + \setregularquotes \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie @@ -7204,11 +7076,7 @@ end % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. -\font\circle=lcircle10 -\newdimen\circthick -\newdimen\cartouter\newdimen\cartinner -\newskip\normbskip\newskip\normpskip\newskip\normlskip -\circthick=\fontdimen8\circle + % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} @@ -7223,7 +7091,18 @@ end % \newskip\lskip\newskip\rskip +% only require the font if @cartouche is actually used +\def\cartouchefontdefs{% + \font\circle=lcircle10\relax + \circthick=\fontdimen8\circle +} +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip + + \envdef\cartouche{% + \cartouchefontdefs \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip @@ -7317,7 +7196,7 @@ end % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: -% @example, @display, @format, @lisp +% @example, @display, @format, @lisp, @verbatim % \def\smallword{small} \def\nosmallword{nosmall} @@ -7363,9 +7242,9 @@ end % \maketwodispenvdef{lisp}{example}{% \nonfillstart - \tt\setupmarkupstyle{example}% + \tt\setcodequotes \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. - \gobble % eat return + \parsearg\gobble } % @display/@smalldisplay: same as @lisp except keep current font. % @@ -7402,13 +7281,9 @@ end % @raggedright does more-or-less normal line breaking but no right -% justification. From plain.tex. Don't stretch around special -% characters in urls in this environment, since the stretch at the right -% should be enough. +% justification. From plain.tex. \envdef\raggedright{% \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax - \def\urefprestretchamount{0pt}% - \def\urefpoststretchamount{0pt}% } \let\Eraggedright\par @@ -7467,7 +7342,7 @@ end % @indentedblock is like @quotation, but indents only on the left and % has no optional argument. -% +% \makedispenvdef{indentedblock}{\indentedblockstart} % \def\indentedblockstart{% @@ -7527,7 +7402,7 @@ end \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% - \setupmarkupstyle{verb}% + \setcodequotes \tabeightspaces % Respect line breaks, % print special symbols as themselves, and @@ -7542,13 +7417,9 @@ end \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % % We typeset each line of the verbatim in an \hbox, so we can handle -% tabs. The \global is in case the verbatim line starts with an accent, -% or some other command that starts with a begin-group. Otherwise, the -% entire \verbbox would disappear at the corresponding end-group, before -% it is typeset. Meanwhile, we can't have nested verbatim commands -% (can we?), so the \global won't be overwriting itself. +% tabs. \newbox\verbbox -\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} +\def\starttabbox{\setbox\verbbox=\hbox\bgroup} % \begingroup \catcode`\^^I=\active @@ -7559,7 +7430,8 @@ end \divide\dimen\verbbox by\tabw \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw - \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox + \wd\verbbox=\dimen\verbbox + \leavevmode\box\verbbox \starttabbox }% } \endgroup @@ -7569,17 +7441,14 @@ end \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim - % The \leavevmode here is for blank lines. Otherwise, we would - % never \starttabox and the \egroup would end verbatim mode. - \def\par{\leavevmode\egroup\box\verbbox\endgraf}% + \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}% \tabexpand - \setupmarkupstyle{verbatim}% + \setcodequotes % Respect line breaks, % print special symbols as themselves, and % make each space count. % Must do in this order: \obeylines \uncatcodespecials \sepspaces - \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique @@ -7614,13 +7483,16 @@ end % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. - \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + \xdef\doverbatim#1^^M#2@end verbatim{% + \starttabbox#2\egroup\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. + % The \egroup ends the \verbbox started at the end of the last line in + % the block. \endgroup % \envdef\verbatim{% - \setupverbatim\doverbatim + \setnormaldispenv\setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak @@ -7633,9 +7505,12 @@ end {% \makevalueexpandable \setupverbatim - \indexnofonts % Allow `@@' and other weird things in file names. - \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% - \input #1 + {% + \indexnofonts % Allow `@@' and other weird things in file names. + \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% + \edef\tmp{\noexpand\input #1 } + \expandafter + }\expandafter\starttabbox\tmp\egroup \afterenvbreak }% } @@ -7764,7 +7639,7 @@ end % @deftypefnnewline on|off says whether the return type of typed functions % are printed on their own line. This affects @deftypefn, @deftypefun, % @deftypeop, and @deftypemethod. -% +% \parseargdef\deftypefnnewline{% \def\temp{#1}% \ifx\temp\onword @@ -7780,6 +7655,21 @@ end \fi\fi } +% \dosubind {index}{topic}{subtopic} +% +% If SUBTOPIC is present, precede it with a space, and call \doind. +% (At some time during the 20th century, this made a two-level entry in an +% index such as the operation index. Nobody seemed to notice the change in +% behaviour though.) +\def\dosubind#1#2#3{% + \def\thirdarg{#3}% + \ifx\thirdarg\empty + \doind{#1}{#2}% + \else + \doind{#1}{#2\space#3}% + \fi +} + % Untyped functions: % @deffn category name args @@ -7794,7 +7684,6 @@ end % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% - % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } @@ -7945,7 +7834,7 @@ end \tclose{\temp}% typeset the return type \ifrettypeownline % put return type on its own line; prohibit line break following: - \hfil\vadjust{\nobreak}\break + \hfil\vadjust{\nobreak}\break \else \space % type on same line, so just followed by a space \fi @@ -7973,7 +7862,7 @@ end % leave the code in, but it's strange for @var to lead to typewriter. % Nowadays we recommend @code, since the difference between a ttsl hyphen % and a tt hyphen is pretty tiny. @code also disables ?` !`. - \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% + \def\var##1{{\setregularquotes\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } @@ -8001,6 +7890,7 @@ end \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } +\let\ampchar\& \newcount\parencount @@ -8081,36 +7971,25 @@ end } \fi -% alias because \c means cedilla in @tex or @math -\let\texinfoc=\c - -\newcount\savedcatcodeone -\newcount\savedcatcodetwo +\let\E=\expandafter % Used at the time of macro expansion. % Argument is macro body with arguments substituted \def\scanmacro#1{% \newlinechar`\^^M - \def\xeatspaces{\eatspaces}% - % - % Temporarily undo catcode changes of \printindex. Set catcode of @ to - % 0 so that @-commands in macro expansions aren't printed literally when - % formatting an index file, where \ is used as the escape character. - \savedcatcodeone=\catcode`\@ - \savedcatcodetwo=\catcode`\\ - \catcode`\@=0 - \catcode`\\=\active + % expand the expansion of \eatleadingcr twice to maybe remove a leading + % newline (and \else and \fi tokens), then call \eatspaces on the result. + \def\xeatspaces##1{% + \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1% + }}% + \def\xempty##1{}% % % Process the macro body under the current catcode regime. - \scantokens{#1@texinfoc}% + \scantokens{#1@comment}% % - \catcode`\@=\savedcatcodeone - \catcode`\\=\savedcatcodetwo - % - % The \texinfoc is to remove the \newlinechar added by \scantokens, and - % can be noticed by \parsearg. - % We avoid surrounding the call to \scantokens with \bgroup and \egroup - % to allow macros to open or close groups themselves. + % The \comment is to remove the \newlinechar added by \scantokens, and + % can be noticed by \parsearg. Note \c isn't used because this means cedilla + % in math mode. } % Used for copying and captions @@ -8156,6 +8035,11 @@ end \unbrace{\gdef\trim@@@ #1 } #2@{#1} } +{\catcode`\^^M=\other% +\gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}% +% Warning: this won't work for a delimited argument +% or for an empty argument + % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% @@ -8211,12 +8095,14 @@ end \def\macroargctxt{% \scanctxt \catcode`\ =\active + \catcode`\@=\other \catcode`\^^M=\other \catcode`\\=\active } \def\macrolineargctxt{% used for whole-line arguments without braces \scanctxt + \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other } @@ -8308,7 +8194,7 @@ end % list to some hook where the argument is to be expanded. If there are % less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be -% defined `a la TeX in the macro body. +% defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % @@ -8320,6 +8206,7 @@ end \let\hash\relax % \hash is redefined to `#' later to get it into definitions \let\xeatspaces\relax + \let\xempty\relax \parsemargdefxxx#1,;,% \ifnum\paramno<10\relax\else \paramno0\relax @@ -8331,16 +8218,18 @@ end \else \let\next=\parsemargdefxxx \advance\paramno by 1 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname - {\xeatspaces{\hash\the\paramno}}% + {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} +% the \xempty{} is to give \eatleadingcr an argument in the case of an +% empty macro argument. % \parsemacbody, \parsermacbody % % Read recursive and nonrecursive macro bodies. (They're different since % rec and nonrec macros end differently.) -% -% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro +% +% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro % body to be transformed. % Set \macrobody to the body of the macro, and call \defmacro. % @@ -8374,7 +8263,7 @@ end % twice the \macarg.BLAH macros does not cost too much processing power. \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax - \else + \else \let\next=\parsemmanyargdef@@ \edef\tempb{\eatspaces{#1}}% \expandafter\def\expandafter\tempa @@ -8459,7 +8348,7 @@ end % Replace arguments by their values in the macro body, and place the result % in macro \@tempa. -% +% \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument @@ -8483,9 +8372,9 @@ end \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } -% Define the named-macro outside of this group and then close this group. -% -\def\macargexpandinbody@{% +% Define the named-macro outside of this group and then close this group. +% +\def\macargexpandinbody@{% \expandafter \endgroup \macargdeflist@ @@ -8523,7 +8412,7 @@ end } % Trailing missing arguments are set to empty. -% +% \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ @@ -8600,7 +8489,7 @@ end \else % at most 9 \ifnum\paramno<10\relax % @MACNAME sets the context for reading the macro argument - % @MACNAME@@ gets the argument, processes backslashes and appends a + % @MACNAME@@ gets the argument, processes backslashes and appends a % comma. % @MACNAME@@@ removes braces surrounding the argument list. % @MACNAME@@@@ scans the macro body with arguments substituted. @@ -8644,11 +8533,11 @@ end % Call #1 with a list of tokens #2, with any doubled backslashes in #2 % compressed to one. % -% This implementation works by expansion, and not execution (so we cannot use -% \def or similar). This reduces the risk of this failing in contexts where -% complete expansion is done with no execution (for example, in writing out to +% This implementation works by expansion, and not execution (so we cannot use +% \def or similar). This reduces the risk of this failing in contexts where +% complete expansion is done with no execution (for example, in writing out to % an auxiliary file for an index entry). -% +% % State is kept in the input stream: the argument passed to % @look_ahead, @gobble_and_check_finish and @add_segment is % @@ -8670,11 +8559,11 @@ end % #3 - NEXT_TOKEN % #4 used to look ahead % -% If the next token is not a backslash, process the rest of the argument; +% If the next token is not a backslash, process the rest of the argument; % otherwise, remove the next token. @gdef@look_ahead#1!#2#3#4{% @ifx#4\% - @expandafter@gobble_and_check_finish + @expandafter@gobble_and_check_finish @else @expandafter@add_segment @fi#1!{#2}#4#4% @@ -8698,9 +8587,9 @@ end % #3 - NEXT_TOKEN % #4 is input stream until next backslash % -% Input stream is either at the start of the argument, or just after a -% backslash sequence, either a lone backslash, or a doubled backslash. -% NEXT_TOKEN contains the first token in the input stream: if it is \finish, +% Input stream is either at the start of the argument, or just after a +% backslash sequence, either a lone backslash, or a doubled backslash. +% NEXT_TOKEN contains the first token in the input stream: if it is \finish, % finish; otherwise, append to ARG_RESULT the segment of the argument up until % the next backslash. PENDING_BACKSLASH contains a backslash to represent % a backslash just before the start of the input stream that has not been @@ -8712,13 +8601,13 @@ end % append the pending backslash to the result, followed by the next segment @expandafter@is_fi@look_ahead#1#2#4!{\}@fi % this @fi is discarded by @look_ahead. - % we can't get rid of it with \expandafter because we don't know how + % we can't get rid of it with \expandafter because we don't know how % long #4 is. } % #1 - THE_MACRO % #2 - ARG_RESULT -% #3 discards the res of the conditional in @add_segment, and @is_fi ends the +% #3 discards the res of the conditional in @add_segment, and @is_fi ends the % conditional. @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} @@ -8730,7 +8619,7 @@ end % for reading the argument (slightly different in the two cases). Then, % to read the argument, in the whole-line case, it then calls the regular % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. -% +% \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup @@ -8780,9 +8669,29 @@ end % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} -\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode} + +% Used so that the @top node doesn't have to be wrapped in an @ifnottex +% conditional. +% \doignore goes to more effort to skip nested conditionals but we don't need +% that here. +\def\omittopnode{% + \ifx\lastnode\wordTop + \expandafter\ignorenode\fi +} +\def\wordTop{Top} + +% Until the next @node or @bye command, divert output to a box that is not +% output. +\def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}% +\ignorenodebye +} + +{\let\bye\relax +\gdef\ignorenodebye{\let\bye\ignorenodebyedef} +\gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}} +% The redefinition of \bye here is because it is declared \outer -\let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the @@ -8805,7 +8714,7 @@ end % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: -% 1) NAME-title - the current sectioning name taken from \lastsection, +% 1) NAME-title - the current sectioning name taken from \currentsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. @@ -8827,7 +8736,7 @@ end \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% - \toks0 = \expandafter{\lastsection}% + \toks0 = \expandafter{\currentsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout @@ -8839,7 +8748,7 @@ end % automatically in xrefs, if the third arg is not explicitly specified. % This was provided as a "secret" @set xref-automatic-section-title % variable, now it's official. -% +% \parseargdef\xrefautomaticsectiontitle{% \def\temp{#1}% \ifx\temp\onword @@ -8855,7 +8764,7 @@ end \fi\fi } -% +% % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed @@ -8902,7 +8811,7 @@ end \else \ifhavexrefs % We (should) know the real title if we have the xref values. - \def\printedrefname{\refx{#1-title}{}}% + \def\printedrefname{\refx{#1-title}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% @@ -8996,7 +8905,7 @@ end % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd\printedrefnamebox = 0pt - \refx{#1-snt}{}% + \refx{#1-snt}% \else \printedrefname \fi @@ -9008,77 +8917,73 @@ end \fi \else % node/anchor (non-float) references. - % + % % If we use \unhbox to print the node names, TeX does not insert % empty discretionaries after hyphens, which means that it will not % find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, % this is a loss. Therefore, we give the text of the node name % again, so it is as if TeX is seeing it for the first time. - % + % \ifdim \wd\printedmanualbox > 0pt % Cross-manual reference with a printed manual name. - % + % \crossmanualxref{\cite{\printedmanual\unskip}}% % \else\ifdim \wd\infofilenamebox > 0pt % Cross-manual reference with only an info filename (arg 4), no % printed manual name (arg 5). This is essentially the same as % the case above; we output the filename, since we have nothing else. - % + % \crossmanualxref{\code{\infofilename\unskip}}% % \else % Reference within this manual. % - % _ (for example) has to be the character _ for the purposes of the - % control sequence corresponding to the node, but it has to expand - % into the usual \leavevmode...\vrule stuff for purposes of - % printing. So we \turnoffactive for the \refx-snt, back on for the - % printing, back off for the \refx-pg. - {\turnoffactive - % Only output a following space if the -snt ref is nonempty; for - % @unnumbered and @anchor, it won't be. - \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% - \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi - }% + % Only output a following space if the -snt ref is nonempty, as the ref + % will be empty for @unnumbered and @anchor. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + % % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname % - % But we always want a comma and a space: - ,\space - % - % output the `page 3'. - \turnoffactive \putwordpage\tie\refx{#1-pg}{}% - % Add a , if xref followed by a space - \if\space\noexpand\tokenafterxref ,% - \else\ifx\ \tokenafterxref ,% @TAB - \else\ifx\*\tokenafterxref ,% @* - \else\ifx\ \tokenafterxref ,% @SPACE - \else\ifx\ - \tokenafterxref ,% @NL - \else\ifx\tie\tokenafterxref ,% @tie - \fi\fi\fi\fi\fi\fi + \expandafter\ifx\csname SETtxiomitxrefpg\endcsname\relax + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}% + % Add a , if xref followed by a space + \if\space\noexpand\tokenafterxref ,% + \else\ifx\ \tokenafterxref ,% @TAB + \else\ifx\*\tokenafterxref ,% @* + \else\ifx\ \tokenafterxref ,% @SPACE + \else\ifx\ + \tokenafterxref ,% @NL + \else\ifx\tie\tokenafterxref ,% @tie + \fi\fi\fi\fi\fi\fi + \fi \fi\fi \fi \endlink \endgroup} % Output a cross-manual xref to #1. Used just above (twice). -% +% % Only include the text "Section ``foo'' in" if the foo is neither % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply % "see The Foo Manual", the idea being to refer to the whole manual. -% +% % But, this being TeX, we can't easily compare our node name against the % string "Top" while ignoring the possible spaces before and after in % the input. By adding the arbitrary 7sp below, we make it much less % likely that a real node name would have the same width as "Top" (e.g., % in a monospaced font). Hopefully it will never happen in practice. -% +% % For the same basic reason, we retypeset the "Top" at every % reference, since the current font is indeterminate. -% +% \def\crossmanualxref#1{% \setbox\toprefbox = \hbox{Top\kern7sp}% \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% @@ -9125,13 +9030,12 @@ end \fi\fi\fi } -% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX -% is output afterwards if non-empty. -\def\refx#1#2{% +% \refx{NAME} - reference a cross-reference string named NAME. +\def\refx#1{% \requireauxfile {% \indexnofonts - \otherbackslash + \turnoffactive \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname @@ -9154,12 +9058,11 @@ end % It's defined, so just use it. \thisrefX \fi - #2% Output the suffix in any case. } -% This is the macro invoked by entries in the aux file. Define a control -% sequence for a cross-reference target (we prepend XR to the control sequence -% name to avoid collisions). The value is the page number. If this is a float +% This is the macro invoked by entries in the aux file. Define a control +% sequence for a cross-reference target (we prepend XR to the control sequence +% name to avoid collisions). The value is the page number. If this is a float % type, we have more work to do. % \def\xrdef#1#2{% @@ -9175,10 +9078,10 @@ end \bgroup \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% \egroup - % We put the \gdef inside a group to avoid the definitions building up on - % TeX's save stack, which can cause it to run out of space for aux files with + % We put the \gdef inside a group to avoid the definitions building up on + % TeX's save stack, which can cause it to run out of space for aux files with % thousands of lines. \gdef doesn't use the save stack, but \csname does - % when it defines an unknown control sequence as \relax. + % when it defines an unknown control sequence as \relax. % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname @@ -9257,19 +9160,6 @@ end \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other - % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. - % in xref tags, i.e., node names. But since ^^e4 notation isn't - % supported in the main text, it doesn't seem desirable. Furthermore, - % that is not enough: for node names that actually contain a ^ - % character, we would end up writing a line like this: 'xrdef {'hat - % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first - % argument, and \hat is not an expandable control sequence. It could - % all be worked out, but why? Either we support ^^ or we don't. - % - % The other change necessary for this was to define \auxhat: - % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter - % and then to call \auxhat in \setq. - % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... @@ -9277,24 +9167,17 @@ end \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other - \catcode`\_=\other - \catcode`\|=\other - \catcode`\<=\other - \catcode`\>=\other + \catcode`\_=\active + \catcode`\|=\active + \catcode`\<=\active + \catcode`\>=\active \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % - % This is to support \ in node names and titles, since the \ - % characters end up in a \csname. It's easier than - % leaving it active and making its active definition an actual \ - % character. What I don't understand is why it works in the *value* - % of the xrdef. Seems like it should be a catcode12 \, and that - % should not typeset properly. But it works, so I'm moving on for - % now. --karl, 15jan04. - \catcode`\\=\other + \catcode`\\=\active % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 @@ -9508,7 +9391,7 @@ end \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names - \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro + \makevalueexpandable % If the image is by itself, center it. \ifvmode \imagevmodetrue @@ -9534,7 +9417,7 @@ end % On the other hand, if we are in the case of @center @image, we don't % want to start a paragraph, which will create a hsize-width box and % eradicate the centering. - \ifx\centersub\centerV\else \noindent \fi + \ifx\centersub\centerV \else \imageindent \fi % % Output the image. \ifpdf @@ -9557,7 +9440,7 @@ end % \ifimagevmode \medskip % space after a standalone image - \fi + \fi \ifx\centersub\centerV \egroup \fi \endgroup} @@ -9625,13 +9508,13 @@ end \global\advance\floatno by 1 % {% - % This magic value for \lastsection is output by \setref as the + % This magic value for \currentsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % - \edef\lastsection{\floatmagic=\safefloattype}% + \edef\currentsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi @@ -9754,7 +9637,7 @@ end % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic -% \lastsection value which we \setref above. +% \currentsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % @@ -10388,7 +10271,7 @@ directory should work if nowhere else does.} \uppercase{.} \endgroup \else - \errhelp = \EMsimple + \errhelp = \EMsimple \errmessage{Unicode character U+#1 not supported, sorry}% \fi \else @@ -10421,7 +10304,7 @@ directory should work if nowhere else does.} \countUTFz = "#1\relax \begingroup \parseXMLCharref - + % Give \u8:... its definition. The sequence of seven \expandafter's % expands after the \gdef three times, e.g. % @@ -10433,7 +10316,7 @@ directory should work if nowhere else does.} \expandafter\expandafter \expandafter\expandafter \expandafter\gdef \UTFviiiTmp{#2}% - % + % \expandafter\ifx\csname uni:#1\endcsname \relax \else \message{Internal error, already defined: #1}% \fi @@ -10472,7 +10355,7 @@ directory should work if nowhere else does.} \divide\countUTFz by 64 \countUTFy = \countUTFz % Save to be the future value of \countUTFz. \multiply\countUTFz by 64 - + % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract % in order to get the last five bits. \advance\countUTFx by -\countUTFz @@ -10507,7 +10390,7 @@ directory should work if nowhere else does.} % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B -% +% % Many of our renditions are less than wonderful, and all the missing % characters are available somewhere. Loading the necessary fonts % awaits user request. We can't truly support Unicode without @@ -10808,6 +10691,8 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{0233}{\=y}% \DeclareUnicodeCharacter{0237}{\dotless{j}}% % + \DeclareUnicodeCharacter{02BC}{'}% + % \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% % % Greek letters upper case @@ -11242,21 +11127,14 @@ directory should work if nowhere else does.} \relax } -% define all Unicode characters we know about, for the sake of @U. +% Define all Unicode characters we know about. This makes UTF-8 the default +% input encoding and allows @U to work. \iftxinativeunicodecapable \nativeunicodechardefsatu \else \utfeightchardefs \fi - -% Make non-ASCII characters printable again for compatibility with -% existing Texinfo documents that may use them, even without declaring a -% document encoding. -% -\setnonasciicharscatcode \other - - \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt @@ -11449,6 +11327,18 @@ directory should work if nowhere else does.} \globaldefs = 0 }} +\def\bsixpaper{{\globaldefs = 1 + \afourpaper + \internalpagesizes{140mm}{100mm}% + {-6.35mm}{-12.7mm}% + {\bindingoffset}{14pt}% + {176mm}{125mm}% + \let\SETdispenvsize=\smallword + \lispnarrowing = 0.2in + \globaldefs = 0 +}} + + % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. @@ -11462,12 +11352,12 @@ directory should work if nowhere else does.} \setleading{\textleading}% % \dimen0 = #1\relax - \advance\dimen0 by \voffset - \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page + \advance\dimen0 by 2.5in % default 1in margin above heading line + % and 1.5in to include heading, footing and + % bottom margin % \dimen2 = \hsize - \advance\dimen2 by \normaloffset - \advance\dimen2 by 1in % reference point is 1 inch from left edge of page + \advance\dimen2 by 2in % default to 1 inch margin on each side % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% @@ -11552,9 +11442,9 @@ directory should work if nowhere else does.} \def\texinfochars{% \let< = \activeless \let> = \activegtr - \let~ = \activetilde + \let~ = \activetilde \let^ = \activehat - \markupsetuplqdefault \markupsetuprqdefault + \setregularquotes \let\b = \strong \let\i = \smartitalic % in principle, all other definitions in \tex have to be undone too. @@ -11572,11 +11462,9 @@ directory should work if nowhere else does.} % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ -\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work -% \realbackslash is an actual character `\' with catcode other, and -% \doublebackslash is two of them (for the pdf outlines). -{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} +% \realbackslash is an actual character `\' with catcode other. +{\catcode`\\=\other @gdef@realbackslash{\}} % In Texinfo, backslash is an active character; it prints the backslash % in fixed width font. @@ -11594,10 +11482,8 @@ directory should work if nowhere else does.} @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. -% \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with -% catcode other. We switch back and forth between these. -@gdef@rawbackslash{@let\=@backslashcurfont} +% catcode other. @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of @@ -11617,8 +11503,7 @@ directory should work if nowhere else does.} @let|=@normalverticalbar @let~=@normaltilde @let\=@ttbackslash - @markupsetuplqdefault - @markupsetuprqdefault + @setregularquotes @unsepspaces } } @@ -11669,7 +11554,7 @@ directory should work if nowhere else does.} @ifx\@eatinput @let\ = @ttbackslash @fi @catcode13=5 % regular end of line @enableemergencynewline - @let@c=@texinfoc + @let@c=@comment @let@parsearg@originalparsearg % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. @@ -11711,11 +11596,10 @@ directory should work if nowhere else does.} @c Do this last of all since we use ` in the previous @catcode assignments. @catcode`@'=@active @catcode`@`=@active -@markupsetuplqdefault -@markupsetuprqdefault +@setregularquotes @c Local variables: -@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c eval: (add-hook 'before-save-hook 'time-stamp) @c page-delimiter: "^\\\\message\\|emacs-page" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @@ -11725,3 +11609,4 @@ directory should work if nowhere else does.} @c vim:sw=2: @enablebackslashhack + diff --git a/doc/version.texi b/doc/version.texi index d9d5094..6056fad 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 22 November 2019 -@set UPDATED-MONTH November 2019 -@set EDITION 3.3 -@set VERSION 3.3 +@set UPDATED 23 October 2022 +@set UPDATED-MONTH October 2022 +@set EDITION 3.4.4 +@set VERSION 3.4.4 diff --git a/fficonfig.h.in b/fficonfig.h.in index c675685..d38b781 100644 --- a/fficonfig.h.in +++ b/fficonfig.h.in @@ -3,12 +3,7 @@ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ +/* Define to 1 if using 'alloca.c'. */ #undef C_ALLOCA /* Define to the flags needed for the .section .eh_frame directive. */ @@ -17,10 +12,14 @@ /* Define this if you want extra debugging. */ #undef FFI_DEBUG +/* Define this if you want statically defined trampolines */ +#undef FFI_EXEC_STATIC_TRAMP + /* Cannot use PROT_EXEC on this target, so, we revert to alternative means */ #undef FFI_EXEC_TRAMPOLINE_TABLE -/* Define this if you want to enable pax emulated trampolines */ +/* Define this if you want to enable pax emulated trampolines (experimental) + */ #undef FFI_MMAP_EXEC_EMUTRAMP_PAX /* Cannot use malloc on this target, so, we revert to alternative means */ @@ -32,11 +31,10 @@ /* Define this if you do not want support for aggregate types. */ #undef FFI_NO_STRUCTS -/* Define to 1 if you have `alloca', as a function or macro. */ +/* Define to 1 if you have 'alloca', as a function or macro. */ #undef HAVE_ALLOCA -/* Define to 1 if you have and it should be used (not on Ultrix). - */ +/* Define to 1 if works. */ #undef HAVE_ALLOCA_H /* Define if your assembler supports .cfi_* directives. */ @@ -76,12 +74,15 @@ /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H +/* Define to 1 if you have the `memfd_create' function. */ +#undef HAVE_MEMFD_CREATE /* Define to 1 if you have the `mkostemp' function. */ #undef HAVE_MKOSTEMP +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP + /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP @@ -94,12 +95,18 @@ /* Define if read-only mmap of a plain file works. */ #undef HAVE_MMAP_FILE +/* Define if your compiler supports pointer authentication. */ +#undef HAVE_PTRAUTH + /* Define if .eh_frame sections should be read-only. */ #undef HAVE_RO_EH_FRAME /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -109,6 +116,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MEMFD_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H @@ -165,7 +175,9 @@ STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Define if symbols are underscored. */ diff --git a/generate-darwin-source-and-headers.py b/generate-darwin-source-and-headers.py index f7fc414..5b60ccc 100755 --- a/generate-darwin-source-and-headers.py +++ b/generate-darwin-source-and-headers.py @@ -6,15 +6,13 @@ import collections import glob import argparse + class Platform(object): pass -class simulator_platform(Platform): - directory = 'darwin_ios' - sdk = 'iphonesimulator' + +class i386_platform(Platform): arch = 'i386' - triple = 'i386-apple-darwin11' - version_min = '-miphoneos-version-min=7.0' prefix = "#ifdef __i386__\n\n" suffix = "\n\n#endif" @@ -22,12 +20,8 @@ class simulator_platform(Platform): src_files = ['sysv.S', 'ffi.c', 'internal.h'] -class simulator64_platform(Platform): - directory = 'darwin_ios' - sdk = 'iphonesimulator' +class x86_64_platform(Platform): arch = 'x86_64' - triple = 'x86_64-apple-darwin13' - version_min = '-miphoneos-version-min=7.0' prefix = "#ifdef __x86_64__\n\n" suffix = "\n\n#endif" @@ -35,25 +29,8 @@ class simulator64_platform(Platform): src_files = ['unix64.S', 'ffi64.c', 'ffiw64.c', 'win64.S', 'internal64.h', 'asmnames.h'] -class device_platform(Platform): - directory = 'darwin_ios' - sdk = 'iphoneos' - arch = 'armv7' - triple = 'arm-apple-darwin11' - version_min = '-miphoneos-version-min=7.0' - - prefix = "#ifdef __arm__\n\n" - suffix = "\n\n#endif" - src_dir = 'arm' - src_files = ['sysv.S', 'ffi.c', 'internal.h'] - - -class device64_platform(Platform): - directory = 'darwin_ios' - sdk = 'iphoneos' +class arm64_platform(Platform): arch = 'arm64' - triple = 'aarch64-apple-darwin13' - version_min = '-miphoneos-version-min=7.0' prefix = "#ifdef __arm64__\n\n" suffix = "\n\n#endif" @@ -61,30 +38,135 @@ class device64_platform(Platform): src_files = ['sysv.S', 'ffi.c', 'internal.h'] -class desktop32_platform(Platform): - directory = 'darwin_osx' - sdk = 'macosx' - arch = 'i386' - triple = 'i386-apple-darwin10' - version_min = '-mmacosx-version-min=10.6' - src_dir = 'x86' +class armv7_platform(Platform): + arch = 'armv7' + + prefix = "#ifdef __arm__\n\n" + suffix = "\n\n#endif" + src_dir = 'arm' src_files = ['sysv.S', 'ffi.c', 'internal.h'] - prefix = "#ifdef __i386__\n\n" - suffix = "\n\n#endif" + +class ios_simulator_i386_platform(i386_platform): + triple = 'i386-apple-darwin11' + target = 'i386-apple-ios-simulator' + directory = 'darwin_ios' + sdk = 'iphonesimulator' + version_min = '-miphoneos-version-min=7.0' -class desktop64_platform(Platform): +class ios_simulator_x86_64_platform(x86_64_platform): + triple = 'x86_64-apple-darwin13' + target = 'x86_64-apple-ios-simulator' + directory = 'darwin_ios' + sdk = 'iphonesimulator' + version_min = '-miphoneos-version-min=7.0' + + +class ios_simulator_arm64_platform(arm64_platform): + triple = 'aarch64-apple-darwin20' + target = 'arm64-apple-ios-simulator' + directory = 'darwin_ios' + sdk = 'iphonesimulator' + version_min = '-miphoneos-version-min=7.0' + + +class ios_device_armv7_platform(armv7_platform): + triple = 'arm-apple-darwin11' + target = 'armv7-apple-ios' + directory = 'darwin_ios' + sdk = 'iphoneos' + version_min = '-miphoneos-version-min=7.0' + + +class ios_device_arm64_platform(arm64_platform): + triple = 'aarch64-apple-darwin13' + target = 'arm64-apple-ios' + directory = 'darwin_ios' + sdk = 'iphoneos' + version_min = '-miphoneos-version-min=7.0' + + +class desktop_x86_64_platform(x86_64_platform): + triple = 'x86_64-apple-darwin10' + target = 'x86_64-apple-macos' directory = 'darwin_osx' sdk = 'macosx' - arch = 'x86_64' - triple = 'x86_64-apple-darwin10' version_min = '-mmacosx-version-min=10.6' - prefix = "#ifdef __x86_64__\n\n" - suffix = "\n\n#endif" - src_dir = 'x86' - src_files = ['unix64.S', 'ffi64.c', 'ffiw64.c', 'win64.S', 'internal64.h', 'asmnames.h'] + +class desktop_arm64_platform(arm64_platform): + triple = 'aarch64-apple-darwin20' + target = 'arm64-apple-macos' + directory = 'darwin_osx' + sdk = 'macosx' + version_min = '-mmacosx-version-min=11.0' + + +class tvos_simulator_x86_64_platform(x86_64_platform): + triple = 'x86_64-apple-darwin13' + target = 'x86_64-apple-tvos-simulator' + directory = 'darwin_tvos' + sdk = 'appletvsimulator' + version_min = '-mtvos-version-min=9.0' + + +class tvos_simulator_arm64_platform(arm64_platform): + triple = 'aarch64-apple-darwin20' + target = 'arm64-apple-tvos-simulator' + directory = 'darwin_tvos' + sdk = 'appletvsimulator' + version_min = '-mtvos-version-min=9.0' + + +class tvos_device_arm64_platform(arm64_platform): + triple = 'aarch64-apple-darwin13' + target = 'arm64-apple-tvos' + directory = 'darwin_tvos' + sdk = 'appletvos' + version_min = '-mtvos-version-min=9.0' + + +class watchos_simulator_i386_platform(i386_platform): + triple = 'i386-apple-darwin11' + target = 'i386-apple-watchos-simulator' + directory = 'darwin_watchos' + sdk = 'watchsimulator' + version_min = '-mwatchos-version-min=4.0' + + +class watchos_simulator_x86_64_platform(x86_64_platform): + triple = 'x86_64-apple-darwin13' + target = 'x86_64-apple-watchos-simulator' + directory = 'darwin_watchos' + sdk = 'watchsimulator' + version_min = '-mwatchos-version-min=4.0' + + +class watchos_simulator_arm64_platform(arm64_platform): + triple = 'aarch64-apple-darwin20' + target = 'arm64-apple-watchos-simulator' + directory = 'darwin_watchos' + sdk = 'watchsimulator' + version_min = '-mwatchos-version-min=4.0' + + +class watchos_device_armv7k_platform(armv7_platform): + triple = 'arm-apple-darwin11' + target = 'armv7k-apple-watchos' + directory = 'darwin_watchos' + sdk = 'watchos' + arch = 'armv7k' + version_min = '-mwatchos-version-min=4.0' + + +class watchos_device_arm64_32_platform(arm64_platform): + triple = 'aarch64-apple-darwin13' + target = 'arm64_32-apple-watchos' + directory = 'darwin_watchos' + sdk = 'watchos' + arch = 'arm64_32' + version_min = '-mwatchos-version-min=4.0' def mkdir_p(path): @@ -136,14 +218,14 @@ def copy_src_platform_files(platform): def build_target(platform, platform_headers): def xcrun_cmd(cmd): - return 'xcrun -sdk %s %s -arch %s' % (platform.sdk, cmd, platform.arch) + return 'xcrun -sdk %s %s -target %s' % (platform.sdk, cmd, platform.target) tag='%s-%s' % (platform.sdk, platform.arch) build_dir = 'build_%s' % tag mkdir_p(build_dir) env = dict(CC=xcrun_cmd('clang'), LD=xcrun_cmd('ld'), - CFLAGS='%s' % (platform.version_min)) + CFLAGS='%s -fembed-bitcode' % (platform.version_min)) working_dir = os.getcwd() try: os.chdir(build_dir) @@ -163,32 +245,59 @@ def build_target(platform, platform_headers): platform_headers[filename].add((platform.prefix, platform.arch, platform.suffix)) -def generate_source_and_headers(generate_osx=True, generate_ios=True): +def generate_source_and_headers( + generate_osx=True, + generate_ios=True, + generate_tvos=True, + generate_watchos=True, +): copy_files('src', 'darwin_common/src', pattern='*.c') copy_files('include', 'darwin_common/include', pattern='*.h') if generate_ios: - copy_src_platform_files(simulator_platform) - copy_src_platform_files(simulator64_platform) - copy_src_platform_files(device_platform) - copy_src_platform_files(device64_platform) + copy_src_platform_files(ios_simulator_i386_platform) + copy_src_platform_files(ios_simulator_x86_64_platform) + copy_src_platform_files(ios_simulator_arm64_platform) + copy_src_platform_files(ios_device_armv7_platform) + copy_src_platform_files(ios_device_arm64_platform) if generate_osx: - copy_src_platform_files(desktop32_platform) - copy_src_platform_files(desktop64_platform) + copy_src_platform_files(desktop_x86_64_platform) + copy_src_platform_files(desktop_arm64_platform) + if generate_tvos: + copy_src_platform_files(tvos_simulator_x86_64_platform) + copy_src_platform_files(tvos_simulator_arm64_platform) + copy_src_platform_files(tvos_device_arm64_platform) + if generate_watchos: + copy_src_platform_files(watchos_simulator_i386_platform) + copy_src_platform_files(watchos_simulator_x86_64_platform) + copy_src_platform_files(watchos_simulator_arm64_platform) + copy_src_platform_files(watchos_device_armv7k_platform) + copy_src_platform_files(watchos_device_arm64_32_platform) platform_headers = collections.defaultdict(set) if generate_ios: - build_target(simulator_platform, platform_headers) - build_target(simulator64_platform, platform_headers) - build_target(device_platform, platform_headers) - build_target(device64_platform, platform_headers) + build_target(ios_simulator_i386_platform, platform_headers) + build_target(ios_simulator_x86_64_platform, platform_headers) + build_target(ios_simulator_arm64_platform, platform_headers) + build_target(ios_device_armv7_platform, platform_headers) + build_target(ios_device_arm64_platform, platform_headers) if generate_osx: - build_target(desktop32_platform, platform_headers) - build_target(desktop64_platform, platform_headers) + build_target(desktop_x86_64_platform, platform_headers) + build_target(desktop_arm64_platform, platform_headers) + if generate_tvos: + build_target(tvos_simulator_x86_64_platform, platform_headers) + build_target(tvos_simulator_arm64_platform, platform_headers) + build_target(tvos_device_arm64_platform, platform_headers) + if generate_watchos: + build_target(watchos_simulator_i386_platform, platform_headers) + build_target(watchos_simulator_x86_64_platform, platform_headers) + build_target(watchos_simulator_arm64_platform, platform_headers) + build_target(watchos_device_armv7k_platform, platform_headers) + build_target(watchos_device_arm64_32_platform, platform_headers) mkdir_p('darwin_common/include') - for header_name, tag_tuples in platform_headers.iteritems(): + for header_name, tag_tuples in platform_headers.items(): basename, suffix = os.path.splitext(header_name) with open(os.path.join('darwin_common/include', header_name), 'w') as header: for tag_tuple in tag_tuples: @@ -198,6 +307,13 @@ if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--only-ios', action='store_true', default=False) parser.add_argument('--only-osx', action='store_true', default=False) + parser.add_argument('--only-tvos', action='store_true', default=False) + parser.add_argument('--only-watchos', action='store_true', default=False) args = parser.parse_args() - generate_source_and_headers(generate_osx=not args.only_ios, generate_ios=not args.only_osx) + generate_source_and_headers( + generate_osx=not args.only_ios and not args.only_tvos and not args.only_watchos, + generate_ios=not args.only_osx and not args.only_tvos and not args.only_watchos, + generate_tvos=not args.only_ios and not args.only_osx and not args.only_watchos, + generate_watchos=not args.only_ios and not args.only_osx and not args.only_tvos, + ) diff --git a/include/Makefile.am b/include/Makefile.am index c59df9f..5f0d406 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign DISTCLEANFILES=ffitarget.h -noinst_HEADERS=ffi_common.h ffi_cfi.h +noinst_HEADERS=ffi_common.h ffi_cfi.h tramp.h EXTRA_DIST=ffi.h.in nodist_include_HEADERS = ffi.h ffitarget.h diff --git a/include/Makefile.in b/include/Makefile.in index 4ab941e..7e3bbf0 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -92,7 +92,6 @@ target_triplet = @target@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cc_maxopt.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ @@ -101,6 +100,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ $(top_srcdir)/m4/ax_enable_builddir.m4 \ $(top_srcdir)/m4/ax_gcc_archflag.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ + $(top_srcdir)/m4/ax_prepend_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ @@ -179,8 +179,6 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/ffi.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ @@ -200,8 +198,9 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -216,9 +215,11 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@ @@ -257,6 +258,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ +READELF = @READELF@ SECTION_LDFLAGS = @SECTION_LDFLAGS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -312,6 +314,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -322,6 +325,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +tmake_file = @tmake_file@ toolexecdir = @toolexecdir@ toolexeclibdir = @toolexeclibdir@ top_build_prefix = @top_build_prefix@ @@ -329,7 +333,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = ffitarget.h -noinst_HEADERS = ffi_common.h ffi_cfi.h +noinst_HEADERS = ffi_common.h ffi_cfi.h tramp.h EXTRA_DIST = ffi.h.in nodist_include_HEADERS = ffi.h ffitarget.h all: all-am @@ -445,7 +449,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/include/ffi.h.in b/include/ffi.h.in index 71cc05c..227ac79 100644 --- a/include/ffi.h.in +++ b/include/ffi.h.in @@ -1,6 +1,7 @@ /* -----------------------------------------------------------------*-C-*- - libffi @VERSION@ - Copyright (c) 2011, 2014, 2019 Anthony Green - - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. + libffi @VERSION@ + - Copyright (c) 2011, 2014, 2019, 2021, 2022 Anthony Green + - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation @@ -55,6 +56,31 @@ extern "C" { /* ---- System configuration information --------------------------------- */ +/* If these change, update src/mips/ffitarget.h. */ +#define FFI_TYPE_VOID 0 +#define FFI_TYPE_INT 1 +#define FFI_TYPE_FLOAT 2 +#define FFI_TYPE_DOUBLE 3 +#if @HAVE_LONG_DOUBLE@ +#define FFI_TYPE_LONGDOUBLE 4 +#else +#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE +#endif +#define FFI_TYPE_UINT8 5 +#define FFI_TYPE_SINT8 6 +#define FFI_TYPE_UINT16 7 +#define FFI_TYPE_SINT16 8 +#define FFI_TYPE_UINT32 9 +#define FFI_TYPE_SINT32 10 +#define FFI_TYPE_UINT64 11 +#define FFI_TYPE_SINT64 12 +#define FFI_TYPE_STRUCT 13 +#define FFI_TYPE_POINTER 14 +#define FFI_TYPE_COMPLEX 15 + +/* This should always refer to the last type code (for sanity checks). */ +#define FFI_TYPE_LAST FFI_TYPE_COMPLEX + #include #ifndef LIBFFI_ASM @@ -217,7 +243,8 @@ FFI_EXTERN ffi_type ffi_type_complex_longdouble; typedef enum { FFI_OK = 0, FFI_BAD_TYPEDEF, - FFI_BAD_ABI + FFI_BAD_ABI, + FFI_BAD_ARGTYPE } ffi_status; typedef struct { @@ -269,7 +296,7 @@ typedef ffi_raw ffi_java_raw; #endif -FFI_API +FFI_API void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, @@ -310,11 +337,17 @@ typedef struct { void *trampoline_table; void *trampoline_table_entry; #else - char tramp[FFI_TRAMPOLINE_SIZE]; + union { + char tramp[FFI_TRAMPOLINE_SIZE]; + void *ftramp; + }; #endif ffi_cif *cif; void (*fun)(ffi_cif*,void*,void**,void*); void *user_data; +#if defined(_MSC_VER) && defined(_M_IX86) + void *padding; +#endif } ffi_closure #ifdef __GNUC__ __attribute__((aligned (8))) @@ -330,6 +363,14 @@ typedef struct { FFI_API void *ffi_closure_alloc (size_t size, void **code); FFI_API void ffi_closure_free (void *); +#if defined(PA_LINUX) || defined(PA_HPUX) +#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2)) +#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3)) +#else +#define FFI_CLOSURE_PTR(X) (X) +#define FFI_RESTORE_PTR(X) (X) +#endif + FFI_API ffi_status ffi_prep_closure (ffi_closure*, ffi_cif *, @@ -347,7 +388,7 @@ ffi_prep_closure_loc (ffi_closure*, ffi_cif *, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data, - void*codeloc); + void *codeloc); #ifdef __sgi # pragma pack 8 @@ -363,9 +404,9 @@ typedef struct { #if !FFI_NATIVE_RAW_API - /* If this is enabled, then a raw closure has the same layout - as a regular closure. We use this to install an intermediate - handler to do the transaltion, void** -> ffi_raw*. */ + /* If this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate + handler to do the translation, void** -> ffi_raw*. */ void (*translate_args)(ffi_cif*,void*,void**,void*); void *this_closure; @@ -389,8 +430,8 @@ typedef struct { #if !FFI_NATIVE_RAW_API - /* If this is enabled, then a raw closure has the same layout - as a regular closure. We use this to install an intermediate + /* If this is enabled, then a raw closure has the same layout + as a regular closure. We use this to install an intermediate handler to do the translation, void** -> ffi_raw*. */ void (*translate_args)(ffi_cif*,void*,void**,void*); @@ -451,7 +492,7 @@ FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, /* ---- Public interface definition -------------------------------------- */ -FFI_API +FFI_API ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, @@ -483,31 +524,6 @@ ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, #endif -/* If these change, update src/mips/ffitarget.h. */ -#define FFI_TYPE_VOID 0 -#define FFI_TYPE_INT 1 -#define FFI_TYPE_FLOAT 2 -#define FFI_TYPE_DOUBLE 3 -#if @HAVE_LONG_DOUBLE@ -#define FFI_TYPE_LONGDOUBLE 4 -#else -#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE -#endif -#define FFI_TYPE_UINT8 5 -#define FFI_TYPE_SINT8 6 -#define FFI_TYPE_UINT16 7 -#define FFI_TYPE_SINT16 8 -#define FFI_TYPE_UINT32 9 -#define FFI_TYPE_SINT32 10 -#define FFI_TYPE_UINT64 11 -#define FFI_TYPE_SINT64 12 -#define FFI_TYPE_STRUCT 13 -#define FFI_TYPE_POINTER 14 -#define FFI_TYPE_COMPLEX 15 - -/* This should always refer to the last type code (for sanity checks). */ -#define FFI_TYPE_LAST FFI_TYPE_COMPLEX - #ifdef __cplusplus } #endif diff --git a/include/ffi_cfi.h b/include/ffi_cfi.h index 244ce57..f4c292d 100644 --- a/include/ffi_cfi.h +++ b/include/ffi_cfi.h @@ -2,6 +2,27 @@ ffi_cfi.h - Copyright (c) 2014 Red Hat, Inc. Conditionally assemble cfi directives. Only necessary for building libffi. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the ``Software''), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ #ifndef FFI_CFI_H diff --git a/include/ffi_common.h b/include/ffi_common.h index 76b9dd6..2bd31b0 100644 --- a/include/ffi_common.h +++ b/include/ffi_common.h @@ -5,6 +5,27 @@ Common internal definitions and macros. Only necessary for building libffi. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the ``Software''), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ #ifndef FFI_COMMON_H @@ -103,6 +124,10 @@ ffi_status ffi_prep_cif_core(ffi_cif *cif, some targets. */ void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN; +/* The arch code calls this to determine if a given closure has a + static trampoline. */ +int ffi_tramp_is_present (void *closure) FFI_HIDDEN; + /* Extended cif, used in callback from assembly routine */ typedef struct { diff --git a/include/tramp.h b/include/tramp.h new file mode 100644 index 0000000..e14e463 --- /dev/null +++ b/include/tramp.h @@ -0,0 +1,45 @@ +/* ----------------------------------------------------------------------- + ffi_tramp.h - Copyright (C) 2021 Microsoft, Inc. + + Static trampoline definitions. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the ``Software''), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef FFI_TRAMP_H +#define FFI_TRAMP_H + +#ifdef __cplusplus +extern "C" { +#endif + +int ffi_tramp_is_supported(void); +void *ffi_tramp_alloc (int flags); +void ffi_tramp_set_parms (void *tramp, void *data, void *code); +void *ffi_tramp_get_addr (void *tramp); +void ffi_tramp_free (void *tramp); + +#ifdef __cplusplus +} +#endif + +#endif /* FFI_TRAMP_H */ diff --git a/install-sh b/install-sh index 8175c64..ec298b5 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ posix_mkdir= # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ Options: --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ while test $# -ne 0; do -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ do dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -301,22 +325,6 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -326,52 +334,49 @@ do fi posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -382,7 +387,7 @@ do then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -411,7 +416,7 @@ do prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 @@ -451,7 +456,18 @@ do trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -477,6 +493,13 @@ do then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -491,9 +514,9 @@ do # file should still install successfully. { test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || + $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 diff --git a/libffi.map.in b/libffi.map.in index 5553ab0..de8778a 100644 --- a/libffi.map.in +++ b/libffi.map.in @@ -6,7 +6,7 @@ /* These version numbers correspond to the libtool-version abi numbers, not to the libffi release numbers. */ -LIBFFI_BASE_7.0 { +LIBFFI_BASE_8.0 { global: /* Exported data variables. */ ffi_type_void; @@ -38,27 +38,23 @@ LIBFFI_BASE_7.0 { ffi_java_raw_to_ptrarray; ffi_java_raw_size; + ffi_get_struct_offsets; local: *; }; -LIBFFI_BASE_7.1 { - global: - ffi_get_struct_offsets; -} LIBFFI_BASE_7.0; - #ifdef FFI_TARGET_HAS_COMPLEX_TYPE -LIBFFI_COMPLEX_7.0 { +LIBFFI_COMPLEX_8.0 { global: /* Exported data variables. */ ffi_type_complex_float; ffi_type_complex_double; ffi_type_complex_longdouble; -} LIBFFI_BASE_7.0; +} LIBFFI_BASE_8.0; #endif #if FFI_CLOSURES -LIBFFI_CLOSURE_7.0 { +LIBFFI_CLOSURE_8.0 { global: ffi_closure_alloc; ffi_closure_free; @@ -68,13 +64,13 @@ LIBFFI_CLOSURE_7.0 { ffi_prep_raw_closure_loc; ffi_prep_java_raw_closure; ffi_prep_java_raw_closure_loc; -} LIBFFI_BASE_7.0; +} LIBFFI_BASE_8.0; #endif #if FFI_GO_CLOSURES -LIBFFI_GO_CLOSURE_7.0 { +LIBFFI_GO_CLOSURE_8.0 { global: ffi_call_go; ffi_prep_go_closure; -} LIBFFI_CLOSURE_7.0; +} LIBFFI_CLOSURE_8.0; #endif diff --git a/libffi.xcodeproj/project.pbxproj b/libffi.xcodeproj/project.pbxproj index 9a107b4..480c4a4 100644 --- a/libffi.xcodeproj/project.pbxproj +++ b/libffi.xcodeproj/project.pbxproj @@ -9,7 +9,6 @@ /* Begin PBXBuildFile section */ 43B5D3F81D35473200D1E1FD /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */; }; 43B5D3FA1D3547CE00D1E1FD /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */; }; - 43E9A5C71D352C1500926A8F /* sysv_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = 43E9A5C51D352C1500926A8F /* sysv_i386.S */; }; 43E9A5C81D352C1500926A8F /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */; }; DBFA714A187F1D8600A76262 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; }; DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713F187F1D8600A76262 /* ffi_common.h */; }; @@ -28,26 +27,18 @@ DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; }; DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; }; DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; }; - DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7176187F1D9B00A76262 /* ffi_i386.c */; }; - DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7182187F1DA100A76262 /* ffi_i386.h */; }; DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7183187F1DA100A76262 /* ffi_x86_64.h */; }; - DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7184187F1DA100A76262 /* fficonfig_i386.h */; }; DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */; }; - DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7186187F1DA100A76262 /* ffitarget_i386.h */; }; DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */; }; DBFA7194187F1DA100A76262 /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* unix64_x86_64.S */; }; - DBFA7195187F1DA100A76262 /* sysv_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718B187F1DA100A76262 /* sysv_i386.S */; }; DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; }; - DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718D187F1DA100A76262 /* ffi_i386.c */; }; FDB52FB31F6144FA00AA92E6 /* unix64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */; }; - FDB52FB41F6144FA00AA92E6 /* sysv_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = 43E9A5C51D352C1500926A8F /* sysv_i386.S */; }; FDB52FB51F6144FA00AA92E6 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; }; FDB52FB61F6144FA00AA92E6 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; }; FDB52FB71F6144FA00AA92E6 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; }; FDB52FB81F6144FA00AA92E6 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; }; FDB52FB91F6144FA00AA92E6 /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */; }; FDB52FBA1F6144FA00AA92E6 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; }; - FDB52FBB1F6144FA00AA92E6 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7176187F1D9B00A76262 /* ffi_i386.c */; }; FDB52FBC1F6144FA00AA92E6 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; }; FDB52FBD1F6144FA00AA92E6 /* sysv_arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716D187F1D9B00A76262 /* sysv_arm64.S */; }; FDB52FBE1F6144FA00AA92E6 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; }; @@ -56,7 +47,6 @@ FDB52FD01F614A8B00AA92E6 /* ffi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; }; FDB52FD11F614AA700AA92E6 /* ffi_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA715E187F1D9B00A76262 /* ffi_arm64.h */; }; FDB52FD21F614AAB00AA92E6 /* ffi_armv7.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA715F187F1D9B00A76262 /* ffi_armv7.h */; }; - FDB52FD31F614AB000AA92E6 /* ffi_i386.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7160187F1D9B00A76262 /* ffi_i386.h */; }; FDB52FD41F614AB500AA92E6 /* ffi_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */; }; FDB52FD51F614AE200AA92E6 /* ffi.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; }; FDB52FD61F614AEA00AA92E6 /* ffi_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA715E187F1D9B00A76262 /* ffi_arm64.h */; }; @@ -64,7 +54,6 @@ FDB52FD81F614B8700AA92E6 /* ffitarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; }; FDB52FD91F614B8E00AA92E6 /* ffitarget_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */; }; FDB52FDA1F614B9300AA92E6 /* ffitarget_armv7.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */; }; - FDB52FDB1F614B9700AA92E6 /* ffitarget_i386.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */; }; FDB52FDD1F614BA900AA92E6 /* ffitarget_x86_64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */; }; FDB52FDE1F6155E300AA92E6 /* ffitarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; }; FDB52FDF1F6155EA00AA92E6 /* ffitarget_arm64.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */; }; @@ -76,9 +65,7 @@ FDDB2F411F5D66E200EF414E /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */; }; FDDB2F461F5D691E00EF414E /* win64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F441F5D68C900EF414E /* win64_x86_64.S */; }; FDDB2F4A1F5D846400EF414E /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; }; - FDDB2F4B1F5D846400EF414E /* sysv_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718B187F1DA100A76262 /* sysv_i386.S */; }; FDDB2F4C1F5D846400EF414E /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; }; - FDDB2F4D1F5D846400EF414E /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718D187F1DA100A76262 /* ffi_i386.c */; }; FDDB2F4E1F5D846400EF414E /* ffiw64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */; }; FDDB2F4F1F5D846400EF414E /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; }; FDDB2F501F5D846400EF414E /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; }; @@ -97,12 +84,10 @@ FDB52FD01F614A8B00AA92E6 /* ffi.h in CopyFiles */, FDB52FD11F614AA700AA92E6 /* ffi_arm64.h in CopyFiles */, FDB52FD21F614AAB00AA92E6 /* ffi_armv7.h in CopyFiles */, - FDB52FD31F614AB000AA92E6 /* ffi_i386.h in CopyFiles */, FDB52FD41F614AB500AA92E6 /* ffi_x86_64.h in CopyFiles */, FDB52FD81F614B8700AA92E6 /* ffitarget.h in CopyFiles */, FDB52FD91F614B8E00AA92E6 /* ffitarget_arm64.h in CopyFiles */, FDB52FDA1F614B9300AA92E6 /* ffitarget_armv7.h in CopyFiles */, - FDB52FDB1F614B9700AA92E6 /* ffitarget_i386.h in CopyFiles */, FDB52FDD1F614BA900AA92E6 /* ffitarget_x86_64.h in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; @@ -140,7 +125,6 @@ /* Begin PBXFileReference section */ 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffiw64_x86_64.c; sourceTree = ""; }; 43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = win64_x86_64.S; sourceTree = ""; }; - 43E9A5C51D352C1500926A8F /* sysv_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_i386.S; sourceTree = ""; }; 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = unix64_x86_64.S; sourceTree = ""; }; 43E9A5DA1D35373600926A8F /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; 43E9A5DB1D35374400926A8F /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = internal.h; sourceTree = ""; }; @@ -159,32 +143,23 @@ DBFA7149187F1D8600A76262 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = types.c; sourceTree = ""; }; DBFA715E187F1D9B00A76262 /* ffi_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_arm64.h; sourceTree = ""; }; DBFA715F187F1D9B00A76262 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = ""; }; - DBFA7160187F1D9B00A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = ""; }; DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = ""; }; DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_arm64.h; sourceTree = ""; }; DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = ""; }; - DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = ""; }; DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = ""; }; DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm64.h; sourceTree = ""; }; DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = ""; }; - DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = ""; }; DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = ""; }; DBFA716C187F1D9B00A76262 /* ffi_arm64.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.c; path = ffi_arm64.c; sourceTree = ""; }; DBFA716D187F1D9B00A76262 /* sysv_arm64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_arm64.S; sourceTree = ""; }; DBFA716F187F1D9B00A76262 /* ffi_armv7.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.c; path = ffi_armv7.c; sourceTree = ""; }; DBFA7170187F1D9B00A76262 /* sysv_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_armv7.S; sourceTree = ""; }; DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = ""; }; - DBFA7176187F1D9B00A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = ""; }; - DBFA7182187F1DA100A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = ""; }; DBFA7183187F1DA100A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = ""; }; - DBFA7184187F1DA100A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = ""; }; DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = ""; }; - DBFA7186187F1DA100A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = ""; }; DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = ""; }; DBFA718A187F1DA100A76262 /* unix64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = unix64_x86_64.S; sourceTree = ""; }; - DBFA718B187F1DA100A76262 /* sysv_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_i386.S; sourceTree = ""; }; DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = ""; }; - DBFA718D187F1DA100A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = ""; }; FDB52FC51F6144FA00AA92E6 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; }; FDDB2F3E1F5D61BC00EF414E /* asmnames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asmnames.h; sourceTree = ""; }; FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffiw64_x86_64.c; sourceTree = ""; }; @@ -262,15 +237,12 @@ children = ( DBFA715E187F1D9B00A76262 /* ffi_arm64.h */, DBFA715F187F1D9B00A76262 /* ffi_armv7.h */, - DBFA7160187F1D9B00A76262 /* ffi_i386.h */, DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */, DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */, DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */, - DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */, DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */, DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */, DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */, - DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */, DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */, ); path = include; @@ -313,8 +285,6 @@ 43E9A5DD1D35375400926A8F /* internal64.h */, DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */, 43B5D3F71D35473200D1E1FD /* ffiw64_x86_64.c */, - DBFA7176187F1D9B00A76262 /* ffi_i386.c */, - 43E9A5C51D352C1500926A8F /* sysv_i386.S */, 43E9A5C61D352C1500926A8F /* unix64_x86_64.S */, 43B5D3F91D3547CE00D1E1FD /* win64_x86_64.S */, ); @@ -333,11 +303,8 @@ DBFA7181187F1DA100A76262 /* include */ = { isa = PBXGroup; children = ( - DBFA7182187F1DA100A76262 /* ffi_i386.h */, DBFA7183187F1DA100A76262 /* ffi_x86_64.h */, - DBFA7184187F1DA100A76262 /* fficonfig_i386.h */, DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */, - DBFA7186187F1DA100A76262 /* ffitarget_i386.h */, DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */, ); path = include; @@ -359,8 +326,6 @@ FDDB2F3E1F5D61BC00EF414E /* asmnames.h */, DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */, FDDB2F3F1F5D666900EF414E /* ffiw64_x86_64.c */, - DBFA718D187F1DA100A76262 /* ffi_i386.c */, - DBFA718B187F1DA100A76262 /* sysv_i386.S */, DBFA718A187F1DA100A76262 /* unix64_x86_64.S */, FDDB2F441F5D68C900EF414E /* win64_x86_64.S */, ); @@ -379,11 +344,8 @@ DBFA714A187F1D8600A76262 /* ffi.h in Headers */, DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */, DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */, - DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */, - DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */, DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */, DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */, - DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -549,14 +511,12 @@ buildActionMask = 2147483647; files = ( 43E9A5C81D352C1500926A8F /* unix64_x86_64.S in Sources */, - 43E9A5C71D352C1500926A8F /* sysv_i386.S in Sources */, DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */, DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */, DBFA714E187F1D8600A76262 /* closures.c in Sources */, DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */, 43B5D3F81D35473200D1E1FD /* ffiw64_x86_64.c in Sources */, DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */, - DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */, DBFA7158187F1D8600A76262 /* raw_api.c in Sources */, DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */, DBFA715A187F1D8600A76262 /* types.c in Sources */, @@ -570,9 +530,7 @@ buildActionMask = 2147483647; files = ( DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */, - DBFA7195187F1DA100A76262 /* sysv_i386.S in Sources */, DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */, - DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */, FDDB2F411F5D66E200EF414E /* ffiw64_x86_64.c in Sources */, DBFA715B187F1D8600A76262 /* types.c in Sources */, DBFA7159187F1D8600A76262 /* raw_api.c in Sources */, @@ -587,14 +545,12 @@ buildActionMask = 2147483647; files = ( FDB52FB31F6144FA00AA92E6 /* unix64_x86_64.S in Sources */, - FDB52FB41F6144FA00AA92E6 /* sysv_i386.S in Sources */, FDB52FB51F6144FA00AA92E6 /* ffi64_x86_64.c in Sources */, FDB52FB61F6144FA00AA92E6 /* ffi_armv7.c in Sources */, FDB52FB71F6144FA00AA92E6 /* closures.c in Sources */, FDB52FB81F6144FA00AA92E6 /* sysv_armv7.S in Sources */, FDB52FB91F6144FA00AA92E6 /* ffiw64_x86_64.c in Sources */, FDB52FBA1F6144FA00AA92E6 /* prep_cif.c in Sources */, - FDB52FBB1F6144FA00AA92E6 /* ffi_i386.c in Sources */, FDB52FBC1F6144FA00AA92E6 /* raw_api.c in Sources */, FDB52FBD1F6144FA00AA92E6 /* sysv_arm64.S in Sources */, FDB52FBE1F6144FA00AA92E6 /* types.c in Sources */, @@ -608,9 +564,7 @@ buildActionMask = 2147483647; files = ( FDDB2F4A1F5D846400EF414E /* ffi64_x86_64.c in Sources */, - FDDB2F4B1F5D846400EF414E /* sysv_i386.S in Sources */, FDDB2F4C1F5D846400EF414E /* prep_cif.c in Sources */, - FDDB2F4D1F5D846400EF414E /* ffi_i386.c in Sources */, FDDB2F4E1F5D846400EF414E /* ffiw64_x86_64.c in Sources */, FDDB2F4F1F5D846400EF414E /* types.c in Sources */, FDDB2F501F5D846400EF414E /* raw_api.c in Sources */, @@ -712,7 +666,7 @@ PRODUCT_NAME = ffi; SDKROOT = iphoneos; SKIP_INSTALL = YES; - VALID_ARCHS = "arm64 armv7 armv7s i386 x86_64"; + VALID_ARCHS = "arm64 armv7 armv7s x86_64"; }; name = Debug; }; @@ -746,7 +700,7 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; VALIDATE_PRODUCT = YES; - VALID_ARCHS = "arm64 armv7 armv7s i386 x86_64"; + VALID_ARCHS = "arm64 armv7 armv7s x86_64"; }; name = Release; }; diff --git a/libtool-version b/libtool-version index e4f5aa2..03f5402 100644 --- a/libtool-version +++ b/libtool-version @@ -5,7 +5,7 @@ # # Here are a set of rules to help you update your library version # information: -# +# # 1. Start with version information of `0:0:0' for each libtool library. # # 2. Update the version information only immediately before a public @@ -26,4 +26,4 @@ # release, then set age to 0. # # CURRENT:REVISION:AGE -8:0:1 +9:2:1 diff --git a/ltmain.sh b/ltmain.sh index 7f3523d..49fcad1 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.4.7 +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ package_revision=2.4.6 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -139,9 +130,12 @@ do _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ test -z "$SED" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ test -z "$GREP" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ sed_double_backslash="\ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -580,16 +623,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1134,203 @@ func_relative_path () } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break + fi + + # Quote for eval. + case $func_quote_portable_result in *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi + + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () { - $debug_cmd - - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; - esac - - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: ;; esac - func_quote_for_expand_result=$_G_arg + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result + ;; + esac +} + + +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1215,8 +1376,8 @@ func_show_eval () _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1241,8 +1402,8 @@ func_show_eval_locale () _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1369,30 +1530,26 @@ func_lt_ver () # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# Please report bugs or propose patches to: +# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1415,7 +1572,7 @@ scriptversion=2014-01-07.03; # UTC # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1427,7 +1584,7 @@ scriptversion=2014-01-07.03; # UTC # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1476,8 +1633,8 @@ fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1510,7 +1667,8 @@ func_add_hook () # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1519,10 +1677,28 @@ func_remove_hook () } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1532,22 +1708,19 @@ func_run_hooks () case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1557,10 +1730,18 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1751,8 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1761,36 @@ func_run_hooks () # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1610,17 +1801,26 @@ func_run_hooks () # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1830,27 @@ func_options () { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1649,9 +1859,8 @@ func_options () # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1662,9 +1871,7 @@ func_options_prep () opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1676,25 +1883,32 @@ func_parse_options () { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1704,7 +1918,10 @@ func_parse_options () ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1974,24 @@ func_parse_options () shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1782,12 +2008,10 @@ func_validate_options () test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1843,8 +2067,8 @@ func_missing_arg () # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1859,8 +2083,9 @@ then func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1870,7 +2095,7 @@ else func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals @@ -1896,7 +2121,7 @@ else { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -1938,31 +2163,44 @@ func_usage_message () # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^# Written by / { - s|^# || - p - } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -1972,12 +2210,12 @@ func_version () # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... @@ -2068,7 +2306,7 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2270,6 +2508,8 @@ libtool_options_prep () nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2533,16 @@ libtool_options_prep () uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2554,12 @@ libtool_parse_options () { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2634,20 @@ libtool_parse_options () func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2415,17 +2668,10 @@ libtool_validate_options () # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" - case $host in - # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 - # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac + # Keeping compiler generated duplicates in $postdeps and $predeps is not + # harmful, and is necessary in a majority of systems that use it to satisfy + # symbol dependencies. + opt_duplicate_compiler_generated_deps=: $opt_help || { # Sanity checks first: @@ -2451,8 +2697,8 @@ libtool_validate_options () } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3418,8 +3664,8 @@ func_mode_compile () esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3492,8 +3738,8 @@ compiler." func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3648,7 +3894,8 @@ This mode accepts the following additional options: -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3754,6 +4001,8 @@ The following components of LINK-COMMAND are treated specially: -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4096,8 +4345,8 @@ func_mode_install () case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4107,8 +4356,8 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4165,12 +4414,12 @@ func_mode_install () esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4181,8 +4430,8 @@ func_mode_install () if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4478,8 +4727,8 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5258,7 +5507,8 @@ else if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5268,7 +5518,7 @@ func_fallback_echo () \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6611,9 +6861,9 @@ func_mode_link () while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6849,6 +7099,13 @@ func_mode_link () prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7019,7 +7276,7 @@ func_mode_link () # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7039,7 +7296,7 @@ func_mode_link () esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7069,8 +7326,20 @@ func_mode_link () prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" @@ -7211,9 +7480,9 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7227,16 +7496,21 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7254,8 +7528,8 @@ func_mode_link () # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7274,12 +7548,15 @@ func_mode_link () # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7300,15 +7577,15 @@ func_mode_link () continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7428,8 +7705,8 @@ func_mode_link () *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -8634,7 +8911,7 @@ func_mode_link () test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8807,7 +9084,7 @@ func_mode_link () # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor @@ -8898,7 +9175,7 @@ func_mode_link () versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9124,7 +9401,7 @@ func_mode_link () *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -9935,8 +10212,8 @@ EOF for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10029,8 +10306,8 @@ EOF eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10504,12 +10781,13 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10749,13 +11027,15 @@ EOF elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi diff --git a/m4/ax_cc_maxopt.m4 b/m4/ax_cc_maxopt.m4 index 9e7f1ee..2f447af 100644 --- a/m4/ax_cc_maxopt.m4 +++ b/m4/ax_cc_maxopt.m4 @@ -55,7 +55,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 17 +#serial 22 AC_DEFUN([AX_CC_MAXOPT], [ @@ -67,20 +67,19 @@ AC_ARG_ENABLE(portable-binary, [AS_HELP_STRING([--enable-portable-binary], [disa acx_maxopt_portable=$enableval, acx_maxopt_portable=no) # Try to determine "good" native compiler flags if none specified via CFLAGS -if test "$ac_test_CFLAGS" != "set"; then - CFLAGS="" +if test "x$ac_test_CFLAGS" = "x"; then case $ax_cv_c_compiler_vendor in - dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" + dec) CFLAGS="$CFLAGS -newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" if test "x$acx_maxopt_portable" = xno; then CFLAGS="$CFLAGS -arch host" fi;; - sun) CFLAGS="-native -fast -xO5 -dalign" + sun) CFLAGS="$CFLAGS -native -fast -xO5 -dalign" if test "x$acx_maxopt_portable" = xyes; then CFLAGS="$CFLAGS -xarch=generic" fi;; - hp) CFLAGS="+Oall +Optrs_ansi +DSnative" + hp) CFLAGS="$CFLAGS +Oall +Optrs_ansi +DSnative" if test "x$acx_maxopt_portable" = xyes; then CFLAGS="$CFLAGS +DAportable" fi;; @@ -91,8 +90,8 @@ if test "$ac_test_CFLAGS" != "set"; then xlc_opt="-qtune=auto" fi AX_CHECK_COMPILE_FLAG($xlc_opt, - CFLAGS="-O3 -qansialias -w $xlc_opt", - [CFLAGS="-O3 -qansialias -w" + CFLAGS="$CFLAGS -O3 -qansialias -w $xlc_opt", + [CFLAGS="$CFLAGS -O3 -qansialias -w" echo "******************************************************" echo "* You seem to have the IBM C compiler. It is *" echo "* recommended for best performance that you use: *" @@ -105,7 +104,7 @@ if test "$ac_test_CFLAGS" != "set"; then echo "******************************************************"]) ;; - intel) CFLAGS="-O3 -ansi_alias" + intel) CFLAGS="$CFLAGS -O3 -ansi_alias" if test "x$acx_maxopt_portable" = xno; then icc_archflag=unknown icc_flags="" @@ -144,12 +143,18 @@ if test "$ac_test_CFLAGS" != "set"; then fi ;; + nvhpc) + # default optimization flags for nvhpc + CFLAGS="$CFLAGS -O3" + ;; + gnu) # default optimization flags for gcc on all systems - CFLAGS="-O3 -fomit-frame-pointer" + CFLAGS="$CFLAGS -O3 -fomit-frame-pointer" # -malign-double for x86 systems - # libffi local change -- don't align double, as it changes the ABI + # LIBFFI_LOCAL: don't do this. + # The testsuite doesn't use these flags and we'll get test failures. # AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double") # -fstrict-aliasing for gcc-2.95+ @@ -164,7 +169,7 @@ if test "$ac_test_CFLAGS" != "set"; then microsoft) # default optimization flags for MSVC opt builds - CFLAGS="-O2" + CFLAGS="$CFLAGS -O2" ;; esac @@ -176,7 +181,7 @@ if test "$ac_test_CFLAGS" != "set"; then echo "* (otherwise, a default of CFLAGS=-O3 will be used) *" echo "********************************************************" echo "" - CFLAGS="-O3" + CFLAGS="$CFLAGS -O3" fi AX_CHECK_COMPILE_FLAG($CFLAGS, [], [ @@ -187,7 +192,6 @@ if test "$ac_test_CFLAGS" != "set"; then echo "* Use ./configure CFLAGS=... to specify your own flags *" echo "********************************************************" echo "" - CFLAGS="" ]) fi diff --git a/m4/ax_cflags_warn_all.m4 b/m4/ax_cflags_warn_all.m4 index 094577e..9235a18 100644 --- a/m4/ax_cflags_warn_all.m4 +++ b/m4/ax_cflags_warn_all.m4 @@ -4,33 +4,54 @@ # # SYNOPSIS # -# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] -# AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] -# AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])] +# AX_CFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])] +# AX_CXXFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])] +# AX_FCFLAGS_WARN_ALL [(shellvar[, default[, action-if-found[, action-if-not-found]]])] # # DESCRIPTION # -# Try to find a compiler option that enables most reasonable warnings. +# Specify compiler options that enable most reasonable warnings. For the +# GNU Compiler Collection (GCC), for example, it will be "-Wall". The +# result is added to shellvar, one of CFLAGS, CXXFLAGS or FCFLAGS if the +# first parameter is not specified. # -# For the GNU compiler it will be -Wall (and -ansi -pedantic) The result -# is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default. +# Each of these macros accepts the following optional arguments: # -# Currently this macro knows about the GCC, Solaris, Digital Unix, AIX, -# HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and -# Intel compilers. For a given compiler, the Fortran flags are much more -# experimental than their C equivalents. +# - $1 - shellvar +# shell variable to use (CFLAGS, CXXFLAGS or FCFLAGS if not +# specified, depending on macro) # -# - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS -# - $2 add-value-if-not-found : nothing -# - $3 action-if-found : add value to shellvariable -# - $4 action-if-not-found : nothing +# - $2 - default +# value to use for flags if compiler vendor cannot be determined (by +# default, "") # -# NOTE: These macros depend on AX_APPEND_FLAG. +# - $3 - action-if-found +# action to take if the compiler vendor has been successfully +# determined (by default, add the appropriate compiler flags to +# shellvar) +# +# - $4 - action-if-not-found +# action to take if the compiler vendor has not been determined or +# is unknown (by default, add the default flags, or "" if not +# specified, to shellvar) +# +# These macros use AX_COMPILER_VENDOR to determine which flags should be +# returned for a given compiler. Not all compilers currently have flags +# defined for them; patches are welcome. If need be, compiler flags may +# be made language-dependent: use a construct like the following: +# +# [vendor_name], [m4_if(_AC_LANG_PREFIX,[C], VAR="--relevant-c-flags",dnl +# m4_if(_AC_LANG_PREFIX,[CXX], VAR="--relevant-c++-flags",dnl +# m4_if(_AC_LANG_PREFIX,[FC], VAR="--relevant-fortran-flags",dnl +# VAR="$2"; FOUND="no")))], +# +# Note: These macros also depend on AX_PREPEND_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2010 Rhys Ulerich +# Copyright (c) 2018 John Zaitseff # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -58,65 +79,80 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 16 +#serial 25 -AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl -AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl -AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl -AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], -VAR,[VAR="no, unknown" -ac_save_[]FLAGS="$[]FLAGS" -for ac_arg dnl -in "-warn all % -warn all" dnl Intel - "-pedantic % -Wall" dnl GCC - "-xstrconst % -v" dnl Solaris C - "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix - "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX - "-ansi -ansiE % -fullwarn" dnl IRIX - "+ESlit % +w1" dnl HP-UX C - "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) - "-h conform % -h msglevel 2" dnl Cray C (Unicos) - # -do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) -done -FLAGS="$ac_save_[]FLAGS" -]) -AS_VAR_POPDEF([FLAGS])dnl -AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) -case ".$VAR" in - .ok|.ok,*) m4_ifvaln($3,$3) ;; - .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; - *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;; -esac -AS_VAR_POPDEF([VAR])dnl +AC_DEFUN([AX_FLAGS_WARN_ALL], [ + AX_REQUIRE_DEFINED([AX_PREPEND_FLAG])dnl + AC_REQUIRE([AX_COMPILER_VENDOR])dnl + + AS_VAR_PUSHDEF([FLAGS], [m4_default($1,_AC_LANG_PREFIX[]FLAGS)])dnl + AS_VAR_PUSHDEF([VAR], [ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl + AS_VAR_PUSHDEF([FOUND], [ac_save_[]_AC_LANG_ABBREV[]flags_warn_all_found])dnl + + AC_CACHE_CHECK([FLAGS for most reasonable warnings], VAR, [ + VAR="" + FOUND="yes" + dnl Cases are listed in the order found in ax_compiler_vendor.m4 + AS_CASE("$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor", + [intel], [VAR="-w2"], + [ibm], [VAR="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd"], + [pathscale], [], + [clang], [VAR="-Wall"], + [cray], [VAR="-h msglevel 2"], + [fujitsu], [], + [sdcc], [], + [sx], [VAR="-pvctl[,]fullmsg"], + [portland], [], + [gnu], [VAR="-Wall"], + [sun], [VAR="-v"], + [hp], [VAR="+w1"], + [dec], [VAR="-verbose -w0 -warnprotos"], + [borland], [], + [comeau], [], + [kai], [], + [lcc], [], + [sgi], [VAR="-fullwarn"], + [microsoft], [], + [metrowerks], [], + [watcom], [], + [tcc], [], + [unknown], [ + VAR="$2" + FOUND="no" + ], + [ + AC_MSG_WARN([Unknown compiler vendor returned by [AX_COMPILER_VENDOR]]) + VAR="$2" + FOUND="no" + ] + ) + + AS_IF([test "x$FOUND" = "xyes"], [dnl + m4_default($3, [AS_IF([test "x$VAR" != "x"], [AX_PREPEND_FLAG([$VAR], [FLAGS])])]) + ], [dnl + m4_default($4, [m4_ifval($2, [AX_PREPEND_FLAG([$VAR], [FLAGS])], [true])]) + ])dnl + ])dnl + + AS_VAR_POPDEF([FOUND])dnl + AS_VAR_POPDEF([VAR])dnl + AS_VAR_POPDEF([FLAGS])dnl ])dnl AX_FLAGS_WARN_ALL -dnl implementation tactics: -dnl the for-argument contains a list of options. The first part of -dnl these does only exist to detect the compiler - usually it is -dnl a global option to enable -ansi or -extrawarnings. All other -dnl compilers will fail about it. That was needed since a lot of -dnl compilers will give false positives for some option-syntax -dnl like -Woption or -Xoption as they think of it is a pass-through -dnl to later compile stages or something. The "%" is used as a -dnl delimiter. A non-option comment can be given after "%%" marks -dnl which will be shown but not added to the respective C/CXXFLAGS. -AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl -AC_LANG_PUSH([C]) -AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) -AC_LANG_POP([C]) -]) +AC_DEFUN([AX_CFLAGS_WARN_ALL], [dnl + AC_LANG_PUSH([C]) + AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) + AC_LANG_POP([C]) +])dnl -AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl -AC_LANG_PUSH([C++]) -AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) -AC_LANG_POP([C++]) -]) +AC_DEFUN([AX_CXXFLAGS_WARN_ALL], [dnl + AC_LANG_PUSH([C++]) + AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) + AC_LANG_POP([C++]) +])dnl -AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl -AC_LANG_PUSH([Fortran]) -AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) -AC_LANG_POP([Fortran]) -]) +AC_DEFUN([AX_FCFLAGS_WARN_ALL], [dnl + AC_LANG_PUSH([Fortran]) + AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) + AC_LANG_POP([Fortran]) +])dnl diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4 index 73efdb0..039f99d 100644 --- a/m4/ax_compiler_vendor.m4 +++ b/m4/ax_compiler_vendor.m4 @@ -8,15 +8,30 @@ # # DESCRIPTION # -# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, -# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, -# watcom, etc. The vendor is returned in the cache variable -# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. +# Determine the vendor of the C, C++ or Fortran compiler. The vendor is +# returned in the cache variable $ax_cv_c_compiler_vendor for C, +# $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for +# (modern) Fortran. The value is one of "intel", "ibm", "pathscale", +# "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "nvhpc" (NVIDIA HPC +# Compiler), "portland" (PGI), "gnu" (GCC), "sun" (Oracle Developer +# Studio), "hp", "dec", "borland", "comeau", "kai", "lcc", "sgi", +# "microsoft", "metrowerks", "watcom", "tcc" (Tiny CC) or "unknown" (if +# the compiler cannot be determined). +# +# To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT +# with an appropriate preprocessor-enabled extension. For example: +# +# AC_LANG_PUSH([Fortran]) +# AC_PROG_FC +# AC_FC_PP_SRCEXT([F]) +# AX_COMPILER_VENDOR +# AC_LANG_POP([Fortran]) # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo +# Copyright (c) 2018-19 John Zaitseff # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -44,45 +59,61 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 17 +#serial 32 -AC_DEFUN([AX_COMPILER_VENDOR], -[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, - dnl Please add if possible support to ax_compiler_version.m4 - [# note: don't check for gcc first since some other compilers define __GNUC__ - vendors="intel: __ICC,__ECC,__INTEL_COMPILER - ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ - pathscale: __PATHCC__,__PATHSCALE__ - clang: __clang__ - cray: _CRAYC - fujitsu: __FUJITSU - sdcc: SDCC, __SDCC - gnu: __GNUC__ - sun: __SUNPRO_C,__SUNPRO_CC - hp: __HP_cc,__HP_aCC - dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER - borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ - comeau: __COMO__ - kai: __KCC - lcc: __LCC__ - sgi: __sgi,sgi - microsoft: _MSC_VER - metrowerks: __MWERKS__ - watcom: __WATCOMC__ - portland: __PGI - tcc: __TINYC__ - unknown: UNKNOWN" - for ventest in $vendors; do - case $ventest in - *:) vendor=$ventest; continue ;; - *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; - esac - AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ - #if !($vencpp) - thisisanerror; - #endif - ])], [break]) - done - ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` - ]) -]) +AC_DEFUN([AX_COMPILER_VENDOR], [dnl + AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl + dnl If you modify this list of vendors, please add similar support + dnl to ax_compiler_version.m4 if at all possible. + dnl + dnl Note: Do NOT check for GCC first since some other compilers + dnl define __GNUC__ to remain compatible with it. Compilers that + dnl are very slow to start (such as Intel) are listed first. + + vendors=" + intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + sdcc: SDCC,__SDCC + sx: _SX + nvhpc: __NVCOMPILER + portland: __PGI + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + tcc: __TINYC__ + unknown: UNKNOWN + " + for ventest in $vendors; do + case $ventest in + *:) + vendor=$ventest + continue + ;; + *) + vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" + ;; + esac + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ +#if !($vencpp) + thisisanerror; +#endif + ]])], [break]) + done + + ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` + ]) +])dnl diff --git a/m4/ax_append_flag.m4 b/m4/ax_prepend_flag.m4 similarity index 74% rename from m4/ax_append_flag.m4 rename to m4/ax_prepend_flag.m4 index dd6d8b6..adac8c5 100644 --- a/m4/ax_append_flag.m4 +++ b/m4/ax_prepend_flag.m4 @@ -1,36 +1,37 @@ # =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html +# https://www.gnu.org/software/autoconf-archive/ax_prepend_flag.html # =========================================================================== # # SYNOPSIS # -# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE]) +# AX_PREPEND_FLAG(FLAG, [FLAGS-VARIABLE]) # # DESCRIPTION # -# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space -# added in between. +# FLAG is added to the front of the FLAGS-VARIABLE shell variable, with a +# space added in between. # # If FLAGS-VARIABLE is not specified, the current language's flags (e.g. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly # FLAG. # -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. +# NOTE: Implementation based on AX_APPEND_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans +# Copyright (c) 2018 John Zaitseff # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 8 +#serial 2 -AC_DEFUN([AX_APPEND_FLAG], +AC_DEFUN([AX_PREPEND_FLAG], [dnl AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])]) @@ -38,7 +39,7 @@ AS_VAR_SET_IF(FLAGS,[ AS_CASE([" AS_VAR_GET(FLAGS) "], [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])], [ - AS_VAR_APPEND(FLAGS,[" $1"]) + FLAGS="$1 $FLAGS" AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) ], @@ -47,4 +48,4 @@ AS_VAR_SET_IF(FLAGS,[ AC_RUN_LOG([: FLAGS="$FLAGS"]) ]) AS_VAR_POPDEF([FLAGS])dnl -])dnl AX_APPEND_FLAG +])dnl AX_PREPEND_FLAG diff --git a/m4/libtool.m4 b/m4/libtool.m4 index a644432..e3adeda 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ m4_define([_LT_COPYING], [dnl # along with this program. If not, see . ]) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl @@ -219,8 +221,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -778,7 +780,7 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1042,8 +1044,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1067,17 +1069,12 @@ _LT_EOF _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1126,12 +1123,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1245,7 +1242,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot @@ -1262,7 +1260,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1292,7 +1290,7 @@ ia64-*-hpux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1309,7 +1307,7 @@ ia64-*-hpux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1321,7 +1319,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1343,7 +1341,7 @@ mips64*-*linux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1351,7 +1349,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1359,7 +1357,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1379,14 +1377,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1454,7 +1452,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1493,9 +1491,22 @@ need_locks=$enable_libtool_lock m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -1714,7 +1725,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1757,7 +1768,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2207,26 +2218,35 @@ m4_defun([_LT_CMD_STRIPLIB], striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2549,7 +2569,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; @@ -2559,14 +2579,14 @@ m4_if([$1], [],[ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2585,7 +2605,7 @@ m4_if([$1], [],[ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2622,7 +2642,7 @@ m4_if([$1], [],[ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2655,7 +2675,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3457,7 +3477,7 @@ beos*) bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3491,14 +3511,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3512,7 +3532,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' @@ -3559,7 +3579,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3686,13 +3706,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3718,7 +3738,7 @@ else # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3958,7 +3978,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3976,20 +3996,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4013,7 +4033,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4031,9 +4051,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4320,7 +4340,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4403,7 +4423,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4739,7 +4759,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4922,7 +4942,7 @@ m4_if([$1], [CXX], [ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4930,7 +4950,7 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4987,15 +5007,15 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5047,7 +5067,7 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5159,6 +5179,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5173,7 +5194,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5216,7 +5237,7 @@ _LT_EOF _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5228,7 +5249,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -5244,7 +5265,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5376,7 +5397,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5559,12 +5580,12 @@ _LT_EOF cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5605,7 +5626,7 @@ _LT_EOF fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5653,7 +5674,7 @@ _LT_EOF ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5864,6 +5885,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6634,8 +6656,8 @@ if test yes != "$_lt_caught_CXX_error"; then cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6733,6 +6755,7 @@ if test yes != "$_lt_caught_CXX_error"; then emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6763,7 +6786,7 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6900,7 +6923,7 @@ if test yes != "$_lt_caught_CXX_error"; then # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7040,13 +7063,13 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8192,6 +8215,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 index 94b0829..b0b5e9c 100644 --- a/m4/ltoptions.m4 +++ b/m4/ltoptions.m4 @@ -1,7 +1,7 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 index 48bc934..902508b 100644 --- a/m4/ltsugar.m4 +++ b/m4/ltsugar.m4 @@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 index fa04b52..b155d0a 100644 --- a/m4/ltversion.m4 +++ b/m4/ltversion.m4 @@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 index c6b26f8..0f7a875 100644 --- a/m4/lt~obsolete.m4 +++ b/m4/lt~obsolete.m4 @@ -1,7 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives diff --git a/man/Makefile.in b/man/Makefile.in index aaf7cb2..830c842 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,7 +91,6 @@ target_triplet = @target@ subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cc_maxopt.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ @@ -100,6 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ $(top_srcdir)/m4/ax_enable_builddir.m4 \ $(top_srcdir)/m4/ax_gcc_archflag.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ + $(top_srcdir)/m4/ax_prepend_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ @@ -182,8 +182,9 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -198,9 +199,11 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@ @@ -239,6 +242,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ +READELF = @READELF@ SECTION_LDFLAGS = @SECTION_LDFLAGS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -294,6 +298,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -304,6 +309,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +tmake_file = @tmake_file@ toolexecdir = @toolexecdir@ toolexeclibdir = @toolexeclibdir@ top_build_prefix = @top_build_prefix@ @@ -399,7 +405,6 @@ ctags CTAGS: cscope cscopelist: - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/missing b/missing index 625aeb1..1fe1611 100755 --- a/missing +++ b/missing @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff --git a/msvc_build/aarch64/aarch64_include/ffi.h b/msvc_build/aarch64/aarch64_include/ffi.h index 02f26a2..8aed525 100644 --- a/msvc_build/aarch64/aarch64_include/ffi.h +++ b/msvc_build/aarch64/aarch64_include/ffi.h @@ -363,7 +363,7 @@ typedef struct { /* If this is enabled, then a raw closure has the same layout as a regular closure. We use this to install an intermediate - handler to do the transaltion, void** -> ffi_raw*. */ + handler to do the translation, void** -> ffi_raw*. */ void (*translate_args)(ffi_cif*,void*,void**,void*); void *this_closure; diff --git a/msvcc.sh b/msvcc.sh index 97facd6..301e2fb 100755 --- a/msvcc.sh +++ b/msvcc.sh @@ -52,7 +52,7 @@ ml="ml" safeseh="-safeseh" output= libpaths= -libversion=7 +libversion=8 verbose= while [ $# -gt 0 ] @@ -165,24 +165,24 @@ do shift 1 ;; -I) - p=$(cygpath -m $2) - args="$args -I$p" - includes="$includes -I$p" + p=$(cygpath -ma "$2") + args="$args -I\"$p\"" + includes="$includes -I\"$p\"" shift 2 ;; -I*) - p=$(cygpath -m ${1#-I}) - args="$args -I$p" - includes="$includes -I$p" + p=$(cygpath -ma "${1#-I}") + args="$args -I\"$p\"" + includes="$includes -I\"$p\"" shift 1 ;; -L) - p=$(cygpath -m $2) + p=$(cygpath -ma $2) linkargs="$linkargs -LIBPATH:$p" shift 2 ;; -L*) - p=$(cygpath -m ${1#-L}) + p=$(cygpath -ma ${1#-L}) linkargs="$linkargs -LIBPATH:$p" shift 1 ;; @@ -256,12 +256,12 @@ do shift 2 ;; *.S) - src=$1 + src="$(cygpath -ma $1)" assembly="true" shift 1 ;; *.c) - args="$args $1" + args="$args $(cygpath -ma $1)" shift 1 ;; *) @@ -312,7 +312,7 @@ if [ -n "$assembly" ]; then echo "$cl -nologo -EP $includes $defines $src > $ppsrc" fi - "$cl" -nologo -EP $includes $defines $src > $ppsrc || exit $? + eval "\"$cl\" -nologo -EP $includes $defines $src" > $ppsrc || exit $? output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')" if [ $ml = "armasm" ]; then args="-nologo -g -oldit $armasm_output $ppsrc -errorReport:prompt" diff --git a/src/aarch64/ffi.c b/src/aarch64/ffi.c index 1ebf43c..6544ac0 100644 --- a/src/aarch64/ffi.c +++ b/src/aarch64/ffi.c @@ -27,9 +27,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include "internal.h" -#ifdef _M_ARM64 +#ifdef _WIN32 #include /* FlushInstructionCache */ #endif +#include /* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; all further uses in this file will refer to the 128-bit type. */ @@ -62,6 +63,9 @@ struct call_context #if FFI_EXEC_TRAMPOLINE_TABLE #ifdef __MACH__ +#ifdef HAVE_PTRAUTH +#include +#endif #include #endif @@ -78,7 +82,7 @@ ffi_clear_cache (void *start, void *end) sys_icache_invalidate (start, (char *)end - (char *)start); #elif defined (__GNUC__) __builtin___clear_cache (start, end); -#elif defined (_M_ARM64) +#elif defined (_WIN32) FlushInstructionCache(GetCurrentProcess(), start, (char*)end - (char*)start); #else #error "Missing builtin to flush instruction cache" @@ -244,13 +248,18 @@ is_vfp_type (const ffi_type *ty) state. The terse state variable names match the names used in the AARCH64 - PCS. */ + PCS. + + The struct area is allocated downwards from the top of the argument + area. It is used to hold copies of structures passed by value that are + bigger than 16 bytes. */ struct arg_state { unsigned ngrn; /* Next general-purpose register number. */ unsigned nsrn; /* Next vector register number. */ size_t nsaa; /* Next stack offset. */ + size_t next_struct_area; /* Place to allocate big structs. */ #if defined (__APPLE__) unsigned allocating_variadic; @@ -259,11 +268,12 @@ struct arg_state /* Initialize a procedure call argument marshalling state. */ static void -arg_init (struct arg_state *state) +arg_init (struct arg_state *state, size_t size) { state->ngrn = 0; state->nsrn = 0; state->nsaa = 0; + state->next_struct_area = size; #if defined (__APPLE__) state->allocating_variadic = 0; #endif @@ -285,37 +295,83 @@ allocate_to_stack (struct arg_state *state, void *stack, if (alignment < 8) alignment = 8; #endif - + nsaa = FFI_ALIGN (nsaa, alignment); state->nsaa = nsaa + size; return (char *)stack + nsaa; } +/* Allocate and copy a structure that is passed by value on the stack and + return a pointer to it. */ +static void * +allocate_and_copy_struct_to_stack (struct arg_state *state, void *stack, + size_t alignment, size_t size, void *value) +{ + size_t dest = state->next_struct_area - size; + + /* Round down to the natural alignment of the value. */ + dest = FFI_ALIGN_DOWN (dest, alignment); + state->next_struct_area = dest; + + return memcpy ((char *) stack + dest, value, size); +} + static ffi_arg extend_integer_type (void *source, int type) { switch (type) { case FFI_TYPE_UINT8: - return *(UINT8 *) source; + { + UINT8 u8; + memcpy (&u8, source, sizeof (u8)); + return u8; + } case FFI_TYPE_SINT8: - return *(SINT8 *) source; + { + SINT8 s8; + memcpy (&s8, source, sizeof (s8)); + return s8; + } case FFI_TYPE_UINT16: - return *(UINT16 *) source; + { + UINT16 u16; + memcpy (&u16, source, sizeof (u16)); + return u16; + } case FFI_TYPE_SINT16: - return *(SINT16 *) source; + { + SINT16 s16; + memcpy (&s16, source, sizeof (s16)); + return s16; + } case FFI_TYPE_UINT32: - return *(UINT32 *) source; + { + UINT32 u32; + memcpy (&u32, source, sizeof (u32)); + return u32; + } case FFI_TYPE_INT: case FFI_TYPE_SINT32: - return *(SINT32 *) source; + { + SINT32 s32; + memcpy (&s32, source, sizeof (s32)); + return s32; + } case FFI_TYPE_UINT64: case FFI_TYPE_SINT64: - return *(UINT64 *) source; - break; + { + UINT64 u64; + memcpy (&u64, source, sizeof (u64)); + return u64; + } case FFI_TYPE_POINTER: - return *(uintptr_t *) source; + { + uintptr_t uptr; + memcpy (&uptr, source, sizeof (uptr)); + return uptr; + } default: abort(); } @@ -561,6 +617,14 @@ ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, cif->aarch64_nfixedargs = nfixedargs; return status; } +#else +ffi_status FFI_HIDDEN +ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, unsigned int ntotalargs) +{ + ffi_status status = ffi_prep_cif_machdep (cif); + cif->flags |= AARCH64_FLAG_VARARG; + return status; +} #endif /* __APPLE__ */ extern void ffi_call_SYSV (struct call_context *context, void *frame, @@ -577,7 +641,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue, void *stack, *frame, *rvalue; struct arg_state state; size_t stack_bytes, rtype_size, rsize; - int i, nargs, flags; + int i, nargs, flags, isvariadic = 0; ffi_type *rtype; flags = cif->flags; @@ -585,6 +649,12 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue, rtype_size = rtype->size; stack_bytes = cif->bytes; + if (flags & AARCH64_FLAG_VARARG) + { + isvariadic = 1; + flags &= ~AARCH64_FLAG_VARARG; + } + /* If the target function returns a structure via hidden pointer, then we cannot allow a null rvalue. Otherwise, mash a null rvalue to void return type. */ @@ -599,19 +669,21 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue, else if (flags & AARCH64_RET_NEED_COPY) rsize = 16; - /* Allocate consectutive stack for everything we'll need. */ - context = alloca (sizeof(struct call_context) + stack_bytes + 32 + rsize); + /* Allocate consectutive stack for everything we'll need. + The frame uses 40 bytes for: lr, fp, rvalue, flags, sp */ + context = alloca (sizeof(struct call_context) + stack_bytes + 40 + rsize); stack = context + 1; frame = (void*)((uintptr_t)stack + (uintptr_t)stack_bytes); - rvalue = (rsize ? (void*)((uintptr_t)frame + 32) : orig_rvalue); + rvalue = (rsize ? (void*)((uintptr_t)frame + 40) : orig_rvalue); - arg_init (&state); + arg_init (&state, stack_bytes); for (i = 0, nargs = cif->nargs; i < nargs; i++) { ffi_type *ty = cif->arg_types[i]; size_t s = ty->size; void *a = avalue[i]; int h, t; + void *dest; t = ty->type; switch (t) @@ -659,47 +731,44 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue, case FFI_TYPE_STRUCT: case FFI_TYPE_COMPLEX: { - void *dest; - h = is_vfp_type (ty); if (h) { - int elems = 4 - (h & 3); -#ifdef _M_ARM64 /* for handling armasm calling convention */ - if (cif->is_variadic) - { - if (state.ngrn + elems <= N_X_ARG_REG) - { - dest = &context->x[state.ngrn]; - state.ngrn += elems; - extend_hfa_type(dest, a, h); - break; - } - state.nsrn = N_X_ARG_REG; - dest = allocate_to_stack(&state, stack, ty->alignment, s); - } - else - { -#endif /* for handling armasm calling convention */ - if (state.nsrn + elems <= N_V_ARG_REG) - { - dest = &context->v[state.nsrn]; - state.nsrn += elems; - extend_hfa_type (dest, a, h); - break; - } - state.nsrn = N_V_ARG_REG; - dest = allocate_to_stack (&state, stack, ty->alignment, s); -#ifdef _M_ARM64 /* for handling armasm calling convention */ - } -#endif /* for handling armasm calling convention */ + int elems = 4 - (h & 3); + if (cif->abi == FFI_WIN64 && isvariadic) + { + if (state.ngrn + elems <= N_X_ARG_REG) + { + dest = &context->x[state.ngrn]; + state.ngrn += elems; + extend_hfa_type(dest, a, h); + break; + } + state.nsrn = N_X_ARG_REG; + dest = allocate_to_stack(&state, stack, ty->alignment, s); + } + else + { + if (state.nsrn + elems <= N_V_ARG_REG) + { + dest = &context->v[state.nsrn]; + state.nsrn += elems; + extend_hfa_type (dest, a, h); + break; + } + state.nsrn = N_V_ARG_REG; + dest = allocate_to_stack (&state, stack, ty->alignment, s); + } } else if (s > 16) { /* If the argument is a composite type that is larger than 16 - bytes, then the argument has been copied to memory, and + bytes, then the argument is copied to memory, and the argument is replaced by a pointer to the copy. */ - a = &avalue[i]; + dest = allocate_and_copy_struct_to_stack (&state, stack, + ty->alignment, s, + avalue[i]); + a = &dest; t = FFI_TYPE_POINTER; s = sizeof (void *); goto do_pointer; @@ -756,6 +825,8 @@ ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) ffi_call_int (cif, fn, rvalue, avalue, NULL); } +#if FFI_CLOSURES + #ifdef FFI_GO_CLOSURES void ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, @@ -769,6 +840,10 @@ ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, extern void ffi_closure_SYSV (void) FFI_HIDDEN; extern void ffi_closure_SYSV_V (void) FFI_HIDDEN; +#if defined(FFI_EXEC_STATIC_TRAMP) +extern void ffi_closure_SYSV_alt (void) FFI_HIDDEN; +extern void ffi_closure_SYSV_V_alt (void) FFI_HIDDEN; +#endif ffi_status ffi_prep_closure_loc (ffi_closure *closure, @@ -777,22 +852,25 @@ ffi_prep_closure_loc (ffi_closure *closure, void *user_data, void *codeloc) { - if (cif->abi != FFI_SYSV) + if (cif->abi != FFI_SYSV && cif->abi != FFI_WIN64) return FFI_BAD_ABI; void (*start)(void); - + if (cif->flags & AARCH64_FLAG_ARG_V) start = ffi_closure_SYSV_V; else start = ffi_closure_SYSV; #if FFI_EXEC_TRAMPOLINE_TABLE -#ifdef __MACH__ +# ifdef __MACH__ +# ifdef HAVE_PTRAUTH + codeloc = ptrauth_auth_data(codeloc, ptrauth_key_function_pointer, 0); +# endif void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); config[0] = closure; config[1] = start; -#endif +# endif #else static const unsigned char trampoline[16] = { 0x90, 0x00, 0x00, 0x58, /* ldr x16, tramp+16 */ @@ -800,22 +878,39 @@ ffi_prep_closure_loc (ffi_closure *closure, 0x00, 0x02, 0x1f, 0xd6 /* br x16 */ }; char *tramp = closure->tramp; - + +# if defined(FFI_EXEC_STATIC_TRAMP) + if (ffi_tramp_is_present(closure)) + { + /* Initialize the static trampoline's parameters. */ + if (start == ffi_closure_SYSV_V) + start = ffi_closure_SYSV_V_alt; + else + start = ffi_closure_SYSV_alt; + ffi_tramp_set_parms (closure->ftramp, start, closure); + goto out; + } +# endif + + /* Initialize the dynamic trampoline. */ memcpy (tramp, trampoline, sizeof(trampoline)); - + *(UINT64 *)(tramp + 16) = (uintptr_t)start; ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE); /* Also flush the cache for code mapping. */ -#ifdef _M_ARM64 +# ifdef _WIN32 // Not using dlmalloc.c for Windows ARM64 builds // so calling ffi_data_to_code_pointer() isn't necessary unsigned char *tramp_code = tramp; - #else +# else unsigned char *tramp_code = ffi_data_to_code_pointer (tramp); - #endif +# endif ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE); +# if defined(FFI_EXEC_STATIC_TRAMP) +out: +# endif #endif closure->cif = cif; @@ -835,7 +930,7 @@ ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif* cif, { void (*start)(void); - if (cif->abi != FFI_SYSV) + if (cif->abi != FFI_SYSV && cif->abi != FFI_WIN64) return FFI_BAD_ABI; if (cif->flags & AARCH64_FLAG_ARG_V) @@ -875,10 +970,17 @@ ffi_closure_SYSV_inner (ffi_cif *cif, void *stack, void *rvalue, void *struct_rvalue) { void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); - int i, h, nargs, flags; + int i, h, nargs, flags, isvariadic = 0; struct arg_state state; - arg_init (&state); + arg_init (&state, cif->bytes); + + flags = cif->flags; + if (flags & AARCH64_FLAG_VARARG) + { + isvariadic = 1; + flags &= ~AARCH64_FLAG_VARARG; + } for (i = 0, nargs = cif->nargs; i < nargs; i++) { @@ -914,14 +1016,13 @@ ffi_closure_SYSV_inner (ffi_cif *cif, if (h) { n = 4 - (h & 3); -#ifdef _M_ARM64 /* for handling armasm calling convention */ - if (cif->is_variadic) + if (cif->abi == FFI_WIN64 && isvariadic) { if (state.ngrn + n <= N_X_ARG_REG) { void *reg = &context->x[state.ngrn]; state.ngrn += (unsigned int)n; - + /* Eeek! We need a pointer to the structure, however the homogeneous float elements are being passed in individual registers, therefore for float and double the structure @@ -941,7 +1042,6 @@ ffi_closure_SYSV_inner (ffi_cif *cif, } else { -#endif /* for handling armasm calling convention */ if (state.nsrn + n <= N_V_ARG_REG) { void *reg = &context->v[state.nsrn]; @@ -954,17 +1054,24 @@ ffi_closure_SYSV_inner (ffi_cif *cif, avalue[i] = allocate_to_stack(&state, stack, ty->alignment, s); } -#ifdef _M_ARM64 /* for handling armasm calling convention */ } -#endif /* for handling armasm calling convention */ } else if (s > 16) { /* Replace Composite type of size greater than 16 with a pointer. */ +#ifdef __ILP32__ + UINT64 avalue_tmp; + memcpy (&avalue_tmp, + allocate_int_to_reg_or_stack (context, &state, + stack, sizeof (void *)), + sizeof (UINT64)); + avalue[i] = (void *)(UINT32)avalue_tmp; +#else avalue[i] = *(void **) allocate_int_to_reg_or_stack (context, &state, stack, sizeof (void *)); +#endif } else { @@ -997,7 +1104,6 @@ ffi_closure_SYSV_inner (ffi_cif *cif, #endif } - flags = cif->flags; if (flags & AARCH64_RET_IN_MEM) rvalue = struct_rvalue; @@ -1006,4 +1112,18 @@ ffi_closure_SYSV_inner (ffi_cif *cif, return flags; } +#if defined(FFI_EXEC_STATIC_TRAMP) +void * +ffi_tramp_arch (size_t *tramp_size, size_t *map_size) +{ + extern void *trampoline_code_table; + + *tramp_size = AARCH64_TRAMP_SIZE; + *map_size = AARCH64_TRAMP_MAP_SIZE; + return &trampoline_code_table; +} +#endif + +#endif /* FFI_CLOSURES */ + #endif /* (__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)*/ diff --git a/src/aarch64/ffitarget.h b/src/aarch64/ffitarget.h index ecb6d2d..d5622e1 100644 --- a/src/aarch64/ffitarget.h +++ b/src/aarch64/ffitarget.h @@ -32,7 +32,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define FFI_SIZEOF_JAVA_RAW 4 typedef unsigned long long ffi_arg; typedef signed long long ffi_sarg; -#elif defined(_M_ARM64) +#elif defined(_WIN32) #define FFI_SIZEOF_ARG 8 typedef unsigned long long ffi_arg; typedef signed long long ffi_sarg; @@ -45,8 +45,13 @@ typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_SYSV, + FFI_WIN64, FFI_LAST_ABI, +#if defined(_WIN32) + FFI_DEFAULT_ABI = FFI_WIN64 +#else FFI_DEFAULT_ABI = FFI_SYSV +#endif } ffi_abi; #endif @@ -69,22 +74,22 @@ typedef enum ffi_abi #define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE #endif -#ifdef _M_ARM64 +#ifdef _WIN32 #define FFI_EXTRA_CIF_FIELDS unsigned is_variadic #endif +#define FFI_TARGET_SPECIFIC_VARIADIC /* ---- Internal ---- */ #if defined (__APPLE__) -#define FFI_TARGET_SPECIFIC_VARIADIC #define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs -#elif !defined(_M_ARM64) +#elif !defined(_WIN32) /* iOS and Windows reserve x18 for the system. Disable Go closures until a new static chain is chosen. */ #define FFI_GO_CLOSURES 1 #endif -#ifndef _M_ARM64 +#ifndef _WIN32 /* No complex type on Windows */ #define FFI_TARGET_HAS_COMPLEX_TYPE #endif diff --git a/src/aarch64/internal.h b/src/aarch64/internal.h index 9c3e077..b5d102b 100644 --- a/src/aarch64/internal.h +++ b/src/aarch64/internal.h @@ -61,7 +61,40 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #define AARCH64_FLAG_ARG_V_BIT 7 #define AARCH64_FLAG_ARG_V (1 << AARCH64_FLAG_ARG_V_BIT) +#define AARCH64_FLAG_VARARG (1 << 8) #define N_X_ARG_REG 8 #define N_V_ARG_REG 8 #define CALL_CONTEXT_SIZE (N_V_ARG_REG * 16 + N_X_ARG_REG * 8) + +#if defined(FFI_EXEC_STATIC_TRAMP) +/* + * For the trampoline code table mapping, a mapping size of 16K is chosen to + * cover the base page sizes of 4K and 16K. + */ +#define AARCH64_TRAMP_MAP_SHIFT 14 +#define AARCH64_TRAMP_MAP_SIZE (1 << AARCH64_TRAMP_MAP_SHIFT) +#define AARCH64_TRAMP_SIZE 32 + +#endif + +/* Helpers for writing assembly compatible with arm ptr auth */ +#ifdef LIBFFI_ASM + +#ifdef HAVE_PTRAUTH +#define SIGN_LR pacibsp +#define SIGN_LR_WITH_REG(x) pacib lr, x +#define AUTH_LR_AND_RET retab +#define AUTH_LR_WITH_REG(x) autib lr, x +#define BRANCH_AND_LINK_TO_REG blraaz +#define BRANCH_TO_REG braaz +#else +#define SIGN_LR +#define SIGN_LR_WITH_REG(x) +#define AUTH_LR_AND_RET ret +#define AUTH_LR_WITH_REG(x) +#define BRANCH_AND_LINK_TO_REG blr +#define BRANCH_TO_REG br +#endif + +#endif diff --git a/src/aarch64/sysv.S b/src/aarch64/sysv.S index 6761ee1..eeaf3f8 100644 --- a/src/aarch64/sysv.S +++ b/src/aarch64/sysv.S @@ -78,9 +78,22 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ cfi_startproc CNAME(ffi_call_SYSV): + /* Sign the lr with x1 since that is where it will be stored */ + SIGN_LR_WITH_REG(x1) + /* Use a stack frame allocated by our caller. */ - cfi_def_cfa(x1, 32); +#if defined(HAVE_PTRAUTH) && defined(__APPLE__) + /* darwin's libunwind assumes that the cfa is the sp and that's the data + * used to sign the lr. In order to allow unwinding through this + * function it is necessary to point the cfa at the signing register. + */ + cfi_def_cfa(x1, 0); +#else + cfi_def_cfa(x1, 40); +#endif stp x29, x30, [x1] + mov x9, sp + str x9, [x1, #32] mov x29, x1 mov sp, x0 cfi_def_cfa_register(x29) @@ -111,13 +124,15 @@ CNAME(ffi_call_SYSV): /* Deallocate the context, leaving the stacked arguments. */ add sp, sp, #CALL_CONTEXT_SIZE - blr x9 /* call fn */ + BRANCH_AND_LINK_TO_REG x9 /* call fn */ ldp x3, x4, [x29, #16] /* reload rvalue and flags */ /* Partially deconstruct the stack frame. */ - mov sp, x29 + ldr x9, [x29, #32] + mov sp, x9 cfi_def_cfa_register (sp) + mov x2, x29 /* Preserve for auth */ ldp x29, x30, [x29] /* Save the return value as directed. */ @@ -131,71 +146,76 @@ CNAME(ffi_call_SYSV): and therefore we want to extend to 64 bits; these types have two consecutive entries allocated for them. */ .align 4 -0: ret /* VOID */ +0: b 99f /* VOID */ nop 1: str x0, [x3] /* INT64 */ - ret + b 99f 2: stp x0, x1, [x3] /* INT128 */ - ret + b 99f 3: brk #1000 /* UNUSED */ - ret + b 99f 4: brk #1000 /* UNUSED */ - ret + b 99f 5: brk #1000 /* UNUSED */ - ret + b 99f 6: brk #1000 /* UNUSED */ - ret + b 99f 7: brk #1000 /* UNUSED */ - ret + b 99f 8: st4 { v0.s, v1.s, v2.s, v3.s }[0], [x3] /* S4 */ - ret + b 99f 9: st3 { v0.s, v1.s, v2.s }[0], [x3] /* S3 */ - ret + b 99f 10: stp s0, s1, [x3] /* S2 */ - ret + b 99f 11: str s0, [x3] /* S1 */ - ret + b 99f 12: st4 { v0.d, v1.d, v2.d, v3.d }[0], [x3] /* D4 */ - ret + b 99f 13: st3 { v0.d, v1.d, v2.d }[0], [x3] /* D3 */ - ret + b 99f 14: stp d0, d1, [x3] /* D2 */ - ret + b 99f 15: str d0, [x3] /* D1 */ - ret + b 99f 16: str q3, [x3, #48] /* Q4 */ nop 17: str q2, [x3, #32] /* Q3 */ nop 18: stp q0, q1, [x3] /* Q2 */ - ret + b 99f 19: str q0, [x3] /* Q1 */ - ret + b 99f 20: uxtb w0, w0 /* UINT8 */ str x0, [x3] -21: ret /* reserved */ +21: b 99f /* reserved */ nop 22: uxth w0, w0 /* UINT16 */ str x0, [x3] -23: ret /* reserved */ +23: b 99f /* reserved */ nop 24: mov w0, w0 /* UINT32 */ str x0, [x3] -25: ret /* reserved */ +25: b 99f /* reserved */ nop 26: sxtb x0, w0 /* SINT8 */ str x0, [x3] -27: ret /* reserved */ +27: b 99f /* reserved */ nop 28: sxth x0, w0 /* SINT16 */ str x0, [x3] -29: ret /* reserved */ +29: b 99f /* reserved */ nop 30: sxtw x0, w0 /* SINT32 */ str x0, [x3] -31: ret /* reserved */ +31: b 99f /* reserved */ nop + /* Return now that result has been populated. */ +99: + AUTH_LR_WITH_REG(x2) + ret + cfi_endproc .globl CNAME(ffi_call_SYSV) @@ -205,6 +225,8 @@ CNAME(ffi_call_SYSV): .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV) #endif +#if FFI_CLOSURES + /* ffi_closure_SYSV Closure invocation glue. This is the low level code invoked directly by @@ -224,6 +246,7 @@ CNAME(ffi_call_SYSV): .align 4 CNAME(ffi_closure_SYSV_V): cfi_startproc + SIGN_LR stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) cfi_rel_offset (x29, 0) @@ -247,6 +270,7 @@ CNAME(ffi_closure_SYSV_V): .align 4 cfi_startproc CNAME(ffi_closure_SYSV): + SIGN_LR stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) cfi_rel_offset (x29, 0) @@ -263,7 +287,9 @@ CNAME(ffi_closure_SYSV): /* Load ffi_closure_inner arguments. */ ldp PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */ ldr PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2] /* load user_data */ +#ifdef FFI_GO_CLOSURES .Ldo_closure: +#endif add x3, sp, #16 /* load context */ add x4, sp, #ffi_closure_SYSV_FS /* load stack */ add x5, sp, #16+CALL_CONTEXT_SIZE /* load rvalue */ @@ -346,7 +372,7 @@ CNAME(ffi_closure_SYSV): cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS) cfi_restore (x29) cfi_restore (x30) - ret + AUTH_LR_AND_RET cfi_endproc .globl CNAME(ffi_closure_SYSV) @@ -356,6 +382,76 @@ CNAME(ffi_closure_SYSV): .size CNAME(ffi_closure_SYSV), . - CNAME(ffi_closure_SYSV) #endif +#if defined(FFI_EXEC_STATIC_TRAMP) + .align 4 +CNAME(ffi_closure_SYSV_V_alt): + /* See the comments above trampoline_code_table. */ + ldr x17, [sp, #8] /* Load closure in x17 */ + add sp, sp, #16 /* Restore the stack */ + b CNAME(ffi_closure_SYSV_V) + + .globl CNAME(ffi_closure_SYSV_V_alt) + FFI_HIDDEN(CNAME(ffi_closure_SYSV_V_alt)) +#ifdef __ELF__ + .type CNAME(ffi_closure_SYSV_V_alt), #function + .size CNAME(ffi_closure_SYSV_V_alt), . - CNAME(ffi_closure_SYSV_V_alt) +#endif + + .align 4 +CNAME(ffi_closure_SYSV_alt): + /* See the comments above trampoline_code_table. */ + ldr x17, [sp, #8] /* Load closure in x17 */ + add sp, sp, #16 /* Restore the stack */ + b CNAME(ffi_closure_SYSV) + + .globl CNAME(ffi_closure_SYSV_alt) + FFI_HIDDEN(CNAME(ffi_closure_SYSV_alt)) +#ifdef __ELF__ + .type CNAME(ffi_closure_SYSV_alt), #function + .size CNAME(ffi_closure_SYSV_alt), . - CNAME(ffi_closure_SYSV_alt) +#endif + +/* + * Below is the definition of the trampoline code table. Each element in + * the code table is a trampoline. + */ +/* + * The trampoline uses register x17. It saves the original value of x17 on + * the stack. + * + * The trampoline has two parameters - target code to jump to and data for + * the target code. The trampoline extracts the parameters from its parameter + * block (see tramp_table_map()). The trampoline saves the data address on + * the stack. Finally, it jumps to the target code. + * + * The target code can choose to: + * + * - restore the value of x17 + * - load the data address in a register + * - restore the stack pointer to what it was when the trampoline was invoked. + */ + .align AARCH64_TRAMP_MAP_SHIFT +CNAME(trampoline_code_table): + .rept AARCH64_TRAMP_MAP_SIZE / AARCH64_TRAMP_SIZE + sub sp, sp, #16 /* Make space on the stack */ + str x17, [sp] /* Save x17 on stack */ + adr x17, #16376 /* Get data address */ + ldr x17, [x17] /* Copy data into x17 */ + str x17, [sp, #8] /* Save data on stack */ + adr x17, #16372 /* Get code address */ + ldr x17, [x17] /* Load code address into x17 */ + br x17 /* Jump to code */ + .endr + + .globl CNAME(trampoline_code_table) + FFI_HIDDEN(CNAME(trampoline_code_table)) +#ifdef __ELF__ + .type CNAME(trampoline_code_table), #function + .size CNAME(trampoline_code_table), . - CNAME(trampoline_code_table) +#endif + .align AARCH64_TRAMP_MAP_SHIFT +#endif /* FFI_EXEC_STATIC_TRAMP */ + #if FFI_EXEC_TRAMPOLINE_TABLE #ifdef __MACH__ @@ -366,7 +462,7 @@ CNAME(ffi_closure_trampoline_table_page): adr x16, -PAGE_MAX_SIZE ldp x17, x16, [x16] br x16 - nop /* each entry in the trampoline config page is 2*sizeof(void*) so the trampoline itself cannot be smaller that 16 bytes */ + nop /* each entry in the trampoline config page is 2*sizeof(void*) so the trampoline itself cannot be smaller than 16 bytes */ .endr .globl CNAME(ffi_closure_trampoline_table_page) @@ -432,6 +528,7 @@ CNAME(ffi_go_closure_SYSV): .size CNAME(ffi_go_closure_SYSV), . - CNAME(ffi_go_closure_SYSV) #endif #endif /* FFI_GO_CLOSURES */ +#endif /* FFI_CLOSURES */ #endif /* __arm64__ */ #if defined __ELF__ && defined __linux__ diff --git a/src/aarch64/win64_armasm.S b/src/aarch64/win64_armasm.S index a79f8a8..7fc185b 100644 --- a/src/aarch64/win64_armasm.S +++ b/src/aarch64/win64_armasm.S @@ -42,7 +42,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ EXPORT ffi_go_closure_SYSV #endif - TEXTAREA, ALLIGN=8 + TEXTAREA, ALIGN=8 /* ffi_call_SYSV extern void ffi_call_SYSV (void *stack, void *frame, diff --git a/src/arm/ffi.c b/src/arm/ffi.c index 4e27071..cfd3e9d 100644 --- a/src/arm/ffi.c +++ b/src/arm/ffi.c @@ -34,9 +34,10 @@ #include #include #include +#include #include "internal.h" -#if defined(_MSC_VER) && defined(_M_ARM) +#if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #include #endif @@ -48,13 +49,25 @@ #endif #else -#ifndef _M_ARM +#ifndef _WIN32 extern unsigned int ffi_arm_trampoline[2] FFI_HIDDEN; #else -extern unsigned int ffi_arm_trampoline[3] FFI_HIDDEN; +// Declare this as an array of char, instead of array of int, +// otherwise Clang optimizes out the "& 0xFFFFFFFE" for clearing +// the thumb bit. +extern unsigned char ffi_arm_trampoline[12] FFI_HIDDEN; #endif #endif +#if defined(__FreeBSD__) && defined(__arm__) +#include +#include +#endif + +#if defined(__QNX__) +#include +#endif + /* Forward declares. */ static int vfp_type_p (const ffi_type *); static void layout_vfp_args (ffi_cif *); @@ -98,13 +111,13 @@ ffi_put_arg (ffi_type *ty, void *src, void *dst) case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: case FFI_TYPE_POINTER: -#ifndef _MSC_VER +#ifndef _WIN32 case FFI_TYPE_FLOAT: #endif *(UINT32 *)dst = *(UINT32 *)src; break; -#ifdef _MSC_VER +#ifdef _WIN32 // casting a float* to a UINT32* doesn't work on Windows case FFI_TYPE_FLOAT: *(uintptr_t *)dst = 0; @@ -421,12 +434,14 @@ ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) ffi_call_int (cif, fn, rvalue, avalue, NULL); } +#ifdef FFI_GO_CLOSURES void ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, void *closure) { ffi_call_int (cif, fn, rvalue, avalue, closure); } +#endif static void * ffi_prep_incoming_args_SYSV (ffi_cif *cif, void *rvalue, @@ -529,6 +544,8 @@ ffi_prep_incoming_args_VFP (ffi_cif *cif, void *rvalue, char *stack, return rvalue; } +#if FFI_CLOSURES + struct closure_frame { char vfp_space[8*8] __attribute__((aligned(8))); @@ -564,11 +581,28 @@ ffi_closure_inner_VFP (ffi_cif *cif, void ffi_closure_SYSV (void) FFI_HIDDEN; void ffi_closure_VFP (void) FFI_HIDDEN; +#if defined(FFI_EXEC_STATIC_TRAMP) +void ffi_closure_SYSV_alt (void) FFI_HIDDEN; +void ffi_closure_VFP_alt (void) FFI_HIDDEN; +#endif + +#ifdef FFI_GO_CLOSURES void ffi_go_closure_SYSV (void) FFI_HIDDEN; void ffi_go_closure_VFP (void) FFI_HIDDEN; +#endif /* the cif must already be prep'ed */ +#if defined(__FreeBSD__) && defined(__arm__) +#define __clear_cache(start, end) do { \ + struct arm_sync_icache_args ua; \ + \ + ua.addr = (uintptr_t)(start); \ + ua.len = (char *)(end) - (char *)start; \ + sysarch(ARM_SYNC_ICACHE, &ua); \ + } while (0); +#endif + ffi_status ffi_prep_closure_loc (ffi_closure * closure, ffi_cif * cif, @@ -592,27 +626,44 @@ ffi_prep_closure_loc (ffi_closure * closure, config[1] = closure_func; #else -#ifndef _M_ARM +# if defined(FFI_EXEC_STATIC_TRAMP) + if (ffi_tramp_is_present(closure)) + { + /* Initialize the static trampoline's parameters. */ + if (closure_func == ffi_closure_SYSV) + closure_func = ffi_closure_SYSV_alt; + else + closure_func = ffi_closure_VFP_alt; + ffi_tramp_set_parms (closure->ftramp, closure_func, closure); + goto out; + } +# endif + + /* Initialize the dynamic trampoline. */ +# ifndef _WIN32 memcpy(closure->tramp, ffi_arm_trampoline, 8); -#else +# else // cast away function type so MSVC doesn't set the lower bit of the function pointer memcpy(closure->tramp, (void*)((uintptr_t)ffi_arm_trampoline & 0xFFFFFFFE), FFI_TRAMPOLINE_CLOSURE_OFFSET); -#endif +# endif -#if defined (__QNX__) - msync(closure->tramp, 8, 0x1000000); /* clear data map */ - msync(codeloc, 8, 0x1000000); /* clear insn map */ -#elif defined(_MSC_VER) +# if defined(__QNX__) + msync (closure->tramp, 8, MS_INVALIDATE_ICACHE); /* clear data map */ + msync (codeloc, 8, MS_INVALIDATE_ICACHE); /* clear insn map */ +# elif defined(_WIN32) FlushInstructionCache(GetCurrentProcess(), closure->tramp, FFI_TRAMPOLINE_SIZE); -#else +# else __clear_cache(closure->tramp, closure->tramp + 8); /* clear data map */ __clear_cache(codeloc, codeloc + 8); /* clear insn map */ -#endif -#ifdef _M_ARM +# endif +# ifdef _WIN32 *(void(**)(void))(closure->tramp + FFI_TRAMPOLINE_CLOSURE_FUNCTION) = closure_func; -#else +# else *(void (**)(void))(closure->tramp + 8) = closure_func; -#endif +# endif +# if defined(FFI_EXEC_STATIC_TRAMP) +out: +# endif #endif closure->cif = cif; @@ -622,6 +673,7 @@ ffi_prep_closure_loc (ffi_closure * closure, return FFI_OK; } +#ifdef FFI_GO_CLOSURES ffi_status ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, void (*fun) (ffi_cif *, void *, void **, void *)) @@ -643,6 +695,9 @@ ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, return FFI_OK; } +#endif + +#endif /* FFI_CLOSURES */ /* Below are routines for VFP hard-float support. */ @@ -851,4 +906,16 @@ layout_vfp_args (ffi_cif * cif) } } +#if defined(FFI_EXEC_STATIC_TRAMP) +void * +ffi_tramp_arch (size_t *tramp_size, size_t *map_size) +{ + extern void *trampoline_code_table; + + *tramp_size = ARM_TRAMP_SIZE; + *map_size = ARM_TRAMP_MAP_SIZE; + return &trampoline_code_table; +} +#endif + #endif /* __arm__ or _M_ARM */ diff --git a/src/arm/ffitarget.h b/src/arm/ffitarget.h index cb57b84..12d5d20 100644 --- a/src/arm/ffitarget.h +++ b/src/arm/ffitarget.h @@ -43,7 +43,7 @@ typedef enum ffi_abi { FFI_SYSV, FFI_VFP, FFI_LAST_ABI, -#if defined(__ARM_PCS_VFP) || defined(_M_ARM) +#if defined(__ARM_PCS_VFP) || defined(_WIN32) FFI_DEFAULT_ABI = FFI_VFP, #else FFI_DEFAULT_ABI = FFI_SYSV, @@ -57,7 +57,7 @@ typedef enum ffi_abi { signed char vfp_args[16] \ #define FFI_TARGET_SPECIFIC_VARIADIC -#ifndef _M_ARM +#ifndef _WIN32 #define FFI_TARGET_HAS_COMPLEX_TYPE #endif @@ -77,7 +77,7 @@ typedef enum ffi_abi { #endif #else -#ifdef _MSC_VER +#ifdef _WIN32 #define FFI_TRAMPOLINE_SIZE 16 #define FFI_TRAMPOLINE_CLOSURE_FUNCTION 12 #else diff --git a/src/arm/internal.h b/src/arm/internal.h index 6cf0b2a..fa8ab0b 100644 --- a/src/arm/internal.h +++ b/src/arm/internal.h @@ -5,3 +5,13 @@ #define ARM_TYPE_INT 4 #define ARM_TYPE_VOID 5 #define ARM_TYPE_STRUCT 6 + +#if defined(FFI_EXEC_STATIC_TRAMP) +/* + * For the trampoline table mapping, a mapping size of 4K (base page size) + * is chosen. + */ +#define ARM_TRAMP_MAP_SHIFT 12 +#define ARM_TRAMP_MAP_SIZE (1 << ARM_TRAMP_MAP_SHIFT) +#define ARM_TRAMP_SIZE 20 +#endif diff --git a/src/arm/sysv.S b/src/arm/sysv.S index 63180a4..fb36213 100644 --- a/src/arm/sysv.S +++ b/src/arm/sysv.S @@ -92,9 +92,25 @@ #define ARM_FUNC_END(name) \ SIZE(name) + .text + .syntax unified +#if defined(_WIN32) + /* Windows on ARM is thumb-only */ + .thumb +#else + /* Keep the assembly in ARM mode in other cases, for simplicity + * (to avoid interworking issues). */ +#undef __thumb__ + .arm +#endif + /* Aid in defining a jump table with 8 bytes between entries. */ +#ifdef __thumb__ +/* In thumb mode, instructions can be shorter than expected in arm mode, so + * we need to align the start of each case. */ +# define E(index) .align 3 +#elif defined(__clang__) /* ??? The clang assembler doesn't handle .if with symbolic expressions. */ -#ifdef __clang__ # define E(index) #else # define E(index) \ @@ -103,9 +119,6 @@ .endif #endif - .text - .syntax unified - .arm #ifndef __clang__ /* We require interworking on LDM, which implies ARMv5T, @@ -128,12 +141,13 @@ ARM_FUNC_START(ffi_call_VFP) cfi_startproc cmp r3, #3 @ load only d0 if possible + ite le #ifdef __clang__ - vldrle d0, [sp] - vldmgt sp, {d0-d7} + vldrle d0, [r0] + vldmgt r0, {d0-d7} #else - ldcle p11, cr0, [r0] @ vldrle d0, [sp] - ldcgt p11, cr0, [r0], {16} @ vldmgt sp, {d0-d7} + ldcle p11, cr0, [r0] @ vldrle d0, [r0] + ldcgt p11, cr0, [r0], {16} @ vldmgt r0, {d0-d7} #endif add r0, r0, #64 @ discard the vfp register args /* FALLTHRU */ @@ -167,9 +181,16 @@ ARM_FUNC_START(ffi_call_SYSV) cfi_def_cfa_register(sp) @ Store values stored in registers. +#ifndef __thumb__ .align 3 add pc, pc, r3, lsl #3 nop +#else + adr ip, 0f + add ip, ip, r3, lsl #3 + mov pc, ip + .align 3 +#endif 0: E(ARM_TYPE_VFP_S) #ifdef __clang__ @@ -208,6 +229,7 @@ E(ARM_TYPE_STRUCT) UNWIND(.fnend) ARM_FUNC_END(ffi_call_SYSV) +#if FFI_CLOSURES /* int ffi_closure_inner_* (cif, fun, user_data, frame) @@ -227,6 +249,9 @@ ARM_FUNC_END(ffi_go_closure_SYSV) ARM_FUNC_START(ffi_closure_SYSV) UNWIND(.fnstart) cfi_startproc +#ifdef _WIN32 + ldmfd sp!, {r0, ip} @ restore fp (r0 is used for stack alignment) +#endif stmdb sp!, {r0-r3} @ save argument regs cfi_adjust_cfa_offset(16) @@ -255,7 +280,12 @@ ARM_FUNC_START(ffi_closure_SYSV) @ Load values returned in registers. add r2, sp, #8+64 @ load result adr r3, CNAME(ffi_closure_ret) +#ifndef __thumb__ add pc, r3, r0, lsl #3 +#else + add r3, r3, r0, lsl #3 + mov pc, r3 +#endif cfi_endproc UNWIND(.fnend) ARM_FUNC_END(ffi_closure_SYSV) @@ -274,6 +304,9 @@ ARM_FUNC_END(ffi_go_closure_VFP) ARM_FUNC_START(ffi_closure_VFP) UNWIND(.fnstart) cfi_startproc +#ifdef _WIN32 + ldmfd sp!, {r0, ip} @ restore fp (r0 is used for stack alignment) +#endif stmdb sp!, {r0-r3} @ save argument regs cfi_adjust_cfa_offset(16) @@ -305,7 +338,12 @@ ARM_FUNC_START(ffi_closure_VFP) @ Load values returned in registers. add r2, sp, #8+64 @ load result adr r3, CNAME(ffi_closure_ret) +#ifndef __thumb__ add pc, r3, r0, lsl #3 +#else + add r3, r3, r0, lsl #3 + mov pc, r3 +#endif cfi_endproc UNWIND(.fnend) ARM_FUNC_END(ffi_closure_VFP) @@ -325,35 +363,92 @@ E(ARM_TYPE_VFP_S) #else ldc p10, cr0, [r2] @ vldr s0, [r2] #endif - ldm sp, {sp,pc} + b call_epilogue E(ARM_TYPE_VFP_D) #ifdef __clang__ vldr d0, [r2] #else ldc p11, cr0, [r2] @ vldr d0, [r2] #endif - ldm sp, {sp,pc} + b call_epilogue E(ARM_TYPE_VFP_N) #ifdef __clang__ vldm r2, {d0-d3} #else ldc p11, cr0, [r2], {8} @ vldm r2, {d0-d3} #endif - ldm sp, {sp,pc} + b call_epilogue E(ARM_TYPE_INT64) ldr r1, [r2, #4] nop E(ARM_TYPE_INT) ldr r0, [r2] - ldm sp, {sp,pc} + b call_epilogue E(ARM_TYPE_VOID) - ldm sp, {sp,pc} + b call_epilogue nop E(ARM_TYPE_STRUCT) + b call_epilogue +call_epilogue: +#ifndef __thumb__ ldm sp, {sp,pc} +#else + ldm sp, {ip,lr} + mov sp, ip + bx lr +#endif cfi_endproc ARM_FUNC_END(ffi_closure_ret) +#if defined(FFI_EXEC_STATIC_TRAMP) +ARM_FUNC_START(ffi_closure_SYSV_alt) + /* See the comments above trampoline_code_table. */ + ldr ip, [sp, #4] /* Load closure in ip */ + add sp, sp, 8 /* Restore the stack */ + b CNAME(ffi_closure_SYSV) +ARM_FUNC_END(ffi_closure_SYSV_alt) + +ARM_FUNC_START(ffi_closure_VFP_alt) + /* See the comments above trampoline_code_table. */ + ldr ip, [sp, #4] /* Load closure in ip */ + add sp, sp, 8 /* Restore the stack */ + b CNAME(ffi_closure_VFP) +ARM_FUNC_END(ffi_closure_VFP_alt) + +/* + * Below is the definition of the trampoline code table. Each element in + * the code table is a trampoline. + */ +/* + * The trampoline uses register ip (r12). It saves the original value of ip + * on the stack. + * + * The trampoline has two parameters - target code to jump to and data for + * the target code. The trampoline extracts the parameters from its parameter + * block (see tramp_table_map()). The trampoline saves the data address on + * the stack. Finally, it jumps to the target code. + * + * The target code can choose to: + * + * - restore the value of ip + * - load the data address in a register + * - restore the stack pointer to what it was when the trampoline was invoked. + */ + .align ARM_TRAMP_MAP_SHIFT +ARM_FUNC_START(trampoline_code_table) + .rept ARM_TRAMP_MAP_SIZE / ARM_TRAMP_SIZE + sub sp, sp, #8 /* Make space on the stack */ + str ip, [sp] /* Save ip on stack */ + ldr ip, [pc, #4080] /* Copy data into ip */ + str ip, [sp, #4] /* Save data on stack */ + ldr pc, [pc, #4076] /* Copy code into PC */ + .endr +ARM_FUNC_END(trampoline_code_table) + .align ARM_TRAMP_MAP_SHIFT +#endif /* FFI_EXEC_STATIC_TRAMP */ + +#endif /* FFI_CLOSURES */ + #if FFI_EXEC_TRAMPOLINE_TABLE #ifdef __MACH__ @@ -369,6 +464,15 @@ ARM_FUNC_START(ffi_closure_trampoline_table_page) ARM_FUNC_END(ffi_closure_trampoline_table_page) #endif +#elif defined(_WIN32) + +ARM_FUNC_START(ffi_arm_trampoline) +0: adr ip, 0b + stmdb sp!, {r0, ip} + ldr pc, 1f +1: .long 0 +ARM_FUNC_END(ffi_arm_trampoline) + #else ARM_FUNC_START(ffi_arm_trampoline) diff --git a/src/closures.c b/src/closures.c index 5120021..9aafbec 100644 --- a/src/closures.c +++ b/src/closures.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - closures.c - Copyright (c) 2019 Anthony Green + closures.c - Copyright (c) 2019, 2022 Anthony Green Copyright (c) 2007, 2009, 2010 Red Hat, Inc. Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc Copyright (c) 2011 Plausible Labs Cooperative, Inc. @@ -27,13 +27,14 @@ DEALINGS IN THE SOFTWARE. ----------------------------------------------------------------------- */ -#if defined __linux__ && !defined _GNU_SOURCE +#if (defined __linux__ || defined __CYGWIN__) && !defined _GNU_SOURCE #define _GNU_SOURCE 1 #endif #include #include #include +#include #ifdef __NetBSD__ #include @@ -45,6 +46,9 @@ #include #include +#ifdef HAVE_SYS_MEMFD_H +#include +#endif static const size_t overhead = (sizeof(max_align_t) > sizeof(void *) + sizeof(size_t)) ? @@ -109,6 +113,12 @@ ffi_closure_free (void *ptr) munmap(dataseg, rounded_size); munmap(codeseg, rounded_size); } + +int +ffi_tramp_is_present (__attribute__((unused)) void *ptr) +{ + return 0; +} #else /* !NetBSD with PROT_MPROTECT */ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE @@ -123,22 +133,26 @@ ffi_closure_free (void *ptr) # define FFI_MMAP_EXEC_WRIT 1 # define HAVE_MNTENT 1 # endif -# if defined(X86_WIN32) || defined(X86_WIN64) || defined(_M_ARM64) || defined(__OS2__) -/* Windows systems may have Data Execution Protection (DEP) enabled, +# if defined(__CYGWIN__) || defined(_WIN32) || defined(__OS2__) +/* Windows systems may have Data Execution Protection (DEP) enabled, which requires the use of VirtualMalloc/VirtualFree to alloc/free executable memory. */ # define FFI_MMAP_EXEC_WRIT 1 # endif #endif -#if FFI_MMAP_EXEC_WRIT && !defined FFI_MMAP_EXEC_SELINUX -# if defined(__linux__) && !defined(__ANDROID__) +#if FFI_MMAP_EXEC_WRIT && defined(__linux__) && !defined(__ANDROID__) +# if !defined FFI_MMAP_EXEC_SELINUX /* When defined to 1 check for SELinux and if SELinux is active, don't attempt PROT_EXEC|PROT_WRITE mapping at all, as that might cause audit messages. */ # define FFI_MMAP_EXEC_SELINUX 1 -# endif -#endif +# endif /* !defined FFI_MMAP_EXEC_SELINUX */ +# if !defined FFI_MMAP_PAX +/* Also check for PaX MPROTECT */ +# define FFI_MMAP_PAX 1 +# endif /* !defined FFI_MMAP_PAX */ +#endif /* FFI_MMAP_EXEC_WRIT && defined(__linux__) && !defined(__ANDROID__) */ #if FFI_CLOSURES @@ -148,6 +162,9 @@ ffi_closure_free (void *ptr) #include #include +#ifdef HAVE_PTRAUTH +#include +#endif #include #include @@ -160,7 +177,6 @@ struct ffi_trampoline_table { /* contiguous writable and executable pages */ vm_address_t config_page; - vm_address_t trampoline_page; /* free list tracking */ uint16_t free_count; @@ -204,7 +220,13 @@ ffi_trampoline_table_alloc (void) /* Remap the trampoline table on top of the placeholder page */ trampoline_page = config_page + PAGE_MAX_SIZE; + +#ifdef HAVE_PTRAUTH + trampoline_page_template = (vm_address_t)(uintptr_t)ptrauth_auth_data((void *)&ffi_closure_trampoline_table_page, ptrauth_key_function_pointer, 0); +#else trampoline_page_template = (vm_address_t)&ffi_closure_trampoline_table_page; +#endif + #ifdef __arm__ /* ffi_closure_trampoline_table_page can be thumb-biased on some ARM archs */ trampoline_page_template &= ~1UL; @@ -218,11 +240,22 @@ ffi_trampoline_table_alloc (void) return NULL; } + if (!(cur_prot & VM_PROT_EXECUTE)) + { + /* If VM_PROT_EXECUTE isn't set on the remapped trampoline page, set it */ + kt = vm_protect (mach_task_self (), trampoline_page, PAGE_MAX_SIZE, + FALSE, cur_prot | VM_PROT_EXECUTE); + if (kt != KERN_SUCCESS) + { + vm_deallocate (mach_task_self (), config_page, PAGE_MAX_SIZE * 2); + return NULL; + } + } + /* We have valid trampoline and config pages */ table = calloc (1, sizeof (ffi_trampoline_table)); table->free_count = FFI_TRAMPOLINE_COUNT; table->config_page = config_page; - table->trampoline_page = trampoline_page; /* Create and initialize the free list */ table->free_list_pool = @@ -232,7 +265,10 @@ ffi_trampoline_table_alloc (void) { ffi_trampoline_table_entry *entry = &table->free_list_pool[i]; entry->trampoline = - (void *) (table->trampoline_page + (i * FFI_TRAMPOLINE_SIZE)); + (void *) (trampoline_page + (i * FFI_TRAMPOLINE_SIZE)); +#ifdef HAVE_PTRAUTH + entry->trampoline = ptrauth_sign_unauthenticated(entry->trampoline, ptrauth_key_function_pointer, 0); +#endif if (i < table->free_count - 1) entry->next = &table->free_list_pool[i + 1]; @@ -386,7 +422,7 @@ ffi_closure_free (void *ptr) #endif #include #include -#if !defined(X86_WIN32) && !defined(X86_WIN64) && !defined(_M_ARM64) +#if !defined(_WIN32) #ifdef HAVE_MNTENT #include #endif /* HAVE_MNTENT */ @@ -447,14 +483,18 @@ selinux_enabled_check (void) #endif /* !FFI_MMAP_EXEC_SELINUX */ -/* On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. */ -#ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX +/* On PaX enable kernels that have MPROTECT enabled we can't use PROT_EXEC. */ +#if defined FFI_MMAP_PAX #include -static int emutramp_enabled = -1; +enum { + PAX_MPROTECT = (1 << 0), + PAX_EMUTRAMP = (1 << 1), +}; +static int cached_pax_flags = -1; static int -emutramp_enabled_check (void) +pax_flags_check (void) { char *buf = NULL; size_t len = 0; @@ -468,9 +508,10 @@ emutramp_enabled_check (void) while (getline (&buf, &len, f) != -1) if (!strncmp (buf, "PaX:", 4)) { - char emutramp; - if (sscanf (buf, "%*s %*c%c", &emutramp) == 1) - ret = (emutramp == 'E'); + if (NULL != strchr (buf + 4, 'M')) + ret |= PAX_MPROTECT; + if (NULL != strchr (buf + 4, 'E')) + ret |= PAX_EMUTRAMP; break; } free (buf); @@ -478,9 +519,13 @@ emutramp_enabled_check (void) return ret; } -#define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \ - : (emutramp_enabled = emutramp_enabled_check ())) -#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */ +#define get_pax_flags() (cached_pax_flags >= 0 ? cached_pax_flags \ + : (cached_pax_flags = pax_flags_check ())) +#define has_pax_flags(flags) ((flags) == ((flags) & get_pax_flags ())) +#define is_mprotect_enabled() (has_pax_flags (PAX_MPROTECT)) +#define is_emutramp_enabled() (has_pax_flags (PAX_EMUTRAMP)) + +#endif /* defined FFI_MMAP_PAX */ #elif defined (__CYGWIN__) || defined(__INTERIX) @@ -491,9 +536,10 @@ emutramp_enabled_check (void) #endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */ -#ifndef FFI_MMAP_EXEC_EMUTRAMP_PAX -#define is_emutramp_enabled() 0 -#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */ +#if !defined FFI_MMAP_PAX +# define is_mprotect_enabled() 0 +# define is_emutramp_enabled() 0 +#endif /* !defined FFI_MMAP_PAX */ /* Declare all functions defined in dlmalloc.c as static. */ static void *dlmalloc(size_t); @@ -512,11 +558,11 @@ static int dlmalloc_trim(size_t) MAYBE_UNUSED; static size_t dlmalloc_usable_size(void*) MAYBE_UNUSED; static void dlmalloc_stats(void) MAYBE_UNUSED; -#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(_M_ARM64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) +#if !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) /* Use these for mmap and munmap within dlmalloc.c. */ static void *dlmmap(void *, size_t, int, int, int, off_t); static int dlmunmap(void *, size_t); -#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ +#endif /* !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ #define mmap dlmmap #define munmap dlmunmap @@ -526,7 +572,7 @@ static int dlmunmap(void *, size_t); #undef mmap #undef munmap -#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(_M_ARM64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) +#if !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) /* A mutex used to synchronize access to *exec* variables in this file. */ static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -538,6 +584,17 @@ static int execfd = -1; /* The amount of space already allocated from the temporary file. */ static size_t execsize = 0; +#ifdef HAVE_MEMFD_CREATE +/* Open a temporary file name, and immediately unlink it. */ +static int +open_temp_exec_file_memfd (const char *name) +{ + int fd; + fd = memfd_create (name, MFD_CLOEXEC); + return fd; +} +#endif + /* Open a temporary file name, and immediately unlink it. */ static int open_temp_exec_file_name (char *name, int flags) @@ -665,6 +722,10 @@ static struct const char *arg; int repeat; } open_temp_exec_file_opts[] = { +#ifdef HAVE_MEMFD_CREATE + { open_temp_exec_file_memfd, "libffi", 0 }, +#endif + { open_temp_exec_file_env, "LIBFFI_TMPDIR", 0 }, { open_temp_exec_file_env, "TMPDIR", 0 }, { open_temp_exec_file_dir, "/tmp", 0 }, { open_temp_exec_file_dir, "/var/tmp", 0 }, @@ -702,7 +763,7 @@ open_temp_exec_file_opts_next (void) /* Return a file descriptor of a temporary zero-sized file in a writable and executable filesystem. */ -static int +int open_temp_exec_file (void) { int fd; @@ -837,13 +898,29 @@ dlmmap (void *start, size_t length, int prot, && flags == (MAP_PRIVATE | MAP_ANONYMOUS) && fd == -1 && offset == 0); - if (execfd == -1 && is_emutramp_enabled ()) + if (execfd == -1 && ffi_tramp_is_supported ()) { ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset); return ptr; } - if (execfd == -1 && !is_selinux_enabled ()) + /* -1 != execfd hints that we already decided to use dlmmap_locked + last time. */ + if (execfd == -1 && is_mprotect_enabled ()) + { +#ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX + if (is_emutramp_enabled ()) + { + /* emutramp requires the kernel recognizing the trampoline pattern + generated by ffi_prep_closure_loc; there is no way to test + in advance whether this will work, so this is experimental. */ + ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset); + return ptr; + } +#endif + /* fallback to dlmmap_locked. */ + } + else if (execfd == -1 && !is_selinux_enabled ()) { ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset); @@ -856,16 +933,11 @@ dlmmap (void *start, size_t length, int prot, MREMAP_DUP and prot at this point. */ } - if (execsize == 0 || execfd == -1) - { - pthread_mutex_lock (&open_temp_exec_file_mutex); - ptr = dlmmap_locked (start, length, prot, flags, offset); - pthread_mutex_unlock (&open_temp_exec_file_mutex); + pthread_mutex_lock (&open_temp_exec_file_mutex); + ptr = dlmmap_locked (start, length, prot, flags, offset); + pthread_mutex_unlock (&open_temp_exec_file_mutex); - return ptr; - } - - return dlmmap_locked (start, length, prot, flags, offset); + return ptr; } /* Release memory at the given address, as well as the corresponding @@ -908,7 +980,7 @@ segment_holding_code (mstate m, char* addr) } #endif -#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(_M_ARM64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ +#endif /* !(defined(_WIN32) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */ /* Allocate a chunk of memory with the given size. Returns a pointer to the writable address, and sets *CODE to the executable @@ -916,18 +988,29 @@ segment_holding_code (mstate m, char* addr) void * ffi_closure_alloc (size_t size, void **code) { - void *ptr; + void *ptr, *ftramp; if (!code) return NULL; - ptr = dlmalloc (size); + ptr = FFI_CLOSURE_PTR (dlmalloc (size)); if (ptr) { msegmentptr seg = segment_holding (gm, ptr); *code = add_segment_exec_offset (ptr, seg); + if (!ffi_tramp_is_supported ()) + return ptr; + + ftramp = ffi_tramp_alloc (0); + if (ftramp == NULL) + { + dlfree (FFI_RESTORE_PTR (ptr)); + return NULL; + } + *code = ffi_tramp_get_addr (ftramp); + ((ffi_closure *) ptr)->ftramp = ftramp; } return ptr; @@ -942,7 +1025,11 @@ ffi_data_to_code_pointer (void *data) burden of managing this memory themselves, in which case this we'll just return data. */ if (seg) - return add_segment_exec_offset (data, seg); + { + if (!ffi_tramp_is_supported ()) + return add_segment_exec_offset (data, seg); + return ffi_tramp_get_addr (((ffi_closure *) data)->ftramp); + } else return data; } @@ -960,8 +1047,17 @@ ffi_closure_free (void *ptr) if (seg) ptr = sub_segment_exec_offset (ptr, seg); #endif + if (ffi_tramp_is_supported ()) + ffi_tramp_free (((ffi_closure *) ptr)->ftramp); - dlfree (ptr); + dlfree (FFI_RESTORE_PTR (ptr)); +} + +int +ffi_tramp_is_present (void *ptr) +{ + msegmentptr seg = segment_holding (gm, ptr); + return seg != NULL && ffi_tramp_is_supported(); } # else /* ! FFI_MMAP_EXEC_WRIT */ @@ -977,13 +1073,13 @@ ffi_closure_alloc (size_t size, void **code) if (!code) return NULL; - return *code = malloc (size); + return *code = FFI_CLOSURE_PTR (malloc (size)); } void ffi_closure_free (void *ptr) { - free (ptr); + free (FFI_RESTORE_PTR (ptr)); } void * @@ -992,6 +1088,12 @@ ffi_data_to_code_pointer (void *data) return data; } +int +ffi_tramp_is_present (__attribute__((unused)) void *ptr) +{ + return 0; +} + # endif /* ! FFI_MMAP_EXEC_WRIT */ #endif /* FFI_CLOSURES */ diff --git a/src/csky/ffi.c b/src/csky/ffi.c new file mode 100644 index 0000000..af50b7c --- /dev/null +++ b/src/csky/ffi.c @@ -0,0 +1,395 @@ +/* ----------------------------------------------------------------------- + ffi.c + + CSKY Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments +*/ +void ffi_prep_args(char *stack, extended_cif *ecif) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + argp = stack; + + if ( ecif->cif->flags == FFI_TYPE_STRUCT ) { + *(void **) argp = ecif->rvalue; + argp += 4; + } + + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + (i != 0); + i--, p_arg++) + { + size_t z; + size_t alignment; + + /* Align if necessary */ + alignment = (*p_arg)->alignment; +#ifdef __CSKYABIV1__ + /* + * Adapt ABIV1 bug. + * If struct's size is larger than 8 bytes, then it always alignment as 4 bytes. + */ + if (((*p_arg)->type == FFI_TYPE_STRUCT) && ((*p_arg)->size > 8) && (alignment == 8)) { + alignment = 4; + } +#endif + + if ((alignment - 1) & (unsigned) argp) { + argp = (char *) FFI_ALIGN(argp, alignment); + } + + if ((*p_arg)->type == FFI_TYPE_STRUCT) + argp = (char *) FFI_ALIGN(argp, 4); + + z = (*p_arg)->size; + if (z < sizeof(int)) + { + z = sizeof(int); + switch ((*p_arg)->type) + { + case FFI_TYPE_SINT8: + *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); + break; + + case FFI_TYPE_UINT8: + *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); + break; + + case FFI_TYPE_SINT16: + *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); + break; + + case FFI_TYPE_UINT16: + *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); + break; + + case FFI_TYPE_STRUCT: +#ifdef __CSKYBE__ + memcpy((argp + 4 - (*p_arg)->size), *p_argv, (*p_arg)->size); +#else + memcpy(argp, *p_argv, (*p_arg)->size); +#endif + break; + + default: + FFI_ASSERT(0); + } + } + else if (z == sizeof(int)) + { + *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); + } + else + { + memcpy(argp, *p_argv, z); + } + p_argv++; + argp += z; + } + + return; +} + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + /* Round the stack up to a multiple of 8 bytes. This isn't needed + everywhere, but it is on some platforms, and it doesn't hcsky anything + when it isn't needed. */ + cif->bytes = (cif->bytes + 7) & ~7; + + /* Set the return type flag */ + switch (cif->rtype->type) + { + + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + cif->flags = (unsigned) FFI_TYPE_SINT64; + break; + + case FFI_TYPE_STRUCT: + if (cif->rtype->size <= 4) + /* A Composite Type not larger than 4 bytes is returned in r0. */ + cif->flags = (unsigned)FFI_TYPE_INT; + else if (cif->rtype->size <= 8) + /* A Composite Type not larger than 8 bytes is returned in r0, r1. */ + cif->flags = (unsigned)FFI_TYPE_SINT64; + else + /* A Composite Type larger than 8 bytes, or whose size cannot + be determined statically ... is stored in memory at an + address passed [in r0]. */ + cif->flags = (unsigned)FFI_TYPE_STRUCT; + break; + + default: + cif->flags = FFI_TYPE_INT; + break; + } + + return FFI_OK; +} + +/* Perform machine dependent cif processing for variadic calls */ +ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, + unsigned int nfixedargs, + unsigned int ntotalargs) +{ + return ffi_prep_cif_machdep(cif); +} + +/* Prototypes for assembly functions, in sysv.S */ +extern void ffi_call_SYSV (void (*fn)(void), extended_cif *, unsigned, unsigned, unsigned *); + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + extended_cif ecif; + + int small_struct = (cif->flags == FFI_TYPE_INT + && cif->rtype->type == FFI_TYPE_STRUCT); + + ecif.cif = cif; + ecif.avalue = avalue; + + unsigned int temp; + + /* If the return value is a struct and we don't have a return */ + /* value address then we need to make one */ + + if ((rvalue == NULL) && + (cif->flags == FFI_TYPE_STRUCT)) + { + ecif.rvalue = alloca(cif->rtype->size); + } + else if (small_struct) + ecif.rvalue = &temp; + else + ecif.rvalue = rvalue; + + switch (cif->abi) + { + case FFI_SYSV: + ffi_call_SYSV (fn, &ecif, cif->bytes, cif->flags, ecif.rvalue); + break; + + default: + FFI_ASSERT(0); + break; + } + if (small_struct) +#ifdef __CSKYBE__ + memcpy (rvalue, ((unsigned char *)&temp + (4 - cif->rtype->size)), cif->rtype->size); +#else + memcpy (rvalue, &temp, cif->rtype->size); +#endif +} + +/** private members **/ + +static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, + void** args, ffi_cif* cif); + +void ffi_closure_SYSV (ffi_closure *); + +/* This function is jumped to by the trampoline */ + +unsigned int +ffi_closure_SYSV_inner (closure, respp, args) + ffi_closure *closure; + void **respp; + void *args; +{ + // our various things... + ffi_cif *cif; + void **arg_area; + + cif = closure->cif; + arg_area = (void**) alloca (cif->nargs * sizeof (void*)); + + /* this call will initialize ARG_AREA, such that each + * element in that array points to the corresponding + * value on the stack; and if the function returns + * a structure, it will re-set RESP to point to the + * structure return address. */ + + ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif); + + (closure->fun) (cif, *respp, arg_area, closure->user_data); + +#ifdef __CSKYBE__ + if (cif->flags == FFI_TYPE_INT && cif->rtype->type == FFI_TYPE_STRUCT) { + unsigned int tmp = 0; + tmp = *(unsigned int *)(*respp); + *(unsigned int *)(*respp) = (tmp >> ((4 - cif->rtype->size) * 8)); + } +#endif + + return cif->flags; +} + + +static void +ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, + void **avalue, ffi_cif *cif) +{ + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + + argp = stack; + + if ( cif->flags == FFI_TYPE_STRUCT ) { + *rvalue = *(void **) argp; + argp += 4; + } + + p_argv = avalue; + + for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) + { + size_t z; + size_t alignment; + + alignment = (*p_arg)->alignment; + if (alignment < 4) + alignment = 4; + +#ifdef __CSKYABIV1__ + /* + * Adapt ABIV1 bug. + * If struct's size is larger than 8 bytes, then it always alignment as 4 bytes. + */ + if (((*p_arg)->type == FFI_TYPE_STRUCT) && ((*p_arg)->size > 8) && (alignment == 8)) { + alignment = 4; + } +#endif + + /* Align if necessary */ + if ((alignment - 1) & (unsigned) argp) { + argp = (char *) FFI_ALIGN(argp, alignment); + } + + z = (*p_arg)->size; + +#ifdef __CSKYBE__ + unsigned int tmp = 0; + if ((*p_arg)->size < 4) { + tmp = *(unsigned int *)argp; + memcpy(argp, ((unsigned char *)&tmp + (4 - (*p_arg)->size)), (*p_arg)->size); + } +#else + /* because we're little endian, this is what it turns into. */ +#endif + *p_argv = (void*) argp; + + p_argv++; + argp += z; + } + + return; +} + +/* How to make a trampoline. */ + +extern unsigned char ffi_csky_trampoline[TRAMPOLINE_SIZE]; + +/* + * Since there is no __clear_cache in libgcc in csky toolchain. + * define ffi_csky_cacheflush in sysv.S. + * void ffi_csky_cacheflush(uint32 start_addr, uint32 size, int cache) + */ +#define CACHEFLUSH_IN_FFI 1 +#if CACHEFLUSH_IN_FFI +extern void ffi_csky_cacheflush(unsigned char *__tramp, unsigned int k, + int i); +#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ +({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ + unsigned char *insns = (unsigned char *)(CTX); \ + memcpy (__tramp, ffi_csky_trampoline, TRAMPOLINE_SIZE); \ + *(unsigned int*) &__tramp[TRAMPOLINE_SIZE] = __ctx; \ + *(unsigned int*) &__tramp[TRAMPOLINE_SIZE + 4] = __fun; \ + ffi_csky_cacheflush(&__tramp[0], TRAMPOLINE_SIZE, 3); /* Clear data mapping. */ \ + ffi_csky_cacheflush(insns, TRAMPOLINE_SIZE, 3); \ + /* Clear instruction \ + mapping. */ \ + }) +#else +#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ +({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ + unsigned char *insns = (unsigned char *)(CTX); \ + memcpy (__tramp, ffi_csky_trampoline, TRAMPOLINE_SIZE); \ + *(unsigned int*) &__tramp[TRAMPOLINE_SIZE] = __ctx; \ + *(unsigned int*) &__tramp[TRAMPOLINE_SIZE + 4] = __fun; \ + __clear_cache((&__tramp[0]), (&__tramp[TRAMPOLINE_SIZE-1])); /* Clear data mapping. */ \ + __clear_cache(insns, insns + TRAMPOLINE_SIZE); \ + /* Clear instruction \ + mapping. */ \ + }) +#endif + +/* the cif must already be prep'ed */ + +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + void (*closure_func)(ffi_closure*) = NULL; + + if (cif->abi == FFI_SYSV) + closure_func = &ffi_closure_SYSV; + else + return FFI_BAD_ABI; + + FFI_INIT_TRAMPOLINE (&closure->tramp[0], \ + closure_func, \ + codeloc); + + closure->cif = cif; + closure->user_data = user_data; + closure->fun = fun; + + return FFI_OK; +} + + diff --git a/src/csky/ffitarget.h b/src/csky/ffitarget.h new file mode 100644 index 0000000..f770aac --- /dev/null +++ b/src/csky/ffitarget.h @@ -0,0 +1,63 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2012 Anthony Green + Copyright (c) 2010 CodeSourcery + Copyright (c) 1996-2003 Red Hat, Inc. + + Target configuration macros for CSKY. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV, +} ffi_abi; +#endif + +#ifdef __CSKYABIV2__ +#define FFI_ASM_ARGREG_SIZE 16 +#define TRAMPOLINE_SIZE 16 +#define FFI_TRAMPOLINE_SIZE 24 +#else +#define FFI_ASM_ARGREG_SIZE 24 +#define TRAMPOLINE_SIZE 20 +#define FFI_TRAMPOLINE_SIZE 28 +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_NATIVE_RAW_API 0 +#endif diff --git a/src/csky/sysv.S b/src/csky/sysv.S new file mode 100644 index 0000000..21670bf --- /dev/null +++ b/src/csky/sysv.S @@ -0,0 +1,371 @@ +/* ----------------------------------------------------------------------- + sysv.S + + CSKY Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +.macro CSKY_FUNC_START name + .text + .align 2 + .globl \name + .type \name, @function + \name: +.endm + +#ifdef __CSKYABIV2__ + + /* + * a0: fn + * a1: &ecif + * a2: cif->bytes + * a3: fig->flags + * sp+0: ecif.rvalue + */ +CSKY_FUNC_START ffi_call_SYSV + /* Save registers */ + .cfi_startproc + subi sp, 28 + .cfi_def_cfa_offset 28 + stw a0, (sp, 0x0) + .cfi_offset 0, -28 + stw a1, (sp, 0x4) + .cfi_offset 1, -24 + stw a2, (sp, 0x8) + .cfi_offset 2, -20 + stw a3, (sp, 0xC) + .cfi_offset 3, -16 + stw l0, (sp, 0x10) + .cfi_offset 4, -12 + stw l1, (sp, 0x14) + .cfi_offset 5, -8 + stw lr, (sp, 0x18) + .cfi_offset 15, -4 + + mov l0, sp + .cfi_def_cfa_register 4 + + /* Make room for all of the new args. */ + subu sp, sp, a2 + + /* Place all of the ffi_prep_args in position */ + mov a0, sp + /* a1 already set */ + + /* Call ffi_prep_args(stack, &ecif) */ + jsri ffi_prep_args + + /* move first 4 parameters in registers */ + ldw a0, (sp, 0x0) + ldw a1, (sp, 0x4) + ldw a2, (sp, 0x8) + ldw a3, (sp, 0xC) + + /* and adjust stack */ + subu lr, l0, sp /* cif->bytes == l0 - sp */ + cmphsi lr, 16 + movi l1, 16 + movt lr, l1 + addu sp, sp, lr + + ldw l1, (l0, 0) /* load fn() in advance */ + + /* call (fn) (...) */ + jsr l1 + + /* Remove the space we pushed for the args */ + mov sp, l0 + + /* Load r2 with the pointer to storage for the return value */ + ldw a2, (sp, 0x1C) + + /* Load r3 with the return type code */ + ldw a3, (sp, 0xC) + + /* If the return value pointer is NULL, assume no return value. */ + cmpnei a2, 0 + bf .Lepilogue + + cmpnei a3, FFI_TYPE_STRUCT + bf .Lepilogue + + /* return INT64 */ + cmpnei a3, FFI_TYPE_SINT64 + bt .Lretint + /* stw a0, (a2, 0x0) at .Lretint */ + stw a1, (a2, 0x4) + +.Lretint: + /* return INT */ + stw a0, (a2, 0x0) + +.Lepilogue: + ldw a0, (sp, 0x0) + ldw a1, (sp, 0x4) + ldw a2, (sp, 0x8) + ldw a3, (sp, 0xC) + ldw l0, (sp, 0x10) + ldw l1, (sp, 0x14) + ldw lr, (sp, 0x18) + addi sp, sp, 28 + rts + .cfi_endproc + .size ffi_call_SYSV, .-ffi_call_SYSV + + + /* + * unsigned int FFI_HIDDEN + * ffi_closure_SYSV_inner (closure, respp, args) + * ffi_closure *closure; + * void **respp; + * void *args; + */ +CSKY_FUNC_START ffi_closure_SYSV + .cfi_startproc + mov a2, sp + addi a1, sp, 16 + subi sp, sp, 24 + .cfi_def_cfa_offset 40 + stw a1, (sp, 0x10) + .cfi_offset 1, -24 + stw lr, (sp, 0x14) + .cfi_offset 15, -20 + stw sp, (sp, 0x8) + addi a1, sp, 8 + jsri ffi_closure_SYSV_inner + ldw a0, (sp, 0x0) + /* + * if FFI_TYPE_SINT64, need a1. + * if FFI_TYPE_INT, ignore a1. + */ + ldw a1, (sp, 0x4) + + ldw lr, (sp, 0x14) + addi sp, sp, 40 + rts + .cfi_endproc + .size ffi_closure_SYSV, .-ffi_closure_SYSV + +CSKY_FUNC_START ffi_csky_trampoline + subi sp, sp, 16 + stw a0, (sp, 0x0) + stw a1, (sp, 0x4) + stw a2, (sp, 0x8) + stw a3, (sp, 0xC) + lrw a0, [.Lctx] + lrw a1, [.Lfun] + jmp a1 +.Lctx: + mov a0, a0 + mov a0, a0 +.Lfun: + + .size ffi_csky_trampoline, .-ffi_csky_trampoline + +CSKY_FUNC_START ffi_csky_cacheflush + mov t0, r7 + movi r7, 123 + trap 0 + mov r7, t0 + rts + + .size ffi_csky_cacheflush, .-ffi_csky_cacheflush + +#else /* !__CSKYABIV2__ */ + + /* + * a0: fn + * a1: &ecif + * a2: cif->bytes + * a3: fig->flags + * a4: ecif.rvalue + */ +CSKY_FUNC_START ffi_call_SYSV + /* Save registers */ + .cfi_startproc + subi sp, 32 + subi sp, 8 + .cfi_def_cfa_offset 40 + stw a0, (sp, 0x0) + .cfi_offset 2, -40 + stw a1, (sp, 0x4) + .cfi_offset 3, -36 + stw a2, (sp, 0x8) + .cfi_offset 4, -32 + stw a3, (sp, 0xC) + .cfi_offset 5, -28 + stw a4, (sp, 0x10) + .cfi_offset 6, -24 + stw a5, (sp, 0x14) + .cfi_offset 7, -20 + stw l0, (sp, 0x18) + .cfi_offset 8, -16 + stw l1, (sp, 0x1C) + .cfi_offset 9, -12 + stw lr, (sp, 0x20) + .cfi_offset 15, -8 + + mov l0, sp + .cfi_def_cfa_register 8 + + /* Make room for all of the new args. */ + subu sp, sp, a2 + + /* Place all of the ffi_prep_args in position */ + mov a0, sp + /* a1 already set */ + + /* Call ffi_prep_args(stack, &ecif) */ + jsri ffi_prep_args + + /* move first 4 parameters in registers */ + ldw a0, (sp, 0x0) + ldw a1, (sp, 0x4) + ldw a2, (sp, 0x8) + ldw a3, (sp, 0xC) + ldw a4, (sp, 0x10) + ldw a5, (sp, 0x14) + + /* and adjust stack */ + mov lr, l0 + subu lr, sp /* cif->bytes == l0 - sp */ + movi l1, 24 + cmphs lr, l1 + movt lr, l1 + addu sp, sp, lr + + ldw l1, (l0, 0) /* load fn() in advance */ + + /* call (fn) (...) */ + jsr l1 + + /* Remove the space we pushed for the args */ + mov sp, l0 + + /* Load r2 with the pointer to storage for the return value */ + ldw a2, (sp, 0x10) + + /* Load r3 with the return type code */ + ldw a3, (sp, 0xC) + + /* If the return value pointer is NULL, assume no return value. */ + cmpnei a2, 0 + bf .Lepilogue + + cmpnei a3, FFI_TYPE_STRUCT + bf .Lepilogue + + /* return INT64 */ + cmpnei a3, FFI_TYPE_SINT64 + bt .Lretint + /* stw a0, (a2, 0x0) at .Lretint */ + stw a1, (a2, 0x4) + +.Lretint: + /* return INT */ + stw a0, (a2, 0x0) + +.Lepilogue: + ldw a0, (sp, 0x0) + ldw a1, (sp, 0x4) + ldw a2, (sp, 0x8) + ldw a3, (sp, 0xC) + ldw a4, (sp, 0x10) + ldw a5, (sp, 0x14) + ldw l0, (sp, 0x18) + ldw l1, (sp, 0x1C) + ldw lr, (sp, 0x20) + addi sp, sp, 32 + addi sp, sp, 8 + rts + .cfi_endproc + + .size ffi_call_SYSV, .-ffi_call_SYSV + + + /* + * unsigned int FFI_HIDDEN + * ffi_closure_SYSV_inner (closure, respp, args) + * ffi_closure *closure; + * void **respp; + * void *args; + */ +CSKY_FUNC_START ffi_closure_SYSV + .cfi_startproc + mov a2, sp + mov a1, sp + addi a1, 24 + subi sp, sp, 24 + .cfi_def_cfa_offset 48 + stw a1, (sp, 0x10) + .cfi_offset 3, -32 + stw lr, (sp, 0x14) + .cfi_offset 15, -28 + stw sp, (sp, 0x8) + mov a1, sp + addi a1, 8 + jsri ffi_closure_SYSV_inner + ldw a0, (sp, 0x0) + /* + * if FFI_TYPE_SINT64, need a1. + * if FFI_TYPE_INT, ignore a1. + */ + ldw a1, (sp, 0x4) + + ldw lr, (sp, 0x14) + addi sp, sp, 24 + addi sp, sp, 24 + rts + .cfi_endproc + + .size ffi_closure_SYSV, .-ffi_closure_SYSV + +CSKY_FUNC_START ffi_csky_trampoline + subi sp, 24 + stw a0, (sp, 0x0) + stw a1, (sp, 0x4) + stw a2, (sp, 0x8) + stw a3, (sp, 0xC) + stw a4, (sp, 0x10) + stw a5, (sp, 0x14) + lrw a0, [.Lctx] + lrw a1, [.Lfun] + jmp a1 +.Lctx: + mov a0, a0 + mov a0, a0 +.Lfun: + + .size ffi_csky_trampoline, .-ffi_csky_trampoline + +CSKY_FUNC_START ffi_csky_cacheflush + lrw r1, 123 + trap 0 + rts + + .size ffi_csky_cacheflush, .-ffi_csky_cacheflush + +#endif /* __CSKYABIV2__ */ diff --git a/src/dlmalloc.c b/src/dlmalloc.c index d63dd36..6f4a5f6 100644 --- a/src/dlmalloc.c +++ b/src/dlmalloc.c @@ -592,6 +592,11 @@ DEFAULT_MMAP_THRESHOLD default: 256K malloc does support the following options. */ +/* The system's malloc.h may have conflicting defines. */ +#undef M_TRIM_THRESHOLD +#undef M_GRANULARITY +#undef M_MMAP_THRESHOLD + #define M_TRIM_THRESHOLD (-1) #define M_GRANULARITY (-2) #define M_MMAP_THRESHOLD (-3) @@ -2371,7 +2376,7 @@ static size_t traverse_and_check(mstate m); #else /* GNUC */ #if USE_BUILTIN_FFS -#define compute_bit2idx(X, I) I = ffs(X)-1 +#define compute_bit2idx(X, I) I = __builtin_ffs(X)-1 #else /* USE_BUILTIN_FFS */ #define compute_bit2idx(X, I)\ diff --git a/src/kvx/asm.h b/src/kvx/asm.h new file mode 100644 index 0000000..4edba41 --- /dev/null +++ b/src/kvx/asm.h @@ -0,0 +1,5 @@ +/* args are passed on registers from r0 up to r11 => 12*8 bytes */ +#define REG_ARGS_SIZE (12*8) +#define KVX_REGISTER_SIZE (8) +#define KVX_ABI_SLOT_SIZE (KVX_REGISTER_SIZE) +#define KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE (4*KVX_ABI_SLOT_SIZE) diff --git a/src/kvx/ffi.c b/src/kvx/ffi.c new file mode 100644 index 0000000..58f6aef --- /dev/null +++ b/src/kvx/ffi.c @@ -0,0 +1,273 @@ +/* Copyright (c) 2020 Kalray + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined(__kvx__) +#include +#include +#include +#include +#include +#include "ffi_common.h" +#include "asm.h" + +#define ALIGN(x, a) ALIGN_MASK(x, (typeof(x))(a) - 1) +#define ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) +#define KVX_ABI_STACK_ALIGNMENT (32) +#define KVX_ABI_STACK_ARG_ALIGNMENT (8) +#define max(a,b) ((a) > (b) ? (a) : (b)) + +#ifdef FFI_DEBUG +#define DEBUG_PRINT(...) do{ fprintf( stderr, __VA_ARGS__ ); } while(0) +#else +#define DEBUG_PRINT(...) +#endif + +struct ret_value { + unsigned long int r0; + unsigned long int r1; + unsigned long int r2; + unsigned long int r3; +}; + +extern struct ret_value ffi_call_SYSV(unsigned total_size, + unsigned size, + extended_cif *ecif, + unsigned *rvalue_addr, + void *fn, + unsigned int_ext_method); + +/* Perform machine dependent cif processing */ +ffi_status ffi_prep_cif_machdep(ffi_cif *cif) +{ + cif->flags = cif->rtype->size; + return FFI_OK; +} + +/* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + +void *ffi_prep_args(char *stack, unsigned int arg_slots_size, extended_cif *ecif) +{ + char *stacktemp = stack; + char *current_arg_passed_by_value = stack + arg_slots_size; + int i, s; + ffi_type **arg; + int count = 0; + ffi_cif *cif = ecif->cif; + void **argv = ecif->avalue; + + arg = cif->arg_types; + + DEBUG_PRINT("stack: %p\n", stack); + DEBUG_PRINT("arg_slots_size: %u\n", arg_slots_size); + DEBUG_PRINT("current_arg_passed_by_value: %p\n", current_arg_passed_by_value); + DEBUG_PRINT("ecif: %p\n", ecif); + DEBUG_PRINT("ecif->avalue: %p\n", ecif->avalue); + + for (i = 0; i < cif->nargs; i++) { + + s = KVX_ABI_SLOT_SIZE; + switch((*arg)->type) { + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + DEBUG_PRINT("INT64/32/16/8/FLOAT/DOUBLE or POINTER @%p\n", stack); + *(uint64_t *) stack = *(uint64_t *)(* argv); + break; + + case FFI_TYPE_COMPLEX: + if ((*arg)->size == 8) + *(_Complex float *) stack = *(_Complex float *)(* argv); + else if ((*arg)->size == 16) { + *(_Complex double *) stack = *(_Complex double *)(* argv); + s = 16; + } else + abort(); + break; + case FFI_TYPE_STRUCT: { + char *value; + unsigned int written_size = 0; + DEBUG_PRINT("struct by value @%p\n", stack); + if ((*arg)->size > KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) { + DEBUG_PRINT("big struct\n"); + *(uint64_t *) stack = (uintptr_t)current_arg_passed_by_value; + value = current_arg_passed_by_value; + current_arg_passed_by_value += (*arg)->size; + written_size = KVX_ABI_SLOT_SIZE; + } else { + value = stack; + written_size = (*arg)->size; + } + memcpy(value, *argv, (*arg)->size); + s = ALIGN(written_size, KVX_ABI_STACK_ARG_ALIGNMENT); + break; + } + default: + printf("Error: unsupported arg type %d\n", (*arg)->type); + abort(); + break; + + } + stack += s; + count += s; + argv++; + arg++; + } +#ifdef FFI_DEBUG + FFI_ASSERT(((intptr_t)(stacktemp + REG_ARGS_SIZE) & (KVX_ABI_STACK_ALIGNMENT-1)) == 0); +#endif + return stacktemp + REG_ARGS_SIZE; +} + +/* Perform machine dependent cif processing when we have a variadic function */ + +ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs, + unsigned int ntotalargs) +{ + cif->flags = cif->rtype->size; + return FFI_OK; +} + +static unsigned long handle_small_int_ext(kvx_intext_method *int_ext_method, + const ffi_type *rtype) +{ + switch (rtype->type) { + case FFI_TYPE_SINT8: + *int_ext_method = KVX_RET_SXBD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_SINT16: + *int_ext_method = KVX_RET_SXHD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_SINT32: + *int_ext_method = KVX_RET_SXWD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_UINT8: + *int_ext_method = KVX_RET_ZXBD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_UINT16: + *int_ext_method = KVX_RET_ZXHD; + return KVX_REGISTER_SIZE; + + case FFI_TYPE_UINT32: + *int_ext_method = KVX_RET_ZXWD; + return KVX_REGISTER_SIZE; + + default: + *int_ext_method = KVX_RET_NONE; + return rtype->size; + } +} + +void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) +{ + int i; + unsigned long int slot_fitting_args_size = 0; + unsigned long int total_size = 0; + unsigned long int big_struct_size = 0; + kvx_intext_method int_extension_method; + ffi_type **arg; + struct ret_value local_rvalue = {0}; + size_t wb_size; + + + /* Calculate size to allocate on stack */ + for (i = 0, arg = cif->arg_types; i < cif->nargs; i++, arg++) { + DEBUG_PRINT("argument %d, type %d, size %lu\n", i, (*arg)->type, (*arg)->size); + if (((*arg)->type == FFI_TYPE_STRUCT) || ((*arg)->type == FFI_TYPE_COMPLEX)) { + if ((*arg)->size <= KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) { + slot_fitting_args_size += ALIGN((*arg)->size, KVX_ABI_SLOT_SIZE); + } else { + slot_fitting_args_size += KVX_ABI_SLOT_SIZE; /* aggregate passed by reference */ + big_struct_size += ALIGN((*arg)->size, KVX_ABI_SLOT_SIZE); + } + } else if ((*arg)->size <= KVX_ABI_SLOT_SIZE) { + slot_fitting_args_size += KVX_ABI_SLOT_SIZE; + } else { + printf("Error: unsupported arg size %ld arg type %d\n", (*arg)->size, (*arg)->type); + abort(); /* should never happen? */ + } + } + + extended_cif ecif; + ecif.cif = cif; + ecif.avalue = avalue; + ecif.rvalue = rvalue; + + /* This implementation allocates anyway for all register based args */ + slot_fitting_args_size = max(slot_fitting_args_size, REG_ARGS_SIZE); + total_size = slot_fitting_args_size + big_struct_size; + total_size = ALIGN(total_size, KVX_ABI_STACK_ALIGNMENT); + + /* wb_size: write back size, the size we will need to write back to user + * provided buffer. In theory it should always be cif->flags which is + * cif->rtype->size. But libffi API mandates that for integral types + * of size <= system register size, then we *MUST* write back + * the size of system register size. + * in our case, if size <= 8 bytes we must write back 8 bytes. + * floats, complex and structs are not affected, only integrals. + */ + wb_size = handle_small_int_ext(&int_extension_method, cif->rtype); + + switch (cif->abi) { + case FFI_SYSV: + DEBUG_PRINT("total_size: %lu\n", total_size); + DEBUG_PRINT("slot fitting args size: %lu\n", slot_fitting_args_size); + DEBUG_PRINT("rvalue: %p\n", rvalue); + DEBUG_PRINT("fn: %p\n", fn); + DEBUG_PRINT("rsize: %u\n", cif->flags); + DEBUG_PRINT("wb_size: %u\n", wb_size); + DEBUG_PRINT("int_extension_method: %u\n", int_extension_method); + local_rvalue = ffi_call_SYSV(total_size, slot_fitting_args_size, + &ecif, rvalue, fn, int_extension_method); + if ((cif->flags <= KVX_ABI_MAX_AGGREGATE_IN_REG_SIZE) + && (cif->rtype->type != FFI_TYPE_VOID)) + memcpy(rvalue, &local_rvalue, wb_size); + break; + default: + abort(); + break; + } +} + +/* Closures not supported yet */ +ffi_status +ffi_prep_closure_loc (ffi_closure* closure, + ffi_cif* cif, + void (*fun)(ffi_cif*,void*,void**,void*), + void *user_data, + void *codeloc) +{ + return FFI_BAD_ABI; +} + +#endif /* (__kvx__) */ diff --git a/src/kvx/ffitarget.h b/src/kvx/ffitarget.h new file mode 100644 index 0000000..8df8735 --- /dev/null +++ b/src/kvx/ffitarget.h @@ -0,0 +1,75 @@ +/* ----------------------------------------------------------------------- + ffitarget.h - Copyright (c) 2020 Kalray + + KVX Target configuration macros + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +/* ---- System specific configurations ----------------------------------- */ + +#ifndef LIBFFI_ASM +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + FFI_SYSV, + FFI_LAST_ABI, + FFI_DEFAULT_ABI = FFI_SYSV +} ffi_abi; + +/* Those values are set depending on return type + * they are used in the assembly code in sysv.S + */ +typedef enum kvx_intext_method { + KVX_RET_NONE = 0, + KVX_RET_SXBD = 1, + KVX_RET_SXHD = 2, + KVX_RET_SXWD = 3, + KVX_RET_ZXBD = 4, + KVX_RET_ZXHD = 5, + KVX_RET_ZXWD = 6 +} kvx_intext_method; + +#endif + +/* ---- Definitions for closures ----------------------------------------- */ + +/* This is only to allow Python to compile + * but closures are not supported yet + */ +#define FFI_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 0 + +#define FFI_NATIVE_RAW_API 0 +#define FFI_TARGET_SPECIFIC_VARIADIC 1 +#define FFI_TARGET_HAS_COMPLEX_TYPE + +#endif + diff --git a/src/kvx/sysv.S b/src/kvx/sysv.S new file mode 100644 index 0000000..952afc7 --- /dev/null +++ b/src/kvx/sysv.S @@ -0,0 +1,127 @@ +/* Copyright (c) 2020 Kalray + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined(__kvx__) +#define LIBFFI_ASM +#include +#include +#include +#include + +.text +.global ffi_call_SYSV +.type ffi_call_SYSV, @function +.type ffi_prep_args, @function +.align 8 + +/* ffi_call_SYSV + + r0: total size to allocate on stack + r1: size of arg slots + r2: extended cif structure, DO NOT REMOVE: it is used by ffi_prep_args() + r3: return value address + r4: function to call + r5: integer sign extension method to be used +*/ +ffi_call_SYSV: + addd $r12 = $r12, -64 + so (-32)[$r12] = $r20r21r22r23 + ;; + sd (0)[$r12] = $r24 + ;; + get $r23 = $ra + copyd $r20 = $r12 + sbfd $r12 = $r0, $r12 + ;; + copyd $r0 = $r12 + copyd $r21 = $r3 + copyd $r22 = $r4 + copyd $r24 = $r5 + call ffi_prep_args + ;; + lo $r8r9r10r11 = (64)[$r12] + ;; + lo $r4r5r6r7 = (32)[$r12] + ;; + lo $r0r1r2r3 = (0)[$r12] + copyd $r12 = $r0 + /* $r15 is the register used by the ABI to return big (>32 bytes) + * structs by value. + * It is also referred to as the "struct register" in the ABI. + */ + copyd $r15 = $r21 + icall $r22 + ;; + pcrel $r4 = @pcrel(.Ltable) + cb.deqz $r24 ? .Lend + ;; + addx8d $r24 = $r24, $r4 + ;; + igoto $r24 + ;; +.Ltable: +0: /* we should never arrive here */ + goto .Lerror + nop + ;; +1: /* Sign extend byte to double */ + sxbd $r0 = $r0 + goto .Lend + ;; +2: /* Sign extend half to double */ + sxhd $r0 = $r0 + goto .Lend + ;; +3: /* Sign extend word to double */ + sxwd $r0 = $r0 + goto .Lend + ;; +4: /* Zero extend byte to double */ + zxbd $r0 = $r0 + goto .Lend + ;; +5: /* Zero extend half to double */ + zxhd $r0 = $r0 + goto .Lend + ;; +6: /* Zero extend word to double */ + zxwd $r0 = $r0 + /* Fallthrough to .Lend */ + ;; +.Lend: + ld $r24 = (0)[$r12] + ;; + set $ra = $r23 + lo $r20r21r22r23 = (32)[$r20] + addd $r12 = $r20, 64 + ;; + ret + ;; +.Lerror: + errop + ;; + +#endif /* __kvx__ */ + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",%progbits +#endif + diff --git a/src/loongarch64/ffi.c b/src/loongarch64/ffi.c new file mode 100644 index 0000000..140be3b --- /dev/null +++ b/src/loongarch64/ffi.c @@ -0,0 +1,621 @@ +/* ----------------------------------------------------------------------- + ffi.c - Copyright (c) 2022 Xu Chenghua + 2022 Cheng Lulu + Based on RISC-V port + + LoongArch Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include +#include + +#include +#include + +#if defined(__loongarch_soft_float) +# define ABI_FRLEN 0 +#elif defined(__loongarch_single_float) +# define ABI_FRLEN 32 +# define ABI_FLOAT float +#elif defined(__loongarch_double_float) +# define ABI_FRLEN 64 +# define ABI_FLOAT double +#else +#error unsupported LoongArch floating-point ABI +#endif + +#define NARGREG 8 +#define STKALIGN 16 +#define MAXCOPYARG (2 * sizeof (double)) + +/* call_context registers + - 8 floating point parameter/result registers. + - 8 integer parameter/result registers. + - 2 registers used by the assembly code to in-place construct its own + stack frame + - frame register + - return register +*/ +typedef struct call_context +{ + ABI_FLOAT fa[8]; + size_t a[10]; +} call_context; + +typedef struct call_builder +{ + call_context *aregs; + int used_integer; + int used_float; + size_t *used_stack; + size_t *stack; + size_t next_struct_area; +} call_builder; + +/* Integer (not pointer) less than ABI GRLEN. */ +/* FFI_TYPE_INT does not appear to be used. */ +#if __SIZEOF_POINTER__ == 8 +# define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT64) +#else +# define IS_INT(type) ((type) >= FFI_TYPE_UINT8 && (type) <= FFI_TYPE_SINT32) +#endif + +#if ABI_FRLEN +typedef struct float_struct_info +{ + char as_elements; + char type1; + char offset2; + char type2; +} float_struct_info; + +#if ABI_FRLEN >= 64 +# define IS_FLOAT(type) ((type) >= FFI_TYPE_FLOAT && (type) <= FFI_TYPE_DOUBLE) +#else +# define IS_FLOAT(type) ((type) == FFI_TYPE_FLOAT) +#endif + +static ffi_type ** +flatten_struct (ffi_type *in, ffi_type **out, ffi_type **out_end) +{ + int i; + + if (out == out_end) + return out; + if (in->type != FFI_TYPE_STRUCT) + *(out++) = in; + else + for (i = 0; in->elements[i]; i++) + out = flatten_struct (in->elements[i], out, out_end); + return out; +} + +/* Structs with at most two fields after flattening, one of which is of + floating point type, are passed in multiple registers if sufficient + registers are available. */ +static float_struct_info +struct_passed_as_elements (call_builder *cb, ffi_type *top) +{ + float_struct_info ret = {0, 0, 0, 0}; + ffi_type *fields[3]; + int num_floats, num_ints; + int num_fields = flatten_struct (top, fields, fields + 3) - fields; + + if (num_fields == 1) + { + if (IS_FLOAT (fields[0]->type)) + { + ret.as_elements = 1; + ret.type1 = fields[0]->type; + } + } + else if (num_fields == 2) + { + num_floats = IS_FLOAT (fields[0]->type) + IS_FLOAT (fields[1]->type); + num_ints = IS_INT (fields[0]->type) + IS_INT (fields[1]->type); + if (num_floats == 0 || num_floats + num_ints != 2) + return ret; + if (cb->used_float + num_floats > NARGREG + || cb->used_integer + (2 - num_floats) > NARGREG) + return ret; + if (!IS_FLOAT (fields[0]->type) && !IS_FLOAT (fields[1]->type)) + return ret; + + ret.type1 = fields[0]->type; + ret.type2 = fields[1]->type; + ret.offset2 = FFI_ALIGN (fields[0]->size, fields[1]->alignment); + ret.as_elements = 1; + } + return ret; +} +#endif + +/* Allocates a single register, float register, or GRLEN-sized stack slot to a + datum. */ +static void +marshal_atom (call_builder *cb, int type, void *data) +{ + size_t value = 0; + switch (type) + { + case FFI_TYPE_UINT8: + value = *(uint8_t *) data; + break; + case FFI_TYPE_SINT8: + value = *(int8_t *) data; + break; + case FFI_TYPE_UINT16: + value = *(uint16_t *) data; + break; + case FFI_TYPE_SINT16: + value = *(int16_t *) data; + break; + /* 32-bit quantities are always sign-extended in the ABI. */ + case FFI_TYPE_UINT32: + value = *(int32_t *) data; + break; + case FFI_TYPE_SINT32: + value = *(int32_t *) data; + break; +#if __SIZEOF_POINTER__ == 8 + case FFI_TYPE_UINT64: + value = *(uint64_t *) data; + break; + case FFI_TYPE_SINT64: + value = *(int64_t *) data; + break; +#endif + case FFI_TYPE_POINTER: + value = *(size_t *) data; + break; + +#if ABI_FRLEN >= 32 + case FFI_TYPE_FLOAT: + *(float *)(cb->aregs->fa + cb->used_float++) = *(float *) data; + return; +#endif +#if ABI_FRLEN >= 64 + case FFI_TYPE_DOUBLE: + (cb->aregs->fa[cb->used_float++]) = *(double *) data; + return; +#endif + default: + FFI_ASSERT (0); + break; + } + + if (cb->used_integer == NARGREG) + *cb->used_stack++ = value; + else + cb->aregs->a[cb->used_integer++] = value; +} + +static void +unmarshal_atom (call_builder *cb, int type, void *data) +{ + size_t value; + switch (type) + { +#if ABI_FRLEN >= 32 + case FFI_TYPE_FLOAT: + *(float *) data = *(float *)(cb->aregs->fa + cb->used_float++); + return; +#endif +#if ABI_FRLEN >= 64 + case FFI_TYPE_DOUBLE: + *(double *) data = cb->aregs->fa[cb->used_float++]; + return; +#endif + } + + if (cb->used_integer == NARGREG) + value = *cb->used_stack++; + else + value = cb->aregs->a[cb->used_integer++]; + + switch (type) + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: + case FFI_TYPE_UINT32: + case FFI_TYPE_SINT32: +#if __SIZEOF_POINTER__ == 8 + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +#endif + case FFI_TYPE_POINTER: + *(ffi_arg *)data = value; + break; + default: + FFI_ASSERT (0); + break; + } +} + +/* Allocate and copy a structure that is passed by value on the stack and + return a pointer to it. */ +static void * +allocate_and_copy_struct_to_stack (call_builder *cb, void *data, + ffi_type *type) +{ + size_t dest = cb->next_struct_area - type->size; + + dest = FFI_ALIGN_DOWN (dest, type->alignment); + cb->next_struct_area = dest; + + return memcpy ((char *)cb->stack + dest, data, type->size); +} + +/* Adds an argument to a call, or a not by reference return value. */ +static void +marshal (call_builder *cb, ffi_type *type, int var, void *data) +{ + size_t realign[2]; + +#if ABI_FRLEN + if (!var && type->type == FFI_TYPE_STRUCT) + { + float_struct_info fsi = struct_passed_as_elements (cb, type); + if (fsi.as_elements) + { + marshal_atom (cb, fsi.type1, data); + if (fsi.offset2) + marshal_atom (cb, fsi.type2, ((char *) data) + fsi.offset2); + return; + } + } + + if (!var && cb->used_float < NARGREG + && IS_FLOAT (type->type)) + { + marshal_atom (cb, type->type, data); + return; + } + + double promoted; + if (var && type->type == FFI_TYPE_FLOAT) + { + /* C standard requires promoting float -> double for variable arg. */ + promoted = *(float *) data; + type = &ffi_type_double; + data = &promoted; + } +#endif + + if (type->size > 2 * __SIZEOF_POINTER__) + /* Pass by reference. */ + { + allocate_and_copy_struct_to_stack (cb, data, type); + data = (char *)cb->stack + cb->next_struct_area; + marshal_atom (cb, FFI_TYPE_POINTER, &data); + } + else if (IS_INT (type->type) || type->type == FFI_TYPE_POINTER) + marshal_atom (cb, type->type, data); + else + { + /* Overlong integers, soft-float floats, and structs without special + float handling are treated identically from this point on. */ + + /* Variadics are aligned even in registers. */ + if (type->alignment > __SIZEOF_POINTER__) + { + if (var) + cb->used_integer = FFI_ALIGN (cb->used_integer, 2); + cb->used_stack + = (size_t *) FFI_ALIGN (cb->used_stack, 2 * __SIZEOF_POINTER__); + } + + memcpy (realign, data, type->size); + if (type->size > 0) + marshal_atom (cb, FFI_TYPE_POINTER, realign); + if (type->size > __SIZEOF_POINTER__) + marshal_atom (cb, FFI_TYPE_POINTER, realign + 1); + } +} + +/* For arguments passed by reference returns the pointer, otherwise the arg + is copied (up to MAXCOPYARG bytes). */ +static void * +unmarshal (call_builder *cb, ffi_type *type, int var, void *data) +{ + size_t realign[2]; + void *pointer; + +#if ABI_FRLEN + if (!var && type->type == FFI_TYPE_STRUCT) + { + float_struct_info fsi = struct_passed_as_elements (cb, type); + if (fsi.as_elements) + { + unmarshal_atom (cb, fsi.type1, data); + if (fsi.offset2) + unmarshal_atom (cb, fsi.type2, ((char *) data) + fsi.offset2); + return data; + } + } + + if (!var && cb->used_float < NARGREG + && IS_FLOAT (type->type)) + { + unmarshal_atom (cb, type->type, data); + return data; + } + + if (var && type->type == FFI_TYPE_FLOAT) + { + int m = cb->used_integer; + void *promoted + = m < NARGREG ? cb->aregs->a + m : cb->used_stack + m - NARGREG + 1; + *(float *) promoted = *(double *) promoted; + } +#endif + + if (type->size > 2 * __SIZEOF_POINTER__) + { + /* Pass by reference. */ + unmarshal_atom (cb, FFI_TYPE_POINTER, (char *) &pointer); + return pointer; + } + else if (IS_INT (type->type) || type->type == FFI_TYPE_POINTER) + { + unmarshal_atom (cb, type->type, data); + return data; + } + else + { + /* Overlong integers, soft-float floats, and structs without special + float handling are treated identically from this point on. */ + + /* Variadics are aligned even in registers. */ + if (type->alignment > __SIZEOF_POINTER__) + { + if (var) + cb->used_integer = FFI_ALIGN (cb->used_integer, 2); + cb->used_stack + = (size_t *) FFI_ALIGN (cb->used_stack, 2 * __SIZEOF_POINTER__); + } + + if (type->size > 0) + unmarshal_atom (cb, FFI_TYPE_POINTER, realign); + if (type->size > __SIZEOF_POINTER__) + unmarshal_atom (cb, FFI_TYPE_POINTER, realign + 1); + memcpy (data, realign, type->size); + return data; + } +} + +static int +passed_by_ref (call_builder *cb, ffi_type *type, int var) +{ +#if ABI_FRLEN + if (!var && type->type == FFI_TYPE_STRUCT) + { + float_struct_info fsi = struct_passed_as_elements (cb, type); + if (fsi.as_elements) + return 0; + } +#endif + + return type->size > 2 * __SIZEOF_POINTER__; +} + +/* Perform machine dependent cif processing. */ +ffi_status +ffi_prep_cif_machdep (ffi_cif *cif) +{ + cif->loongarch_nfixedargs = cif->nargs; + return FFI_OK; +} + +/* Perform machine dependent cif processing when we have a variadic + function. */ +ffi_status +ffi_prep_cif_machdep_var (ffi_cif *cif, unsigned int nfixedargs, + unsigned int ntotalargs) +{ + cif->loongarch_nfixedargs = nfixedargs; + return FFI_OK; +} + +/* Low level routine for calling functions. */ +extern void ffi_call_asm (void *stack, struct call_context *regs, + void (*fn) (void), void *closure) FFI_HIDDEN; + +static void +ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, + void *closure) +{ + /* This is a conservative estimate, assuming a complex return value and + that all remaining arguments are long long / __int128 */ + size_t arg_bytes = cif->bytes; + size_t rval_bytes = 0; + if (rvalue == NULL && cif->rtype->size > 2 * __SIZEOF_POINTER__) + rval_bytes = FFI_ALIGN (cif->rtype->size, STKALIGN); + size_t alloc_size = arg_bytes + rval_bytes + sizeof (call_context); + + /* The assembly code will deallocate all stack data at lower addresses + than the argument region, so we need to allocate the frame and the + return value after the arguments in a single allocation. */ + size_t alloc_base; + /* Argument region must be 16-byte aligned in LP64 ABIs. */ + if (_Alignof(max_align_t) >= STKALIGN) + /* Since sizeof long double is normally 16, the compiler will + guarantee alloca alignment to at least that much. */ + alloc_base = (size_t) alloca (alloc_size); + else + alloc_base = FFI_ALIGN (alloca (alloc_size + STKALIGN - 1), STKALIGN); + + if (rval_bytes) + rvalue = (void *) (alloc_base + arg_bytes); + + call_builder cb; + cb.used_float = cb.used_integer = 0; + cb.aregs = (call_context *) (alloc_base + arg_bytes + rval_bytes); + cb.used_stack = (void *) alloc_base; + cb.stack = (void *) alloc_base; + cb.next_struct_area = arg_bytes; + + int return_by_ref = passed_by_ref (&cb, cif->rtype, 0); + if (return_by_ref) + cb.aregs->a[cb.used_integer++] = (size_t)rvalue; + + int i; + for (i = 0; i < cif->nargs; i++) + marshal (&cb, cif->arg_types[i], i >= cif->loongarch_nfixedargs, + avalue[i]); + + ffi_call_asm ((void *) alloc_base, cb.aregs, fn, closure); + + cb.used_float = cb.used_integer = 0; + if (!return_by_ref && rvalue) + unmarshal (&cb, cif->rtype, 0, rvalue); +} + +void +ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) +{ + ffi_call_int (cif, fn, rvalue, avalue, NULL); +} + +void +ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, + void *closure) +{ + ffi_call_int (cif, fn, rvalue, avalue, closure); +} + +extern void ffi_closure_asm (void) FFI_HIDDEN; + +ffi_status +ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, void *codeloc) +{ + uint32_t *tramp = (uint32_t *) &closure->tramp[0]; + uint64_t fn = (uint64_t) (uintptr_t) ffi_closure_asm; + + if (cif->abi <= FFI_FIRST_ABI || cif->abi >= FFI_LAST_ABI) + return FFI_BAD_ABI; + +#if defined(FFI_EXEC_STATIC_TRAMP) + if (ffi_tramp_is_present(closure)) + { + ffi_tramp_set_parms (closure->ftramp, ffi_closure_asm, closure); + goto out; + } +#endif + + /* Fill the dynamic trampoline. We will call ffi_closure_inner with codeloc, + not closure, but as long as the memory is readable it should work. */ + tramp[0] = 0x1800000c; /* pcaddi $t0, 0 (i.e. $t0 <- tramp) */ + tramp[1] = 0x28c0418d; /* ld.d $t1, $t0, 16 */ + tramp[2] = 0x4c0001a0; /* jirl $zero, $t1, 0 */ + tramp[3] = 0x03400000; /* nop */ + tramp[4] = fn; + tramp[5] = fn >> 32; + + __builtin___clear_cache (codeloc, codeloc + FFI_TRAMPOLINE_SIZE); + +#if defined(FFI_EXEC_STATIC_TRAMP) +out: +#endif + closure->cif = cif; + closure->fun = fun; + closure->user_data = user_data; + + return FFI_OK; +} + +extern void ffi_go_closure_asm (void) FFI_HIDDEN; + +ffi_status +ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *)) +{ + if (cif->abi <= FFI_FIRST_ABI || cif->abi >= FFI_LAST_ABI) + return FFI_BAD_ABI; + + closure->tramp = (void *) ffi_go_closure_asm; + closure->cif = cif; + closure->fun = fun; + return FFI_OK; +} + +/* Called by the assembly code with aregs pointing to saved argument registers + and stack pointing to the stacked arguments. Return values passed in + registers will be reloaded from aregs. */ +void FFI_HIDDEN +ffi_closure_inner (ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *), + void *user_data, size_t *stack, call_context *aregs) +{ + void **avalue = alloca (cif->nargs * sizeof (void *)); + /* Storage for arguments which will be copied by unmarshal(). We could + theoretically avoid the copies in many cases and use at most 128 bytes + of memory, but allocating disjoint storage for each argument is + simpler. */ + char *astorage = alloca (cif->nargs * MAXCOPYARG); + void *rvalue; + call_builder cb; + int return_by_ref; + int i; + + cb.aregs = aregs; + cb.used_integer = cb.used_float = 0; + cb.used_stack = stack; + + return_by_ref = passed_by_ref (&cb, cif->rtype, 0); + if (return_by_ref) + unmarshal (&cb, &ffi_type_pointer, 0, &rvalue); + else + rvalue = alloca (cif->rtype->size); + + for (i = 0; i < cif->nargs; i++) + avalue[i] + = unmarshal (&cb, cif->arg_types[i], i >= cif->loongarch_nfixedargs, + astorage + i * MAXCOPYARG); + + fun (cif, rvalue, avalue, user_data); + + if (!return_by_ref && cif->rtype->type != FFI_TYPE_VOID) + { + cb.used_integer = cb.used_float = 0; + marshal (&cb, cif->rtype, 0, rvalue); + } +} + +#if defined(FFI_EXEC_STATIC_TRAMP) +void * +ffi_tramp_arch (size_t *tramp_size, size_t *map_size) +{ + extern void *trampoline_code_table; + + *tramp_size = 16; + /* A mapping size of 64K is chosen to cover the page sizes of 4K, 16K, and + 64K. */ + *map_size = 1 << 16; + return &trampoline_code_table; +} +#endif diff --git a/src/loongarch64/ffitarget.h b/src/loongarch64/ffitarget.h new file mode 100644 index 0000000..5a4698a --- /dev/null +++ b/src/loongarch64/ffitarget.h @@ -0,0 +1,82 @@ +/* -----------------------------------------------------------------*-C-*- + ffitarget.h - Copyright (c) 2022 Xu Chenghua + 2022 Cheng Lulu + + Target configuration macros for LoongArch. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + ----------------------------------------------------------------------- */ + +#ifndef LIBFFI_TARGET_H +#define LIBFFI_TARGET_H + +#ifndef LIBFFI_H +#error \ + "Please do not include ffitarget.h directly into your source. Use ffi.h instead." +#endif + +#ifndef __loongarch__ +#error \ + "libffi was configured for a LoongArch target but this does not appear to be a LoongArch compiler." +#endif + +#ifndef LIBFFI_ASM + +typedef unsigned long ffi_arg; +typedef signed long ffi_sarg; + +typedef enum ffi_abi +{ + FFI_FIRST_ABI = 0, + FFI_LP64S, + FFI_LP64F, + FFI_LP64D, + FFI_LAST_ABI, + +#if defined(__loongarch64) +#if defined(__loongarch_soft_float) + FFI_DEFAULT_ABI = FFI_LP64S +#elif defined(__loongarch_single_float) + FFI_DEFAULT_ABI = FFI_LP64F +#elif defined(__loongarch_double_float) + FFI_DEFAULT_ABI = FFI_LP64D +#else +#error unsupported LoongArch floating-point ABI +#endif +#else +#error unsupported LoongArch base architecture +#endif +} ffi_abi; + +#endif /* LIBFFI_ASM */ + +/* ---- Definitions for closures ----------------------------------------- */ + +#define FFI_CLOSURES 1 +#define FFI_GO_CLOSURES 1 +#define FFI_TRAMPOLINE_SIZE 24 +#define FFI_NATIVE_RAW_API 0 +#define FFI_EXTRA_CIF_FIELDS \ + unsigned loongarch_nfixedargs; \ + unsigned loongarch_unused; +#define FFI_TARGET_SPECIFIC_VARIADIC +#endif diff --git a/src/loongarch64/sysv.S b/src/loongarch64/sysv.S new file mode 100644 index 0000000..aa7bde2 --- /dev/null +++ b/src/loongarch64/sysv.S @@ -0,0 +1,327 @@ +/* ----------------------------------------------------------------------- + sysv.S - Copyright (c) 2022 Xu Chenghua + 2022 Cheng Lulu + + LoongArch Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#define LIBFFI_ASM +#include +#include + +/* Define aliases so that we can handle all ABIs uniformly. */ + +#if __SIZEOF_POINTER__ == 8 +# define PTRS 8 +# define LARG ld.d +# define SARG st.d +#else +# define PTRS 4 +# define LARG ld.w +# define SARG st.w +#endif + +#if defined(__loongarch_single_float) +# define FLTS 4 +# define FLD fld.w +# define FST fst.w +#elif defined(__loongarch_double_float) +# define FLTS 8 +# define FLARG fld.d +# define FSARG fst.d +#elif defined(__loongarch_soft_float) +# define FLTS 0 +#else +#error unsupported LoongArch floating-point ABI +#endif + + .text + .globl ffi_call_asm + .type ffi_call_asm, @function + .hidden ffi_call_asm +/* struct call_context + { + ABI_FLOAT fa[8]; + size_t a[10]; + } + + - 8 floating point parameter/result registers (fa[0] - fa[7]) + - 8 integer parameter/result registers (a[0] - a[7]) + - 2 registers used by the assembly code to in-place construct its own stack + frame. + - frame pointer (a[8]) + - return address (a[9]) + + void ffi_call_asm (size_t *stackargs, struct call_context *regargs, + void (*fn)(void), void *closure); */ + +#define FRAME_LEN (8 * FLTS + 10 * PTRS) + +ffi_call_asm: + .cfi_startproc + + /* We are NOT going to set up an ordinary stack frame. In order to pass + the stacked args to the called function, we adjust our stack pointer + to a0, which is in the _caller's_ alloca area. We establish our own + stack frame at the end of the call_context. + + Anything below the arguments will be freed at this point, although + we preserve the call_context so that it can be read back in the + caller. */ + + .cfi_def_cfa 5, FRAME_LEN # Interim CFA based on a1. + SARG $fp, $a1, FRAME_LEN - 2*PTRS + .cfi_offset 22, -2*PTRS + SARG $ra, $a1, FRAME_LEN - 1*PTRS + .cfi_offset 1, -1*PTRS + + addi.d $fp, $a1, FRAME_LEN + move $sp, $a0 + .cfi_def_cfa 22, 0 # Our frame is fully set up. + + # Load arguments. + move $t1, $a2 + move $t2, $a3 + +#if FLTS + FLARG $fa0, $fp, -FRAME_LEN+0*FLTS + FLARG $fa1, $fp, -FRAME_LEN+1*FLTS + FLARG $fa2, $fp, -FRAME_LEN+2*FLTS + FLARG $fa3, $fp, -FRAME_LEN+3*FLTS + FLARG $fa4, $fp, -FRAME_LEN+4*FLTS + FLARG $fa5, $fp, -FRAME_LEN+5*FLTS + FLARG $fa6, $fp, -FRAME_LEN+6*FLTS + FLARG $fa7, $fp, -FRAME_LEN+7*FLTS +#endif + + LARG $a0, $fp, -FRAME_LEN+8*FLTS+0*PTRS + LARG $a1, $fp, -FRAME_LEN+8*FLTS+1*PTRS + LARG $a2, $fp, -FRAME_LEN+8*FLTS+2*PTRS + LARG $a3, $fp, -FRAME_LEN+8*FLTS+3*PTRS + LARG $a4, $fp, -FRAME_LEN+8*FLTS+4*PTRS + LARG $a5, $fp, -FRAME_LEN+8*FLTS+5*PTRS + LARG $a6, $fp, -FRAME_LEN+8*FLTS+6*PTRS + LARG $a7, $fp, -FRAME_LEN+8*FLTS+7*PTRS + + /* Call */ + jirl $ra, $t1, 0 + +#if FLTS + /* Save return values - only a0/a1 (fa0/fa1) are used. */ + FSARG $fa0, $fp, -FRAME_LEN+0*FLTS + FSARG $fa1, $fp, -FRAME_LEN+1*FLTS +#endif + + SARG $a0, $fp, -FRAME_LEN+8*FLTS+0*PTRS + SARG $a1, $fp, -FRAME_LEN+8*FLTS+1*PTRS + + /* Restore and return. */ + addi.d $sp, $fp, -FRAME_LEN + .cfi_def_cfa 3, FRAME_LEN + LARG $ra, $fp, -1*PTRS + .cfi_restore 1 + LARG $fp, $fp, -2*PTRS + .cfi_restore 22 + jr $ra + .cfi_endproc + .size ffi_call_asm, .-ffi_call_asm + + +/* ffi_closure_asm. Expects address of the passed-in ffi_closure in t0. + void ffi_closure_inner (ffi_cif *cif, + void (*fun)(ffi_cif *, void *, void **, void *), + void *user_data, + size_t *stackargs, struct call_context *regargs) */ + + .globl ffi_closure_asm + .hidden ffi_closure_asm + .type ffi_closure_asm, @function + +ffi_closure_asm: + .cfi_startproc + addi.d $sp, $sp, -FRAME_LEN + .cfi_def_cfa_offset FRAME_LEN + + /* Make a frame. */ + SARG $fp, $sp, FRAME_LEN - 2*PTRS + .cfi_offset 22, -2*PTRS + SARG $ra, $sp, FRAME_LEN - 1*PTRS + .cfi_offset 1, -1*PTRS + addi.d $fp, $sp, FRAME_LEN + + /* Save arguments. */ +#if FLTS + FSARG $fa0, $sp, 0*FLTS + FSARG $fa1, $sp, 1*FLTS + FSARG $fa2, $sp, 2*FLTS + FSARG $fa3, $sp, 3*FLTS + FSARG $fa4, $sp, 4*FLTS + FSARG $fa5, $sp, 5*FLTS + FSARG $fa6, $sp, 6*FLTS + FSARG $fa7, $sp, 7*FLTS +#endif + + SARG $a0, $sp, 8*FLTS+0*PTRS + SARG $a1, $sp, 8*FLTS+1*PTRS + SARG $a2, $sp, 8*FLTS+2*PTRS + SARG $a3, $sp, 8*FLTS+3*PTRS + SARG $a4, $sp, 8*FLTS+4*PTRS + SARG $a5, $sp, 8*FLTS+5*PTRS + SARG $a6, $sp, 8*FLTS+6*PTRS + SARG $a7, $sp, 8*FLTS+7*PTRS + + /* Enter C */ + LARG $a0, $t0, FFI_TRAMPOLINE_SIZE+0*PTRS + LARG $a1, $t0, FFI_TRAMPOLINE_SIZE+1*PTRS + LARG $a2, $t0, FFI_TRAMPOLINE_SIZE+2*PTRS + addi.d $a3, $sp, FRAME_LEN + move $a4, $sp + + bl ffi_closure_inner + + /* Return values. */ +#if FLTS + FLARG $fa0, $sp, 0*FLTS + FLARG $fa1, $sp, 1*FLTS +#endif + + LARG $a0, $sp, 8*FLTS+0*PTRS + LARG $a1, $sp, 8*FLTS+1*PTRS + + /* Restore and return. */ + LARG $ra, $sp, FRAME_LEN-1*PTRS + .cfi_restore 1 + LARG $fp, $sp, FRAME_LEN-2*PTRS + .cfi_restore 22 + addi.d $sp, $sp, FRAME_LEN + .cfi_def_cfa_offset 0 + jr $ra + .cfi_endproc + .size ffi_closure_asm, .-ffi_closure_asm + +/* Static trampoline code table, in which each element is a trampoline. + + The trampoline clobbers t0 and t1, but we don't save them on the stack + because our psABI explicitly says they are scratch registers, at least for + ELF. Our dynamic trampoline is already clobbering them anyway. + + The trampoline has two parameters - target code to jump to and data for + the target code. The trampoline extracts the parameters from its parameter + block (see tramp_table_map()). The trampoline saves the data address in + t0 and jumps to the target code. As ffi_closure_asm() already expects the + data address to be in t0, we don't need a "ffi_closure_asm_alt". */ + +#if defined(FFI_EXEC_STATIC_TRAMP) + .align 16 + .globl trampoline_code_table + .hidden trampoline_code_table + .type trampoline_code_table, @function + +trampoline_code_table: + + .rept 65536 / 16 + pcaddu12i $t1, 16 # 65536 >> 12 + ld.d $t0, $t1, 0 + ld.d $t1, $t1, 8 + jirl $zero, $t1, 0 + .endr + .size trampoline_code_table, .-trampoline_code_table + + .align 2 +#endif + +/* ffi_go_closure_asm. Expects address of the passed-in ffi_go_closure in t2. + void ffi_closure_inner (ffi_cif *cif, + void (*fun)(ffi_cif *, void *, void **, void *), + void *user_data, + size_t *stackargs, struct call_context *regargs) */ + + .globl ffi_go_closure_asm + .hidden ffi_go_closure_asm + .type ffi_go_closure_asm, @function + +ffi_go_closure_asm: + .cfi_startproc + addi.d $sp, $sp, -FRAME_LEN + .cfi_def_cfa_offset FRAME_LEN + + /* Make a frame. */ + SARG $fp, $sp, FRAME_LEN - 2*PTRS + .cfi_offset 22, -2*PTRS + SARG $ra, $sp, FRAME_LEN - 1*PTRS + .cfi_offset 1, -1*PTRS + addi.d $fp, $sp, FRAME_LEN + + /* Save arguments. */ +#if FLTS + FSARG $fa0, $sp, 0*FLTS + FSARG $fa1, $sp, 1*FLTS + FSARG $fa2, $sp, 2*FLTS + FSARG $fa3, $sp, 3*FLTS + FSARG $fa4, $sp, 4*FLTS + FSARG $fa5, $sp, 5*FLTS + FSARG $fa6, $sp, 6*FLTS + FSARG $fa7, $sp, 7*FLTS +#endif + + SARG $a0, $sp, 8*FLTS+0*PTRS + SARG $a1, $sp, 8*FLTS+1*PTRS + SARG $a2, $sp, 8*FLTS+2*PTRS + SARG $a3, $sp, 8*FLTS+3*PTRS + SARG $a4, $sp, 8*FLTS+4*PTRS + SARG $a5, $sp, 8*FLTS+5*PTRS + SARG $a6, $sp, 8*FLTS+6*PTRS + SARG $a7, $sp, 8*FLTS+7*PTRS + + /* Enter C */ + LARG $a0, $t2, 1*PTRS + LARG $a1, $t2, 2*PTRS + move $a2, $t2 + addi.d $a3, $sp, FRAME_LEN + move $a4, $sp + + bl ffi_closure_inner + + /* Return values. */ +#if FLTS + FLARG $fa0, $sp, 0*FLTS + FLARG $fa1, $sp, 1*FLTS +#endif + + LARG $a0, $sp, 8*FLTS+0*PTRS + LARG $a1, $sp, 8*FLTS+1*PTRS + + /* Restore and return. */ + LARG $ra, $sp, FRAME_LEN-1*PTRS + .cfi_restore 1 + LARG $fp, $sp, FRAME_LEN-2*PTRS + .cfi_restore 22 + addi.d $sp, $sp, FRAME_LEN + .cfi_def_cfa_offset 0 + jr $ra + .cfi_endproc + .size ffi_go_closure_asm, .-ffi_go_closure_asm + +#if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/m32r/ffi.c b/src/m32r/ffi.c index ab8fc4e..6fab50b 100644 --- a/src/m32r/ffi.c +++ b/src/m32r/ffi.c @@ -1,8 +1,9 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2004 Renesas Technology Copyright (c) 2008 Red Hat, Inc. - - M32R Foreign Function Interface + Copyright (c) 2022 Anthony Green + + M32R Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -63,7 +64,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif) if (((*p_arg)->alignment - 1) & (unsigned) argp) argp = (char *) FFI_ALIGN (argp, (*p_arg)->alignment); - if (avn != 0) + if (avn != 0) { avn--; z = (*p_arg)->size; @@ -76,19 +77,19 @@ void ffi_prep_args(char *stack, extended_cif *ecif) case FFI_TYPE_SINT8: *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); break; - + case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); break; - + case FFI_TYPE_SINT16: *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); break; - + case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); break; - + case FFI_TYPE_STRUCT: z = (*p_arg)->size; if ((*p_arg)->alignment != 1) @@ -131,7 +132,7 @@ void ffi_prep_args(char *stack, extended_cif *ecif) argp += z; } } - + return; } @@ -178,24 +179,40 @@ extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { extended_cif ecif; + ffi_type **arg_types = cif->arg_types; + int i, nargs = cif->nargs; ecif.cif = cif; ecif.avalue = avalue; - + /* If the return value is a struct and we don't have a return value address then we need to make one. */ - if ((rvalue == NULL) && + if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { ecif.rvalue = alloca (cif->rtype->size); } else - ecif.rvalue = rvalue; - - switch (cif->abi) + ecif.rvalue = rvalue; + + /* If we have any large structure arguments, make a copy so we are passing + by value. */ + for (i = 0; i < nargs; i++) + { + ffi_type *at = arg_types[i]; + int size = at->size; + if (at->type == FFI_TYPE_STRUCT && size > 4) + { + char *argcopy = alloca (size); + memcpy (argcopy, avalue[i], size); + avalue[i] = argcopy; + } + } + + switch (cif->abi) { case FFI_SYSV: - ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, + ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); if (cif->rtype->type == FFI_TYPE_STRUCT) { diff --git a/src/mips/ffi.c b/src/mips/ffi.c index 057b046..e704325 100644 --- a/src/mips/ffi.c +++ b/src/mips/ffi.c @@ -31,6 +31,7 @@ #include #include +#include #ifdef __GNUC__ # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) @@ -39,7 +40,9 @@ #endif #ifndef USE__BUILTIN___CLEAR_CACHE -# if defined(__OpenBSD__) +# if defined(__FreeBSD__) +# include +# elif defined(__OpenBSD__) # include # else # include @@ -75,22 +78,39 @@ static void ffi_prep_args(char *stack, { int i; void **p_argv; - char *argp; + char *argp, *argp_f; ffi_type **p_arg; + memset(stack, 0, bytes); + #ifdef FFI_MIPS_N32 + int soft_float = (ecif->cif->abi == FFI_N32_SOFT_FLOAT + || ecif->cif->abi == FFI_N64_SOFT_FLOAT); /* If more than 8 double words are used, the remainder go on the stack. We reorder stuff on the stack here to support this easily. */ - if (bytes > 8 * sizeof(ffi_arg)) - argp = &stack[bytes - (8 * sizeof(ffi_arg))]; + /* if ret is _Complex long double, args reg shift2, and a0 should holds pointer to rvalue */ + if (ecif->cif->rtype->type == FFI_TYPE_COMPLEX && ecif->cif->rtype->elements[0]->type == FFI_TYPE_LONGDOUBLE) + { + if (bytes + 16 > 8 * sizeof(ffi_arg)) + argp = &stack[bytes - (8 * sizeof(ffi_arg))]; + else + argp = stack; + * (unsigned long *) argp = (unsigned long) ecif->rvalue; + argp += 16; + } else - argp = stack; + { + if (bytes > 8 * sizeof(ffi_arg)) + argp = &stack[bytes - (8 * sizeof(ffi_arg))]; + else + argp = stack; + } #else argp = stack; #endif - memset(stack, 0, bytes); + argp_f = argp; #ifdef FFI_MIPS_N32 if ( ecif->cif->rstruct_flag != 0 ) @@ -131,7 +151,7 @@ static void ffi_prep_args(char *stack, if (type == FFI_TYPE_POINTER) type = (ecif->cif->abi == FFI_N64 || ecif->cif->abi == FFI_N64_SOFT_FLOAT) - ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32; + ? FFI_TYPE_SINT64 : FFI_TYPE_UINT32; if (i < 8 && (ecif->cif->abi == FFI_N32_SOFT_FLOAT || ecif->cif->abi == FFI_N64_SOFT_FLOAT)) @@ -181,6 +201,25 @@ static void ffi_prep_args(char *stack, #endif break; +#ifdef FFI_MIPS_N32 + case FFI_TYPE_COMPLEX: + /* expand from 4+4 to 8+8 if pass with fpr reg */ + /* argp will wind back to stack when we process all of reg args */ + /* all var_args passed with gpr, should be expand */ + if(!soft_float + && (*p_arg)->elements[0]->type == FFI_TYPE_FLOAT + && argp>=argp_f + && i < ecif->cif->mips_nfixedargs) + { + *(float *) argp = *(float *)(* p_argv); + argp += z; + char *tmp = (void *) (*p_argv); + *(float *) argp = *(float *)(tmp+4); + } + else + memcpy(argp, *p_argv, (*p_arg)->size); + break; +#endif /* This can only happen with 64bit slots. */ case FFI_TYPE_FLOAT: *(float *) argp = *(float *)(* p_argv); @@ -233,6 +272,24 @@ static void ffi_prep_args(char *stack, passed in an integer register". This code traverses structure definitions and generates the appropriate flags. */ +static int +calc_n32_struct_flags_element(unsigned *flags, ffi_type *e, + unsigned *loc, unsigned *arg_reg) +{ + /* Align this object. */ + *loc = FFI_ALIGN(*loc, e->alignment); + if (e->type == FFI_TYPE_DOUBLE) + { + /* Already aligned to FFI_SIZEOF_ARG. */ + *arg_reg = *loc / FFI_SIZEOF_ARG; + if (*arg_reg > 7) + return 1; + *flags += (FFI_TYPE_DOUBLE << (*arg_reg * FFI_FLAG_BITS)); + } + *loc += e->size; + return 0; +} + static unsigned calc_n32_struct_flags(int soft_float, ffi_type *arg, unsigned *loc, unsigned *arg_reg) @@ -247,19 +304,16 @@ calc_n32_struct_flags(int soft_float, ffi_type *arg, while ((e = arg->elements[index])) { - /* Align this object. */ - *loc = FFI_ALIGN(*loc, e->alignment); - if (e->type == FFI_TYPE_DOUBLE) + if (e->type == FFI_TYPE_COMPLEX) { - /* Already aligned to FFI_SIZEOF_ARG. */ - *arg_reg = *loc / FFI_SIZEOF_ARG; - if (*arg_reg > 7) - break; - flags += (FFI_TYPE_DOUBLE << (*arg_reg * FFI_FLAG_BITS)); - *loc += e->size; + if (calc_n32_struct_flags_element(&flags, e->elements[0], loc, arg_reg)) + break; + if (calc_n32_struct_flags_element(&flags, e->elements[0], loc, arg_reg)) + break; } else - *loc += e->size; + if (calc_n32_struct_flags_element(&flags, e, loc, arg_reg)) + break; index++; } /* Next Argument register at alignment of FFI_SIZEOF_ARG. */ @@ -271,7 +325,7 @@ calc_n32_struct_flags(int soft_float, ffi_type *arg, static unsigned calc_n32_return_struct_flags(int soft_float, ffi_type *arg) { - unsigned flags = 0; + unsigned flags; unsigned small = FFI_TYPE_SMALLSTRUCT; ffi_type *e; @@ -290,33 +344,48 @@ calc_n32_return_struct_flags(int soft_float, ffi_type *arg) e = arg->elements[0]; - if (e->type == FFI_TYPE_DOUBLE) - flags = FFI_TYPE_DOUBLE; - else if (e->type == FFI_TYPE_FLOAT) - flags = FFI_TYPE_FLOAT; - - if (flags && (e = arg->elements[1])) + if (e->type == FFI_TYPE_COMPLEX) { - if (e->type == FFI_TYPE_DOUBLE) - flags += FFI_TYPE_DOUBLE << FFI_FLAG_BITS; - else if (e->type == FFI_TYPE_FLOAT) - flags += FFI_TYPE_FLOAT << FFI_FLAG_BITS; - else + int type = e->elements[0]->type; + + if (type != FFI_TYPE_DOUBLE && type != FFI_TYPE_FLOAT) return small; - if (flags && (arg->elements[2])) + if (arg->elements[1]) { - /* There are three arguments and the first two are - floats! This must be passed the old way. */ + /* Two floating point fields with more fields! + This must be passed the old way. */ return small; } - if (soft_float) - flags += FFI_TYPE_STRUCT_SOFT; + + flags = (type << FFI_FLAG_BITS) + type; } else - if (!flags) - return small; + { + if (e->type != FFI_TYPE_DOUBLE && e->type != FFI_TYPE_FLOAT) + return small; + flags = e->type; + + if (arg->elements[1]) + { + e = arg->elements[1]; + if (e->type != FFI_TYPE_DOUBLE && e->type != FFI_TYPE_FLOAT) + return small; + + if (arg->elements[2]) + { + /* There are three arguments and the first two are + floats! This must be passed the old way. */ + return small; + } + + flags += e->type << FFI_FLAG_BITS; + } + } + + if (soft_float) + flags += FFI_TYPE_STRUCT_SOFT; return flags; } @@ -333,7 +402,7 @@ static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) * does not have special handling for floating point args. */ - if (cif->rtype->type != FFI_TYPE_STRUCT && cif->abi == FFI_O32) + if (cif->rtype->type != FFI_TYPE_STRUCT && cif->rtype->type != FFI_TYPE_COMPLEX && cif->abi == FFI_O32) { if (cif->nargs > 0 && cif->nargs == nfixedargs) { @@ -401,7 +470,10 @@ static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) case FFI_TYPE_STRUCT: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: + case FFI_TYPE_COMPLEX: cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2); + if (cif->rtype->type == FFI_TYPE_COMPLEX) + cif->flags += ((*cif->rtype->elements[0]).type) << (FFI_FLAG_BITS * 4); break; case FFI_TYPE_SINT64: @@ -419,7 +491,6 @@ static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) #ifdef FFI_MIPS_N32 /* Set the flags necessary for N32 processing */ { - int type; unsigned arg_reg = 0; unsigned loc = 0; unsigned count = (cif->nargs < 8) ? cif->nargs : 8; @@ -451,29 +522,14 @@ static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) while (count-- > 0 && arg_reg < 8) { - type = (cif->arg_types)[index]->type; + ffi_type *t = cif->arg_types[index]; - // Pass variadic arguments in integer registers even if they're floats - if (soft_float || index >= nfixedargs) - { - switch (type) - { - case FFI_TYPE_FLOAT: - type = FFI_TYPE_UINT32; - break; - case FFI_TYPE_DOUBLE: - type = FFI_TYPE_UINT64; - break; - default: - break; - } - } - switch (type) + switch (t->type) { case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: - cif->flags += - ((cif->arg_types)[index]->type << (arg_reg * FFI_FLAG_BITS)); + if (!soft_float && index < nfixedargs) + cif->flags += t->type << (arg_reg * FFI_FLAG_BITS); arg_reg++; break; case FFI_TYPE_LONGDOUBLE: @@ -489,17 +545,71 @@ static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) cif->flags += (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); arg_reg++; + if (arg_reg >= 8) + continue; cif->flags += (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); arg_reg++; } break; + case FFI_TYPE_COMPLEX: + switch (t->elements[0]->type) + { + case FFI_TYPE_LONGDOUBLE: + arg_reg = FFI_ALIGN(arg_reg, 2); + if (soft_float || index >= nfixedargs) + { + arg_reg += 2; + } + else + { + cif->flags += + (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); + arg_reg++; + if (arg_reg >= 8) + continue; + cif->flags += + (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); + arg_reg++; + if (arg_reg >= 8) + continue; + } + /* passthrough */ + case FFI_TYPE_FLOAT: + // one fpr can only holds one arg even it is single + cif->bytes += 16; + /* passthrough */ + case FFI_TYPE_SINT32: + case FFI_TYPE_UINT32: + case FFI_TYPE_DOUBLE: + if (soft_float || index >= nfixedargs) + { + arg_reg += 2; + } + else + { + uint32_t type = t->elements[0]->type != FFI_TYPE_LONGDOUBLE? t->elements[0]->type: FFI_TYPE_DOUBLE; + cif->flags += + (type << (arg_reg * FFI_FLAG_BITS)); + arg_reg++; + if (arg_reg >= 8) + continue; + cif->flags += + (type << (arg_reg * FFI_FLAG_BITS)); + arg_reg++; + } + break; + default: + arg_reg += 2; + break; + } + break; + case FFI_TYPE_STRUCT: loc = arg_reg * FFI_SIZEOF_ARG; cif->flags += calc_n32_struct_flags(soft_float || index >= nfixedargs, - (cif->arg_types)[index], - &loc, &arg_reg); + t, &loc, &arg_reg); break; default: @@ -537,7 +647,7 @@ static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) case FFI_TYPE_POINTER: if (cif->abi == FFI_N32_SOFT_FLOAT || cif->abi == FFI_N32) - cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8); + cif->flags += FFI_TYPE_UINT32 << (FFI_FLAG_BITS * 8); else cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8); break; @@ -561,8 +671,9 @@ static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) two doubles. */ if (soft_float) { - cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8); - cif->flags += FFI_TYPE_SMALLSTRUCT2 << (4 + (FFI_FLAG_BITS * 8)); + /* if ret is long double, the ret is given by v0 and a0, no idea why + * Let's us VOID | VOID | LONGDOUBLE for it*/ + cif->flags += FFI_TYPE_LONGDOUBLE << (FFI_FLAG_BITS * 8); } else { @@ -572,13 +683,44 @@ static ffi_status ffi_prep_cif_machdep_int(ffi_cif *cif, unsigned nfixedargs) << (4 + (FFI_FLAG_BITS * 8)); } break; + case FFI_TYPE_COMPLEX: + { + int type = cif->rtype->elements[0]->type; + + cif->flags += (FFI_TYPE_COMPLEX << (FFI_FLAG_BITS * 8)); + if (soft_float || (type != FFI_TYPE_FLOAT && type != FFI_TYPE_DOUBLE && type != FFI_TYPE_LONGDOUBLE)) + { + switch (type) + { + case FFI_TYPE_DOUBLE: + case FFI_TYPE_SINT64: + case FFI_TYPE_UINT64: + case FFI_TYPE_INT: + type = FFI_TYPE_SMALLSTRUCT2; + break; + case FFI_TYPE_LONGDOUBLE: + type = FFI_TYPE_LONGDOUBLE; + break; + case FFI_TYPE_FLOAT: + default: + type = FFI_TYPE_SMALLSTRUCT; + } + cif->flags += type << (4 + (FFI_FLAG_BITS * 8)); + } + else + { + //cif->flags += (type + (type << FFI_FLAG_BITS)) + // << (4 + (FFI_FLAG_BITS * 8)); + cif->flags += type << (4 + (FFI_FLAG_BITS * 8)); + } + break; + } default: cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8); break; } } #endif - return FFI_OK; } @@ -616,7 +758,7 @@ void ffi_call_int(ffi_cif *cif, void (*fn)(void), void *rvalue, /* value address then we need to make one */ if ((rvalue == NULL) && - (cif->rtype->type == FFI_TYPE_STRUCT)) + (cif->rtype->type == FFI_TYPE_STRUCT || cif->rtype->type == FFI_TYPE_COMPLEX)) ecif.rvalue = alloca(cif->rtype->size); else ecif.rvalue = rvalue; @@ -777,11 +919,13 @@ ffi_prep_closure_loc (ffi_closure *closure, closure->fun = fun; closure->user_data = user_data; +#if !defined(__FreeBSD__) #ifdef USE__BUILTIN___CLEAR_CACHE __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE); #else cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE); #endif +#endif /* ! __FreeBSD__ */ return FFI_OK; } @@ -826,6 +970,11 @@ ffi_closure_mips_inner_O32 (ffi_cif *cif, argn = 1; seen_int = 1; } + if ((cif->flags >> (FFI_FLAG_BITS * 2)) == FFI_TYPE_COMPLEX) + { + rvalue = fpr; + argn = 1; + } i = 0; avn = cif->nargs; @@ -898,6 +1047,9 @@ ffi_closure_mips_inner_O32 (ffi_cif *cif, } else { + if (cif->rtype->type == FFI_TYPE_COMPLEX) { + __asm__ volatile ("move $v1, %0" : : "r"(cif->rtype->size)); + } return cif->rtype->type; } } @@ -987,6 +1139,8 @@ ffi_closure_mips_inner_N32 (ffi_cif *cif, #endif argn = 1; } + if (cif->rtype->type == FFI_TYPE_COMPLEX && cif->rtype->elements[0]->type == FFI_TYPE_LONGDOUBLE) + argn = 2; i = 0; avn = cif->nargs; @@ -1011,6 +1165,31 @@ ffi_closure_mips_inner_N32 (ffi_cif *cif, #endif avaluep[i] = (char *) argp; } + else if (arg_types[i]->type == FFI_TYPE_COMPLEX && arg_types[i]->elements[0]->type == FFI_TYPE_DOUBLE) + { + argp = (argn >= 8 || i >= cif->mips_nfixedargs || soft_float) ? ar + argn : fpr + argn; + avaluep[i] = (char *) argp; + } + else if (arg_types[i]->type == FFI_TYPE_COMPLEX && arg_types[i]->elements[0]->type == FFI_TYPE_LONGDOUBLE) + { + /* align long double */ + argn += ((argn & 0x1)? 1 : 0); + argp = (argn >= 8 || i >= cif->mips_nfixedargs || soft_float) ? ar + argn : fpr + argn; + avaluep[i] = (char *) argp; + } + else if (arg_types[i]->type == FFI_TYPE_COMPLEX && arg_types[i]->elements[0]->type == FFI_TYPE_FLOAT) + { + if (argn >= 8 || i >= cif->mips_nfixedargs || soft_float) + argp = ar + argn; + else + { + argp = fpr + argn; + /* the normal args for function holds 8bytes, while here we convert it to ptr */ + uint32_t *tmp = (uint32_t *)argp; + tmp[1] = tmp[2]; + } + avaluep[i] = (char *) argp; + } else { unsigned type = arg_types[i]->type; @@ -1023,10 +1202,10 @@ ffi_closure_mips_inner_N32 (ffi_cif *cif, /* The size of a pointer depends on the ABI */ if (type == FFI_TYPE_POINTER) type = (cif->abi == FFI_N64 || cif->abi == FFI_N64_SOFT_FLOAT) - ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32; + ? FFI_TYPE_SINT64 : FFI_TYPE_UINT32; if (soft_float && type == FFI_TYPE_FLOAT) - type = FFI_TYPE_UINT32; + type = FFI_TYPE_SINT32; switch (type) { diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h index fffdb97..294c3ba 100644 --- a/src/mips/ffitarget.h +++ b/src/mips/ffitarget.h @@ -41,7 +41,7 @@ #define _MIPS_SIM_ABI32 1 #define _MIPS_SIM_NABI32 2 #define _MIPS_SIM_ABI64 3 -#elif !defined(__OpenBSD__) +#elif !defined(__OpenBSD__) && !defined(__FreeBSD__) # include #endif @@ -80,6 +80,7 @@ # endif #endif +#define FFI_TARGET_HAS_COMPLEX_TYPE 1 #define FFI_FLAG_BITS 2 /* SGI's strange assembler requires that we multiply by 4 rather @@ -111,6 +112,12 @@ #define FFI_TYPE_STRUCT_SMALL 93 #define FFI_TYPE_STRUCT_SMALL2 109 +#define FFI_TYPE_COMPLEX_SMALL 95 +#define FFI_TYPE_COMPLEX_SMALL2 111 +#define FFI_TYPE_COMPLEX_FF 47 +#define FFI_TYPE_COMPLEX_DD 63 +#define FFI_TYPE_COMPLEX_LDLD 79 + /* and for n32 soft float, add 16 * 2^4 */ #define FFI_TYPE_STRUCT_D_SOFT 317 #define FFI_TYPE_STRUCT_F_SOFT 301 diff --git a/src/mips/n32.S b/src/mips/n32.S index 1a940b6..e1938d1 100644 --- a/src/mips/n32.S +++ b/src/mips/n32.S @@ -114,6 +114,16 @@ loadregs: REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. + # when retval is _Complex long double, $f12/$a0, $f13/$a1 will be skipped + # no idea why, but gcc does it. + SRL t4, t6, 8*FFI_FLAG_BITS + move t8, t6 + bne t4, FFI_TYPE_COMPLEX_LDLD, loadregs1 + + SLL t8, t6, 2*FFI_FLAG_BITS + + +loadregs1: #ifdef __mips_soft_float REG_L a0, 0*FFI_SIZEOF_ARG(t9) REG_L a1, 1*FFI_SIZEOF_ARG(t9) @@ -124,7 +134,7 @@ loadregs: REG_L a6, 6*FFI_SIZEOF_ARG(t9) REG_L a7, 7*FFI_SIZEOF_ARG(t9) #else - and t4, t6, ((1<>4 + bne t1, FFI_TYPE_COMPLEX, noretval + jalr t9 + REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp) + REG_L t1, A3_OFF($fp) # load the flags word + SRL t1, t1, 8 + li t3, 3 + beq t1, t3, 3f # double + li t3, 2 + beq t1, t3, 2f # float + # FIXME: long double + slti t3, t1, 5 + beqz t3, 5f # (u)int8/16/32/64 +2: +#ifndef __mips_soft_float + s.s $f0, 0(t0) + s.s $f2, 4(t0) +#else + # FIXME: do nothing can pass all of the testsuite +#endif + b epilogue +3: +#ifndef __mips_soft_float + s.d $f0, 0(t0) + s.d $f2, 8(t0) +#else + # FIXME: do nothing can pass all of the testsuite +#endif + b epilogue + +5: + REG_S v1, 4(t0) + REG_S v0, 0(t0) + b epilogue + noretval: jalr t9 @@ -282,9 +326,11 @@ $LCFI12: li $13, 1 # FFI_O32 bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT +#ifndef __mips_soft_float # Store all possible float/double registers. s.d $f12, FA_0_0_OFF2($fp) s.d $f14, FA_1_0_OFF2($fp) +#endif 1: # prepare arguments for ffi_closure_mips_inner_O32 REG_L a0, 4($15) # cif @@ -376,6 +422,19 @@ $do_closure: li $9, FFI_TYPE_DOUBLE l.d $f0, V0_OFF2($fp) beq $8, $9, closure_done + + li $9, FFI_TYPE_COMPLEX + bne $8, $9, 1f + + li $9, 8 + l.s $f0, V0_OFF2($fp) + l.s $f2, V1_OFF2($fp) + beq $3, $9, closure_done + + li $9, 16 + l.d $f0, V0_OFF2($fp) + l.d $f2, (V0_OFF2+8)($fp) + beq $3, $9, closure_done #endif 1: REG_L $3, V1_OFF2($fp) diff --git a/src/moxie/ffi.c b/src/moxie/ffi.c index 16d2bb3..99bcf40 100644 --- a/src/moxie/ffi.c +++ b/src/moxie/ffi.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (C) 2012, 2013, 2018 Anthony Green - - Moxie Foreign Function Interface + ffi.c - Copyright (C) 2012, 2013, 2018, 2021, 2022 Anthony Green + + Moxie Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -54,14 +54,14 @@ void *ffi_prep_args(char *stack, extended_cif *ecif) i--, p_arg++) { size_t z; - + z = (*p_arg)->size; if ((*p_arg)->type == FFI_TYPE_STRUCT) { z = sizeof(void*); *(void **) argp = *p_argv; - } + } else if (z < sizeof(int)) { z = sizeof(int); @@ -70,19 +70,19 @@ void *ffi_prep_args(char *stack, extended_cif *ecif) case FFI_TYPE_SINT8: *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); break; - + case FFI_TYPE_UINT8: *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); break; - + case FFI_TYPE_SINT16: *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); break; - + case FFI_TYPE_UINT16: *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); break; - + default: FFI_ASSERT(0); } @@ -116,26 +116,28 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) return FFI_OK; } -extern void ffi_call_EABI(void *(*)(char *, extended_cif *), - extended_cif *, - unsigned, unsigned, - unsigned *, +extern void ffi_call_EABI(void *(*)(char *, extended_cif *), + extended_cif *, + unsigned, unsigned, + unsigned *, void (*fn)(void)); -void ffi_call(ffi_cif *cif, - void (*fn)(void), - void *rvalue, +void ffi_call(ffi_cif *cif, + void (*fn)(void), + void *rvalue, void **avalue) { extended_cif ecif; + ffi_type **arg_types = cif->arg_types; + int i, nargs = cif->nargs; ecif.cif = cif; ecif.avalue = avalue; - + /* If the return value is a struct and we don't have a return */ /* value address then we need to make one */ - if ((rvalue == NULL) && + if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { ecif.rvalue = alloca(cif->rtype->size); @@ -143,10 +145,24 @@ void ffi_call(ffi_cif *cif, else ecif.rvalue = rvalue; - switch (cif->abi) + /* If we have any large structure arguments, make a copy so we are passing + by value. */ + for (i = 0; i < nargs; i++) + { + ffi_type *at = arg_types[i]; + int size = at->size; + if (at->type == FFI_TYPE_STRUCT) /* && size > 4) All struct args?? */ + { + char *argcopy = alloca (size); + memcpy (argcopy, avalue[i], size); + avalue[i] = argcopy; + } + } + + switch (cif->abi) { case FFI_EABI: - ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes, + ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, fn); break; default: @@ -172,7 +188,7 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3, void *struct_rvalue = (void *) arg1; /* 6 words reserved for register args + 3 words from jsr */ - char *stack_args = frame_pointer + 9*4; + char *stack_args = frame_pointer + 9*4; /* Lay the register arguments down in a continuous chunk of memory. */ unsigned register_args[6] = @@ -211,7 +227,16 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3, avalue[i] = ptr; break; case FFI_TYPE_STRUCT: - avalue[i] = *(void**)ptr; + { + if (arg_types[i]->size > 4) + { + void *copy = alloca(arg_types[i]->size); + memcpy(copy, *(void**)ptr, arg_types[i]->size); + avalue[i] = copy; + } + else + avalue[i] = *(void**)ptr; + } break; default: /* This is an 8-byte value. */ diff --git a/src/or1k/ffi.c b/src/or1k/ffi.c index 2bad938..9451d4e 100644 --- a/src/or1k/ffi.c +++ b/src/or1k/ffi.c @@ -37,7 +37,7 @@ void* ffi_prep_args(char *stack, extended_cif *ecif) ffi_type **arg; int count = 0; int nfixedargs; - + nfixedargs = ecif->cif->nfixedargs; arg = ecif->cif->arg_types; void **argv = ecif->avalue; @@ -47,7 +47,7 @@ void* ffi_prep_args(char *stack, extended_cif *ecif) *(void **) stack = ecif->rvalue; stack += 4; count = 4; - } + } for(i=0; icif->nargs; i++) { @@ -55,12 +55,12 @@ void* ffi_prep_args(char *stack, extended_cif *ecif) if ((nfixedargs == 0) && (count < 24)) { count = 24; - stack = stacktemp + 24; + stack = stacktemp + 24; } nfixedargs--; s = 4; - switch((*arg)->type) + switch((*arg)->type) { case FFI_TYPE_STRUCT: *(void **)stack = *argv; @@ -94,7 +94,7 @@ void* ffi_prep_args(char *stack, extended_cif *ecif) { stack += 4; count += 4; - } + } s = (*arg)->size; memcpy(stack, *argv, s); break; @@ -133,6 +133,19 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) size += 4; else size += 8; + + /* If we have any large structure arguments, make a copy so we are passing + by value. */ + { + ffi_type *at = cif->arg_types[i]; + int size = at->size; + if (at->type == FFI_TYPE_STRUCT) /* && size > 4) All struct args? */ + { + char *argcopy = alloca (size); + memcpy (argcopy, avalue[i], size); + avalue[i] = argcopy; + } + } } /* for variadic functions more space is needed on the stack */ @@ -148,7 +161,7 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) ecif.avalue = avalue; ecif.rvalue = rvalue; - switch (cif->abi) + switch (cif->abi) { case FFI_SYSV: ffi_call_SYSV(size, &ecif, ffi_prep_args, rvalue, fn, cif->flags); @@ -160,7 +173,7 @@ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) } -void ffi_closure_SYSV(unsigned long r3, unsigned long r4, unsigned long r5, +void ffi_closure_SYSV(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7, unsigned long r8) { register int *sp __asm__ ("r17"); @@ -186,7 +199,7 @@ void ffi_closure_SYSV(unsigned long r3, unsigned long r4, unsigned long r5, /* preserve struct type return pointer passing */ - if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) + if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) { ptr += 4; count = 4; @@ -256,7 +269,7 @@ void ffi_closure_SYSV(unsigned long r3, unsigned long r4, unsigned long r5, long long rvalue; (closure->fun) (cif, &rvalue, avalue, closure->user_data); if (cif->rtype) - asm ("l.ori r12, %0, 0x0\n l.lwz r11, 0(r12)\n l.lwz r12, 4(r12)" : : "r" (&rvalue)); + asm ("l.ori r12, %0, 0x0\n l.lwz r11, 0(r12)\n l.lwz r12, 4(r12)" : : "r" (&rvalue)); } } @@ -303,11 +316,11 @@ ffi_prep_closure_loc (ffi_closure* closure, ffi_status ffi_prep_cif_machdep (ffi_cif *cif) { cif->flags = 0; - + /* structures are returned as pointers */ if (cif->rtype->type == FFI_TYPE_STRUCT) cif->flags = FFI_TYPE_STRUCT; - else + else if (cif->rtype->size > 4) cif->flags = FFI_TYPE_UINT64; @@ -325,4 +338,4 @@ ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, status = ffi_prep_cif_machdep (cif); cif->nfixedargs = nfixedargs; return status; -} +} diff --git a/src/pa/ffi.c b/src/pa/ffi.c index 4ce2bc6..95e6694 100644 --- a/src/pa/ffi.c +++ b/src/pa/ffi.c @@ -421,12 +421,15 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack) ffi_cif *cif; void **avalue; void *rvalue; - UINT32 ret[2]; /* function can return up to 64-bits in registers */ + /* Functions can return up to 64-bits in registers. Return address + must be double word aligned. */ + union { double rd; UINT32 ret[2]; } u; ffi_type **p_arg; char *tmp; int i, avn; unsigned int slot = FIRST_ARG_SLOT; register UINT32 r28 asm("r28"); + ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure); cif = closure->cif; @@ -434,7 +437,7 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack) if (cif->flags == FFI_TYPE_STRUCT) rvalue = (void *)r28; else - rvalue = &ret[0]; + rvalue = &u; avalue = (void **)alloca(cif->nargs * FFI_SIZEOF_ARG); avn = cif->nargs; @@ -529,35 +532,35 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack) } /* Invoke the closure. */ - (closure->fun) (cif, rvalue, avalue, closure->user_data); + (c->fun) (cif, rvalue, avalue, c->user_data); - debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", ret[0], - ret[1]); + debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", u.ret[0], + u.ret[1]); /* Store the result using the lower 2 bytes of the flags. */ switch (cif->flags) { case FFI_TYPE_UINT8: - *(stack - FIRST_ARG_SLOT) = (UINT8)(ret[0] >> 24); + *(stack - FIRST_ARG_SLOT) = (UINT8)(u.ret[0] >> 24); break; case FFI_TYPE_SINT8: - *(stack - FIRST_ARG_SLOT) = (SINT8)(ret[0] >> 24); + *(stack - FIRST_ARG_SLOT) = (SINT8)(u.ret[0] >> 24); break; case FFI_TYPE_UINT16: - *(stack - FIRST_ARG_SLOT) = (UINT16)(ret[0] >> 16); + *(stack - FIRST_ARG_SLOT) = (UINT16)(u.ret[0] >> 16); break; case FFI_TYPE_SINT16: - *(stack - FIRST_ARG_SLOT) = (SINT16)(ret[0] >> 16); + *(stack - FIRST_ARG_SLOT) = (SINT16)(u.ret[0] >> 16); break; case FFI_TYPE_INT: case FFI_TYPE_SINT32: case FFI_TYPE_UINT32: - *(stack - FIRST_ARG_SLOT) = ret[0]; + *(stack - FIRST_ARG_SLOT) = u.ret[0]; break; case FFI_TYPE_SINT64: case FFI_TYPE_UINT64: - *(stack - FIRST_ARG_SLOT) = ret[0]; - *(stack - FIRST_ARG_SLOT - 1) = ret[1]; + *(stack - FIRST_ARG_SLOT) = u.ret[0]; + *(stack - FIRST_ARG_SLOT - 1) = u.ret[1]; break; case FFI_TYPE_DOUBLE: @@ -577,7 +580,7 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack) case FFI_TYPE_SMALL_STRUCT4: tmp = (void*)(stack - FIRST_ARG_SLOT); tmp += 4 - cif->rtype->size; - memcpy((void*)tmp, &ret[0], cif->rtype->size); + memcpy((void*)tmp, &u, cif->rtype->size); break; case FFI_TYPE_SMALL_STRUCT5: @@ -598,7 +601,7 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack) } memset (ret2, 0, sizeof (ret2)); - memcpy ((char *)ret2 + off, ret, 8 - off); + memcpy ((char *)ret2 + off, &u, 8 - off); *(stack - FIRST_ARG_SLOT) = ret2[0]; *(stack - FIRST_ARG_SLOT - 1) = ret2[1]; @@ -630,89 +633,41 @@ ffi_prep_closure_loc (ffi_closure* closure, void *user_data, void *codeloc) { - UINT32 *tramp = (UINT32 *)(closure->tramp); -#ifdef PA_HPUX - UINT32 *tmp; -#endif + ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure); + + /* The layout of a function descriptor. A function pointer with the PLABEL + bit set points to a function descriptor. */ + struct pa32_fd + { + UINT32 code_pointer; + UINT32 gp; + }; + + struct ffi_pa32_trampoline_struct + { + UINT32 code_pointer; /* Pointer to ffi_closure_unix. */ + UINT32 fake_gp; /* Pointer to closure, installed as gp. */ + UINT32 real_gp; /* Real gp value. */ + }; + + struct ffi_pa32_trampoline_struct *tramp; + struct pa32_fd *fd; if (cif->abi != FFI_PA32) return FFI_BAD_ABI; - /* Make a small trampoline that will branch to our - handler function. Use PC-relative addressing. */ + /* Get function descriptor address for ffi_closure_pa32. */ + fd = (struct pa32_fd *)((UINT32)ffi_closure_pa32 & ~3); -#ifdef PA_LINUX - tramp[0] = 0xeaa00000; /* b,l .+8,%r21 ; %r21 <- pc+8 */ - tramp[1] = 0xd6a01c1e; /* depi 0,31,2,%r21 ; mask priv bits */ - tramp[2] = 0x4aa10028; /* ldw 20(%r21),%r1 ; load plabel */ - tramp[3] = 0x36b53ff1; /* ldo -8(%r21),%r21 ; get closure addr */ - tramp[4] = 0x0c201096; /* ldw 0(%r1),%r22 ; address of handler */ - tramp[5] = 0xeac0c000; /* bv%r0(%r22) ; branch to handler */ - tramp[6] = 0x0c281093; /* ldw 4(%r1),%r19 ; GP of handler */ - tramp[7] = ((UINT32)(ffi_closure_pa32) & ~2); + /* Setup trampoline. */ + tramp = (struct ffi_pa32_trampoline_struct *)c->tramp; + tramp->code_pointer = fd->code_pointer; + tramp->fake_gp = (UINT32)codeloc & ~3; + tramp->real_gp = fd->gp; - /* Flush d/icache -- have to flush up 2 two lines because of - alignment. */ - __asm__ volatile( - "fdc 0(%0)\n\t" - "fdc %1(%0)\n\t" - "fic 0(%%sr4, %0)\n\t" - "fic %1(%%sr4, %0)\n\t" - "sync\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n" - : - : "r"((unsigned long)tramp & ~31), - "r"(32 /* stride */) - : "memory"); -#endif - -#ifdef PA_HPUX - tramp[0] = 0xeaa00000; /* b,l .+8,%r21 ; %r21 <- pc+8 */ - tramp[1] = 0xd6a01c1e; /* depi 0,31,2,%r21 ; mask priv bits */ - tramp[2] = 0x4aa10038; /* ldw 28(%r21),%r1 ; load plabel */ - tramp[3] = 0x36b53ff1; /* ldo -8(%r21),%r21 ; get closure addr */ - tramp[4] = 0x0c201096; /* ldw 0(%r1),%r22 ; address of handler */ - tramp[5] = 0x02c010b4; /* ldsid (%r22),%r20 ; load space id */ - tramp[6] = 0x00141820; /* mtsp %r20,%sr0 ; into %sr0 */ - tramp[7] = 0xe2c00000; /* be 0(%sr0,%r22) ; branch to handler */ - tramp[8] = 0x0c281093; /* ldw 4(%r1),%r19 ; GP of handler */ - tramp[9] = ((UINT32)(ffi_closure_pa32) & ~2); - - /* Flush d/icache -- have to flush three lines because of alignment. */ - __asm__ volatile( - "copy %1,%0\n\t" - "fdc,m %2(%0)\n\t" - "fdc,m %2(%0)\n\t" - "fdc,m %2(%0)\n\t" - "ldsid (%1),%0\n\t" - "mtsp %0,%%sr0\n\t" - "copy %1,%0\n\t" - "fic,m %2(%%sr0,%0)\n\t" - "fic,m %2(%%sr0,%0)\n\t" - "fic,m %2(%%sr0,%0)\n\t" - "sync\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n" - : "=&r" ((unsigned long)tmp) - : "r" ((unsigned long)tramp & ~31), - "r" (32/* stride */) - : "memory"); -#endif - - closure->cif = cif; - closure->user_data = user_data; - closure->fun = fun; + c->cif = cif; + c->user_data = user_data; + c->fun = fun; return FFI_OK; } diff --git a/src/pa/ffitarget.h b/src/pa/ffitarget.h index fff4c6b..df1209e 100644 --- a/src/pa/ffitarget.h +++ b/src/pa/ffitarget.h @@ -68,12 +68,7 @@ typedef enum ffi_abi { #define FFI_CLOSURES 1 #define FFI_NATIVE_RAW_API 0 - -#ifdef PA_LINUX -#define FFI_TRAMPOLINE_SIZE 32 -#else -#define FFI_TRAMPOLINE_SIZE 40 -#endif +#define FFI_TRAMPOLINE_SIZE 12 #define FFI_TYPE_SMALL_STRUCT2 -1 #define FFI_TYPE_SMALL_STRUCT3 -2 diff --git a/src/pa/hpux32.S b/src/pa/hpux32.S index 40528ba..d0e5f69 100644 --- a/src/pa/hpux32.S +++ b/src/pa/hpux32.S @@ -259,7 +259,7 @@ L$done L$FE1 /* void ffi_closure_pa32(void); - Called with closure argument in %r21 */ + Called with closure argument in %r19 */ .SPACE $TEXT$ .SUBSPA $CODE$ @@ -285,7 +285,9 @@ L$CFI22 stw %arg2, -44(%r3) stw %arg3, -48(%r3) - copy %r21, %arg0 + /* Retrieve closure pointer and real gp. */ + copy %r19, %arg0 + ldw 8(%r19), %r19 bl ffi_closure_inner_pa32, %r2 copy %r3, %arg1 ldwm -64(%sp), %r3 diff --git a/src/pa/linux.S b/src/pa/linux.S index ab04c75..33ef0b1 100644 --- a/src/pa/linux.S +++ b/src/pa/linux.S @@ -252,7 +252,7 @@ ffi_call_pa32: .LFE1: /* void ffi_closure_pa32(void); - Called with closure argument in %r21 */ + Called with closure argument in %r19 */ .export ffi_closure_pa32,code .import ffi_closure_inner_pa32,code @@ -277,7 +277,9 @@ ffi_closure_pa32: stw %arg2, -44(%r3) stw %arg3, -48(%r3) - copy %r21, %arg0 + /* Retrieve closure pointer and real gp. */ + copy %r19, %arg0 + ldw 8(%r19), %r19 bl ffi_closure_inner_pa32, %r2 copy %r3, %arg1 diff --git a/src/powerpc/ffi_darwin.c b/src/powerpc/ffi_darwin.c index 61a18c4..64bb94d 100644 --- a/src/powerpc/ffi_darwin.c +++ b/src/powerpc/ffi_darwin.c @@ -33,7 +33,10 @@ #include extern void ffi_closure_ASM (void); + +#if defined (FFI_GO_CLOSURES) extern void ffi_go_closure_ASM (void); +#endif enum { /* The assembly depends on these exact flags. @@ -909,8 +912,10 @@ ffi_prep_cif_machdep (ffi_cif *cif) extern void ffi_call_AIX(extended_cif *, long, unsigned, unsigned *, void (*fn)(void), void (*fn2)(void)); +#if defined (FFI_GO_CLOSURES) extern void ffi_call_go_AIX(extended_cif *, long, unsigned, unsigned *, void (*fn)(void), void (*fn2)(void), void *closure); +#endif extern void ffi_call_DARWIN(extended_cif *, long, unsigned, unsigned *, void (*fn)(void), void (*fn2)(void), ffi_type*); @@ -950,6 +955,7 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) } } +#if defined (FFI_GO_CLOSURES) void ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, void *closure) @@ -981,6 +987,7 @@ ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, break; } } +#endif static void flush_icache(char *); static void flush_range(char *, int); @@ -1110,6 +1117,7 @@ ffi_prep_closure_loc (ffi_closure* closure, return FFI_OK; } +#if defined (FFI_GO_CLOSURES) ffi_status ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, @@ -1133,6 +1141,7 @@ ffi_prep_go_closure (ffi_go_closure* closure, } return FFI_OK; } +#endif static void flush_icache(char *addr) @@ -1168,9 +1177,11 @@ ffi_type * ffi_closure_helper_DARWIN (ffi_closure *, void *, unsigned long *, ffi_dblfl *); +#if defined (FFI_GO_CLOSURES) ffi_type * ffi_go_closure_helper_DARWIN (ffi_go_closure*, void *, unsigned long *, ffi_dblfl *); +#endif /* Basically the trampoline invokes ffi_closure_ASM, and on entry, r11 holds the address of the closure. @@ -1430,6 +1441,7 @@ ffi_closure_helper_DARWIN (ffi_closure *closure, void *rvalue, closure->user_data, rvalue, pgr, pfr); } +#if defined (FFI_GO_CLOSURES) ffi_type * ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue, unsigned long *pgr, ffi_dblfl *pfr) @@ -1437,4 +1449,4 @@ ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue, return ffi_closure_helper_common (closure->cif, closure->fun, closure, rvalue, pgr, pfr); } - +#endif diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c index 4d50878..3454dac 100644 --- a/src/powerpc/ffi_linux64.c +++ b/src/powerpc/ffi_linux64.c @@ -680,7 +680,7 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) { if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs) - memcpy (vec_base.f128++, arg.f128, sizeof (float128)); + memcpy (vec_base.f128++, arg.f128++, sizeof (float128)); else memcpy (next_arg.f128, arg.f128++, sizeof (float128)); if (++next_arg.f128 == gpr_end.f128) diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h index 8e2f2f0..960a5c4 100644 --- a/src/powerpc/ffi_powerpc.h +++ b/src/powerpc/ffi_powerpc.h @@ -57,7 +57,7 @@ typedef union double d; } ffi_dblfl; -#if defined(__FLOAT128_TYPE__) +#if defined(__FLOAT128_TYPE__) && defined(__HAVE_FLOAT128) typedef _Float128 float128; #elif defined(__FLOAT128__) typedef __float128 float128; diff --git a/src/powerpc/linux64.S b/src/powerpc/linux64.S index c99889c..1f876ea 100644 --- a/src/powerpc/linux64.S +++ b/src/powerpc/linux64.S @@ -29,6 +29,8 @@ #include #include + .machine altivec + #ifdef POWERPC64 .hidden ffi_call_LINUX64 .globl ffi_call_LINUX64 @@ -36,8 +38,10 @@ .cfi_startproc # if _CALL_ELF == 2 ffi_call_LINUX64: +# ifndef __PCREL__ addis %r2, %r12, .TOC.-ffi_call_LINUX64@ha addi %r2, %r2, .TOC.-ffi_call_LINUX64@l +# endif .localentry ffi_call_LINUX64, . - ffi_call_LINUX64 # else .section ".opd","aw" @@ -89,9 +93,15 @@ ffi_call_LINUX64: /* Call ffi_prep_args64. */ mr %r4, %r1 # if defined _CALL_LINUX || _CALL_ELF == 2 +# ifdef __PCREL__ + bl ffi_prep_args64@notoc +# else bl ffi_prep_args64 + nop +# endif # else bl .ffi_prep_args64 + nop # endif # if _CALL_ELF == 2 diff --git a/src/powerpc/linux64_closure.S b/src/powerpc/linux64_closure.S index d67e4bb..199981d 100644 --- a/src/powerpc/linux64_closure.S +++ b/src/powerpc/linux64_closure.S @@ -30,6 +30,8 @@ .file "linux64_closure.S" + .machine altivec + #ifdef POWERPC64 FFI_HIDDEN (ffi_closure_LINUX64) .globl ffi_closure_LINUX64 @@ -37,8 +39,10 @@ .cfi_startproc # if _CALL_ELF == 2 ffi_closure_LINUX64: +# ifndef __PCREL__ addis %r2, %r12, .TOC.-ffi_closure_LINUX64@ha addi %r2, %r2, .TOC.-ffi_closure_LINUX64@l +# endif .localentry ffi_closure_LINUX64, . - ffi_closure_LINUX64 # else .section ".opd","aw" @@ -190,11 +194,19 @@ ffi_closure_LINUX64: # make the call # if defined _CALL_LINUX || _CALL_ELF == 2 +# ifdef __PCREL__ + bl ffi_closure_helper_LINUX64@notoc +.Lret: +# else bl ffi_closure_helper_LINUX64 +.Lret: + nop +# endif # else bl .ffi_closure_helper_LINUX64 -# endif .Lret: + nop +# endif # now r3 contains the return type # so use it to look up in a table @@ -460,8 +472,10 @@ ffi_closure_LINUX64: .cfi_startproc # if _CALL_ELF == 2 ffi_go_closure_linux64: +# ifndef __PCREL__ addis %r2, %r12, .TOC.-ffi_go_closure_linux64@ha addi %r2, %r2, .TOC.-ffi_go_closure_linux64@l +# endif .localentry ffi_go_closure_linux64, . - ffi_go_closure_linux64 # else .section ".opd","aw" diff --git a/src/powerpc/t-aix b/src/powerpc/t-aix new file mode 100644 index 0000000..e7be1ca --- /dev/null +++ b/src/powerpc/t-aix @@ -0,0 +1,5 @@ +# This file is needed by GCC in order to correctly build AIX FAT +# library for libffi. +# However, it has no sense to include this code here, as it depends +# on GCC multilib architecture. +# Thus, this file is a simple stub replaced in GCC repository. diff --git a/src/prep_cif.c b/src/prep_cif.c index 06c6544..2d0f252 100644 --- a/src/prep_cif.c +++ b/src/prep_cif.c @@ -1,6 +1,7 @@ /* ----------------------------------------------------------------------- - prep_cif.c - Copyright (c) 2011, 2012 Anthony Green + prep_cif.c - Copyright (c) 2011, 2012, 2021 Anthony Green Copyright (c) 1996, 1998, 2007 Red Hat, Inc. + Copyright (c) 2022 Oracle and/or its affiliates. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -129,7 +130,7 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi, cif->rtype = rtype; cif->flags = 0; -#ifdef _M_ARM64 +#if (defined(_M_ARM64) || defined(__aarch64__)) && defined(_WIN32) cif->is_variadic = isvariadic; #endif #if HAVE_LONG_DOUBLE_VARIANT @@ -231,7 +232,26 @@ ffi_status ffi_prep_cif_var(ffi_cif *cif, ffi_type *rtype, ffi_type **atypes) { - return ffi_prep_cif_core(cif, abi, 1, nfixedargs, ntotalargs, rtype, atypes); + ffi_status rc; + size_t int_size = ffi_type_sint.size; + int i; + + rc = ffi_prep_cif_core(cif, abi, 1, nfixedargs, ntotalargs, rtype, atypes); + + if (rc != FFI_OK) + return rc; + + for (i = nfixedargs; i < ntotalargs; i++) + { + ffi_type *arg_type = atypes[i]; + if (arg_type == &ffi_type_float + || ((arg_type->type != FFI_TYPE_STRUCT + && arg_type->type != FFI_TYPE_COMPLEX) + && arg_type->size < int_size)) + return FFI_BAD_ARGTYPE; + } + + return FFI_OK; } #if FFI_CLOSURES diff --git a/src/riscv/ffi.c b/src/riscv/ffi.c index c910858..b455b12 100644 --- a/src/riscv/ffi.c +++ b/src/riscv/ffi.c @@ -61,6 +61,7 @@ typedef struct call_builder int used_integer; int used_float; size_t *used_stack; + void *struct_stack; } call_builder; /* integer (not pointer) less than ABI XLEN */ @@ -227,7 +228,9 @@ static void marshal(call_builder *cb, ffi_type *type, int var, void *data) { #endif if (type->size > 2 * __SIZEOF_POINTER__) { - /* pass by reference */ + /* copy to stack and pass by reference */ + data = memcpy (cb->struct_stack, data, type->size); + cb->struct_stack = (size_t *) FFI_ALIGN ((char *) cb->struct_stack + type->size, __SIZEOF_POINTER__); marshal_atom(cb, FFI_TYPE_POINTER, &data); } else if (IS_INT(type->type) || type->type == FFI_TYPE_POINTER) { marshal_atom(cb, type->type, data); @@ -335,10 +338,12 @@ ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, that all remaining arguments are long long / __int128 */ size_t arg_bytes = cif->nargs <= 3 ? 0 : FFI_ALIGN(2 * sizeof(size_t) * (cif->nargs - 3), STKALIGN); + /* Allocate space for copies of big structures. */ + size_t struct_bytes = FFI_ALIGN (cif->bytes, STKALIGN); size_t rval_bytes = 0; if (rvalue == NULL && cif->rtype->size > 2*__SIZEOF_POINTER__) rval_bytes = FFI_ALIGN(cif->rtype->size, STKALIGN); - size_t alloc_size = arg_bytes + rval_bytes + sizeof(call_context); + size_t alloc_size = arg_bytes + rval_bytes + struct_bytes + sizeof(call_context); /* the assembly code will deallocate all stack data at lower addresses than the argument region, so we need to allocate the frame and the @@ -358,8 +363,9 @@ ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, call_builder cb; cb.used_float = cb.used_integer = 0; - cb.aregs = (call_context*)(alloc_base + arg_bytes + rval_bytes); + cb.aregs = (call_context*)(alloc_base + arg_bytes + rval_bytes + struct_bytes); cb.used_stack = (void*)alloc_base; + cb.struct_stack = (void *) (alloc_base + arg_bytes + rval_bytes); int return_by_ref = passed_by_ref(&cb, cif->rtype, 0); if (return_by_ref) @@ -373,7 +379,32 @@ ffi_call_int (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue, cb.used_float = cb.used_integer = 0; if (!return_by_ref && rvalue) - unmarshal(&cb, cif->rtype, 0, rvalue); + { + if (IS_INT(cif->rtype->type) + && cif->rtype->size < sizeof (ffi_arg)) + { + /* Integer types smaller than ffi_arg need to be extended. */ + switch (cif->rtype->type) + { + case FFI_TYPE_SINT8: + case FFI_TYPE_SINT16: + case FFI_TYPE_SINT32: + unmarshal_atom (&cb, (sizeof (ffi_arg) > 4 + ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32), + rvalue); + break; + case FFI_TYPE_UINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_UINT32: + unmarshal_atom (&cb, (sizeof (ffi_arg) > 4 + ? FFI_TYPE_UINT64 : FFI_TYPE_UINT32), + rvalue); + break; + } + } + else + unmarshal(&cb, cif->rtype, 0, rvalue); + } } void @@ -417,7 +448,9 @@ ffi_status ffi_prep_closure_loc(ffi_closure *closure, ffi_cif *cif, void (*fun)( closure->fun = fun; closure->user_data = user_data; +#if !defined(__FreeBSD__) __builtin___clear_cache(codeloc, codeloc + FFI_TRAMPOLINE_SIZE); +#endif return FFI_OK; } diff --git a/src/sparc/ffi64.c b/src/sparc/ffi64.c index 9e04061..5ae43e8 100644 --- a/src/sparc/ffi64.c +++ b/src/sparc/ffi64.c @@ -421,12 +421,28 @@ ffi_call_int(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue, void *closure) { size_t bytes = cif->bytes; + size_t i, nargs = cif->nargs; + ffi_type **arg_types = cif->arg_types; FFI_ASSERT (cif->abi == FFI_V9); if (rvalue == NULL && (cif->flags & SPARC_FLAG_RET_IN_MEM)) bytes += FFI_ALIGN (cif->rtype->size, 16); + /* If we have any large structure arguments, make a copy so we are passing + by value. */ + for (i = 0; i < nargs; i++) + { + ffi_type *at = arg_types[i]; + int size = at->size; + if (at->type == FFI_TYPE_STRUCT && size > 4) + { + char *argcopy = alloca (size); + memcpy (argcopy, avalue[i], size); + avalue[i] = argcopy; + } + } + ffi_call_v9(cif, fn, rvalue, avalue, -bytes, closure); } diff --git a/src/tramp.c b/src/tramp.c new file mode 100644 index 0000000..b9d273a --- /dev/null +++ b/src/tramp.c @@ -0,0 +1,709 @@ +/* ----------------------------------------------------------------------- + tramp.c - Copyright (c) 2020 Madhavan T. Venkataraman + Copyright (c) 2022 Anthony Green + + API and support functions for managing statically defined closure + trampolines. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +#include + +#ifdef FFI_EXEC_STATIC_TRAMP + +/* -------------------------- Headers and Definitions ---------------------*/ +/* + * Add support for other OSes later. For now, it is just Linux and Cygwin. + */ + +#if defined (__linux__) || defined (__CYGWIN__) +#ifdef __linux__ +#define _GNU_SOURCE 1 +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef __linux__ +#include +#include +#endif +#ifdef __CYGWIN__ +#include +#endif +#endif + +/* + * Each architecture defines static code for a trampoline code table. The + * trampoline code table is mapped into the address space of a process. + * + * The following architecture specific function returns: + * + * - the address of the trampoline code table in the text segment + * - the size of each trampoline in the trampoline code table + * - the size of the mapping for the whole trampoline code table + */ +void __attribute__((weak)) *ffi_tramp_arch (size_t *tramp_size, + size_t *map_size); + +/* ------------------------- Trampoline Data Structures --------------------*/ + +struct tramp; + +/* + * Trampoline table. Manages one trampoline code table and one trampoline + * parameter table. + * + * prev, next Links in the global trampoline table list. + * code_table Trampoline code table mapping. + * parm_table Trampoline parameter table mapping. + * array Array of trampolines malloced. + * free List of free trampolines. + * nfree Number of free trampolines. + */ +struct tramp_table +{ + struct tramp_table *prev; + struct tramp_table *next; + void *code_table; + void *parm_table; + struct tramp *array; + struct tramp *free; + int nfree; +}; + +/* + * Parameters for each trampoline. + * + * data + * Data for the target code that the trampoline jumps to. + * target + * Target code that the trampoline jumps to. + */ +struct tramp_parm +{ + void *data; + void *target; +}; + +/* + * Trampoline structure for each trampoline. + * + * prev, next Links in the trampoline free list of a trampoline table. + * table Trampoline table to which this trampoline belongs. + * code Address of this trampoline in the code table mapping. + * parm Address of this trampoline's parameters in the parameter + * table mapping. + */ +struct tramp +{ + struct tramp *prev; + struct tramp *next; + struct tramp_table *table; + void *code; + struct tramp_parm *parm; +}; + +enum tramp_globals_status { + TRAMP_GLOBALS_UNINITIALIZED = 0, + TRAMP_GLOBALS_PASSED, + TRAMP_GLOBALS_FAILED, +}; + +/* + * Trampoline globals. + * + * fd + * File descriptor of binary file that contains the trampoline code table. + * offset + * Offset of the trampoline code table in that file. + * text + * Address of the trampoline code table in the text segment. + * map_size + * Size of the trampoline code table mapping. + * size + * Size of one trampoline in the trampoline code table. + * ntramp + * Total number of trampolines in the trampoline code table. + * free_tables + * List of trampoline tables that contain free trampolines. + * nfree_tables + * Number of trampoline tables that contain free trampolines. + * status + * Initialization status. + */ +struct tramp_globals +{ + int fd; + off_t offset; + void *text; + size_t map_size; + size_t size; + int ntramp; + struct tramp_table *free_tables; + int nfree_tables; + enum tramp_globals_status status; +}; + +static struct tramp_globals tramp_globals; + +/* --------------------- Trampoline File Initialization --------------------*/ + +/* + * The trampoline file is the file used to map the trampoline code table into + * the address space of a process. There are two ways to get this file: + * + * - From the OS. E.g., on Linux, /proc//maps lists all the memory + * mappings for . For file-backed mappings, maps supplies the file name + * and the file offset. Using this, we can locate the mapping that maps + * libffi and get the path to the libffi binary. And, we can compute the + * offset of the trampoline code table within that binary. + * + * - Else, if we can create a temporary file, we can write the trampoline code + * table from the text segment into the temporary file. + * + * The first method is the preferred one. If the OS security subsystem + * disallows mapping unsigned files with PROT_EXEC, then the second method + * will fail. + * + * If an OS allows the trampoline code table in the text segment to be + * directly remapped (e.g., MACH vm_remap ()), then we don't need the + * trampoline file. + */ +static int tramp_table_alloc (void); + +#if defined (__linux__) || defined (__CYGWIN__) + +static int +ffi_tramp_get_libffi (void) +{ + FILE *fp; + char file[PATH_MAX], line[PATH_MAX+100], perm[10], dev[10]; + unsigned long start, end, offset, inode; + uintptr_t addr = (uintptr_t) tramp_globals.text; + int nfields, found; + + snprintf (file, PATH_MAX, "/proc/%d/maps", getpid()); + fp = fopen (file, "r"); + if (fp == NULL) + return 0; + + found = 0; + while (feof (fp) == 0) { + if (fgets (line, sizeof (line), fp) == 0) + break; + + nfields = sscanf (line, "%lx-%lx %9s %lx %9s %ld %s", + &start, &end, perm, &offset, dev, &inode, file); + if (nfields != 7) + continue; + + if (addr >= start && addr < end) { + tramp_globals.offset = offset + (addr - start); + found = 1; + break; + } + } + fclose (fp); + + if (!found) + return 0; + + tramp_globals.fd = open (file, O_RDONLY); + if (tramp_globals.fd == -1) + return 0; + + /* + * Allocate a trampoline table just to make sure that the trampoline code + * table can be mapped. + */ + if (!tramp_table_alloc ()) + { + close (tramp_globals.fd); + tramp_globals.fd = -1; + return 0; + } + return 1; +} + +#endif /* defined (__linux__) || defined (__CYGWIN__) */ + +#if defined (__linux__) || defined (__CYGWIN__) + +static int +ffi_tramp_get_temp_file (void) +{ + ssize_t count; + + tramp_globals.offset = 0; + tramp_globals.fd = open_temp_exec_file (); + + /* + * Write the trampoline code table into the temporary file and allocate a + * trampoline table to make sure that the temporary file can be mapped. + */ + count = write(tramp_globals.fd, tramp_globals.text, tramp_globals.map_size); + if (count == tramp_globals.map_size && tramp_table_alloc ()) + return 1; + + close (tramp_globals.fd); + tramp_globals.fd = -1; + return 0; +} + +#endif /* defined (__linux__) || defined (__CYGWIN__) */ + +/* ------------------------ OS-specific Initialization ----------------------*/ + +#if defined (__linux__) || defined (__CYGWIN__) + +static int +ffi_tramp_init_os (void) +{ + if (ffi_tramp_get_libffi ()) + return 1; + return ffi_tramp_get_temp_file (); +} + +#endif /* defined (__linux__) || defined (__CYGWIN__) */ + +/* --------------------------- OS-specific Locking -------------------------*/ + +#if defined (__linux__) || defined (__CYGWIN__) + +static pthread_mutex_t tramp_globals_mutex = PTHREAD_MUTEX_INITIALIZER; + +static void +ffi_tramp_lock(void) +{ + pthread_mutex_lock (&tramp_globals_mutex); +} + +static void +ffi_tramp_unlock() +{ + pthread_mutex_unlock (&tramp_globals_mutex); +} + +#endif /* defined (__linux__) || defined (__CYGWIN__) */ + +/* ------------------------ OS-specific Memory Mapping ----------------------*/ + +/* + * Create a trampoline code table mapping and a trampoline parameter table + * mapping. The two mappings must be adjacent to each other for PC-relative + * access. + * + * For each trampoline in the code table, there is a corresponding parameter + * block in the parameter table. The size of the parameter block is the same + * as the size of the trampoline. This means that the parameter block is at + * a fixed offset from its trampoline making it easy for a trampoline to find + * its parameters using PC-relative access. + * + * The parameter block will contain a struct tramp_parm. This means that + * sizeof (struct tramp_parm) cannot exceed the size of a parameter block. + */ + +#if defined (__linux__) || defined (__CYGWIN__) + +static int +tramp_table_map (struct tramp_table *table) +{ + char *addr; + + /* + * Create an anonymous mapping twice the map size. The top half will be used + * for the code table. The bottom half will be used for the parameter table. + */ + addr = mmap (NULL, tramp_globals.map_size * 2, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (addr == MAP_FAILED) + return 0; + + /* + * Replace the top half of the anonymous mapping with the code table mapping. + */ + table->code_table = mmap (addr, tramp_globals.map_size, PROT_READ | PROT_EXEC, + MAP_PRIVATE | MAP_FIXED, tramp_globals.fd, tramp_globals.offset); + if (table->code_table == MAP_FAILED) + { + (void) munmap (addr, tramp_globals.map_size * 2); + return 0; + } + table->parm_table = table->code_table + tramp_globals.map_size; + return 1; +} + +static void +tramp_table_unmap (struct tramp_table *table) +{ + (void) munmap (table->code_table, tramp_globals.map_size); + (void) munmap (table->parm_table, tramp_globals.map_size); +} + +#endif /* defined (__linux__) || defined (__CYGWIN__) */ + +/* ------------------------ Trampoline Initialization ----------------------*/ + +/* + * Initialize the static trampoline feature. + */ +static int +ffi_tramp_init (void) +{ + if (tramp_globals.status == TRAMP_GLOBALS_PASSED) + return 1; + + if (tramp_globals.status == TRAMP_GLOBALS_FAILED) + return 0; + + if (ffi_tramp_arch == NULL) + { + tramp_globals.status = TRAMP_GLOBALS_FAILED; + return 0; + } + + tramp_globals.free_tables = NULL; + tramp_globals.nfree_tables = 0; + + /* + * Get trampoline code table information from the architecture. + */ + tramp_globals.text = ffi_tramp_arch (&tramp_globals.size, + &tramp_globals.map_size); + tramp_globals.ntramp = tramp_globals.map_size / tramp_globals.size; + + if (sysconf (_SC_PAGESIZE) > tramp_globals.map_size) + return 0; + + if (ffi_tramp_init_os ()) + { + tramp_globals.status = TRAMP_GLOBALS_PASSED; + return 1; + } + + tramp_globals.status = TRAMP_GLOBALS_FAILED; + return 0; +} + +/* ---------------------- Trampoline Table functions ---------------------- */ + +/* This code assumes that malloc () is available on all OSes. */ + +static void tramp_add (struct tramp *tramp); + +/* + * Allocate and initialize a trampoline table. + */ +static int +tramp_table_alloc (void) +{ + struct tramp_table *table; + struct tramp *tramp_array, *tramp; + size_t size; + char *code, *parm; + int i; + + /* + * If we already have tables with free trampolines, there is no need to + * allocate a new table. + */ + if (tramp_globals.nfree_tables > 0) + return 1; + + /* + * Allocate a new trampoline table structure. + */ + table = malloc (sizeof (*table)); + if (table == NULL) + return 0; + + /* + * Allocate new trampoline structures. + */ + tramp_array = malloc (sizeof (*tramp) * tramp_globals.ntramp); + if (tramp_array == NULL) + goto free_table; + + /* + * Map a code table and a parameter table into the caller's address space. + */ + if (!tramp_table_map (table)) + { + /* + * Failed to map the code and parameter tables. + */ + goto free_tramp_array; + } + + /* + * Initialize the trampoline table. + */ + table->array = tramp_array; + table->free = NULL; + table->nfree = 0; + + /* + * Populate the trampoline table free list. This will also add the trampoline + * table to the global list of trampoline tables. + */ + size = tramp_globals.size; + code = table->code_table; + parm = table->parm_table; + for (i = 0; i < tramp_globals.ntramp; i++) + { + tramp = &tramp_array[i]; + tramp->table = table; + tramp->code = code; + tramp->parm = (struct tramp_parm *) parm; + tramp_add (tramp); + + code += size; + parm += size; + } + /* Success */ + return 1; + +/* Failure */ +free_tramp_array: + free (tramp_array); +free_table: + free (table); + return 0; +} + +/* + * Free a trampoline table. + */ +static void +tramp_table_free (struct tramp_table *table) +{ + tramp_table_unmap (table); + free (table->array); + free (table); +} + +/* + * Add a new trampoline table to the global table list. + */ +static void +tramp_table_add (struct tramp_table *table) +{ + table->next = tramp_globals.free_tables; + table->prev = NULL; + if (tramp_globals.free_tables != NULL) + tramp_globals.free_tables->prev = table; + tramp_globals.free_tables = table; + tramp_globals.nfree_tables++; +} + +/* + * Delete a trampoline table from the global table list. + */ +static void +tramp_table_del (struct tramp_table *table) +{ + tramp_globals.nfree_tables--; + if (table->prev != NULL) + table->prev->next = table->next; + if (table->next != NULL) + table->next->prev = table->prev; + if (tramp_globals.free_tables == table) + tramp_globals.free_tables = table->next; +} + +/* ------------------------- Trampoline functions ------------------------- */ + +/* + * Add a trampoline to its trampoline table. + */ +static void +tramp_add (struct tramp *tramp) +{ + struct tramp_table *table = tramp->table; + + tramp->next = table->free; + tramp->prev = NULL; + if (table->free != NULL) + table->free->prev = tramp; + table->free = tramp; + table->nfree++; + + if (table->nfree == 1) + tramp_table_add (table); + + /* + * We don't want to keep too many free trampoline tables lying around. + */ + if (table->nfree == tramp_globals.ntramp && + tramp_globals.nfree_tables > 1) + { + tramp_table_del (table); + tramp_table_free (table); + } +} + +/* + * Remove a trampoline from its trampoline table. + */ +static void +tramp_del (struct tramp *tramp) +{ + struct tramp_table *table = tramp->table; + + table->nfree--; + if (tramp->prev != NULL) + tramp->prev->next = tramp->next; + if (tramp->next != NULL) + tramp->next->prev = tramp->prev; + if (table->free == tramp) + table->free = tramp->next; + + if (table->nfree == 0) + tramp_table_del (table); +} + +/* ------------------------ Trampoline API functions ------------------------ */ + +int +ffi_tramp_is_supported(void) +{ + int ret; + + ffi_tramp_lock(); + ret = ffi_tramp_init (); + ffi_tramp_unlock(); + return ret; +} + +/* + * Allocate a trampoline and return its opaque address. + */ +void * +ffi_tramp_alloc (int flags) +{ + struct tramp *tramp; + + ffi_tramp_lock(); + + if (!ffi_tramp_init () || flags != 0) + { + ffi_tramp_unlock(); + return NULL; + } + + if (!tramp_table_alloc ()) + { + ffi_tramp_unlock(); + return NULL; + } + + tramp = tramp_globals.free_tables->free; + tramp_del (tramp); + + ffi_tramp_unlock(); + + return tramp; +} + +/* + * Set the parameters for a trampoline. + */ +void +ffi_tramp_set_parms (void *arg, void *target, void *data) +{ + struct tramp *tramp = arg; + + ffi_tramp_lock(); + tramp->parm->target = target; + tramp->parm->data = data; + ffi_tramp_unlock(); +} + +/* + * Get the invocation address of a trampoline. + */ +void * +ffi_tramp_get_addr (void *arg) +{ + struct tramp *tramp = arg; + void *addr; + + ffi_tramp_lock(); + addr = tramp->code; + ffi_tramp_unlock(); + + return addr; +} + +/* + * Free a trampoline. + */ +void +ffi_tramp_free (void *arg) +{ + struct tramp *tramp = arg; + + ffi_tramp_lock(); + tramp_add (tramp); + ffi_tramp_unlock(); +} + +/* ------------------------------------------------------------------------- */ + +#else /* !FFI_EXEC_STATIC_TRAMP */ + +#include + +int +ffi_tramp_is_supported(void) +{ + return 0; +} + +void * +ffi_tramp_alloc (int flags) +{ + return NULL; +} + +void +ffi_tramp_set_parms (void *arg, void *target, void *data) +{ +} + +void * +ffi_tramp_get_addr (void *arg) +{ + return NULL; +} + +void +ffi_tramp_free (void *arg) +{ +} + +#endif /* FFI_EXEC_STATIC_TRAMP */ diff --git a/src/x86/ffi.c b/src/x86/ffi.c index 9a59218..b8bb178 100644 --- a/src/x86/ffi.c +++ b/src/x86/ffi.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi.c - Copyright (c) 2017 Anthony Green + ffi.c - Copyright (c) 2017, 2022 Anthony Green Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc. Copyright (c) 2002 Ranjit Mathew Copyright (c) 2002 Bo Thorsen @@ -34,6 +34,7 @@ #include #include #include +#include #include "internal.h" /* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; @@ -116,35 +117,37 @@ ffi_prep_cif_machdep(ffi_cif *cif) flags = X86_RET_INT64; break; case FFI_TYPE_STRUCT: -#ifndef X86 - /* ??? This should be a different ABI rather than an ifdef. */ - if (cif->rtype->size == 1) - flags = X86_RET_STRUCT_1B; - else if (cif->rtype->size == 2) - flags = X86_RET_STRUCT_2B; - else if (cif->rtype->size == 4) - flags = X86_RET_INT32; - else if (cif->rtype->size == 8) - flags = X86_RET_INT64; - else + { +#ifdef X86_WIN32 + size_t size = cif->rtype->size; + if (size == 1) + flags = X86_RET_STRUCT_1B; + else if (size == 2) + flags = X86_RET_STRUCT_2B; + else if (size == 4) + flags = X86_RET_INT32; + else if (size == 8) + flags = X86_RET_INT64; + else #endif - { - do_struct: - switch (cabi) - { - case FFI_THISCALL: - case FFI_FASTCALL: - case FFI_STDCALL: - case FFI_MS_CDECL: - flags = X86_RET_STRUCTARG; - break; - default: - flags = X86_RET_STRUCTPOP; - break; - } - /* Allocate space for return value pointer. */ - bytes += FFI_ALIGN (sizeof(void*), FFI_SIZEOF_ARG); - } + { + do_struct: + switch (cabi) + { + case FFI_THISCALL: + case FFI_FASTCALL: + case FFI_STDCALL: + case FFI_MS_CDECL: + flags = X86_RET_STRUCTARG; + break; + default: + flags = X86_RET_STRUCTPOP; + break; + } + /* Allocate space for return value pointer. */ + bytes += FFI_ALIGN (sizeof(void*), FFI_SIZEOF_ARG); + } + } break; case FFI_TYPE_COMPLEX: switch (cif->rtype->elements[0]->type) @@ -181,7 +184,12 @@ ffi_prep_cif_machdep(ffi_cif *cif) { ffi_type *t = cif->arg_types[i]; - bytes = FFI_ALIGN (bytes, t->alignment); +#if defined(X86_WIN32) + if (cabi == FFI_STDCALL) + bytes = FFI_ALIGN (bytes, FFI_SIZEOF_ARG); + else +#endif + bytes = FFI_ALIGN (bytes, t->alignment); bytes += FFI_ALIGN (t->size, FFI_SIZEOF_ARG); } cif->bytes = bytes; @@ -255,6 +263,13 @@ static const struct abi_params abi_params[FFI_LAST_ABI] = { extern void FFI_DECLARE_FASTCALL ffi_call_i386(struct call_frame *, char *) FFI_HIDDEN; +/* We perform some black magic here to use some of the parent's stack frame in + * ffi_call_i386() that breaks with the MSVC compiler with the /RTCs or /GZ + * flags. Disable the 'Stack frame run time error checking' for this function + * so we don't hit weird exceptions in debug builds. */ +#if defined(_MSC_VER) +#pragma runtime_checks("s", off) +#endif static void ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue, void *closure) @@ -353,7 +368,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, size_t align = FFI_SIZEOF_ARG; /* Issue 434: For thiscall and fastcall, if the paramter passed - as 64-bit integer or struct, all following integer paramters + as 64-bit integer or struct, all following integer parameters will be passed on stack. */ if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL) && (t == FFI_TYPE_SINT64 @@ -370,7 +385,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, cases. */ if (t == FFI_TYPE_STRUCT && ty->alignment >= 16) align = 16; - + if (dir < 0) { /* ??? These reverse argument ABIs are probably too old @@ -390,6 +405,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_call_i386 (frame, stack); } +#if defined(_MSC_VER) +#pragma runtime_checks("s", restore) +#endif void ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) @@ -397,18 +415,25 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) ffi_call_int (cif, fn, rvalue, avalue, NULL); } +#ifdef FFI_GO_CLOSURES void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue, void *closure) { ffi_call_int (cif, fn, rvalue, avalue, closure); } +#endif /** private members **/ void FFI_HIDDEN ffi_closure_i386(void); void FFI_HIDDEN ffi_closure_STDCALL(void); void FFI_HIDDEN ffi_closure_REGISTER(void); +#if defined(FFI_EXEC_STATIC_TRAMP) +void FFI_HIDDEN ffi_closure_i386_alt(void); +void FFI_HIDDEN ffi_closure_STDCALL_alt(void); +void FFI_HIDDEN ffi_closure_REGISTER_alt(void); +#endif struct closure_frame { @@ -492,7 +517,7 @@ ffi_closure_inner (struct closure_frame *frame, char *stack) align = 16; /* Issue 434: For thiscall and fastcall, if the paramter passed - as 64-bit integer or struct, all following integer paramters + as 64-bit integer or struct, all following integer parameters will be passed on stack. */ if ((cabi == FFI_THISCALL || cabi == FFI_FASTCALL) && (t == FFI_TYPE_SINT64 @@ -520,10 +545,17 @@ ffi_closure_inner (struct closure_frame *frame, char *stack) frame->fun (cif, rvalue, avalue, frame->user_data); - if (cabi == FFI_STDCALL) - return flags + (cif->bytes << X86_RET_POP_SHIFT); - else - return flags; + switch (cabi) + { + case FFI_STDCALL: + return flags | (cif->bytes << X86_RET_POP_SHIFT); + case FFI_THISCALL: + case FFI_FASTCALL: + return flags | ((cif->bytes - (narg_reg * FFI_SIZEOF_ARG)) + << X86_RET_POP_SHIFT); + default: + return flags; + } } ffi_status @@ -540,12 +572,12 @@ ffi_prep_closure_loc (ffi_closure* closure, switch (cif->abi) { case FFI_SYSV: - case FFI_THISCALL: - case FFI_FASTCALL: case FFI_MS_CDECL: dest = ffi_closure_i386; break; case FFI_STDCALL: + case FFI_THISCALL: + case FFI_FASTCALL: case FFI_PASCAL: dest = ffi_closure_STDCALL; break; @@ -557,14 +589,36 @@ ffi_prep_closure_loc (ffi_closure* closure, return FFI_BAD_ABI; } +#if defined(FFI_EXEC_STATIC_TRAMP) + if (ffi_tramp_is_present(closure)) + { + /* Initialize the static trampoline's parameters. */ + if (dest == ffi_closure_i386) + dest = ffi_closure_i386_alt; + else if (dest == ffi_closure_STDCALL) + dest = ffi_closure_STDCALL_alt; + else + dest = ffi_closure_REGISTER_alt; + ffi_tramp_set_parms (closure->ftramp, dest, closure); + goto out; + } +#endif + + /* Initialize the dynamic trampoline. */ + /* endbr32. */ + *(UINT32 *) tramp = 0xfb1e0ff3; + /* movl or pushl immediate. */ - tramp[0] = op; - *(void **)(tramp + 1) = codeloc; + tramp[4] = op; + *(void **)(tramp + 5) = codeloc; /* jmp dest */ - tramp[5] = 0xe9; - *(unsigned *)(tramp + 6) = (unsigned)dest - ((unsigned)codeloc + 10); + tramp[9] = 0xe9; + *(unsigned *)(tramp + 10) = (unsigned)dest - ((unsigned)codeloc + 14); +#if defined(FFI_EXEC_STATIC_TRAMP) +out: +#endif closure->cif = cif; closure->fun = fun; closure->user_data = user_data; @@ -572,6 +626,8 @@ ffi_prep_closure_loc (ffi_closure* closure, return FFI_OK; } +#ifdef FFI_GO_CLOSURES + void FFI_HIDDEN ffi_go_closure_EAX(void); void FFI_HIDDEN ffi_go_closure_ECX(void); void FFI_HIDDEN ffi_go_closure_STDCALL(void); @@ -608,6 +664,8 @@ ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, return FFI_OK; } +#endif /* FFI_GO_CLOSURES */ + /* ------- Native raw API support -------------------------------- */ #if !FFI_NO_RAW_API @@ -758,4 +816,17 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *avalue) ffi_call_i386 (frame, stack); } #endif /* !FFI_NO_RAW_API */ + +#if defined(FFI_EXEC_STATIC_TRAMP) +void * +ffi_tramp_arch (size_t *tramp_size, size_t *map_size) +{ + extern void *trampoline_code_table; + + *map_size = X86_TRAMP_MAP_SIZE; + *tramp_size = X86_TRAMP_SIZE; + return &trampoline_code_table; +} +#endif + #endif /* __i386__ */ diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c index dec331c..6a8e37f 100644 --- a/src/x86/ffi64.c +++ b/src/x86/ffi64.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------- - ffi64.c - Copyright (c) 2011, 2018 Anthony Green + ffi64.c - Copyright (c) 2011, 2018, 2022 Anthony Green Copyright (c) 2013 The Written Word, Inc. Copyright (c) 2008, 2010 Red Hat, Inc. Copyright (c) 2002, 2007 Bo Thorsen @@ -33,6 +33,7 @@ #include #include #include +#include #include "internal64.h" #ifdef __x86_64__ @@ -217,7 +218,8 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[], case FFI_TYPE_STRUCT: { const size_t UNITS_PER_WORD = 8; - size_t words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + size_t words = (type->size + byte_offset + UNITS_PER_WORD - 1) + / UNITS_PER_WORD; ffi_type **ptr; unsigned int i; enum x86_64_reg_class subclasses[MAX_CLASSES]; @@ -241,14 +243,15 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[], /* Merge the fields of structure. */ for (ptr = type->elements; *ptr != NULL; ptr++) { - size_t num; + size_t num, pos; byte_offset = FFI_ALIGN (byte_offset, (*ptr)->alignment); num = classify_argument (*ptr, subclasses, byte_offset % 8); if (num == 0) return 0; - for (i = 0; i < num; i++) + pos = byte_offset / 8; + for (i = 0; i < num && (i + pos) < words; i++) { size_t pos = byte_offset / 8; classes[i + pos] = @@ -578,6 +581,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, flags = UNIX64_RET_VOID; } + arg_types = cif->arg_types; + avn = cif->nargs; + /* Allocate the space for the arguments, plus 4 words of temp space. */ stack = alloca (sizeof (struct register_args) + cif->bytes + 4*8); reg_args = (struct register_args *) stack; @@ -592,9 +598,6 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, if (flags & UNIX64_FLAG_RET_IN_MEM) reg_args->gpr[gprcount++] = (unsigned long) rvalue; - avn = cif->nargs; - arg_types = cif->arg_types; - for (i = 0; i < avn; ++i) { size_t n, size = arg_types[i]->size; @@ -610,11 +613,12 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, if (align < 8) align = 8; - /* Pass this argument in memory. */ - argp = (void *) FFI_ALIGN (argp, align); - memcpy (argp, avalue[i], size); - argp += size; - } + /* Pass this argument in memory. */ + argp = (void *) FFI_ALIGN (argp, align); + memcpy (argp, avalue[i], size); + + argp += size; + } else { /* The argument is passed entirely in registers. */ @@ -678,6 +682,24 @@ ffi_call_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue); void ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) { + ffi_type **arg_types = cif->arg_types; + int i, nargs = cif->nargs; + const int max_reg_struct_size = cif->abi == FFI_GNUW64 ? 8 : 16; + + /* If we have any large structure arguments, make a copy so we are passing + by value. */ + for (i = 0; i < nargs; i++) + { + ffi_type *at = arg_types[i]; + int size = at->size; + if (at->type == FFI_TYPE_STRUCT && size > max_reg_struct_size) + { + char *argcopy = alloca (size); + memcpy (argcopy, avalue[i], size); + avalue[i] = argcopy; + } + } + #ifndef __ILP32__ if (cif->abi == FFI_EFI64 || cif->abi == FFI_GNUW64) { @@ -688,6 +710,8 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) ffi_call_int (cif, fn, rvalue, avalue, NULL); } +#ifdef FFI_GO_CLOSURES + #ifndef __ILP32__ extern void ffi_call_go_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, @@ -708,9 +732,14 @@ ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_call_int (cif, fn, rvalue, avalue, closure); } +#endif /* FFI_GO_CLOSURES */ extern void ffi_closure_unix64(void) FFI_HIDDEN; extern void ffi_closure_unix64_sse(void) FFI_HIDDEN; +#if defined(FFI_EXEC_STATIC_TRAMP) +extern void ffi_closure_unix64_alt(void) FFI_HIDDEN; +extern void ffi_closure_unix64_sse_alt(void) FFI_HIDDEN; +#endif #ifndef __ILP32__ extern ffi_status @@ -728,13 +757,15 @@ ffi_prep_closure_loc (ffi_closure* closure, void *user_data, void *codeloc) { - static const unsigned char trampoline[16] = { - /* leaq -0x7(%rip),%r10 # 0x0 */ - 0x4c, 0x8d, 0x15, 0xf9, 0xff, 0xff, 0xff, - /* jmpq *0x3(%rip) # 0x10 */ - 0xff, 0x25, 0x03, 0x00, 0x00, 0x00, - /* nopl (%rax) */ - 0x0f, 0x1f, 0x00 + static const unsigned char trampoline[24] = { + /* endbr64 */ + 0xf3, 0x0f, 0x1e, 0xfa, + /* leaq -0xb(%rip),%r10 # 0x0 */ + 0x4c, 0x8d, 0x15, 0xf5, 0xff, 0xff, 0xff, + /* jmpq *0x7(%rip) # 0x18 */ + 0xff, 0x25, 0x07, 0x00, 0x00, 0x00, + /* nopl 0(%rax) */ + 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 }; void (*dest)(void); char *tramp = closure->tramp; @@ -751,9 +782,26 @@ ffi_prep_closure_loc (ffi_closure* closure, else dest = ffi_closure_unix64; - memcpy (tramp, trampoline, sizeof(trampoline)); - *(UINT64 *)(tramp + 16) = (uintptr_t)dest; +#if defined(FFI_EXEC_STATIC_TRAMP) + if (ffi_tramp_is_present(closure)) + { + /* Initialize the static trampoline's parameters. */ + if (dest == ffi_closure_unix64_sse) + dest = ffi_closure_unix64_sse_alt; + else + dest = ffi_closure_unix64_alt; + ffi_tramp_set_parms (closure->ftramp, dest, closure); + goto out; + } +#endif + /* Initialize the dynamic trampoline. */ + memcpy (tramp, trampoline, sizeof(trampoline)); + *(UINT64 *)(tramp + sizeof (trampoline)) = (uintptr_t)dest; + +#if defined(FFI_EXEC_STATIC_TRAMP) +out: +#endif closure->cif = cif; closure->fun = fun; closure->user_data = user_data; @@ -854,6 +902,8 @@ ffi_closure_unix64_inner(ffi_cif *cif, return flags; } +#ifdef FFI_GO_CLOSURES + extern void ffi_go_closure_unix64(void) FFI_HIDDEN; extern void ffi_go_closure_unix64_sse(void) FFI_HIDDEN; @@ -883,4 +933,18 @@ ffi_prep_go_closure (ffi_go_closure* closure, ffi_cif* cif, return FFI_OK; } +#endif /* FFI_GO_CLOSURES */ + +#if defined(FFI_EXEC_STATIC_TRAMP) +void * +ffi_tramp_arch (size_t *tramp_size, size_t *map_size) +{ + extern void *trampoline_code_table; + + *map_size = UNIX64_TRAMP_MAP_SIZE; + *tramp_size = UNIX64_TRAMP_SIZE; + return &trampoline_code_table; +} +#endif + #endif /* __x86_64__ */ diff --git a/src/x86/ffitarget.h b/src/x86/ffitarget.h index 85ccedf..5a3399d 100644 --- a/src/x86/ffitarget.h +++ b/src/x86/ffitarget.h @@ -41,6 +41,9 @@ #if defined (X86_64) && defined (__i386__) #undef X86_64 +#warning ****************************************************** +#warning ********** X86 IS DEFINED **************************** +#warning ****************************************************** #define X86 #endif @@ -85,9 +88,9 @@ typedef enum ffi_abi { FFI_LAST_ABI, #ifdef __GNUC__ FFI_DEFAULT_ABI = FFI_GNUW64 -#else +#else FFI_DEFAULT_ABI = FFI_WIN64 -#endif +#endif #elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN)) FFI_FIRST_ABI = 1, @@ -136,12 +139,26 @@ typedef enum ffi_abi { #if defined (X86_64) || defined(X86_WIN64) \ || (defined (__x86_64__) && defined (X86_DARWIN)) -# define FFI_TRAMPOLINE_SIZE 24 +/* 4 bytes of ENDBR64 + 7 bytes of LEA + 6 bytes of JMP + 7 bytes of NOP + + 8 bytes of pointer. */ +# define FFI_TRAMPOLINE_SIZE 32 # define FFI_NATIVE_RAW_API 0 #else -# define FFI_TRAMPOLINE_SIZE 12 +/* 4 bytes of ENDBR32 + 5 bytes of MOV + 5 bytes of JMP + 2 unused + bytes. */ +# define FFI_TRAMPOLINE_SIZE 16 # define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */ #endif +#if !defined(GENERATE_LIBFFI_MAP) && defined(__CET__) +# include +# if (__CET__ & 1) != 0 +# define ENDBR_PRESENT +# endif +# define _CET_NOTRACK notrack +#else +# define _CET_ENDBR +# define _CET_NOTRACK #endif +#endif diff --git a/src/x86/ffiw64.c b/src/x86/ffiw64.c index b68f69c..8271658 100644 --- a/src/x86/ffiw64.c +++ b/src/x86/ffiw64.c @@ -30,6 +30,7 @@ #include #include #include +#include #ifdef X86_WIN64 #define EFI64(name) name @@ -107,6 +108,13 @@ EFI64(ffi_prep_cif_machdep)(ffi_cif *cif) return FFI_OK; } +/* We perform some black magic here to use some of the parent's stack frame in + * ffi_call_win64() that breaks with the MSVC compiler with the /RTCs or /GZ + * flags. Disable the 'Stack frame run time error checking' for this function + * so we don't hit weird exceptions in debug builds. */ +#if defined(_MSC_VER) +#pragma runtime_checks("s", off) +#endif static void ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue, void *closure) @@ -115,9 +123,25 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, UINT64 *stack; size_t rsize; struct win64_call_frame *frame; + ffi_type **arg_types = cif->arg_types; + int nargs = cif->nargs; FFI_ASSERT(cif->abi == FFI_GNUW64 || cif->abi == FFI_WIN64); + /* If we have any large structure arguments, make a copy so we are passing + by value. */ + for (i = 0; i < nargs; i++) + { + ffi_type *at = arg_types[i]; + int size = at->size; + if (at->type == FFI_TYPE_STRUCT && size > 8) + { + char *argcopy = alloca (size); + memcpy (argcopy, avalue[i], size); + avalue[i] = argcopy; + } + } + flags = cif->flags; rsize = 0; @@ -171,6 +195,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_call_win64 (stack, frame, closure); } +#if defined(_MSC_VER) +#pragma runtime_checks("s", restore) +#endif void EFI64(ffi_call)(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) @@ -187,7 +214,13 @@ EFI64(ffi_call_go)(ffi_cif *cif, void (*fn)(void), void *rvalue, extern void ffi_closure_win64(void) FFI_HIDDEN; +#if defined(FFI_EXEC_STATIC_TRAMP) +extern void ffi_closure_win64_alt(void) FFI_HIDDEN; +#endif + +#ifdef FFI_GO_CLOSURES extern void ffi_go_closure_win64(void) FFI_HIDDEN; +#endif ffi_status EFI64(ffi_prep_closure_loc)(ffi_closure* closure, @@ -196,13 +229,15 @@ EFI64(ffi_prep_closure_loc)(ffi_closure* closure, void *user_data, void *codeloc) { - static const unsigned char trampoline[16] = { - /* leaq -0x7(%rip),%r10 # 0x0 */ - 0x4c, 0x8d, 0x15, 0xf9, 0xff, 0xff, 0xff, - /* jmpq *0x3(%rip) # 0x10 */ - 0xff, 0x25, 0x03, 0x00, 0x00, 0x00, - /* nopl (%rax) */ - 0x0f, 0x1f, 0x00 + static const unsigned char trampoline[FFI_TRAMPOLINE_SIZE - 8] = { + /* endbr64 */ + 0xf3, 0x0f, 0x1e, 0xfa, + /* leaq -0xb(%rip),%r10 # 0x0 */ + 0x4c, 0x8d, 0x15, 0xf5, 0xff, 0xff, 0xff, + /* jmpq *0x7(%rip) # 0x18 */ + 0xff, 0x25, 0x07, 0x00, 0x00, 0x00, + /* nopl 0(%rax) */ + 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00 }; char *tramp = closure->tramp; @@ -215,9 +250,22 @@ EFI64(ffi_prep_closure_loc)(ffi_closure* closure, return FFI_BAD_ABI; } - memcpy (tramp, trampoline, sizeof(trampoline)); - *(UINT64 *)(tramp + 16) = (uintptr_t)ffi_closure_win64; +#if defined(FFI_EXEC_STATIC_TRAMP) + if (ffi_tramp_is_present(closure)) + { + /* Initialize the static trampoline's parameters. */ + ffi_tramp_set_parms (closure->ftramp, ffi_closure_win64_alt, closure); + goto out; + } +#endif + /* Initialize the dynamic trampoline. */ + memcpy (tramp, trampoline, sizeof(trampoline)); + *(UINT64 *)(tramp + sizeof (trampoline)) = (uintptr_t)ffi_closure_win64; + +#if defined(FFI_EXEC_STATIC_TRAMP) +out: +#endif closure->cif = cif; closure->fun = fun; closure->user_data = user_data; @@ -225,6 +273,7 @@ EFI64(ffi_prep_closure_loc)(ffi_closure* closure, return FFI_OK; } +#ifdef FFI_GO_CLOSURES ffi_status EFI64(ffi_prep_go_closure)(ffi_go_closure* closure, ffi_cif* cif, void (*fun)(ffi_cif*, void*, void**, void*)) @@ -244,6 +293,7 @@ EFI64(ffi_prep_go_closure)(ffi_go_closure* closure, ffi_cif* cif, return FFI_OK; } +#endif struct win64_closure_frame { diff --git a/src/x86/internal.h b/src/x86/internal.h index 09771ba..23be7a2 100644 --- a/src/x86/internal.h +++ b/src/x86/internal.h @@ -27,3 +27,17 @@ #else # define HAVE_FASTCALL 1 #endif + +#if defined(FFI_EXEC_STATIC_TRAMP) +/* + * For the trampoline code table mapping, a mapping size of 4K (base page size) + * is chosen. + */ +#define X86_TRAMP_MAP_SHIFT 12 +#define X86_TRAMP_MAP_SIZE (1 << X86_TRAMP_MAP_SHIFT) +#ifdef ENDBR_PRESENT +#define X86_TRAMP_SIZE 44 +#else +#define X86_TRAMP_SIZE 40 +#endif +#endif diff --git a/src/x86/internal64.h b/src/x86/internal64.h index 512e955..282b408 100644 --- a/src/x86/internal64.h +++ b/src/x86/internal64.h @@ -20,3 +20,17 @@ #define UNIX64_FLAG_RET_IN_MEM (1 << 10) #define UNIX64_FLAG_XMM_ARGS (1 << 11) #define UNIX64_SIZE_SHIFT 12 + +#if defined(FFI_EXEC_STATIC_TRAMP) +/* + * For the trampoline code table mapping, a mapping size of 4K (base page size) + * is chosen. + */ +#define UNIX64_TRAMP_MAP_SHIFT 12 +#define UNIX64_TRAMP_MAP_SIZE (1 << UNIX64_TRAMP_MAP_SHIFT) +#ifdef ENDBR_PRESENT +#define UNIX64_TRAMP_SIZE 40 +#else +#define UNIX64_TRAMP_SIZE 32 +#endif +#endif diff --git a/src/x86/sysv.S b/src/x86/sysv.S index 7c9598c..7110f02 100644 --- a/src/x86/sysv.S +++ b/src/x86/sysv.S @@ -56,8 +56,8 @@ /* Handle win32 fastcall name mangling. */ #ifdef X86_WIN32 -# define ffi_call_i386 @ffi_call_i386@8 -# define ffi_closure_inner @ffi_closure_inner@8 +# define ffi_call_i386 "@ffi_call_i386@8" +# define ffi_closure_inner "@ffi_closure_inner@8" #else # define ffi_call_i386 C(ffi_call_i386) # define ffi_closure_inner C(ffi_closure_inner) @@ -92,6 +92,7 @@ ffi_call_i386: L(UW0): # cfi_startproc + _CET_ENDBR #if !HAVE_FASTCALL movl 4(%esp), %ecx movl 8(%esp), %edx @@ -133,7 +134,7 @@ L(pc1): leal L(store_table)(,%ecx, 8), %ebx #endif movl 16(%ebp), %ecx /* load result address */ - jmp *%ebx + _CET_NOTRACK jmp *%ebx .balign 8 L(store_table): @@ -256,7 +257,7 @@ ENDF(ffi_call_i386) andl $X86_RET_TYPE_MASK, %eax; \ leal L(C1(load_table,N))(, %eax, 8), %edx; \ movl closure_CF(%esp), %eax; /* optimiztic load */ \ - jmp *%edx + _CET_NOTRACK jmp *%edx #ifdef __PIC__ # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE @@ -267,7 +268,7 @@ ENDF(ffi_call_i386) L(C1(pc,N)): \ leal L(C1(load_table,N))-L(C1(pc,N))(%edx, %eax, 8), %edx; \ movl closure_CF(%esp), %eax; /* optimiztic load */ \ - jmp *%edx + _CET_NOTRACK jmp *%edx # else # define FFI_CLOSURE_CALL_INNER_SAVE_EBX # undef FFI_CLOSURE_CALL_INNER @@ -286,7 +287,7 @@ L(C1(UW,UWN)): \ L(C1(UW,UWN)): \ /* cfi_restore(%ebx); */ \ movl closure_CF(%esp), %eax; /* optimiztic load */ \ - jmp *%edx + _CET_NOTRACK jmp *%edx # endif /* DARWIN || HIDDEN */ #endif /* __PIC__ */ @@ -296,6 +297,7 @@ L(C1(UW,UWN)): \ C(ffi_go_closure_EAX): L(UW6): # cfi_startproc + _CET_ENDBR subl $closure_FS, %esp L(UW7): # cfi_def_cfa_offset(closure_FS + 4) @@ -316,6 +318,7 @@ ENDF(C(ffi_go_closure_EAX)) C(ffi_go_closure_ECX): L(UW9): # cfi_startproc + _CET_ENDBR subl $closure_FS, %esp L(UW10): # cfi_def_cfa_offset(closure_FS + 4) @@ -340,6 +343,7 @@ ENDF(C(ffi_go_closure_ECX)) C(ffi_closure_i386): L(UW12): # cfi_startproc + _CET_ENDBR subl $closure_FS, %esp L(UW13): # cfi_def_cfa_offset(closure_FS + 4) @@ -423,6 +427,7 @@ ENDF(C(ffi_closure_i386)) C(ffi_go_closure_STDCALL): L(UW21): # cfi_startproc + _CET_ENDBR subl $closure_FS, %esp L(UW22): # cfi_def_cfa_offset(closure_FS + 4) @@ -448,6 +453,7 @@ L(UW24): # cfi_startproc # cfi_def_cfa(%esp, 8) # cfi_offset(%eip, -8) + _CET_ENDBR subl $closure_FS-4, %esp L(UW25): # cfi_def_cfa_offset(closure_FS + 4) @@ -470,6 +476,7 @@ ENDF(C(ffi_closure_REGISTER)) C(ffi_closure_STDCALL): L(UW27): # cfi_startproc + _CET_ENDBR subl $closure_FS, %esp L(UW28): # cfi_def_cfa_offset(closure_FS + 4) @@ -566,6 +573,94 @@ L(UW31): # cfi_endproc ENDF(C(ffi_closure_STDCALL)) +#if defined(FFI_EXEC_STATIC_TRAMP) + .balign 16 + .globl C(ffi_closure_i386_alt) + FFI_HIDDEN(C(ffi_closure_i386_alt)) +C(ffi_closure_i386_alt): + /* See the comments above trampoline_code_table. */ + _CET_ENDBR + movl 4(%esp), %eax /* Load closure in eax */ + add $8, %esp /* Restore the stack */ + jmp C(ffi_closure_i386) +ENDF(C(ffi_closure_i386_alt)) + + .balign 16 + .globl C(ffi_closure_REGISTER_alt) + FFI_HIDDEN(C(ffi_closure_REGISTER_alt)) +C(ffi_closure_REGISTER_alt): + /* See the comments above trampoline_code_table. */ + _CET_ENDBR + movl (%esp), %eax /* Restore eax */ + add $4, %esp /* Leave closure on stack */ + jmp C(ffi_closure_REGISTER) +ENDF(C(ffi_closure_REGISTER_alt)) + + .balign 16 + .globl C(ffi_closure_STDCALL_alt) + FFI_HIDDEN(C(ffi_closure_STDCALL_alt)) +C(ffi_closure_STDCALL_alt): + /* See the comments above trampoline_code_table. */ + _CET_ENDBR + movl 4(%esp), %eax /* Load closure in eax */ + add $8, %esp /* Restore the stack */ + jmp C(ffi_closure_STDCALL) +ENDF(C(ffi_closure_STDCALL_alt)) + +/* + * Below is the definition of the trampoline code table. Each element in + * the code table is a trampoline. + * + * Because we jump to the trampoline, we place a _CET_ENDBR at the + * beginning of the trampoline to mark it as a valid branch target. This is + * part of the the Intel CET (Control Flow Enforcement Technology). + */ +/* + * The trampoline uses register eax. It saves the original value of eax on + * the stack. + * + * The trampoline has two parameters - target code to jump to and data for + * the target code. The trampoline extracts the parameters from its parameter + * block (see tramp_table_map()). The trampoline saves the data address on + * the stack. Finally, it jumps to the target code. + * + * The target code can choose to: + * + * - restore the value of eax + * - load the data address in a register + * - restore the stack pointer to what it was when the trampoline was invoked. + */ +#ifdef ENDBR_PRESENT +#define X86_DATA_OFFSET 4081 +#define X86_CODE_OFFSET 4070 +#else +#define X86_DATA_OFFSET 4085 +#define X86_CODE_OFFSET 4074 +#endif + + .align X86_TRAMP_MAP_SIZE + .globl C(trampoline_code_table) + FFI_HIDDEN(C(trampoline_code_table)) +C(trampoline_code_table): + .rept X86_TRAMP_MAP_SIZE / X86_TRAMP_SIZE + _CET_ENDBR + sub $8, %esp + movl %eax, (%esp) /* Save %eax on stack */ + call 1f /* Get next PC into %eax */ + movl X86_DATA_OFFSET(%eax), %eax /* Copy data into %eax */ + movl %eax, 4(%esp) /* Save data on stack */ + call 1f /* Get next PC into %eax */ + movl X86_CODE_OFFSET(%eax), %eax /* Copy code into %eax */ + jmp *%eax /* Jump to code */ +1: + mov (%esp), %eax + ret + .align 4 + .endr +ENDF(C(trampoline_code_table)) + .align X86_TRAMP_MAP_SIZE +#endif /* FFI_EXEC_STATIC_TRAMP */ + #if !FFI_NO_RAW_API #define raw_closure_S_FS (16+16+12) @@ -576,6 +671,7 @@ ENDF(C(ffi_closure_STDCALL)) C(ffi_closure_raw_SYSV): L(UW32): # cfi_startproc + _CET_ENDBR subl $raw_closure_S_FS, %esp L(UW33): # cfi_def_cfa_offset(raw_closure_S_FS + 4) @@ -679,6 +775,7 @@ ENDF(C(ffi_closure_raw_SYSV)) C(ffi_closure_raw_THISCALL): L(UW41): # cfi_startproc + _CET_ENDBR /* Rearrange the stack such that %ecx is the first argument. This means moving the return address. */ popl %edx @@ -1122,6 +1219,7 @@ L(EFDE9): #endif /* __APPLE__ */ #endif /* ifndef _MSC_VER */ + #endif /* ifdef __i386__ */ #if defined __ELF__ && defined __linux__ diff --git a/src/x86/sysv_intel.S b/src/x86/sysv_intel.S index 3cafd71..cccdf7d 100644 --- a/src/x86/sysv_intel.S +++ b/src/x86/sysv_intel.S @@ -1,9 +1,9 @@ /* ----------------------------------------------------------------------- - sysv.S - Copyright (c) 2017 Anthony Green + sysv.S - Copyright (c) 2017, 2022 Anthony Green - Copyright (c) 2013 The Written Word, Inc. - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc. - - X86 Foreign Function Interface + + X86 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -29,11 +29,11 @@ #ifndef __x86_64__ #ifdef _MSC_VER -#define LIBFFI_ASM +#define LIBFFI_ASM #include #include #include -#include "internal.h" +#include "internal.h" #define C2(X, Y) X ## Y #define C1(X, Y) C2(X, Y) @@ -89,8 +89,8 @@ L(UW0): perspective of the unwind info, it hasn't moved. */ mov ebp, ecx L(UW1): - // cfi_def_cfa(%ebp, 8) - // cfi_rel_offset(%ebp, 0) + /* cfi_def_cfa(%ebp, 8) */ + /* cfi_rel_offset(%ebp, 0) */ mov esp, edx /* set outgoing argument stack */ mov eax, [20+R_EAX*4+ebp] /* set register arguments */ @@ -102,7 +102,7 @@ L(UW1): mov ecx, [12+ebp] /* load return type code */ mov [ebp+8], ebx /* preserve %ebx */ L(UW2): - // cfi_rel_offset(%ebx, 8) + /* cfi_rel_offset(%ebx, 8) */ and ecx, X86_RET_TYPE_MASK lea ebx, [L(store_table) + ecx * 8] @@ -148,13 +148,13 @@ L(e1): mov esp, ebp pop ebp L(UW3): - // cfi_remember_state - // cfi_def_cfa(%esp, 4) - // cfi_restore(%ebx) - // cfi_restore(%ebp) + /* cfi_remember_state */ + /* cfi_def_cfa(%esp, 4) */ + /* cfi_restore(%ebx) */ + /* cfi_restore(%ebp) */ ret L(UW4): - // cfi_restore_state + /* cfi_restore_state */ E(L(store_table), X86_RET_STRUCTPOP) jmp L(e1) @@ -174,7 +174,7 @@ E(L(store_table), X86_RET_UNUSED15) int 3 L(UW5): - // cfi_endproc + /* cfi_endproc */ ENDF(@ffi_call_i386@8) /* The inner helper is declared as @@ -242,10 +242,10 @@ ALIGN 16 PUBLIC ffi_go_closure_EAX ffi_go_closure_EAX PROC C L(UW6): - // cfi_startproc + /* cfi_startproc */ sub esp, closure_FS L(UW7): - // cfi_def_cfa_offset(closure_FS + 4) + /* cfi_def_cfa_offset(closure_FS + 4) */ FFI_CLOSURE_SAVE_REGS mov edx, [eax+4] /* copy cif */ mov ecx, [eax +8] /* copy fun */ @@ -254,17 +254,17 @@ L(UW7): mov [esp+closure_CF+36], eax /* closure is user_data */ jmp L(do_closure_i386) L(UW8): - // cfi_endproc + /* cfi_endproc */ ENDF(ffi_go_closure_EAX) ALIGN 16 PUBLIC ffi_go_closure_ECX ffi_go_closure_ECX PROC C L(UW9): - // cfi_startproc + /* cfi_startproc */ sub esp, closure_FS L(UW10): - // cfi_def_cfa_offset(closure_FS + 4) + /* cfi_def_cfa_offset(closure_FS + 4) */ FFI_CLOSURE_SAVE_REGS mov edx, [ecx+4] /* copy cif */ mov eax, [ecx+8] /* copy fun */ @@ -273,7 +273,7 @@ L(UW10): mov [esp+closure_CF+36], ecx /* closure is user_data */ jmp L(do_closure_i386) L(UW11): - // cfi_endproc + /* cfi_endproc */ ENDF(ffi_go_closure_ECX) /* The closure entry points are reached from the ffi_closure trampoline. @@ -283,10 +283,10 @@ ALIGN 16 PUBLIC ffi_closure_i386 ffi_closure_i386 PROC C L(UW12): - // cfi_startproc + /* cfi_startproc */ sub esp, closure_FS L(UW13): - // cfi_def_cfa_offset(closure_FS + 4) + /* cfi_def_cfa_offset(closure_FS + 4) */ FFI_CLOSURE_SAVE_REGS FFI_CLOSURE_COPY_TRAMP_DATA @@ -331,17 +331,17 @@ E(L(load_table2), X86_RET_VOID) L(e2): add esp, closure_FS L(UW16): - // cfi_adjust_cfa_offset(-closure_FS) + /* cfi_adjust_cfa_offset(-closure_FS) */ ret L(UW17): - // cfi_adjust_cfa_offset(closure_FS) + /* cfi_adjust_cfa_offset(closure_FS) */ E(L(load_table2), X86_RET_STRUCTPOP) add esp, closure_FS L(UW18): - // cfi_adjust_cfa_offset(-closure_FS) + /* cfi_adjust_cfa_offset(-closure_FS) */ ret 4 L(UW19): - // cfi_adjust_cfa_offset(closure_FS) + /* cfi_adjust_cfa_offset(closure_FS) */ E(L(load_table2), X86_RET_STRUCTARG) jmp L(e2) E(L(load_table2), X86_RET_STRUCT_1B) @@ -358,17 +358,17 @@ E(L(load_table2), X86_RET_UNUSED15) int 3 L(UW20): - // cfi_endproc + /* cfi_endproc */ ENDF(ffi_closure_i386) ALIGN 16 PUBLIC ffi_go_closure_STDCALL ffi_go_closure_STDCALL PROC C L(UW21): - // cfi_startproc + /* cfi_startproc */ sub esp, closure_FS L(UW22): - // cfi_def_cfa_offset(closure_FS + 4) + /* cfi_def_cfa_offset(closure_FS + 4) */ FFI_CLOSURE_SAVE_REGS mov edx, [ecx+4] /* copy cif */ mov eax, [ecx+8] /* copy fun */ @@ -377,7 +377,7 @@ L(UW22): mov [esp+closure_CF+36], ecx /* closure is user_data */ jmp L(do_closure_STDCALL) L(UW23): - // cfi_endproc + /* cfi_endproc */ ENDF(ffi_go_closure_STDCALL) /* For REGISTER, we have no available parameter registers, and so we @@ -387,19 +387,19 @@ ALIGN 16 PUBLIC ffi_closure_REGISTER ffi_closure_REGISTER PROC C L(UW24): - // cfi_startproc - // cfi_def_cfa(%esp, 8) - // cfi_offset(%eip, -8) + /* cfi_startproc */ + /* cfi_def_cfa(%esp, 8) */ + /* cfi_offset(%eip, -8) */ sub esp, closure_FS-4 L(UW25): - // cfi_def_cfa_offset(closure_FS + 4) + /* cfi_def_cfa_offset(closure_FS + 4) */ FFI_CLOSURE_SAVE_REGS mov ecx, [esp+closure_FS-4] /* load retaddr */ mov eax, [esp+closure_FS] /* load closure */ mov [esp+closure_FS], ecx /* move retaddr */ jmp L(do_closure_REGISTER) L(UW26): - // cfi_endproc + /* cfi_endproc */ ENDF(ffi_closure_REGISTER) /* For STDCALL (and others), we need to pop N bytes of arguments off @@ -410,10 +410,10 @@ ALIGN 16 PUBLIC ffi_closure_STDCALL ffi_closure_STDCALL PROC C L(UW27): - // cfi_startproc + /* cfi_startproc */ sub esp, closure_FS L(UW28): - // cfi_def_cfa_offset(closure_FS + 4) + /* cfi_def_cfa_offset(closure_FS + 4) */ FFI_CLOSURE_SAVE_REGS @@ -504,7 +504,7 @@ E(L(load_table3), X86_RET_UNUSED15) int 3 L(UW31): - // cfi_endproc + /* cfi_endproc */ ENDF(ffi_closure_STDCALL) #if !FFI_NO_RAW_API @@ -515,13 +515,13 @@ ALIGN 16 PUBLIC ffi_closure_raw_SYSV ffi_closure_raw_SYSV PROC C L(UW32): - // cfi_startproc + /* cfi_startproc */ sub esp, raw_closure_S_FS L(UW33): - // cfi_def_cfa_offset(raw_closure_S_FS + 4) + /* cfi_def_cfa_offset(raw_closure_S_FS + 4) */ mov [esp+raw_closure_S_FS-4], ebx L(UW34): - // cfi_rel_offset(%ebx, raw_closure_S_FS-4) + /* cfi_rel_offset(%ebx, raw_closure_S_FS-4) */ mov edx, [eax+FFI_TRAMPOLINE_SIZE+8] /* load cl->user_data */ mov [esp+12], edx @@ -535,16 +535,16 @@ L(UW34): mov eax, [ebx+20] /* load cif->flags */ and eax, X86_RET_TYPE_MASK -// #ifdef __PIC__ -// call __x86.get_pc_thunk.bx -// L(pc4): -// lea ecx, L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx -// #else +/* #ifdef __PIC__ */ +/* call __x86.get_pc_thunk.bx */ +/* L(pc4): */ +/* lea ecx, L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx */ +/* #else */ lea ecx, [L(load_table4)+eax+8] -// #endif +/* #endif */ mov ebx, [esp+raw_closure_S_FS-4] L(UW35): - // cfi_restore(%ebx) + /* cfi_restore(%ebx) */ mov eax, [esp+16] /* Optimistic load */ jmp dword ptr [ecx] @@ -581,17 +581,17 @@ E(L(load_table4), X86_RET_VOID) L(e4): add esp, raw_closure_S_FS L(UW36): - // cfi_adjust_cfa_offset(-raw_closure_S_FS) + /* cfi_adjust_cfa_offset(-raw_closure_S_FS) */ ret L(UW37): - // cfi_adjust_cfa_offset(raw_closure_S_FS) + /* cfi_adjust_cfa_offset(raw_closure_S_FS) */ E(L(load_table4), X86_RET_STRUCTPOP) add esp, raw_closure_S_FS L(UW38): - // cfi_adjust_cfa_offset(-raw_closure_S_FS) + /* cfi_adjust_cfa_offset(-raw_closure_S_FS) */ ret 4 L(UW39): - // cfi_adjust_cfa_offset(raw_closure_S_FS) + /* cfi_adjust_cfa_offset(raw_closure_S_FS) */ E(L(load_table4), X86_RET_STRUCTARG) jmp L(e4) E(L(load_table4), X86_RET_STRUCT_1B) @@ -608,7 +608,7 @@ E(L(load_table4), X86_RET_UNUSED15) int 3 L(UW40): - // cfi_endproc + /* cfi_endproc */ ENDF(ffi_closure_raw_SYSV) #define raw_closure_T_FS (16+16+8) @@ -617,26 +617,26 @@ ALIGN 16 PUBLIC ffi_closure_raw_THISCALL ffi_closure_raw_THISCALL PROC C L(UW41): - // cfi_startproc + /* cfi_startproc */ /* Rearrange the stack such that %ecx is the first argument. This means moving the return address. */ pop edx L(UW42): - // cfi_def_cfa_offset(0) - // cfi_register(%eip, %edx) + /* cfi_def_cfa_offset(0) */ + /* cfi_register(%eip, %edx) */ push ecx L(UW43): - // cfi_adjust_cfa_offset(4) + /* cfi_adjust_cfa_offset(4) */ push edx L(UW44): - // cfi_adjust_cfa_offset(4) - // cfi_rel_offset(%eip, 0) + /* cfi_adjust_cfa_offset(4) */ + /* cfi_rel_offset(%eip, 0) */ sub esp, raw_closure_T_FS L(UW45): - // cfi_adjust_cfa_offset(raw_closure_T_FS) + /* cfi_adjust_cfa_offset(raw_closure_T_FS) */ mov [esp+raw_closure_T_FS-4], ebx L(UW46): - // cfi_rel_offset(%ebx, raw_closure_T_FS-4) + /* cfi_rel_offset(%ebx, raw_closure_T_FS-4) */ mov edx, [eax+FFI_TRAMPOLINE_SIZE+8] /* load cl->user_data */ mov [esp+12], edx @@ -650,16 +650,16 @@ L(UW46): mov eax, [ebx+20] /* load cif->flags */ and eax, X86_RET_TYPE_MASK -// #ifdef __PIC__ -// call __x86.get_pc_thunk.bx -// L(pc5): -// leal L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx -// #else +/* #ifdef __PIC__ */ +/* call __x86.get_pc_thunk.bx */ +/* L(pc5): */ +/* leal L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx */ +/* #else */ lea ecx, [L(load_table5)+eax*8] -//#endif +/*#endif */ mov ebx, [esp+raw_closure_T_FS-4] L(UW47): - // cfi_restore(%ebx) + /* cfi_restore(%ebx) */ mov eax, [esp+16] /* Optimistic load */ jmp DWORD PTR [ecx] @@ -696,18 +696,18 @@ E(L(load_table5), X86_RET_VOID) L(e5): add esp, raw_closure_T_FS L(UW48): - // cfi_adjust_cfa_offset(-raw_closure_T_FS) + /* cfi_adjust_cfa_offset(-raw_closure_T_FS) */ /* Remove the extra %ecx argument we pushed. */ ret 4 L(UW49): - // cfi_adjust_cfa_offset(raw_closure_T_FS) + /* cfi_adjust_cfa_offset(raw_closure_T_FS) */ E(L(load_table5), X86_RET_STRUCTPOP) add esp, raw_closure_T_FS L(UW50): - // cfi_adjust_cfa_offset(-raw_closure_T_FS) + /* cfi_adjust_cfa_offset(-raw_closure_T_FS) */ ret 8 L(UW51): - // cfi_adjust_cfa_offset(raw_closure_T_FS) + /* cfi_adjust_cfa_offset(raw_closure_T_FS) */ E(L(load_table5), X86_RET_STRUCTARG) jmp L(e5) E(L(load_table5), X86_RET_STRUCT_1B) @@ -724,7 +724,7 @@ E(L(load_table5), X86_RET_UNUSED15) int 3 L(UW52): - // cfi_endproc + /* cfi_endproc */ ENDF(ffi_closure_raw_THISCALL) #endif /* !FFI_NO_RAW_API */ @@ -743,20 +743,23 @@ ENDF(ffi_closure_raw_THISCALL) # define COMDAT(X) #endif -// #if defined(__PIC__) -// COMDAT(C(__x86.get_pc_thunk.bx)) -// C(__x86.get_pc_thunk.bx): -// movl (%esp), %ebx -// ret -// ENDF(C(__x86.get_pc_thunk.bx)) -// # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE -// COMDAT(C(__x86.get_pc_thunk.dx)) -// C(__x86.get_pc_thunk.dx): -// movl (%esp), %edx -// ret -// ENDF(C(__x86.get_pc_thunk.dx)) -// #endif /* DARWIN || HIDDEN */ -// #endif /* __PIC__ */ +#if 0 +#if defined(__PIC__) + COMDAT(C(__x86.get_pc_thunk.bx)) +C(__x86.get_pc_thunk.bx): + movl (%esp), %ebx + ret +ENDF(C(__x86.get_pc_thunk.bx)) +# if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE + COMDAT(C(__x86.get_pc_thunk.dx)) +C(__x86.get_pc_thunk.dx): + movl (%esp), %edx + ret +ENDF(C(__x86.get_pc_thunk.dx)) +#endif /* DARWIN || HIDDEN */ +#endif /* __PIC__ */ +#endif + #if 0 /* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */ @@ -992,4 +995,4 @@ L(EFDE9): #endif #endif -END \ No newline at end of file +END diff --git a/src/x86/unix64.S b/src/x86/unix64.S index 41563f5..d9c5bd4 100644 --- a/src/x86/unix64.S +++ b/src/x86/unix64.S @@ -39,7 +39,10 @@ actual table. The entry points into the table are all 8 bytes. The use of ORG asserts that we're at the correct location. */ /* ??? The clang assembler doesn't handle .org with symbolic expressions. */ -#if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) +#ifdef __CET__ +/* Double slot size to 16 byte to add 4 bytes of ENDBR64. */ +# define E(BASE, X) .balign 8; .org BASE + X * 16 +#elif defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) # define E(BASE, X) .balign 8 #else # define E(BASE, X) .balign 8; .org BASE + X * 8 @@ -58,6 +61,7 @@ C(ffi_call_unix64): L(UW0): + _CET_ENDBR movq (%rsp), %r10 /* Load return address. */ leaq (%rdi, %rsi), %rax /* Find local stack base. */ movq %rdx, (%rax) /* Save flags. */ @@ -79,7 +83,6 @@ L(UW1): movq %rdi, %r10 /* Save a copy of the register area. */ movq %r8, %r11 /* Save a copy of the target fn. */ - movl %r9d, %eax /* Set number of SSE registers. */ /* Load up all argument registers. */ movq (%r10), %rdi @@ -88,7 +91,7 @@ L(UW1): movq 0x18(%r10), %rcx movq 0x20(%r10), %r8 movq 0x28(%r10), %r9 - movl 0xb0(%r10), %eax + movl 0xb0(%r10), %eax /* Set number of SSE registers. */ testl %eax, %eax jnz L(load_sse) L(ret_from_load_sse): @@ -116,6 +119,11 @@ L(UW2): movzbl %cl, %r10d leaq L(store_table)(%rip), %r11 ja L(sa) +#ifdef __CET__ + /* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 + + 4 bytes NOP padding double slot size to 16 bytes. */ + addl %r10d, %r10d +#endif leaq (%r11, %r10, 8), %r10 /* Prep for the structure cases: scratch area in redzone. */ @@ -125,57 +133,73 @@ L(UW2): .balign 8 L(store_table): E(L(store_table), UNIX64_RET_VOID) + _CET_ENDBR ret E(L(store_table), UNIX64_RET_UINT8) + _CET_ENDBR movzbl %al, %eax movq %rax, (%rdi) ret E(L(store_table), UNIX64_RET_UINT16) + _CET_ENDBR movzwl %ax, %eax movq %rax, (%rdi) ret E(L(store_table), UNIX64_RET_UINT32) + _CET_ENDBR movl %eax, %eax movq %rax, (%rdi) ret E(L(store_table), UNIX64_RET_SINT8) + _CET_ENDBR movsbq %al, %rax movq %rax, (%rdi) ret E(L(store_table), UNIX64_RET_SINT16) + _CET_ENDBR movswq %ax, %rax movq %rax, (%rdi) ret E(L(store_table), UNIX64_RET_SINT32) + _CET_ENDBR cltq movq %rax, (%rdi) ret E(L(store_table), UNIX64_RET_INT64) + _CET_ENDBR movq %rax, (%rdi) ret E(L(store_table), UNIX64_RET_XMM32) + _CET_ENDBR movd %xmm0, (%rdi) ret E(L(store_table), UNIX64_RET_XMM64) + _CET_ENDBR movq %xmm0, (%rdi) ret E(L(store_table), UNIX64_RET_X87) + _CET_ENDBR fstpt (%rdi) ret E(L(store_table), UNIX64_RET_X87_2) + _CET_ENDBR fstpt (%rdi) fstpt 16(%rdi) ret E(L(store_table), UNIX64_RET_ST_XMM0_RAX) + _CET_ENDBR movq %rax, 8(%rsi) jmp L(s3) E(L(store_table), UNIX64_RET_ST_RAX_XMM0) + _CET_ENDBR movq %xmm0, 8(%rsi) jmp L(s2) E(L(store_table), UNIX64_RET_ST_XMM0_XMM1) + _CET_ENDBR movq %xmm1, 8(%rsi) jmp L(s3) E(L(store_table), UNIX64_RET_ST_RAX_RDX) + _CET_ENDBR movq %rdx, 8(%rsi) L(s2): movq %rax, (%rsi) @@ -227,6 +251,7 @@ ENDF(C(ffi_call_unix64)) C(ffi_closure_unix64_sse): L(UW5): + _CET_ENDBR subq $ffi_closure_FS, %rsp L(UW6): /* cfi_adjust_cfa_offset(ffi_closure_FS) */ @@ -250,6 +275,7 @@ ENDF(C(ffi_closure_unix64_sse)) C(ffi_closure_unix64): L(UW8): + _CET_ENDBR subq $ffi_closure_FS, %rsp L(UW9): /* cfi_adjust_cfa_offset(ffi_closure_FS) */ @@ -286,6 +312,11 @@ L(UW10): movzbl %al, %r10d leaq L(load_table)(%rip), %r11 ja L(la) +#ifdef __CET__ + /* NB: Originally, each slot is 8 byte. 4 bytes of ENDBR64 + + 4 bytes NOP padding double slot size to 16 bytes. */ + addl %r10d, %r10d +#endif leaq (%r11, %r10, 8), %r10 leaq ffi_closure_RED_RVALUE(%rsp), %rsi jmp *%r10 @@ -293,51 +324,67 @@ L(UW10): .balign 8 L(load_table): E(L(load_table), UNIX64_RET_VOID) + _CET_ENDBR ret E(L(load_table), UNIX64_RET_UINT8) + _CET_ENDBR movzbl (%rsi), %eax ret E(L(load_table), UNIX64_RET_UINT16) + _CET_ENDBR movzwl (%rsi), %eax ret E(L(load_table), UNIX64_RET_UINT32) + _CET_ENDBR movl (%rsi), %eax ret E(L(load_table), UNIX64_RET_SINT8) + _CET_ENDBR movsbl (%rsi), %eax ret E(L(load_table), UNIX64_RET_SINT16) + _CET_ENDBR movswl (%rsi), %eax ret E(L(load_table), UNIX64_RET_SINT32) + _CET_ENDBR movl (%rsi), %eax ret E(L(load_table), UNIX64_RET_INT64) + _CET_ENDBR movq (%rsi), %rax ret E(L(load_table), UNIX64_RET_XMM32) + _CET_ENDBR movd (%rsi), %xmm0 ret E(L(load_table), UNIX64_RET_XMM64) + _CET_ENDBR movq (%rsi), %xmm0 ret E(L(load_table), UNIX64_RET_X87) + _CET_ENDBR fldt (%rsi) ret E(L(load_table), UNIX64_RET_X87_2) + _CET_ENDBR fldt 16(%rsi) fldt (%rsi) ret E(L(load_table), UNIX64_RET_ST_XMM0_RAX) + _CET_ENDBR movq 8(%rsi), %rax jmp L(l3) E(L(load_table), UNIX64_RET_ST_RAX_XMM0) + _CET_ENDBR movq 8(%rsi), %xmm0 jmp L(l2) E(L(load_table), UNIX64_RET_ST_XMM0_XMM1) + _CET_ENDBR movq 8(%rsi), %xmm1 jmp L(l3) E(L(load_table), UNIX64_RET_ST_RAX_RDX) + _CET_ENDBR movq 8(%rsi), %rdx L(l2): movq (%rsi), %rax @@ -358,6 +405,7 @@ ENDF(C(ffi_closure_unix64)) C(ffi_go_closure_unix64_sse): L(UW12): + _CET_ENDBR subq $ffi_closure_FS, %rsp L(UW13): /* cfi_adjust_cfa_offset(ffi_closure_FS) */ @@ -381,6 +429,7 @@ ENDF(C(ffi_go_closure_unix64_sse)) C(ffi_go_closure_unix64): L(UW15): + _CET_ENDBR subq $ffi_closure_FS, %rsp L(UW16): /* cfi_adjust_cfa_offset(ffi_closure_FS) */ @@ -406,6 +455,97 @@ L(sse_entry2): L(UW17): ENDF(C(ffi_go_closure_unix64)) +#if defined(FFI_EXEC_STATIC_TRAMP) + .balign 8 + .globl C(ffi_closure_unix64_sse_alt) + FFI_HIDDEN(C(ffi_closure_unix64_sse_alt)) + +C(ffi_closure_unix64_sse_alt): + /* See the comments above trampoline_code_table. */ + _CET_ENDBR + movq 8(%rsp), %r10 /* Load closure in r10 */ + addq $16, %rsp /* Restore the stack */ + jmp C(ffi_closure_unix64_sse) +ENDF(C(ffi_closure_unix64_sse_alt)) + + .balign 8 + .globl C(ffi_closure_unix64_alt) + FFI_HIDDEN(C(ffi_closure_unix64_alt)) + +C(ffi_closure_unix64_alt): + /* See the comments above trampoline_code_table. */ + _CET_ENDBR + movq 8(%rsp), %r10 /* Load closure in r10 */ + addq $16, %rsp /* Restore the stack */ + jmp C(ffi_closure_unix64) + ENDF(C(ffi_closure_unix64_alt)) + +/* + * Below is the definition of the trampoline code table. Each element in + * the code table is a trampoline. + * + * Because we jump to the trampoline, we place a _CET_ENDBR at the + * beginning of the trampoline to mark it as a valid branch target. This is + * part of the the Intel CET (Control Flow Enforcement Technology). + */ +/* + * The trampoline uses register r10. It saves the original value of r10 on + * the stack. + * + * The trampoline has two parameters - target code to jump to and data for + * the target code. The trampoline extracts the parameters from its parameter + * block (see tramp_table_map()). The trampoline saves the data address on + * the stack. Finally, it jumps to the target code. + * + * The target code can choose to: + * + * - restore the value of r10 + * - load the data address in a register + * - restore the stack pointer to what it was when the trampoline was invoked. + */ +#ifdef ENDBR_PRESENT +# define X86_DATA_OFFSET 4077 +# ifdef __ILP32__ +# define X86_CODE_OFFSET 4069 +# else +# define X86_CODE_OFFSET 4073 +# endif +#else +# define X86_DATA_OFFSET 4081 +# ifdef __ILP32__ +# define X86_CODE_OFFSET 4073 +# else +# define X86_CODE_OFFSET 4077 +# endif +#endif + + .align UNIX64_TRAMP_MAP_SIZE + .globl trampoline_code_table + FFI_HIDDEN(C(trampoline_code_table)) + +C(trampoline_code_table): + .rept UNIX64_TRAMP_MAP_SIZE / UNIX64_TRAMP_SIZE + _CET_ENDBR + subq $16, %rsp /* Make space on the stack */ + movq %r10, (%rsp) /* Save %r10 on stack */ +#ifdef __ILP32__ + movl X86_DATA_OFFSET(%rip), %r10d /* Copy data into %r10 */ +#else + movq X86_DATA_OFFSET(%rip), %r10 /* Copy data into %r10 */ +#endif + movq %r10, 8(%rsp) /* Save data on stack */ +#ifdef __ILP32__ + movl X86_CODE_OFFSET(%rip), %r10d /* Copy code into %r10 */ +#else + movq X86_CODE_OFFSET(%rip), %r10 /* Copy code into %r10 */ +#endif + jmp *%r10 /* Jump to code */ + .align 8 + .endr +ENDF(C(trampoline_code_table)) + .align UNIX64_TRAMP_MAP_SIZE +#endif /* FFI_EXEC_STATIC_TRAMP */ + /* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */ #ifdef __APPLE__ @@ -424,7 +564,12 @@ EHFrame0: #endif /* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */ -#define ADV(N, P) .byte 2, L(N)-L(P) +#ifdef __CET__ +/* Use DW_CFA_advance_loc2 when IBT is enabled. */ +# define ADV(N, P) .byte 3; .2byte L(N)-L(P) +#else +# define ADV(N, P) .byte 2, L(N)-L(P) +#endif .balign 8 L(CIE): diff --git a/src/x86/win64.S b/src/x86/win64.S index 2c334c8..58ec6a1 100644 --- a/src/x86/win64.S +++ b/src/x86/win64.S @@ -30,7 +30,7 @@ #if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) # define E(BASE, X) .balign 8 #else -# define E(BASE, X) .balign 8; .org BASE + X * 8 +# define E(BASE, X) .balign 8; .org BASE + (X) * 8 #endif .text @@ -48,6 +48,7 @@ SEH(.seh_proc ffi_call_win64) C(ffi_call_win64): cfi_startproc + _CET_ENDBR /* Set up the local stack frame and install it in rbp/rsp. */ movq (%rsp), %rax movq %rbp, (arg1) @@ -80,18 +81,17 @@ C(ffi_call_win64): cmpl $FFI_TYPE_SMALL_STRUCT_4B, %ecx leaq (%r10, %rcx, 8), %r10 ja 99f - jmp *%r10 + _CET_NOTRACK jmp *%r10 /* Below, we're space constrained most of the time. Thus we eschew the modern "mov, pop, ret" sequence (5 bytes) for "leave, ret" (2 bytes). */ -.macro epilogue - leaveq - cfi_remember_state - cfi_def_cfa(%rsp, 8) - cfi_restore(%rbp) - ret +#define epilogue \ + leaveq; \ + cfi_remember_state; \ + cfi_def_cfa(%rsp, 8); \ + cfi_restore(%rbp); \ + ret; \ cfi_restore_state -.endm .align 8 0: @@ -107,7 +107,8 @@ E(0b, FFI_TYPE_FLOAT) E(0b, FFI_TYPE_DOUBLE) movsd %xmm0, (%r8) epilogue -E(0b, FFI_TYPE_LONGDOUBLE) +// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here. +E(0b, FFI_TYPE_DOUBLE + 1) call PLT(C(abort)) E(0b, FFI_TYPE_UINT8) movzbl %al, %eax @@ -176,6 +177,7 @@ E(0b, FFI_TYPE_SMALL_STRUCT_4B) SEH(.seh_proc ffi_go_closure_win64) C(ffi_go_closure_win64): cfi_startproc + _CET_ENDBR /* Save all integer arguments into the incoming reg stack space. */ movq %rcx, 8(%rsp) movq %rdx, 16(%rsp) @@ -196,6 +198,7 @@ C(ffi_go_closure_win64): SEH(.seh_proc ffi_closure_win64) C(ffi_closure_win64): cfi_startproc + _CET_ENDBR /* Save all integer arguments into the incoming reg stack space. */ movq %rcx, 8(%rsp) movq %rdx, 16(%rsp) @@ -230,6 +233,20 @@ C(ffi_closure_win64): cfi_endproc SEH(.seh_endproc) + +#if defined(FFI_EXEC_STATIC_TRAMP) + .align 8 + .globl C(ffi_closure_win64_alt) + FFI_HIDDEN(C(ffi_closure_win64_alt)) + + SEH(.seh_proc ffi_closure_win64_alt) +C(ffi_closure_win64_alt): + _CET_ENDBR + movq 8(%rsp), %r10 + addq $16, %rsp + jmp C(ffi_closure_win64) + SEH(.seh_endproc) +#endif #endif /* __x86_64__ */ #if defined __ELF__ && defined __linux__ diff --git a/src/x86/win64_intel.S b/src/x86/win64_intel.S index 7df78b3..970a4f9 100644 --- a/src/x86/win64_intel.S +++ b/src/x86/win64_intel.S @@ -29,7 +29,7 @@ #if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__)) # define E(BASE, X) ALIGN 8 #else -# define E(BASE, X) ALIGN 8; ORG BASE + X * 8 +# define E(BASE, X) ALIGN 8; ORG BASE + (X) * 8 #endif .CODE @@ -107,7 +107,8 @@ E(0b, FFI_TYPE_FLOAT) E(0b, FFI_TYPE_DOUBLE) movsd qword ptr[r8], xmm0; movsd %xmm0, (%r8) epilogue -E(0b, FFI_TYPE_LONGDOUBLE) +// FFI_TYPE_LONGDOUBLE may be FFI_TYPE_DOUBLE but we need a different value here. +E(0b, FFI_TYPE_DOUBLE + 1) call PLT(C(abort)) E(0b, FFI_TYPE_UINT8) movzx eax, al ;movzbl %al, %eax diff --git a/src/xtensa/ffi.c b/src/xtensa/ffi.c index 9a0575f..82b42a1 100644 --- a/src/xtensa/ffi.c +++ b/src/xtensa/ffi.c @@ -86,11 +86,16 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) break; } - /* Round the stack up to a full 4 register frame, just in case - (we use this size in movsp). This way, it's also a multiple of - 8 bytes for 64-bit arguments. */ - cif->bytes = FFI_ALIGN(cif->bytes, 16); - + /* Round up stack size needed for arguments. + Allocate FFI_REGISTER_ARGS_SPACE bytes when there are only arguments + passed in registers, round space reserved for arguments passed on stack + up to ABI-specified alignment. */ + if (cif->bytes < FFI_REGISTER_NARGS * 4) + cif->bytes = FFI_REGISTER_ARGS_SPACE; + else + cif->bytes = FFI_REGISTER_ARGS_SPACE + + FFI_ALIGN(cif->bytes - FFI_REGISTER_NARGS * 4, + XTENSA_STACK_ALIGNMENT); return FFI_OK; } @@ -232,6 +237,9 @@ ffi_prep_closure_loc (ffi_closure* closure, void *user_data, void *codeloc) { + if (cif->abi != FFI_SYSV) + return FFI_BAD_ABI; + /* copye trampoline to stack and patch 'ffi_closure_SYSV' pointer */ memcpy(closure->tramp, ffi_trampoline, FFI_TRAMPOLINE_SIZE); *(unsigned int*)(&closure->tramp[8]) = (unsigned int)ffi_closure_SYSV; @@ -277,15 +285,15 @@ ffi_closure_SYSV_inner(ffi_closure *closure, void **values, void *rvalue) if (arg_types[i]->alignment == 8 && (areg & 1) != 0) areg++; - // skip the entry 16,a1 framework, add 16 bytes (4 registers) + // skip the entry a1, * framework, see ffi_trampoline if (areg == FFI_REGISTER_NARGS) - areg += 4; + areg = (FFI_REGISTER_ARGS_SPACE + 32) / 4; if (arg_types[i]->type == FFI_TYPE_STRUCT) { int numregs = ((arg_types[i]->size + 3) & ~3) / 4; if (areg < FFI_REGISTER_NARGS && areg + numregs > FFI_REGISTER_NARGS) - areg = FFI_REGISTER_NARGS + 4; + areg = (FFI_REGISTER_ARGS_SPACE + 32) / 4; } avalue[i] = &values[areg]; diff --git a/src/xtensa/ffitarget.h b/src/xtensa/ffitarget.h index 0ba728b..4231ed3 100644 --- a/src/xtensa/ffitarget.h +++ b/src/xtensa/ffitarget.h @@ -43,6 +43,10 @@ typedef enum ffi_abi { #endif #define FFI_REGISTER_NARGS 6 +#define XTENSA_STACK_ALIGNMENT 16 +#define FFI_REGISTER_ARGS_SPACE ((FFI_REGISTER_NARGS * 4 + \ + XTENSA_STACK_ALIGNMENT - 1) & \ + -XTENSA_STACK_ALIGNMENT) /* ---- Definitions for closures ----------------------------------------- */ diff --git a/src/xtensa/sysv.S b/src/xtensa/sysv.S index e942179..70e83ac 100644 --- a/src/xtensa/sysv.S +++ b/src/xtensa/sysv.S @@ -43,6 +43,9 @@ #error "xtensa/sysv.S out of sync with ffi.h" #endif +#define FFI_REGISTER_ARGS_OFFSET ((XTENSA_STACK_ALIGNMENT - \ + FFI_REGISTER_NARGS * 4) & \ + (XTENSA_STACK_ALIGNMENT - 1)) /* ffi_call_SYSV (rvalue, rbytes, flags, (*fnaddr)(), bytes, ecif) void *rvalue; a2 @@ -62,28 +65,28 @@ ENTRY(ffi_call_SYSV) mov a7, a1 # fp movsp a1, a11 # set new sp = old_sp - bytes + # align ffi_prep_args stack argument so that arguments + # passed on stack if any start on 16-byte aligned boundary + + addi a11, a11, FFI_REGISTER_ARGS_OFFSET + movi a8, ffi_prep_args callx8 a8 # ffi_prep_args(ecif, stack) - # prepare to move stack pointer back up to 6 arguments - # note that 'bytes' is already aligned - - movi a10, 6*4 - sub a11, a6, a10 - movgez a6, a10, a11 - add a6, a1, a6 + # prepare to move stack pointer back + # to point to arguments passed on stack + addi a6, a1, FFI_REGISTER_ARGS_SPACE # we can pass up to 6 arguments in registers # for simplicity, just load 6 arguments - # (the stack size is at least 32 bytes, so no risk to cross boundaries) - l32i a10, a1, 0 - l32i a11, a1, 4 - l32i a12, a1, 8 - l32i a13, a1, 12 - l32i a14, a1, 16 - l32i a15, a1, 20 + l32i a10, a1, FFI_REGISTER_ARGS_OFFSET + 0 + l32i a11, a1, FFI_REGISTER_ARGS_OFFSET + 4 + l32i a12, a1, FFI_REGISTER_ARGS_OFFSET + 8 + l32i a13, a1, FFI_REGISTER_ARGS_OFFSET + 12 + l32i a14, a1, FFI_REGISTER_ARGS_OFFSET + 16 + l32i a15, a1, FFI_REGISTER_ARGS_OFFSET + 20 # move stack pointer @@ -167,7 +170,7 @@ END(ffi_call_SYSV) ENTRY(ffi_cacheflush) - entry a1, 16 + entry a1, 32 1: #if XCHAL_DCACHE_SIZE @@ -187,7 +190,14 @@ END(ffi_cacheflush) ENTRY(ffi_trampoline) - entry a1, 16 + (FFI_REGISTER_NARGS * 4) + (4 * 4) # [ 0] + /* 32 bytes for spill + spill overflow area of a frame that uses + call8, + FFI_REGISTER_NARGS * 4 bytes for arguments passed in registers, + aligned up to 4 to maintain 16 byte stack alignment, + 4 * 4 bytes for the result. + This size must be in sync with ffi_closure_SYSV_inner logic. + */ + entry a1, 32 + FFI_REGISTER_ARGS_SPACE + (4 * 4) # [ 0] j 2f # [ 3] .align 4 # [ 6] 1: .long 0 # [ 8] diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index bcfea57..c4331b1 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -6,117 +6,128 @@ EXTRA_DEJAGNU_SITE_CONFIG=../local.exp CLEANFILES = *.exe core* *.log *.sum -EXTRA_DIST = lib/target-libpath.exp lib/libffi.exp lib/wrapper.exp \ -libffi.call/strlen4.c libffi.call/struct10.c libffi.call/many_mixed.c \ -libffi.call/float.c libffi.call/struct5.c libffi.call/return_fl3.c \ -libffi.call/return_fl1.c libffi.call/call.exp libffi.call/pyobjc-tc.c \ -libffi.call/float_va.c libffi.call/struct8.c libffi.call/pr1172638.c \ -libffi.call/return_sc.c libffi.call/va_struct1.c \ -libffi.call/align_stdcall.c libffi.call/struct9.c libffi.call/va_1.c \ -libffi.call/va_struct2.c libffi.call/return_fl2.c \ -libffi.call/align_mixed.c libffi.call/ffitest.h libffi.call/struct4.c \ -libffi.call/return_ldl.c libffi.call/float3.c libffi.call/return_sl.c \ -libffi.call/return_dbl1.c libffi.call/err_bad_typedef.c \ -libffi.call/return_ll1.c libffi.call/return_dbl2.c \ -libffi.call/negint.c libffi.closures/nested_struct3.c \ -libffi.call/struct2.c libffi.call/struct3.c libffi.call/return_fl.c \ -libffi.call/offsets.c libffi.call/struct7.c libffi.call/va_struct3.c \ -libffi.call/float1.c libffi.call/uninitialized.c libffi.call/many2.c \ -libffi.call/struct6.c libffi.call/strlen2.c libffi.call/float2.c \ -libffi.call/return_ul.c libffi.call/struct1.c libffi.call/strlen3.c \ -libffi.call/return_dbl.c libffi.call/float4.c libffi.call/many.c \ -libffi.call/strlen.c libffi.call/return_uc.c libffi.call/many_double.c \ -libffi.call/return_ll.c libffi.call/promotion.c \ -libffi.complex/complex_defs_longdouble.inc \ -libffi.complex/cls_align_complex_float.c \ -libffi.complex/cls_complex_va_float.c \ -libffi.complex/cls_complex_struct_float.c \ -libffi.complex/return_complex2_longdouble.c \ -libffi.complex/cls_complex_float.c \ -libffi.complex/return_complex_longdouble.c \ -libffi.complex/return_complex2_float.c libffi.complex/cls_complex.inc \ -libffi.complex/cls_complex_va_longdouble.c \ -libffi.complex/return_complex_double.c \ -libffi.complex/return_complex.inc libffi.complex/many_complex.inc \ -libffi.complex/complex_float.c libffi.complex/cls_align_complex.inc \ -libffi.complex/return_complex2_double.c \ -libffi.complex/many_complex_float.c libffi.complex/ffitest.h \ -libffi.complex/return_complex1_double.c \ -libffi.complex/cls_complex_struct_longdouble.c \ -libffi.complex/complex_defs_double.inc \ -libffi.complex/cls_complex_va_double.c \ -libffi.complex/many_complex_double.c \ -libffi.complex/return_complex2.inc \ -libffi.complex/return_complex1_float.c \ -libffi.complex/complex_longdouble.c \ -libffi.complex/complex_defs_float.inc \ -libffi.complex/cls_complex_double.c \ -libffi.complex/cls_align_complex_double.c \ -libffi.complex/cls_align_complex_longdouble.c \ -libffi.complex/complex_double.c libffi.complex/cls_complex_va.inc \ -libffi.complex/many_complex_longdouble.c libffi.complex/complex.inc \ -libffi.complex/return_complex1_longdouble.c \ -libffi.complex/complex_int.c libffi.complex/cls_complex_longdouble.c \ -libffi.complex/cls_complex_struct_double.c \ -libffi.complex/return_complex1.inc libffi.complex/complex.exp \ -libffi.complex/cls_complex_struct.inc \ -libffi.complex/return_complex_float.c libffi.go/closure1.c \ -libffi.go/aa-direct.c libffi.go/ffitest.h libffi.go/go.exp \ -libffi.go/static-chain.h libffi.bhaible/bhaible.exp \ -libffi.bhaible/test-call.c libffi.bhaible/alignof.h \ -libffi.bhaible/testcases.c libffi.bhaible/test-callback.c \ -libffi.bhaible/Makefile libffi.bhaible/README config/default.exp \ -libffi.closures/cls_multi_sshort.c \ -libffi.closures/cls_align_longdouble_split2.c \ -libffi.closures/cls_1_1byte.c libffi.closures/cls_uint_va.c \ -libffi.closures/cls_3_1byte.c libffi.closures/cls_many_mixed_args.c \ -libffi.closures/cls_20byte1.c libffi.closures/cls_pointer_stack.c \ -libffi.closures/cls_align_float.c libffi.closures/cls_5_1_byte.c \ -libffi.closures/cls_9byte1.c libffi.closures/cls_align_uint32.c \ -libffi.closures/stret_medium.c libffi.closures/cls_3byte1.c \ -libffi.closures/cls_align_uint64.c libffi.closures/cls_longdouble_va.c \ -libffi.closures/cls_align_pointer.c libffi.closures/cls_19byte.c \ -libffi.closures/cls_ushort.c libffi.closures/cls_align_sint32.c \ -libffi.closures/cls_ulonglong.c libffi.closures/cls_struct_va1.c \ -libffi.closures/cls_9byte2.c libffi.closures/closure_fn5.c \ -libffi.closures/cls_5byte.c libffi.closures/cls_3float.c \ -libffi.closures/closure.exp libffi.closures/cls_schar.c \ -libffi.closures/closure_fn4.c libffi.closures/cls_uchar_va.c \ -libffi.closures/closure_fn0.c libffi.closures/huge_struct.c \ -libffi.closures/cls_ushort_va.c \ -libffi.closures/cls_64byte.c libffi.closures/cls_longdouble.c \ -libffi.closures/cls_ulong_va.c libffi.closures/cls_6_1_byte.c \ -libffi.closures/cls_align_uint16.c libffi.closures/closure_fn2.c \ -libffi.closures/unwindtest_ffi_call.cc \ -libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_8byte.c \ -libffi.closures/ffitest.h libffi.closures/nested_struct8.c \ -libffi.closures/cls_pointer.c libffi.closures/nested_struct2.c \ -libffi.closures/nested_struct.c libffi.closures/cls_multi_schar.c \ -libffi.closures/cls_align_longdouble_split.c \ -libffi.closures/cls_uchar.c libffi.closures/nested_struct9.c \ -libffi.closures/cls_float.c libffi.closures/stret_medium2.c \ -libffi.closures/closure_loc_fn0.c libffi.closures/cls_6byte.c \ -libffi.closures/closure_simple.c libffi.closures/cls_align_double.c \ -libffi.closures/cls_multi_uchar.c libffi.closures/cls_4_1byte.c \ -libffi.closures/closure_fn3.c libffi.closures/cls_align_sint64.c \ -libffi.closures/nested_struct1.c libffi.closures/unwindtest.cc \ -libffi.closures/nested_struct5.c libffi.closures/cls_multi_ushort.c \ -libffi.closures/nested_struct11.c \ -libffi.closures/cls_multi_sshortchar.c \ -libffi.closures/cls_align_longdouble.c \ -libffi.closures/cls_dbls_struct.c \ -libffi.closures/cls_many_mixed_float_double.c \ -libffi.closures/stret_large.c libffi.closures/stret_large2.c \ -libffi.closures/cls_align_sint16.c libffi.closures/cls_2byte.c \ -libffi.closures/nested_struct4.c libffi.closures/problem1.c \ -libffi.closures/testclosure.c libffi.closures/nested_struct6.c \ -libffi.closures/cls_4byte.c libffi.closures/cls_24byte.c \ -libffi.closures/nested_struct10.c libffi.closures/cls_uint.c \ -libffi.closures/cls_12byte.c libffi.closures/cls_sint.c \ -libffi.closures/cls_7_1_byte.c libffi.closures/cls_sshort.c \ -libffi.closures/cls_16byte.c libffi.closures/nested_struct7.c \ -libffi.closures/cls_double_va.c libffi.closures/cls_3byte2.c \ -libffi.closures/cls_double.c libffi.closures/cls_7byte.c \ -libffi.closures/closure_fn6.c libffi.closures/closure_fn1.c \ -libffi.closures/cls_20byte.c libffi.closures/cls_18byte.c \ -libffi.closures/err_bad_abi.c +EXTRA_DIST = config/default.exp lib/libffi.exp lib/target-libpath.exp \ +lib/wrapper.exp libffi.bhaible/Makefile libffi.bhaible/README \ +libffi.bhaible/alignof.h libffi.bhaible/bhaible.exp \ +libffi.bhaible/test-call.c libffi.bhaible/test-callback.c \ +libffi.bhaible/testcases.c libffi.call/align_mixed.c \ +libffi.call/align_stdcall.c libffi.call/call.exp \ +libffi.call/err_bad_typedef.c libffi.call/ffitest.h \ +libffi.call/float.c libffi.call/float1.c libffi.call/float2.c \ +libffi.call/float3.c libffi.call/float4.c libffi.call/float_va.c \ +libffi.call/many.c libffi.call/many2.c libffi.call/many_double.c \ +libffi.call/many_mixed.c libffi.call/negint.c libffi.call/offsets.c \ +libffi.call/pr1172638.c libffi.call/promotion.c \ +libffi.call/pyobjc_tc.c libffi.call/return_dbl.c \ +libffi.call/return_dbl1.c libffi.call/return_dbl2.c \ +libffi.call/return_fl.c libffi.call/return_fl1.c \ +libffi.call/return_fl2.c libffi.call/return_fl3.c \ +libffi.call/return_ldl.c libffi.call/return_ll.c \ +libffi.call/return_ll1.c libffi.call/return_sc.c \ +libffi.call/return_sl.c libffi.call/return_uc.c \ +libffi.call/return_ul.c libffi.call/struct1.c libffi.call/struct10.c \ +libffi.call/struct2.c libffi.call/struct3.c libffi.call/struct4.c \ +libffi.call/struct5.c libffi.call/struct6.c libffi.call/struct7.c \ +libffi.call/struct8.c libffi.call/struct9.c \ +libffi.call/uninitialized.c libffi.call/va_1.c libffi.call/va_2.c \ +libffi.call/va_3.c libffi.call/va_struct1.c libffi.call/va_struct2.c \ +libffi.call/va_struct3.c libffi.call/struct_by_value_big.c \ +libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \ +libffi.call/struct_by_value_4.c libffi.call/struct_by_value_small.c \ +libffi.call/strlen2.c libffi.call/strlen3.c libffi.call/strlen4.c \ +libffi.call/strlen.c libffi.call/va_3.c \ +libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \ +libffi.call/struct_by_value_4.c libffi.closures/closure.exp \ +libffi.call/s55.c libffi.call/bpo-38748.c \ +libffi.closures/closure_fn0.c libffi.closures/closure_fn1.c \ +libffi.closures/closure_fn2.c libffi.closures/closure_fn3.c \ +libffi.closures/closure_fn4.c libffi.closures/closure_fn5.c \ +libffi.closures/closure_fn6.c libffi.closures/closure_loc_fn0.c \ +libffi.closures/closure_simple.c libffi.closures/cls_12byte.c \ +libffi.closures/cls_16byte.c libffi.closures/cls_18byte.c \ +libffi.closures/cls_19byte.c libffi.closures/cls_1_1byte.c \ +libffi.closures/cls_20byte.c libffi.closures/cls_20byte1.c \ +libffi.closures/cls_24byte.c libffi.closures/cls_2byte.c \ +libffi.closures/cls_3_1byte.c libffi.closures/cls_3byte1.c \ +libffi.closures/cls_3byte2.c libffi.closures/cls_3float.c \ +libffi.closures/cls_4_1byte.c libffi.closures/cls_4byte.c \ +libffi.closures/cls_5_1_byte.c libffi.closures/cls_5byte.c \ +libffi.closures/cls_64byte.c libffi.closures/cls_6_1_byte.c \ +libffi.closures/cls_6byte.c libffi.closures/cls_7_1_byte.c \ +libffi.closures/cls_7byte.c libffi.closures/cls_8byte.c \ +libffi.closures/cls_9byte1.c libffi.closures/cls_9byte2.c \ +libffi.closures/cls_align_double.c libffi.closures/cls_align_float.c \ +libffi.closures/cls_align_longdouble.c \ +libffi.closures/cls_align_pointer.c \ +libffi.closures/cls_align_sint16.c libffi.closures/cls_align_sint32.c \ +libffi.closures/cls_align_sint64.c libffi.closures/cls_align_uint16.c \ +libffi.closures/cls_align_uint32.c libffi.closures/cls_align_uint64.c \ +libffi.closures/cls_dbls_struct.c libffi.closures/cls_double.c \ +libffi.closures/cls_double_va.c libffi.closures/cls_float.c \ +libffi.closures/cls_longdouble_va.c \ +libffi.closures/cls_many_mixed_args.c \ +libffi.closures/cls_many_mixed_float_double.c \ +libffi.closures/cls_multi_schar.c libffi.closures/cls_multi_sshort.c \ +libffi.closures/cls_multi_sshortchar.c \ +libffi.closures/cls_multi_uchar.c libffi.closures/cls_multi_ushort.c \ +libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_pointer.c \ +libffi.closures/cls_pointer_stack.c libffi.closures/cls_schar.c \ +libffi.closures/cls_sint.c libffi.closures/cls_sshort.c \ +libffi.closures/cls_struct_va1.c libffi.closures/cls_uchar.c \ +libffi.closures/cls_uint.c libffi.closures/cls_uint_va.c \ +libffi.closures/cls_ulong_va.c libffi.closures/cls_ulonglong.c \ +libffi.closures/cls_ushort.c libffi.closures/err_bad_abi.c \ +libffi.closures/ffitest.h libffi.closures/nested_struct.c \ +libffi.closures/nested_struct1.c libffi.closures/nested_struct10.c \ +libffi.closures/nested_struct11.c libffi.closures/nested_struct12.c \ +libffi.closures/nested_struct13.c libffi.closures/nested_struct2.c \ +libffi.closures/nested_struct3.c libffi.closures/nested_struct4.c \ +libffi.closures/nested_struct5.c libffi.closures/nested_struct6.c \ +libffi.closures/nested_struct7.c libffi.closures/nested_struct8.c \ +libffi.closures/nested_struct9.c libffi.closures/problem1.c \ +libffi.closures/single_entry_structs1.c \ +libffi.closures/single_entry_structs2.c \ +libffi.closures/single_entry_structs3.c libffi.closures/stret_large.c \ +libffi.closures/stret_large2.c libffi.closures/stret_medium.c \ +libffi.closures/stret_medium2.c libffi.closures/testclosure.c \ +libffi.closures/unwindtest.cc libffi.closures/unwindtest_ffi_call.cc \ +libffi.closures/cls_align_longdouble_split.c \ +libffi.closures/cls_align_longdouble_split2.c \ +libffi.closures/cls_longdouble.c libffi.closures/huge_struct.c \ +libffi.complex/cls_align_complex.inc \ +libffi.complex/cls_align_complex_double.c \ +libffi.complex/cls_align_complex_float.c \ +libffi.complex/cls_align_complex_longdouble.c \ +libffi.complex/cls_complex.inc libffi.complex/cls_complex_double.c \ +libffi.complex/cls_complex_float.c \ +libffi.complex/cls_complex_longdouble.c \ +libffi.complex/cls_complex_struct.inc \ +libffi.complex/cls_complex_struct_double.c \ +libffi.complex/cls_complex_struct_float.c \ +libffi.complex/cls_complex_struct_longdouble.c \ +libffi.complex/cls_complex_va.inc \ +libffi.complex/cls_complex_va_double.c \ +libffi.complex/cls_complex_va_float.c \ +libffi.complex/cls_complex_va_longdouble.c libffi.complex/complex.exp \ +libffi.complex/complex.inc libffi.complex/complex_defs_double.inc \ +libffi.complex/complex_defs_float.inc \ +libffi.complex/complex_defs_longdouble.inc \ +libffi.complex/complex_double.c libffi.complex/complex_float.c \ +libffi.complex/complex_int.c libffi.complex/complex_longdouble.c \ +libffi.complex/ffitest.h libffi.complex/many_complex.inc \ +libffi.complex/many_complex_double.c \ +libffi.complex/many_complex_float.c \ +libffi.complex/many_complex_longdouble.c \ +libffi.complex/return_complex.inc libffi.complex/return_complex1.inc \ +libffi.complex/return_complex1_double.c \ +libffi.complex/return_complex1_float.c \ +libffi.complex/return_complex1_longdouble.c \ +libffi.complex/return_complex2.inc \ +libffi.complex/return_complex2_double.c \ +libffi.complex/return_complex2_float.c \ +libffi.complex/return_complex2_longdouble.c \ +libffi.complex/return_complex_double.c \ +libffi.complex/return_complex_float.c \ +libffi.complex/return_complex_longdouble.c libffi.go/aa-direct.c \ +libffi.go/closure1.c libffi.go/ffitest.h libffi.go/go.exp \ +libffi.go/static-chain.h diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in index 36465e9..b3750c9 100644 --- a/testsuite/Makefile.in +++ b/testsuite/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,7 +91,6 @@ target_triplet = @target@ subdir = testsuite ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ - $(top_srcdir)/m4/ax_append_flag.m4 \ $(top_srcdir)/m4/ax_cc_maxopt.m4 \ $(top_srcdir)/m4/ax_cflags_warn_all.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ @@ -100,6 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ $(top_srcdir)/m4/ax_enable_builddir.m4 \ $(top_srcdir)/m4/ax_gcc_archflag.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ + $(top_srcdir)/m4/ax_prepend_flag.m4 \ $(top_srcdir)/m4/ax_require_defined.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ @@ -155,8 +155,9 @@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -171,9 +172,11 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@ @@ -212,6 +215,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PRTDIAG = @PRTDIAG@ RANLIB = @RANLIB@ +READELF = @READELF@ SECTION_LDFLAGS = @SECTION_LDFLAGS@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -267,6 +271,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -277,6 +282,7 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ +tmake_file = @tmake_file@ toolexecdir = @toolexecdir@ toolexeclibdir = @toolexeclibdir@ top_build_prefix = @top_build_prefix@ @@ -285,120 +291,131 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign dejagnu EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp CLEANFILES = *.exe core* *.log *.sum -EXTRA_DIST = lib/target-libpath.exp lib/libffi.exp lib/wrapper.exp \ -libffi.call/strlen4.c libffi.call/struct10.c libffi.call/many_mixed.c \ -libffi.call/float.c libffi.call/struct5.c libffi.call/return_fl3.c \ -libffi.call/return_fl1.c libffi.call/call.exp libffi.call/pyobjc-tc.c \ -libffi.call/float_va.c libffi.call/struct8.c libffi.call/pr1172638.c \ -libffi.call/return_sc.c libffi.call/va_struct1.c \ -libffi.call/align_stdcall.c libffi.call/struct9.c libffi.call/va_1.c \ -libffi.call/va_struct2.c libffi.call/return_fl2.c \ -libffi.call/align_mixed.c libffi.call/ffitest.h libffi.call/struct4.c \ -libffi.call/return_ldl.c libffi.call/float3.c libffi.call/return_sl.c \ -libffi.call/return_dbl1.c libffi.call/err_bad_typedef.c \ -libffi.call/return_ll1.c libffi.call/return_dbl2.c \ -libffi.call/negint.c libffi.closures/nested_struct3.c \ -libffi.call/struct2.c libffi.call/struct3.c libffi.call/return_fl.c \ -libffi.call/offsets.c libffi.call/struct7.c libffi.call/va_struct3.c \ -libffi.call/float1.c libffi.call/uninitialized.c libffi.call/many2.c \ -libffi.call/struct6.c libffi.call/strlen2.c libffi.call/float2.c \ -libffi.call/return_ul.c libffi.call/struct1.c libffi.call/strlen3.c \ -libffi.call/return_dbl.c libffi.call/float4.c libffi.call/many.c \ -libffi.call/strlen.c libffi.call/return_uc.c libffi.call/many_double.c \ -libffi.call/return_ll.c libffi.call/promotion.c \ -libffi.complex/complex_defs_longdouble.inc \ -libffi.complex/cls_align_complex_float.c \ -libffi.complex/cls_complex_va_float.c \ -libffi.complex/cls_complex_struct_float.c \ -libffi.complex/return_complex2_longdouble.c \ -libffi.complex/cls_complex_float.c \ -libffi.complex/return_complex_longdouble.c \ -libffi.complex/return_complex2_float.c libffi.complex/cls_complex.inc \ -libffi.complex/cls_complex_va_longdouble.c \ -libffi.complex/return_complex_double.c \ -libffi.complex/return_complex.inc libffi.complex/many_complex.inc \ -libffi.complex/complex_float.c libffi.complex/cls_align_complex.inc \ -libffi.complex/return_complex2_double.c \ -libffi.complex/many_complex_float.c libffi.complex/ffitest.h \ -libffi.complex/return_complex1_double.c \ -libffi.complex/cls_complex_struct_longdouble.c \ -libffi.complex/complex_defs_double.inc \ -libffi.complex/cls_complex_va_double.c \ -libffi.complex/many_complex_double.c \ -libffi.complex/return_complex2.inc \ -libffi.complex/return_complex1_float.c \ -libffi.complex/complex_longdouble.c \ -libffi.complex/complex_defs_float.inc \ -libffi.complex/cls_complex_double.c \ -libffi.complex/cls_align_complex_double.c \ -libffi.complex/cls_align_complex_longdouble.c \ -libffi.complex/complex_double.c libffi.complex/cls_complex_va.inc \ -libffi.complex/many_complex_longdouble.c libffi.complex/complex.inc \ -libffi.complex/return_complex1_longdouble.c \ -libffi.complex/complex_int.c libffi.complex/cls_complex_longdouble.c \ -libffi.complex/cls_complex_struct_double.c \ -libffi.complex/return_complex1.inc libffi.complex/complex.exp \ -libffi.complex/cls_complex_struct.inc \ -libffi.complex/return_complex_float.c libffi.go/closure1.c \ -libffi.go/aa-direct.c libffi.go/ffitest.h libffi.go/go.exp \ -libffi.go/static-chain.h libffi.bhaible/bhaible.exp \ -libffi.bhaible/test-call.c libffi.bhaible/alignof.h \ -libffi.bhaible/testcases.c libffi.bhaible/test-callback.c \ -libffi.bhaible/Makefile libffi.bhaible/README config/default.exp \ -libffi.closures/cls_multi_sshort.c \ -libffi.closures/cls_align_longdouble_split2.c \ -libffi.closures/cls_1_1byte.c libffi.closures/cls_uint_va.c \ -libffi.closures/cls_3_1byte.c libffi.closures/cls_many_mixed_args.c \ -libffi.closures/cls_20byte1.c libffi.closures/cls_pointer_stack.c \ -libffi.closures/cls_align_float.c libffi.closures/cls_5_1_byte.c \ -libffi.closures/cls_9byte1.c libffi.closures/cls_align_uint32.c \ -libffi.closures/stret_medium.c libffi.closures/cls_3byte1.c \ -libffi.closures/cls_align_uint64.c libffi.closures/cls_longdouble_va.c \ -libffi.closures/cls_align_pointer.c libffi.closures/cls_19byte.c \ -libffi.closures/cls_ushort.c libffi.closures/cls_align_sint32.c \ -libffi.closures/cls_ulonglong.c libffi.closures/cls_struct_va1.c \ -libffi.closures/cls_9byte2.c libffi.closures/closure_fn5.c \ -libffi.closures/cls_5byte.c libffi.closures/cls_3float.c \ -libffi.closures/closure.exp libffi.closures/cls_schar.c \ -libffi.closures/closure_fn4.c libffi.closures/cls_uchar_va.c \ -libffi.closures/closure_fn0.c libffi.closures/huge_struct.c \ -libffi.closures/cls_ushort_va.c \ -libffi.closures/cls_64byte.c libffi.closures/cls_longdouble.c \ -libffi.closures/cls_ulong_va.c libffi.closures/cls_6_1_byte.c \ -libffi.closures/cls_align_uint16.c libffi.closures/closure_fn2.c \ -libffi.closures/unwindtest_ffi_call.cc \ -libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_8byte.c \ -libffi.closures/ffitest.h libffi.closures/nested_struct8.c \ -libffi.closures/cls_pointer.c libffi.closures/nested_struct2.c \ -libffi.closures/nested_struct.c libffi.closures/cls_multi_schar.c \ -libffi.closures/cls_align_longdouble_split.c \ -libffi.closures/cls_uchar.c libffi.closures/nested_struct9.c \ -libffi.closures/cls_float.c libffi.closures/stret_medium2.c \ -libffi.closures/closure_loc_fn0.c libffi.closures/cls_6byte.c \ -libffi.closures/closure_simple.c libffi.closures/cls_align_double.c \ -libffi.closures/cls_multi_uchar.c libffi.closures/cls_4_1byte.c \ -libffi.closures/closure_fn3.c libffi.closures/cls_align_sint64.c \ -libffi.closures/nested_struct1.c libffi.closures/unwindtest.cc \ -libffi.closures/nested_struct5.c libffi.closures/cls_multi_ushort.c \ -libffi.closures/nested_struct11.c \ -libffi.closures/cls_multi_sshortchar.c \ -libffi.closures/cls_align_longdouble.c \ -libffi.closures/cls_dbls_struct.c \ -libffi.closures/cls_many_mixed_float_double.c \ -libffi.closures/stret_large.c libffi.closures/stret_large2.c \ -libffi.closures/cls_align_sint16.c libffi.closures/cls_2byte.c \ -libffi.closures/nested_struct4.c libffi.closures/problem1.c \ -libffi.closures/testclosure.c libffi.closures/nested_struct6.c \ -libffi.closures/cls_4byte.c libffi.closures/cls_24byte.c \ -libffi.closures/nested_struct10.c libffi.closures/cls_uint.c \ -libffi.closures/cls_12byte.c libffi.closures/cls_sint.c \ -libffi.closures/cls_7_1_byte.c libffi.closures/cls_sshort.c \ -libffi.closures/cls_16byte.c libffi.closures/nested_struct7.c \ -libffi.closures/cls_double_va.c libffi.closures/cls_3byte2.c \ -libffi.closures/cls_double.c libffi.closures/cls_7byte.c \ -libffi.closures/closure_fn6.c libffi.closures/closure_fn1.c \ -libffi.closures/cls_20byte.c libffi.closures/cls_18byte.c \ -libffi.closures/err_bad_abi.c +EXTRA_DIST = config/default.exp lib/libffi.exp lib/target-libpath.exp \ +lib/wrapper.exp libffi.bhaible/Makefile libffi.bhaible/README \ +libffi.bhaible/alignof.h libffi.bhaible/bhaible.exp \ +libffi.bhaible/test-call.c libffi.bhaible/test-callback.c \ +libffi.bhaible/testcases.c libffi.call/align_mixed.c \ +libffi.call/align_stdcall.c libffi.call/call.exp \ +libffi.call/err_bad_typedef.c libffi.call/ffitest.h \ +libffi.call/float.c libffi.call/float1.c libffi.call/float2.c \ +libffi.call/float3.c libffi.call/float4.c libffi.call/float_va.c \ +libffi.call/many.c libffi.call/many2.c libffi.call/many_double.c \ +libffi.call/many_mixed.c libffi.call/negint.c libffi.call/offsets.c \ +libffi.call/pr1172638.c libffi.call/promotion.c \ +libffi.call/pyobjc_tc.c libffi.call/return_dbl.c \ +libffi.call/return_dbl1.c libffi.call/return_dbl2.c \ +libffi.call/return_fl.c libffi.call/return_fl1.c \ +libffi.call/return_fl2.c libffi.call/return_fl3.c \ +libffi.call/return_ldl.c libffi.call/return_ll.c \ +libffi.call/return_ll1.c libffi.call/return_sc.c \ +libffi.call/return_sl.c libffi.call/return_uc.c \ +libffi.call/return_ul.c libffi.call/struct1.c libffi.call/struct10.c \ +libffi.call/struct2.c libffi.call/struct3.c libffi.call/struct4.c \ +libffi.call/struct5.c libffi.call/struct6.c libffi.call/struct7.c \ +libffi.call/struct8.c libffi.call/struct9.c \ +libffi.call/uninitialized.c libffi.call/va_1.c libffi.call/va_2.c \ +libffi.call/va_3.c libffi.call/va_struct1.c libffi.call/va_struct2.c \ +libffi.call/va_struct3.c libffi.call/struct_by_value_big.c \ +libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \ +libffi.call/struct_by_value_4.c libffi.call/struct_by_value_small.c \ +libffi.call/strlen2.c libffi.call/strlen3.c libffi.call/strlen4.c \ +libffi.call/strlen.c libffi.call/va_3.c \ +libffi.call/struct_by_value_2.c libffi.call/struct_by_value_3.c \ +libffi.call/struct_by_value_4.c libffi.closures/closure.exp \ +libffi.call/s55.c libffi.call/bpo-38748.c \ +libffi.closures/closure_fn0.c libffi.closures/closure_fn1.c \ +libffi.closures/closure_fn2.c libffi.closures/closure_fn3.c \ +libffi.closures/closure_fn4.c libffi.closures/closure_fn5.c \ +libffi.closures/closure_fn6.c libffi.closures/closure_loc_fn0.c \ +libffi.closures/closure_simple.c libffi.closures/cls_12byte.c \ +libffi.closures/cls_16byte.c libffi.closures/cls_18byte.c \ +libffi.closures/cls_19byte.c libffi.closures/cls_1_1byte.c \ +libffi.closures/cls_20byte.c libffi.closures/cls_20byte1.c \ +libffi.closures/cls_24byte.c libffi.closures/cls_2byte.c \ +libffi.closures/cls_3_1byte.c libffi.closures/cls_3byte1.c \ +libffi.closures/cls_3byte2.c libffi.closures/cls_3float.c \ +libffi.closures/cls_4_1byte.c libffi.closures/cls_4byte.c \ +libffi.closures/cls_5_1_byte.c libffi.closures/cls_5byte.c \ +libffi.closures/cls_64byte.c libffi.closures/cls_6_1_byte.c \ +libffi.closures/cls_6byte.c libffi.closures/cls_7_1_byte.c \ +libffi.closures/cls_7byte.c libffi.closures/cls_8byte.c \ +libffi.closures/cls_9byte1.c libffi.closures/cls_9byte2.c \ +libffi.closures/cls_align_double.c libffi.closures/cls_align_float.c \ +libffi.closures/cls_align_longdouble.c \ +libffi.closures/cls_align_pointer.c \ +libffi.closures/cls_align_sint16.c libffi.closures/cls_align_sint32.c \ +libffi.closures/cls_align_sint64.c libffi.closures/cls_align_uint16.c \ +libffi.closures/cls_align_uint32.c libffi.closures/cls_align_uint64.c \ +libffi.closures/cls_dbls_struct.c libffi.closures/cls_double.c \ +libffi.closures/cls_double_va.c libffi.closures/cls_float.c \ +libffi.closures/cls_longdouble_va.c \ +libffi.closures/cls_many_mixed_args.c \ +libffi.closures/cls_many_mixed_float_double.c \ +libffi.closures/cls_multi_schar.c libffi.closures/cls_multi_sshort.c \ +libffi.closures/cls_multi_sshortchar.c \ +libffi.closures/cls_multi_uchar.c libffi.closures/cls_multi_ushort.c \ +libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_pointer.c \ +libffi.closures/cls_pointer_stack.c libffi.closures/cls_schar.c \ +libffi.closures/cls_sint.c libffi.closures/cls_sshort.c \ +libffi.closures/cls_struct_va1.c libffi.closures/cls_uchar.c \ +libffi.closures/cls_uint.c libffi.closures/cls_uint_va.c \ +libffi.closures/cls_ulong_va.c libffi.closures/cls_ulonglong.c \ +libffi.closures/cls_ushort.c libffi.closures/err_bad_abi.c \ +libffi.closures/ffitest.h libffi.closures/nested_struct.c \ +libffi.closures/nested_struct1.c libffi.closures/nested_struct10.c \ +libffi.closures/nested_struct11.c libffi.closures/nested_struct12.c \ +libffi.closures/nested_struct13.c libffi.closures/nested_struct2.c \ +libffi.closures/nested_struct3.c libffi.closures/nested_struct4.c \ +libffi.closures/nested_struct5.c libffi.closures/nested_struct6.c \ +libffi.closures/nested_struct7.c libffi.closures/nested_struct8.c \ +libffi.closures/nested_struct9.c libffi.closures/problem1.c \ +libffi.closures/single_entry_structs1.c \ +libffi.closures/single_entry_structs2.c \ +libffi.closures/single_entry_structs3.c libffi.closures/stret_large.c \ +libffi.closures/stret_large2.c libffi.closures/stret_medium.c \ +libffi.closures/stret_medium2.c libffi.closures/testclosure.c \ +libffi.closures/unwindtest.cc libffi.closures/unwindtest_ffi_call.cc \ +libffi.closures/cls_align_longdouble_split.c \ +libffi.closures/cls_align_longdouble_split2.c \ +libffi.closures/cls_longdouble.c libffi.closures/huge_struct.c \ +libffi.complex/cls_align_complex.inc \ +libffi.complex/cls_align_complex_double.c \ +libffi.complex/cls_align_complex_float.c \ +libffi.complex/cls_align_complex_longdouble.c \ +libffi.complex/cls_complex.inc libffi.complex/cls_complex_double.c \ +libffi.complex/cls_complex_float.c \ +libffi.complex/cls_complex_longdouble.c \ +libffi.complex/cls_complex_struct.inc \ +libffi.complex/cls_complex_struct_double.c \ +libffi.complex/cls_complex_struct_float.c \ +libffi.complex/cls_complex_struct_longdouble.c \ +libffi.complex/cls_complex_va.inc \ +libffi.complex/cls_complex_va_double.c \ +libffi.complex/cls_complex_va_float.c \ +libffi.complex/cls_complex_va_longdouble.c libffi.complex/complex.exp \ +libffi.complex/complex.inc libffi.complex/complex_defs_double.inc \ +libffi.complex/complex_defs_float.inc \ +libffi.complex/complex_defs_longdouble.inc \ +libffi.complex/complex_double.c libffi.complex/complex_float.c \ +libffi.complex/complex_int.c libffi.complex/complex_longdouble.c \ +libffi.complex/ffitest.h libffi.complex/many_complex.inc \ +libffi.complex/many_complex_double.c \ +libffi.complex/many_complex_float.c \ +libffi.complex/many_complex_longdouble.c \ +libffi.complex/return_complex.inc libffi.complex/return_complex1.inc \ +libffi.complex/return_complex1_double.c \ +libffi.complex/return_complex1_float.c \ +libffi.complex/return_complex1_longdouble.c \ +libffi.complex/return_complex2.inc \ +libffi.complex/return_complex2_double.c \ +libffi.complex/return_complex2_float.c \ +libffi.complex/return_complex2_longdouble.c \ +libffi.complex/return_complex_double.c \ +libffi.complex/return_complex_float.c \ +libffi.complex/return_complex_longdouble.c libffi.go/aa-direct.c \ +libffi.go/closure1.c libffi.go/ffitest.h libffi.go/go.exp \ +libffi.go/static-chain.h all: all-am @@ -462,7 +479,7 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo '# Do not edit here. If you wish to override these values' >>site.tmp @echo '# edit the last section' >>site.tmp @echo 'set srcdir "$(srcdir)"' >>site.tmp - @echo "set objdir `pwd`" >>site.tmp + @echo "set objdir \"`pwd`\"" >>site.tmp @echo 'set build_alias "$(build_alias)"' >>site.tmp @echo 'set build_triplet $(build_triplet)' >>site.tmp @echo 'set host_alias "$(host_alias)"' >>site.tmp @@ -488,7 +505,6 @@ distclean-DEJAGNU: -l='$(DEJATOOL)'; for tool in $$l; do \ rm -f $$tool.sum $$tool.log; \ done - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp index c02adf9..7457af4 100644 --- a/testsuite/lib/libffi.exp +++ b/testsuite/lib/libffi.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014, 2019 Free Software Foundation, Inc. +# Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011, 2014, 2019, 2022 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,6 +24,11 @@ load_lib libgloss.exp load_gcc_lib target-libpath.exp load_gcc_lib wrapper.exp +proc check_effective_target_gccbug { } { + global has_gccbug + return $has_gccbug +} + # Return 1 if the target matches the effective target 'arg', 0 otherwise. # This can be used with any check_* proc that takes no argument and # returns only 1 or 0. It could be used with check_* procs that take @@ -40,7 +45,7 @@ proc is-effective-target { arg } { if { [info procs check_effective_target_${arg}] != [list] } { set selected [check_effective_target_${arg}] } else { - error "unknown effective target keyword `$arg'" + error "unknown effective target keyword `$arg'" } verbose "is-effective-target: $arg $selected" 2 return $selected @@ -191,7 +196,7 @@ if { [info procs saved-dg-process-target] == [list] } { return "N" } return [dg-process-target-1 $xfail_selector] - + } return [dg-process-target-1 $selector] } @@ -264,6 +269,8 @@ proc libffi-dg-test { prog do_what extra_tool_flags } { proc libffi-dg-prune { target_triplet text } { # We get this with some qemu emulated systems (eg. ppc64le-linux-gnu) regsub -all "(^|\n)\[^\n\]*unable to perform all requested operations" $text "" text + # We get this from sparc64 linux systems + regsub -all "(^|\n)\[^\n\]*warning: .* has a LOAD segment with RWX permissions" $text "" text return $text } @@ -287,9 +294,6 @@ proc libffi-init { args } { verbose "libffi $blddirffi" # Which compiler are we building with? - set tmp [grep "$blddirffi/config.log" "^ax_cv_c_compiler_vendor.*$"] - regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor - if { [string match $compiler_vendor "gnu"] } { set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a] if {$gccdir != ""} { @@ -374,7 +378,8 @@ proc libffi_target_compile { source dest type options } { if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"] || [istarget "*-*-darwin2*"] } { - lappend options "additional_flags=-Wl,-allow_stack_execute" + # lappend options "additional_flags=-Wl,-allow_stack_execute" + lappend options "additional_flags=-Wno-unused-command-line-argument" } # If you're building the compiler with --prefix set to a place @@ -392,17 +397,23 @@ proc libffi_target_compile { source dest type options } { lappend options "libs= -lffi" - if { [string match "aarch64*-*-linux*" $target_triplet] } { - lappend options "libs= -lpthread" - } + if { ![string match "*android*" $target_triplet] } { - # this may be required for g++, but just confused clang. - if { [string match "*.cc" $source] } { - lappend options "c++" - } + if { [string match "aarch64*-*-linux*" $target_triplet] } { + lappend options "libs= -lpthread" + } - if { [string match "arc*-*-linux*" $target_triplet] } { - lappend options "libs= -lpthread" + # this may be required for g++, but just confused clang. + if { [string match "*.cc" $source] } { + lappend options "c++" + if { [string match "*-*-darwin*" $target_triplet] } { + lappend options "libs= -lc++" + } + } + + if { [string match "arc*-*-linux*" $target_triplet] } { + lappend options "libs= -lpthread" + } } verbose "options: $options" @@ -477,13 +488,14 @@ proc libffi-dg-runtest { testcases default-extra-flags } { proc run-many-tests { testcases extra_flags } { global compiler_vendor + global has_gccbug global env switch $compiler_vendor { "clang" { set common "-W -Wall" if [info exists env(LIBFFI_TEST_OPTIMIZATION)] { set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ] - } else { + } else { set optimizations { "-O0" "-O2" } } } @@ -491,7 +503,7 @@ proc run-many-tests { testcases extra_flags } { set common "-W -Wall -Wno-psabi" if [info exists env(LIBFFI_TEST_OPTIMIZATION)] { set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ] - } else { + } else { set optimizations { "-O0" "-O2" } } } @@ -500,7 +512,7 @@ proc run-many-tests { testcases extra_flags } { set common "" if [info exists env(LIBFFI_TEST_OPTIMIZATION)] { set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ] - } else { + } else { set optimizations { "" } } } @@ -538,8 +550,22 @@ proc run-many-tests { testcases extra_flags } { foreach opt $optimizations { foreach abi $abis { set options [concat $common $opt $abi] - verbose "Testing $testname, $options" 1 - dg-test $test $options "" + set has_gccbug false; + if { [string match $compiler_vendor "gnu"] \ + && [string match "*MSABI*" $abi] \ + && ( ( [string match "*DGTEST=57 *" $common] \ + && [string match "*call.c*" $testname] ) \ + || ( [string match "*DGTEST=54 *" $common] \ + && [string match "*callback*" $testname] ) \ + || [string match "*DGTEST=55 *" $common] \ + || [string match "*DGTEST=56 *" $common] ) } then { + if [libffi_feature_test "#if (__GNUC__ < 9) || ((__GNUC__ == 9) && (__GNUC_MINOR__ < 3))"] { + set has_gccbug true; + } + } + verbose "Testing $testname, $options" 1 + verbose "has_gccbug = $has_gccbug" 1 + dg-test $test $options "" } } } @@ -575,7 +601,7 @@ proc check-flags { args } { # compare them to the actual options. if { [string compare [lindex $args 2] "*"] == 0 && [string compare [lindex $args 3] "" ] == 0 } { - set result 1 + set result 1 } else { # The target list might be an effective-target keyword, so replace # the original list with "*-*-*", since we already know it matches. diff --git a/testsuite/lib/target-libpath.exp b/testsuite/lib/target-libpath.exp index 6b7beba..e33a656 100644 --- a/testsuite/lib/target-libpath.exp +++ b/testsuite/lib/target-libpath.exp @@ -175,7 +175,7 @@ proc set_ld_library_path_env_vars { } { } else { setenv DYLD_LIBRARY_PATH "$ld_library_path" } - if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } { + if { [istarget *-*-cygwin*] || [ istarget *-*-msys* ] || [istarget *-*-mingw*] } { if { $orig_path_saved } { setenv PATH "$ld_library_path:$orig_path" } else { @@ -271,7 +271,7 @@ proc get_shlib_extension { } { if { [ istarget *-*-darwin* ] } { set shlib_ext "dylib" - } elseif { [ istarget *-*-cygwin* ] || [ istarget *-*-mingw* ] } { + } elseif { [ istarget *-*-cygwin* ] || [ istarget *-*-msys* ] || [ istarget *-*-mingw* ] } { set shlib_ext "dll" } elseif { [ istarget hppa*-*-hpux* ] } { set shlib_ext "sl" diff --git a/testsuite/libffi.bhaible/test-call.c b/testsuite/libffi.bhaible/test-call.c index 01a8a21..4887e00 100644 --- a/testsuite/libffi.bhaible/test-call.c +++ b/testsuite/libffi.bhaible/test-call.c @@ -4,7 +4,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,7 +16,7 @@ along with this program. If not, see . **/ -/* { dg-do run } */ +/* { dg-do run { xfail gccbug } } */ #include #include @@ -50,6 +50,7 @@ int _fprintf(FILE *stream, const char *format, ...) case 3: vsprintf(&rbuf2[strlen(rbuf2)], format, args); printf("%s", rbuf2); + fflush (stdout); if (strcmp (rbuf1, rbuf2)) abort(); break; } @@ -1220,7 +1221,7 @@ void } fprintf(out,"->{%g}\n",Fr.x); fflush(out); -#endif +#endif #if (!defined(DGTEST)) || DGTEST == 56 Dr = D_fDd(f1,D2,d3); fprintf(out,"->{%g}\n",Dr.x); @@ -1243,7 +1244,7 @@ void } fprintf(out,"->{%g}\n",Dr.x); fflush(out); -#endif +#endif #if (!defined(DGTEST)) || DGTEST == 57 Dr = D_Dfd(D1,f2,d3); fprintf(out,"->{%g}\n",Dr.x); diff --git a/testsuite/libffi.bhaible/test-callback.c b/testsuite/libffi.bhaible/test-callback.c index c2633c7..0b16799 100644 --- a/testsuite/libffi.bhaible/test-callback.c +++ b/testsuite/libffi.bhaible/test-callback.c @@ -4,7 +4,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -/* { dg-do run } */ +/* { dg-do run { xfail gccbug } } */ #include #include diff --git a/testsuite/libffi.bhaible/testcases.c b/testsuite/libffi.bhaible/testcases.c index d25ebf4..23a6f46 100644 --- a/testsuite/libffi.bhaible/testcases.c +++ b/testsuite/libffi.bhaible/testcases.c @@ -64,7 +64,11 @@ typedef struct { typedef struct { char c[3]; } T; typedef struct { char c[33],c1; } X; -char c1='a', c2=127, c3=(char)128, c4=(char)255, c5=-1; +/* Don't use a number over 127, as some systems use signed chars and + the test case 25 doesn't account for this, resulting in undefined + behavior. See https://github.com/libffi/libffi/issues/598. */ +char c1='a', c2=127, c3=(char)1; + short s1=32767, s2=(short)32768, s3=3, s4=4, s5=5, s6=6, s7=7, s8=8, s9=9; int i1=1, i2=2, i3=3, i4=4, i5=5, i6=6, i7=7, i8=8, i9=9, i10=11, i11=12, i12=13, i13=14, i14=15, i15=16, i16=17; diff --git a/testsuite/libffi.call/bpo-38748.c b/testsuite/libffi.call/bpo-38748.c new file mode 100644 index 0000000..294bda0 --- /dev/null +++ b/testsuite/libffi.call/bpo-38748.c @@ -0,0 +1,41 @@ +/* Area: bpo-38748 + Purpose: test for stdcall alignment problem + Source: github.com/python/cpython/pull/26204 */ + +/* { dg-do run } */ + +#include "ffitest.h" +#include "ffi_common.h" + +static UINT32 ABI_ATTR align_arguments(UINT32 l1, + UINT64 l2) +{ + return l1 + (UINT32) l2; +} + +int main(void) +{ + ffi_cif cif; + ffi_type *args[4] = { + &ffi_type_uint32, + &ffi_type_uint64 + }; + ffi_arg lr1, lr2; + UINT32 l1 = 1; + UINT64 l2 = 2; + void *values[2] = {&l1, &l2}; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, + &ffi_type_uint32, args) == FFI_OK); + + lr1 = align_arguments(l1, l2); + + ffi_call(&cif, FFI_FN(align_arguments), &lr2, values); + + if (lr1 == lr2) + printf("bpo-38748 arguments tests ok!\n"); + else + CHECK(0); + exit(0); +} diff --git a/testsuite/libffi.call/call.exp b/testsuite/libffi.call/call.exp index 256f237..13ba2bd 100644 --- a/testsuite/libffi.call/call.exp +++ b/testsuite/libffi.call/call.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2003, 2006, 2009, 2010, 2014, 2019 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006, 2009, 2010, 2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/testsuite/libffi.call/ffitest.h b/testsuite/libffi.call/ffitest.h index cfce1ad..8bd8a3c 100644 --- a/testsuite/libffi.call/ffitest.h +++ b/testsuite/libffi.call/ffitest.h @@ -5,6 +5,9 @@ #include #include "fficonfig.h" +#include +#include + #if defined HAVE_STDINT_H #include #endif @@ -15,7 +18,29 @@ #define MAX_ARGS 256 -#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0) +#define CHECK(x) \ + do { \ + if(!(x)){ \ + printf("Check failed:\n%s\n", #x); \ + abort(); \ + } \ + } while(0) + +#define CHECK_FLOAT_EQ(x, y) \ + do { \ + if(fabs((x) - (y)) > FLT_EPSILON){ \ + printf("Check failed CHECK_FLOAT_EQ(%s, %s)\n", #x, #y); \ + abort(); \ + } \ + } while(0) + +#define CHECK_DOUBLE_EQ(x, y) \ + do { \ + if(fabs((x) - (y)) > DBL_EPSILON){ \ + printf("Check failed CHECK_FLOAT_EQ(%s, %s)\n", #x, #y); \ + abort(); \ + } \ + } while(0) /* Define macros so that compilers other than gcc can run the tests. */ #undef __UNUSED__ @@ -63,8 +88,8 @@ #endif -/* MinGW kludge. */ -#if defined(_WIN64) | defined(_WIN32) +/* msvc kludge. */ +#if defined(_MSC_VER) #define PRIdLL "I64d" #define PRIuLL "I64u" #else diff --git a/testsuite/libffi.call/float_va.c b/testsuite/libffi.call/float_va.c index 5acff91..d01d9d0 100644 --- a/testsuite/libffi.call/float_va.c +++ b/testsuite/libffi.call/float_va.c @@ -74,6 +74,7 @@ int main (void) /* { dg-output "\n0: 2.0 : total: 2.0" } */ printf("ffi: %.1f\n", resfp); /* { dg-output "\nffi: 2.0" } */ + CHECK_DOUBLE_EQ(resfp, 2); /* Second test, float_va_fn(2,2.0,3.0,4.0), now with variadic params */ /* Call it statically and then via ffi */ @@ -81,6 +82,7 @@ int main (void) /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */ printf("compiled: %.1f\n", resfp); /* { dg-output "\ncompiled: 11.0" } */ + CHECK_DOUBLE_EQ(resfp, 11); arg_types[0] = &ffi_type_uint; arg_types[1] = &ffi_type_double; @@ -102,6 +104,7 @@ int main (void) /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */ printf("ffi: %.1f\n", resfp); /* { dg-output "\nffi: 11.0" } */ + CHECK_DOUBLE_EQ(resfp, 11); exit(0); } diff --git a/testsuite/libffi.call/pyobjc-tc.c b/testsuite/libffi.call/pyobjc_tc.c similarity index 100% rename from testsuite/libffi.call/pyobjc-tc.c rename to testsuite/libffi.call/pyobjc_tc.c diff --git a/testsuite/libffi.call/return_ll1.c b/testsuite/libffi.call/return_ll1.c index 593e8a3..a2426ec 100644 --- a/testsuite/libffi.call/return_ll1.c +++ b/testsuite/libffi.call/return_ll1.c @@ -9,6 +9,9 @@ #include "ffitest.h" static long long return_ll(int ll0, long long ll1, int ll2) { + CHECK(ll0 == 11111111); + CHECK(ll1 == 11111111111000LL); + CHECK(ll2 == 11111111); return ll0 + ll1 + ll2; } @@ -39,5 +42,7 @@ int main (void) ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values); printf("res: %" PRIdLL ", %" PRIdLL "\n", rlonglong, ll0 + ll1 + ll2); /* { dg-output "res: 11111133333222, 11111133333222" } */ + CHECK(rlonglong == 11111133333222); + CHECK(ll0 + ll1 + ll2 == 11111133333222); exit(0); } diff --git a/testsuite/libffi.call/return_sl.c b/testsuite/libffi.call/return_sl.c index f0fd345..51bfb49 100644 --- a/testsuite/libffi.call/return_sl.c +++ b/testsuite/libffi.call/return_sl.c @@ -8,6 +8,8 @@ #include "ffitest.h" static long return_sl(long l1, long l2) { + CHECK(l1 == 1073741823L); + CHECK(l2 == 1073741824L); return l1 - l2; } @@ -33,6 +35,8 @@ int main (void) ffi_call(&cif, FFI_FN(return_sl), &res, values); printf("res: %ld, %ld\n", (long)res, l1 - l2); /* { dg-output "res: -1, -1" } */ + CHECK((long)res == -1); + CHECK(l1 + 1 == l2); exit(0); } diff --git a/testsuite/libffi.call/return_ul.c b/testsuite/libffi.call/return_ul.c index 12b266f..fedcc25 100644 --- a/testsuite/libffi.call/return_ul.c +++ b/testsuite/libffi.call/return_ul.c @@ -8,6 +8,8 @@ #include "ffitest.h" static unsigned long return_ul(unsigned long ul1, unsigned long ul2) { + CHECK(ul1 == 1073741823L); + CHECK(ul2 == 1073741824L); return ul1 + ul2; } @@ -33,6 +35,8 @@ int main (void) ffi_call(&cif, FFI_FN(return_ul), &res, values); printf("res: %lu, %lu\n", (unsigned long)res, ul1 + ul2); /* { dg-output "res: 2147483647, 2147483647" } */ + CHECK(res == 2147483647L); + CHECK(ul1 + ul2 == 2147483647L); exit(0); } diff --git a/testsuite/libffi.call/s55.c b/testsuite/libffi.call/s55.c new file mode 100644 index 0000000..94dfd5f --- /dev/null +++ b/testsuite/libffi.call/s55.c @@ -0,0 +1,60 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + float f; +} s55; + +static s55 ABI_ATTR f55(s55 ts, float f) +{ + s55 r; + r.f = ts.f + f; + printf ("f55>> %g + %g = %g\n", ts.f, f, r.f); + return r; +} + +int main (void) +{ + ffi_cif cif; + s55 F, Fr; + float f; + void *values[] = { &F, &f }; + ffi_type s55_type; + ffi_type *args[] = { &s55_type, &ffi_type_float }; + ffi_type *s55_type_elements[] = { &ffi_type_float, NULL }; + + /* This is a hack to get a properly aligned result buffer */ + s55 *s55_result = + (s55 *) malloc (sizeof(s55)); + + s55_type.size = 0; + s55_type.alignment = 0; + s55_type.type = FFI_TYPE_STRUCT; + s55_type.elements = s55_type_elements; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &s55_type, args) == FFI_OK); + + F.f = 1; + Fr = f55(F, 2.14); + printf ("%g\n", Fr.f); + + F.f = 1; + f = 2.14; + ffi_call(&cif, FFI_FN(f55), s55_result, values); + printf ("%g\n", s55_result->f); + + fflush(0); + + CHECK(fabs(Fr.f - s55_result->f) < FLT_EPSILON); + + free (s55_result); + exit(0); +} diff --git a/testsuite/libffi.call/strlen.c b/testsuite/libffi.call/strlen.c index 35b70ea..3ed53d5 100644 --- a/testsuite/libffi.call/strlen.c +++ b/testsuite/libffi.call/strlen.c @@ -7,9 +7,9 @@ /* { dg-do run } */ #include "ffitest.h" -static size_t ABI_ATTR my_strlen(char *s) +static unsigned int ABI_ATTR my_strlen(char *s) { - return (strlen(s)); + return (unsigned int) (strlen(s)); } int main (void) @@ -22,23 +22,22 @@ int main (void) args[0] = &ffi_type_pointer; values[0] = (void*) &s; - + /* Initialize the cif */ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, - &ffi_type_sint, args) == FFI_OK); - + &ffi_type_uint, args) == FFI_OK); + s = "a"; ffi_call(&cif, FFI_FN(my_strlen), &rint, values); CHECK(rint == 1); - + s = "1234567"; ffi_call(&cif, FFI_FN(my_strlen), &rint, values); CHECK(rint == 7); - + s = "1234567890123456789012345"; ffi_call(&cif, FFI_FN(my_strlen), &rint, values); CHECK(rint == 25); - + exit (0); } - diff --git a/testsuite/libffi.call/strlen2.c b/testsuite/libffi.call/strlen2.c index 96282bc..93e5a33 100644 --- a/testsuite/libffi.call/strlen2.c +++ b/testsuite/libffi.call/strlen2.c @@ -8,9 +8,9 @@ #include "ffitest.h" -static size_t ABI_ATTR my_f(char *s, float a) +static int ABI_ATTR my_f(char *s, float a) { - return (size_t) ((int) strlen(s) + (int) a); + return (int) strlen(s) + (int) a; } int main (void) diff --git a/testsuite/libffi.call/strlen3.c b/testsuite/libffi.call/strlen3.c index beba86e..c7d472d 100644 --- a/testsuite/libffi.call/strlen3.c +++ b/testsuite/libffi.call/strlen3.c @@ -8,9 +8,9 @@ #include "ffitest.h" -static size_t ABI_ATTR my_f(float a, char *s) +static int ABI_ATTR my_f(float a, char *s) { - return (size_t) ((int) strlen(s) + (int) a); + return (int) strlen(s) + (int) a; } int main (void) diff --git a/testsuite/libffi.call/strlen4.c b/testsuite/libffi.call/strlen4.c index d5d42b4..ba5c274 100644 --- a/testsuite/libffi.call/strlen4.c +++ b/testsuite/libffi.call/strlen4.c @@ -8,9 +8,9 @@ #include "ffitest.h" -static size_t ABI_ATTR my_f(float a, char *s, int i) +static int ABI_ATTR my_f(float a, char *s, int i) { - return (size_t) ((int) strlen(s) + (int) a + i); + return (int) strlen(s) + (int) a + i; } int main (void) diff --git a/testsuite/libffi.call/struct10.c b/testsuite/libffi.call/struct10.c index 17b1377..1edbd5f 100644 --- a/testsuite/libffi.call/struct10.c +++ b/testsuite/libffi.call/struct10.c @@ -16,7 +16,7 @@ struct s { signed char s8; }; -struct s make_s(void) { +struct s ABI_ATTR make_s(void) { struct s r; r.s32 = 0x1234; r.f32 = 7.0; diff --git a/testsuite/libffi.call/struct_by_value_2.c b/testsuite/libffi.call/struct_by_value_2.c new file mode 100644 index 0000000..f170289 --- /dev/null +++ b/testsuite/libffi.call/struct_by_value_2.c @@ -0,0 +1,63 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + unsigned int ui01; + unsigned int ui02; +} test_structure_1; + +static test_structure_1 ABI_ATTR struct1(test_structure_1 ts) +{ + ts.ui02++; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts1_type; + ffi_type *ts1_type_elements[3]; + + test_structure_1 ts1_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_1 *ts1_result = + (test_structure_1 *) malloc (sizeof(test_structure_1)); + + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + ts1_type_elements[0] = &ffi_type_uint; + ts1_type_elements[1] = &ffi_type_uint; + ts1_type_elements[2] = NULL; + + args[0] = &ts1_type; + values[0] = &ts1_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ts1_type, args) == FFI_OK); + + ts1_arg.ui02 = 555; + + ffi_call(&cif, FFI_FN(struct1), ts1_result, values); + + CHECK(ts1_result->ui02 == 556); + + /* This will fail if ffi_call isn't passing the struct by value. */ + CHECK(ts1_arg.ui02 == 555); + + free (ts1_result); + exit(0); +} diff --git a/testsuite/libffi.call/struct_by_value_3.c b/testsuite/libffi.call/struct_by_value_3.c new file mode 100644 index 0000000..55cf113 --- /dev/null +++ b/testsuite/libffi.call/struct_by_value_3.c @@ -0,0 +1,65 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + unsigned int ui01; + unsigned int ui02; + unsigned int ui03; +} test_structure_1; + +static test_structure_1 ABI_ATTR struct1(test_structure_1 ts) +{ + ts.ui03++; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts1_type; + ffi_type *ts1_type_elements[4]; + + test_structure_1 ts1_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_1 *ts1_result = + (test_structure_1 *) malloc (sizeof(test_structure_1)); + + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + ts1_type_elements[0] = &ffi_type_uint; + ts1_type_elements[1] = &ffi_type_uint; + ts1_type_elements[2] = &ffi_type_uint; + ts1_type_elements[3] = NULL; + + args[0] = &ts1_type; + values[0] = &ts1_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ts1_type, args) == FFI_OK); + + ts1_arg.ui03 = 555; + + ffi_call(&cif, FFI_FN(struct1), ts1_result, values); + + CHECK(ts1_result->ui03 == 556); + + /* This will fail if ffi_call isn't passing the struct by value. */ + CHECK(ts1_arg.ui03 == 555); + + free (ts1_result); + exit(0); +} diff --git a/testsuite/libffi.call/struct_by_value_4.c b/testsuite/libffi.call/struct_by_value_4.c new file mode 100644 index 0000000..768650f --- /dev/null +++ b/testsuite/libffi.call/struct_by_value_4.c @@ -0,0 +1,67 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + unsigned int ui01; + unsigned int ui02; + unsigned int ui03; + unsigned int ui04; +} test_structure_1; + +static test_structure_1 ABI_ATTR struct1(test_structure_1 ts) +{ + ts.ui04++; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts1_type; + ffi_type *ts1_type_elements[5]; + + test_structure_1 ts1_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_1 *ts1_result = + (test_structure_1 *) malloc (sizeof(test_structure_1)); + + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + ts1_type_elements[0] = &ffi_type_uint; + ts1_type_elements[1] = &ffi_type_uint; + ts1_type_elements[2] = &ffi_type_uint; + ts1_type_elements[3] = &ffi_type_uint; + ts1_type_elements[4] = NULL; + + args[0] = &ts1_type; + values[0] = &ts1_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ts1_type, args) == FFI_OK); + + ts1_arg.ui04 = 555; + + ffi_call(&cif, FFI_FN(struct1), ts1_result, values); + + CHECK(ts1_result->ui04 == 556); + + /* This will fail if ffi_call isn't passing the struct by value. */ + CHECK(ts1_arg.ui04 == 555); + + free (ts1_result); + exit(0); +} diff --git a/testsuite/libffi.call/struct_by_value_big.c b/testsuite/libffi.call/struct_by_value_big.c new file mode 100644 index 0000000..06422ca --- /dev/null +++ b/testsuite/libffi.call/struct_by_value_big.c @@ -0,0 +1,93 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + unsigned int ui01; + unsigned int ui02; + unsigned int ui03; + unsigned int ui04; + unsigned int ui05; + unsigned int ui06; + unsigned int ui07; + unsigned int ui08; + unsigned int ui09; + unsigned int ui10; + unsigned int ui11; + unsigned int ui12; + unsigned int ui13; + unsigned int ui14; + unsigned int ui15; + unsigned int ui16; + unsigned int ui17; +} test_structure_1; + +static test_structure_1 ABI_ATTR struct1(test_structure_1 ts) +{ + ts.ui17++; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts1_type; + ffi_type *ts1_type_elements[18]; + + test_structure_1 ts1_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_1 *ts1_result = + (test_structure_1 *) malloc (sizeof(test_structure_1)); + + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + ts1_type_elements[0] = &ffi_type_uint; + ts1_type_elements[1] = &ffi_type_uint; + ts1_type_elements[2] = &ffi_type_uint; + ts1_type_elements[3] = &ffi_type_uint; + ts1_type_elements[4] = &ffi_type_uint; + ts1_type_elements[5] = &ffi_type_uint; + ts1_type_elements[6] = &ffi_type_uint; + ts1_type_elements[7] = &ffi_type_uint; + ts1_type_elements[8] = &ffi_type_uint; + ts1_type_elements[9] = &ffi_type_uint; + ts1_type_elements[10] = &ffi_type_uint; + ts1_type_elements[11] = &ffi_type_uint; + ts1_type_elements[12] = &ffi_type_uint; + ts1_type_elements[13] = &ffi_type_uint; + ts1_type_elements[14] = &ffi_type_uint; + ts1_type_elements[15] = &ffi_type_uint; + ts1_type_elements[16] = &ffi_type_uint; + ts1_type_elements[17] = NULL; + + args[0] = &ts1_type; + values[0] = &ts1_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ts1_type, args) == FFI_OK); + + ts1_arg.ui17 = 555; + + ffi_call(&cif, FFI_FN(struct1), ts1_result, values); + + CHECK(ts1_result->ui17 == 556); + + /* This will fail if ffi_call isn't passing the struct by value. */ + CHECK(ts1_arg.ui17 == 555); + + free (ts1_result); + exit(0); +} diff --git a/testsuite/libffi.call/struct_by_value_small.c b/testsuite/libffi.call/struct_by_value_small.c new file mode 100644 index 0000000..19613f8 --- /dev/null +++ b/testsuite/libffi.call/struct_by_value_small.c @@ -0,0 +1,61 @@ +/* Area: ffi_call + Purpose: Check structures. + Limitations: none. + PR: none. + Originator: From the original ffitest.c */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct +{ + unsigned int ui17; +} test_structure_1; + +static test_structure_1 ABI_ATTR struct1(test_structure_1 ts) +{ + ts.ui17++; + + return ts; +} + +int main (void) +{ + ffi_cif cif; + ffi_type *args[MAX_ARGS]; + void *values[MAX_ARGS]; + ffi_type ts1_type; + ffi_type *ts1_type_elements[2]; + + test_structure_1 ts1_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_1 *ts1_result = + (test_structure_1 *) malloc (sizeof(test_structure_1)); + + ts1_type.size = 0; + ts1_type.alignment = 0; + ts1_type.type = FFI_TYPE_STRUCT; + ts1_type.elements = ts1_type_elements; + ts1_type_elements[0] = &ffi_type_uint; + ts1_type_elements[1] = NULL; + + args[0] = &ts1_type; + values[0] = &ts1_arg; + + /* Initialize the cif */ + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ts1_type, args) == FFI_OK); + + ts1_arg.ui17 = 555; + + ffi_call(&cif, FFI_FN(struct1), ts1_result, values); + + CHECK(ts1_result->ui17 == 556); + + /* This will fail if ffi_call isn't passing the struct by value. */ + CHECK(ts1_arg.ui17 == 555); + + free (ts1_result); + exit(0); +} diff --git a/testsuite/libffi.call/va_1.c b/testsuite/libffi.call/va_1.c index 59d085c..ccc6faf 100644 --- a/testsuite/libffi.call/va_1.c +++ b/testsuite/libffi.call/va_1.c @@ -5,7 +5,6 @@ Originator: ARM Ltd. */ /* { dg-do run } */ -/* { dg-output "" { xfail avr32*-*-* m68k-*-* alpha-*-* } } */ #include "ffitest.h" #include @@ -25,62 +24,10 @@ struct large_tag unsigned e; }; -static int -test_fn (int n, ...) -{ - va_list ap; - struct small_tag s1; - struct small_tag s2; - struct large_tag l; - unsigned char uc; - signed char sc; - unsigned short us; - signed short ss; - unsigned int ui; - signed int si; - unsigned long ul; - signed long sl; - float f; - double d; - - va_start (ap, n); - s1 = va_arg (ap, struct small_tag); - l = va_arg (ap, struct large_tag); - s2 = va_arg (ap, struct small_tag); - - uc = va_arg (ap, unsigned); - sc = va_arg (ap, signed); - - us = va_arg (ap, unsigned); - ss = va_arg (ap, signed); - - ui = va_arg (ap, unsigned int); - si = va_arg (ap, signed int); - - ul = va_arg (ap, unsigned long); - sl = va_arg (ap, signed long); - - f = va_arg (ap, double); /* C standard promotes float->double - when anonymous */ - d = va_arg (ap, double); - - printf ("%u %u %u %u %u %u %u %u %u uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n", - s1.a, s1.b, l.a, l.b, l.c, l.d, l.e, - s2.a, s2.b, - uc, sc, - us, ss, - ui, si, - ul, sl, - f, d); - va_end (ap); - return n + 1; -} - int main (void) { ffi_cif cif; - void* args[15]; ffi_type* arg_types[15]; ffi_type s_type; @@ -89,24 +36,6 @@ main (void) ffi_type l_type; ffi_type *l_type_elements[6]; - struct small_tag s1; - struct small_tag s2; - struct large_tag l1; - - int n; - ffi_arg res; - - unsigned char uc; - signed char sc; - unsigned short us; - signed short ss; - unsigned int ui; - signed int si; - unsigned long ul; - signed long sl; - double d1; - double f1; - s_type.size = 0; s_type.alignment = 0; s_type.type = FFI_TYPE_STRUCT; @@ -144,53 +73,6 @@ main (void) arg_types[13] = &ffi_type_double; arg_types[14] = NULL; - CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_OK); - - s1.a = 5; - s1.b = 6; - - l1.a = 10; - l1.b = 11; - l1.c = 12; - l1.d = 13; - l1.e = 14; - - s2.a = 7; - s2.b = 8; - - n = 41; - - uc = 9; - sc = 10; - us = 11; - ss = 12; - ui = 13; - si = 14; - ul = 15; - sl = 16; - f1 = 2.12; - d1 = 3.13; - - args[0] = &n; - args[1] = &s1; - args[2] = &l1; - args[3] = &s2; - args[4] = &uc; - args[5] = ≻ - args[6] = &us; - args[7] = &ss; - args[8] = &ui; - args[9] = &si; - args[10] = &ul; - args[11] = &sl; - args[12] = &f1; - args[13] = &d1; - args[14] = NULL; - - ffi_call(&cif, FFI_FN(test_fn), &res, args); - /* { dg-output "5 6 10 11 12 13 14 7 8 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */ - printf("res: %d\n", (int) res); - /* { dg-output "\nres: 42" } */ - + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_BAD_ARGTYPE); return 0; } diff --git a/testsuite/libffi.call/va_2.c b/testsuite/libffi.call/va_2.c new file mode 100644 index 0000000..75d4dfc --- /dev/null +++ b/testsuite/libffi.call/va_2.c @@ -0,0 +1,220 @@ +/* Area: ffi_call + Purpose: Test passing struct in variable argument lists. + Limitations: none. + PR: none. + Originator: ARM Ltd. */ + +/* { dg-do run } */ +/* { dg-output "" { xfail avr32*-*-* m68k-*-* } } */ + +#include "ffitest.h" +#include + +struct small_tag +{ + unsigned char a; + unsigned char b; +}; + +struct large_tag +{ + unsigned a; + unsigned b; + unsigned c; + unsigned d; + unsigned e; +}; + + +static int +test_fn (int n, ...) +{ + va_list ap; + struct small_tag s1; + struct small_tag s2; + struct large_tag l; + unsigned char uc; + signed char sc; + unsigned short us; + signed short ss; + unsigned int ui; + signed int si; + unsigned long ul; + signed long sl; + float f; + double d; + + va_start (ap, n); + s1 = va_arg (ap, struct small_tag); + l = va_arg (ap, struct large_tag); + s2 = va_arg (ap, struct small_tag); + + uc = va_arg (ap, unsigned); + sc = va_arg (ap, signed); + + us = va_arg (ap, unsigned); + ss = va_arg (ap, signed); + + ui = va_arg (ap, unsigned int); + si = va_arg (ap, signed int); + + ul = va_arg (ap, unsigned long); + sl = va_arg (ap, signed long); + + f = va_arg (ap, double); /* C standard promotes float->double + when anonymous */ + d = va_arg (ap, double); + + printf ("%u %u %u %u %u %u %u %u %u uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n", + s1.a, s1.b, l.a, l.b, l.c, l.d, l.e, + s2.a, s2.b, + uc, sc, + us, ss, + ui, si, + ul, sl, + f, d); + + va_end (ap); + + CHECK(s1.a == 5); + CHECK(s1.b == 6); + CHECK(l.a == 10); + CHECK(l.b == 11); + CHECK(l.c == 12); + CHECK(l.d == 13); + CHECK(l.e == 14); + CHECK(s2.a == 7); + CHECK(s2.b == 8); + CHECK(uc == 9); + CHECK(sc == 10); + CHECK(us == 11); + CHECK(ss == 12); + CHECK(ui == 13); + CHECK(si == 14); + CHECK(ul == 15); + CHECK(sl == 16); + CHECK((int)f == 2); + CHECK((int)d == 3); + + return n + 1; +} + +int +main (void) +{ + ffi_cif cif; + void* args[15]; + ffi_type* arg_types[15]; + + ffi_type s_type; + ffi_type *s_type_elements[3]; + + ffi_type l_type; + ffi_type *l_type_elements[6]; + + struct small_tag s1; + struct small_tag s2; + struct large_tag l1; + + int n; + ffi_arg res; + + unsigned int uc; + signed int sc; + unsigned int us; + signed int ss; + unsigned int ui; + signed int si; + unsigned long ul; + signed long sl; + double d1; + double f1; + + s_type.size = 0; + s_type.alignment = 0; + s_type.type = FFI_TYPE_STRUCT; + s_type.elements = s_type_elements; + + s_type_elements[0] = &ffi_type_uchar; + s_type_elements[1] = &ffi_type_uchar; + s_type_elements[2] = NULL; + + l_type.size = 0; + l_type.alignment = 0; + l_type.type = FFI_TYPE_STRUCT; + l_type.elements = l_type_elements; + + l_type_elements[0] = &ffi_type_uint; + l_type_elements[1] = &ffi_type_uint; + l_type_elements[2] = &ffi_type_uint; + l_type_elements[3] = &ffi_type_uint; + l_type_elements[4] = &ffi_type_uint; + l_type_elements[5] = NULL; + + arg_types[0] = &ffi_type_sint; + arg_types[1] = &s_type; + arg_types[2] = &l_type; + arg_types[3] = &s_type; + arg_types[4] = &ffi_type_uint; + arg_types[5] = &ffi_type_sint; + arg_types[6] = &ffi_type_uint; + arg_types[7] = &ffi_type_sint; + arg_types[8] = &ffi_type_uint; + arg_types[9] = &ffi_type_sint; + arg_types[10] = &ffi_type_ulong; + arg_types[11] = &ffi_type_slong; + arg_types[12] = &ffi_type_double; + arg_types[13] = &ffi_type_double; + arg_types[14] = NULL; + + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_OK); + + s1.a = 5; + s1.b = 6; + + l1.a = 10; + l1.b = 11; + l1.c = 12; + l1.d = 13; + l1.e = 14; + + s2.a = 7; + s2.b = 8; + + n = 41; + + uc = 9; + sc = 10; + us = 11; + ss = 12; + ui = 13; + si = 14; + ul = 15; + sl = 16; + f1 = 2.12; + d1 = 3.13; + + args[0] = &n; + args[1] = &s1; + args[2] = &l1; + args[3] = &s2; + args[4] = &uc; + args[5] = ≻ + args[6] = &us; + args[7] = &ss; + args[8] = &ui; + args[9] = &si; + args[10] = &ul; + args[11] = &sl; + args[12] = &f1; + args[13] = &d1; + args[14] = NULL; + + ffi_call(&cif, FFI_FN(test_fn), &res, args); + /* { dg-output "5 6 10 11 12 13 14 7 8 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 42" } */ + CHECK(res == 42); + + return 0; +} diff --git a/testsuite/libffi.call/va_3.c b/testsuite/libffi.call/va_3.c new file mode 100644 index 0000000..b3e73b5 --- /dev/null +++ b/testsuite/libffi.call/va_3.c @@ -0,0 +1,154 @@ +/* Area: ffi_call + Purpose: Test function with multiple fixed args and variable argument list. + Limitations: none. + PR: none. + Originator: ARM Ltd., Oracle */ + +/* { dg-do run } */ +/* { dg-output "" { xfail avr32*-*-* m68k-*-* } } */ + +#include "ffitest.h" +#include + +/* + * This is a modified version of va_2.c that has fixed arguments with "small" types that + * are not allowed as variable arguments, but they should be still allowed as fixed args. + */ + +static int +test_fn (char a1, float a2, int n, ...) +{ + va_list ap; + unsigned char uc; + signed char sc; + unsigned short us; + signed short ss; + unsigned int ui; + signed int si; + unsigned long ul; + signed long sl; + float f; + double d; + + va_start (ap, n); + + uc = va_arg (ap, unsigned); + sc = va_arg (ap, signed); + + us = va_arg (ap, unsigned); + ss = va_arg (ap, signed); + + ui = va_arg (ap, unsigned int); + si = va_arg (ap, signed int); + + ul = va_arg (ap, unsigned long); + sl = va_arg (ap, signed long); + + f = va_arg (ap, double); /* C standard promotes float->double + when anonymous */ + d = va_arg (ap, double); + + printf ("%d %f uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n", + a1, a2, + uc, sc, + us, ss, + ui, si, + ul, sl, + f, d); + + va_end (ap); + + CHECK(a1 == 1); + CHECK((int)a2 == 2); + CHECK(uc == 9); + CHECK(sc == 10); + CHECK(us == 11); + CHECK(ss == 12); + CHECK(ui == 13); + CHECK(si == 14); + CHECK(ul == 15); + CHECK(sl == 16); + CHECK((int)f == 2); + CHECK((int)d == 3); + + return n + 1; +} + +int +main (void) +{ + ffi_cif cif; + void* args[14]; + ffi_type* arg_types[14]; + + char a1; + float a2; + int n; + ffi_arg res; + + unsigned int uc; + signed int sc; + unsigned int us; + signed int ss; + unsigned int ui; + signed int si; + unsigned long ul; + signed long sl; + double d1; + double f1; + + arg_types[0] = &ffi_type_schar; + arg_types[1] = &ffi_type_float; + arg_types[2] = &ffi_type_sint; + arg_types[3] = &ffi_type_uint; + arg_types[4] = &ffi_type_sint; + arg_types[5] = &ffi_type_uint; + arg_types[6] = &ffi_type_sint; + arg_types[7] = &ffi_type_uint; + arg_types[8] = &ffi_type_sint; + arg_types[9] = &ffi_type_ulong; + arg_types[10] = &ffi_type_slong; + arg_types[11] = &ffi_type_double; + arg_types[12] = &ffi_type_double; + arg_types[13] = NULL; + + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 3, 13, &ffi_type_sint, arg_types) == FFI_OK); + + a1 = 1; + a2 = 2.0f; + n = 41; + + uc = 9; + sc = 10; + us = 11; + ss = 12; + ui = 13; + si = 14; + ul = 15; + sl = 16; + f1 = 2.12; + d1 = 3.13; + + args[0] = &a1; + args[1] = &a2; + args[2] = &n; + args[3] = &uc; + args[4] = ≻ + args[5] = &us; + args[6] = &ss; + args[7] = &ui; + args[8] = &si; + args[9] = &ul; + args[10] = &sl; + args[11] = &f1; + args[12] = &d1; + args[13] = NULL; + + ffi_call(&cif, FFI_FN(test_fn), &res, args); + /* { dg-output "1 2.000000 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 42" } */ + CHECK(res == 42); + + return 0; +} diff --git a/testsuite/libffi.call/va_struct1.c b/testsuite/libffi.call/va_struct1.c index e645206..fff5c9a 100644 --- a/testsuite/libffi.call/va_struct1.c +++ b/testsuite/libffi.call/va_struct1.c @@ -40,6 +40,18 @@ test_fn (int n, ...) printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e, s2.a, s2.b); va_end (ap); + + CHECK(s1.a == 5); + CHECK(s1.b == 6); + + CHECK(l.a == 10); + CHECK(l.b == 11); + CHECK(l.c == 12); + CHECK(l.d == 13); + CHECK(l.e == 14); + + CHECK(s2.a == 7); + CHECK(s2.b == 8); return n + 1; } @@ -116,6 +128,7 @@ main (void) /* { dg-output "5 6 10 11 12 13 14 7 8" } */ printf("res: %d\n", (int) res); /* { dg-output "\nres: 42" } */ + CHECK(res == 42); return 0; } diff --git a/testsuite/libffi.call/va_struct2.c b/testsuite/libffi.call/va_struct2.c index 56f5b9c..a8daff3 100644 --- a/testsuite/libffi.call/va_struct2.c +++ b/testsuite/libffi.call/va_struct2.c @@ -39,6 +39,15 @@ test_fn (int n, ...) s2 = va_arg (ap, struct small_tag); printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e, s2.a, s2.b); + CHECK(s1.a == 5); + CHECK(s1.b == 6); + CHECK(l.a == 10); + CHECK(l.b == 11); + CHECK(l.c == 12); + CHECK(l.d == 13); + CHECK(l.e == 14); + CHECK(s2.a == 7); + CHECK(s2.b == 8); va_end (ap); s1.a += s2.a; s1.b += s2.b; @@ -118,6 +127,8 @@ main (void) /* { dg-output "5 6 10 11 12 13 14 7 8" } */ printf("res: %d %d\n", res.a, res.b); /* { dg-output "\nres: 12 14" } */ + CHECK(res.a == 12); + CHECK(res.b == 14); return 0; } diff --git a/testsuite/libffi.call/va_struct3.c b/testsuite/libffi.call/va_struct3.c index 9a27e7f..d3bd280 100644 --- a/testsuite/libffi.call/va_struct3.c +++ b/testsuite/libffi.call/va_struct3.c @@ -39,6 +39,16 @@ test_fn (int n, ...) s2 = va_arg (ap, struct small_tag); printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e, s2.a, s2.b); + + CHECK(s1.a == 5); + CHECK(s1.b == 6); + CHECK(l.a == 10); + CHECK(l.b == 11); + CHECK(l.c == 12); + CHECK(l.d == 13); + CHECK(l.e == 14); + CHECK(s2.a == 7); + CHECK(s2.b == 8); va_end (ap); l.a += s1.a; l.b += s1.b; @@ -120,6 +130,11 @@ main (void) /* { dg-output "5 6 10 11 12 13 14 7 8" } */ printf("res: %d %d %d %d %d\n", res.a, res.b, res.c, res.d, res.e); /* { dg-output "\nres: 15 17 19 21 14" } */ + CHECK(res.a == 15); + CHECK(res.b == 17); + CHECK(res.c == 19); + CHECK(res.d == 21); + CHECK(res.e == 14); return 0; } diff --git a/testsuite/libffi.closures/closure_fn0.c b/testsuite/libffi.closures/closure_fn0.c index a579ff6..dfadb05 100644 --- a/testsuite/libffi.closures/closure_fn0.c +++ b/testsuite/libffi.closures/closure_fn0.c @@ -38,7 +38,7 @@ closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args, (int)*(int *)args[12], (int)(*(int *)args[13]), (int)(*(int *)args[14]),*(int *)args[15], (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); - + CHECK((int)*(ffi_arg *)resp == 680); } typedef int (*closure_test_type0)(unsigned long long, int, unsigned long long, @@ -85,5 +85,6 @@ int main (void) /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ printf("res: %d\n",res); /* { dg-output "\nres: 680" } */ - exit(0); + CHECK(res == 680); + exit(0); } diff --git a/testsuite/libffi.closures/closure_fn1.c b/testsuite/libffi.closures/closure_fn1.c index 9123173..a90bb29 100644 --- a/testsuite/libffi.closures/closure_fn1.c +++ b/testsuite/libffi.closures/closure_fn1.c @@ -33,6 +33,7 @@ static void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, void** args, (int)*(int *)args[12], (int)(*(int *)args[13]), (int)(*(int *)args[14]), *(int *)args[15], (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + CHECK((int)*(ffi_arg *)resp == 255); } typedef int (*closure_test_type1)(float, float, float, float, signed short, @@ -77,5 +78,6 @@ int main (void) /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ printf("res: %d\n",res); /* { dg-output "\nres: 255" } */ + CHECK(res == 255); exit(0); } diff --git a/testsuite/libffi.closures/closure_fn2.c b/testsuite/libffi.closures/closure_fn2.c index 08ff9d9..7d7af4b 100644 --- a/testsuite/libffi.closures/closure_fn2.c +++ b/testsuite/libffi.closures/closure_fn2.c @@ -32,6 +32,7 @@ static void closure_test_fn2(ffi_cif* cif __UNUSED__, void* resp, void** args, (int)*(int *)args[12], (int)(*(float *)args[13]), (int)(*(int *)args[14]), *(int *)args[15], (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + CHECK((int)*(ffi_arg *)resp == 255); } typedef int (*closure_test_type2)(double, double, double, double, signed short, @@ -77,5 +78,6 @@ int main (void) /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ printf("res: %d\n",res); /* { dg-output "\nres: 255" } */ + CHECK(res == 255); exit(0); } diff --git a/testsuite/libffi.closures/closure_fn3.c b/testsuite/libffi.closures/closure_fn3.c index 9b54d80..1ad8f9d 100644 --- a/testsuite/libffi.closures/closure_fn3.c +++ b/testsuite/libffi.closures/closure_fn3.c @@ -31,8 +31,27 @@ static void closure_test_fn3(ffi_cif* cif __UNUSED__, void* resp, void** args, (int)(*(float *)args[10]), (int)(*(float *)args[11]), (int)*(int *)args[12], (int)(*(float *)args[13]), (int)(*(float *)args[14]), *(int *)args[15], (int)(intptr_t)userdata, - (int)*(ffi_arg *)resp); + (int)*(ffi_arg *)resp); + CHECK((int)*(float *)args[0] == 1); + CHECK((int)(*(float *)args[1]) == 2); + CHECK((int)(*(float *)args[2]) == 3); + CHECK((int)(*(float *)args[3]) == 4); + CHECK((int)(*(float *)args[4]) == 5); + CHECK((int)(*(float *)args[5]) == 6); + CHECK((int)*(float *)args[6] == 7); + CHECK((int)(*(float *)args[7]) == 8); + CHECK((int)(*(double *)args[8]) == 9); + CHECK((int)*(int *)args[9] == 10); + CHECK((int)(*(float *)args[10]) == 11); + CHECK((int)(*(float *)args[11]) == 12); + CHECK((int)*(int *)args[12] == 13); + CHECK((int)(*(float *)args[13]) == 19); + CHECK((int)(*(float *)args[14]) == 21); + CHECK(*(int *)args[15] == 1); + CHECK((int)(intptr_t)userdata == 3); + + CHECK((int)*(ffi_arg *)resp == 135); } typedef int (*closure_test_type3)(float, float, float, float, float, float, @@ -78,5 +97,6 @@ int main (void) /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 19 21 1 3: 135" } */ printf("res: %d\n",res); /* { dg-output "\nres: 135" } */ + CHECK(res == 135); exit(0); } diff --git a/testsuite/libffi.closures/closure_fn4.c b/testsuite/libffi.closures/closure_fn4.c index d4a1530..e5f1f53 100644 --- a/testsuite/libffi.closures/closure_fn4.c +++ b/testsuite/libffi.closures/closure_fn4.c @@ -45,6 +45,7 @@ closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args, (int)*(unsigned long long *)args[14], *(int *)args[15], (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + CHECK((int)*(ffi_arg *)resp == 680); } @@ -84,6 +85,7 @@ int main (void) /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ printf("res: %d\n",res); /* { dg-output "\nres: 680" } */ + CHECK(res == 680); exit(0); } diff --git a/testsuite/libffi.closures/closure_fn5.c b/testsuite/libffi.closures/closure_fn5.c index 9907442..97277f5 100644 --- a/testsuite/libffi.closures/closure_fn5.c +++ b/testsuite/libffi.closures/closure_fn5.c @@ -44,6 +44,7 @@ closure_test_fn5(ffi_cif* cif __UNUSED__, void* resp, void** args, (int)*(unsigned long long *)args[14], *(int *)args[15], (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + CHECK((int)*(ffi_arg *)resp == 680); } @@ -87,6 +88,7 @@ int main (void) /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ printf("res: %d\n",res); /* { dg-output "\nres: 680" } */ + CHECK(res == 680); exit(0); } diff --git a/testsuite/libffi.closures/closure_fn6.c b/testsuite/libffi.closures/closure_fn6.c index 73c54fd..fb079e2 100644 --- a/testsuite/libffi.closures/closure_fn6.c +++ b/testsuite/libffi.closures/closure_fn6.c @@ -37,6 +37,7 @@ closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args, (int)*(int *)args[12], (int)(*(int *)args[13]), (int)(*(double *)args[14]), (int)(*(double *)args[15]), (int)(intptr_t)userdata, (int)*(ffi_arg *)resp); + CHECK((int)*(ffi_arg *)resp == 680); } @@ -86,5 +87,6 @@ int main (void) /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ printf("res: %d\n",res); /* { dg-output "\nres: 680" } */ + CHECK(res == 680); exit(0); } diff --git a/testsuite/libffi.closures/closure_loc_fn0.c b/testsuite/libffi.closures/closure_loc_fn0.c index b3afa0b..4f2f4f8 100644 --- a/testsuite/libffi.closures/closure_loc_fn0.c +++ b/testsuite/libffi.closures/closure_loc_fn0.c @@ -9,7 +9,7 @@ -/* { dg-do run } */ +/* { dg-do run { xfail wasm32*-*-* } } */ #include "ffitest.h" static void @@ -82,8 +82,11 @@ int main (void) CHECK(ffi_prep_closure_loc(pcl, &cif, closure_loc_test_fn0, (void *) 3 /* userdata */, codeloc) == FFI_OK); - + +#ifndef FFI_EXEC_STATIC_TRAMP + /* With static trampolines, the codeloc does not point to closure */ CHECK(memcmp(pcl, codeloc, sizeof(*pcl)) == 0); +#endif res = (*((closure_loc_test_type0)codeloc)) (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13, @@ -91,5 +94,6 @@ int main (void) /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */ printf("res: %d\n",res); /* { dg-output "\nres: 680" } */ - exit(0); + CHECK(res == 680); + exit(0); } diff --git a/testsuite/libffi.closures/closure_simple.c b/testsuite/libffi.closures/closure_simple.c index 5a4e728..a18b4a4 100644 --- a/testsuite/libffi.closures/closure_simple.c +++ b/testsuite/libffi.closures/closure_simple.c @@ -20,6 +20,11 @@ closure_test(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata) (int)(*(int *)args[2]), (int)(*(int *)args[3]), (int)*(ffi_arg *)resp); + CHECK((int)*(int *)args[0] == 0); + CHECK((int)*(int *)args[1] == 1); + CHECK((int)*(int *)args[2] == 2); + CHECK((int)*(int *)args[3] == 3); + CHECK((int)*(ffi_arg *)resp == 9); } typedef int (ABI_ATTR *closure_test_type0)(int, int, int, int); @@ -50,6 +55,7 @@ int main (void) printf("res: %d\n",res); /* { dg-output "\nres: 9" } */ + CHECK(res == 9); exit(0); } diff --git a/testsuite/libffi.closures/cls_12byte.c b/testsuite/libffi.closures/cls_12byte.c index ea0825d..a1fdcd7 100644 --- a/testsuite/libffi.closures/cls_12byte.c +++ b/testsuite/libffi.closures/cls_12byte.c @@ -25,6 +25,17 @@ cls_struct_12byte cls_struct_12byte_fn(struct cls_struct_12byte b1, printf("%d %d %d %d %d %d: %d %d %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c, result.a, result.b, result.c); + CHECK(b1.a == 7); + CHECK(b1.b == 4); + CHECK(b1.c == 9); + + CHECK(b2.a == 1); + CHECK(b2.b == 5); + CHECK(b2.c == 3); + + CHECK(result.a == 8); + CHECK(result.b == 9); + CHECK(result.c == 12); return result; } @@ -78,6 +89,9 @@ int main (void) /* { dg-output "7 4 9 1 5 3: 8 9 12" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 8 9 12" } */ + CHECK(res_dbl.a == 8); + CHECK(res_dbl.b == 9); + CHECK(res_dbl.c == 12); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_12byte_gn, NULL, code) == FFI_OK); @@ -87,8 +101,12 @@ int main (void) res_dbl = ((cls_struct_12byte(*)(cls_struct_12byte, cls_struct_12byte))(code))(h_dbl, j_dbl); /* { dg-output "\n7 4 9 1 5 3: 8 9 12" } */ + printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 8 9 12" } */ + CHECK(res_dbl.a == 8); + CHECK(res_dbl.b == 9); + CHECK(res_dbl.c == 12); exit(0); } diff --git a/testsuite/libffi.closures/cls_16byte.c b/testsuite/libffi.closures/cls_16byte.c index 89a08a2..57fe873 100644 --- a/testsuite/libffi.closures/cls_16byte.c +++ b/testsuite/libffi.closures/cls_16byte.c @@ -26,6 +26,19 @@ cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1, printf("%d %g %d %d %g %d: %d %g %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c, result.a, result.b, result.c); + CHECK(b1.a == 7); + CHECK(b1.b == 8); + CHECK(b1.c == 9); + + CHECK(b2.a == 1); + CHECK(b2.b == 9); + CHECK(b2.c == 3); + + CHECK(result.a == 8); + CHECK(result.b == 17); + CHECK(result.c == 12); + + return result; } @@ -80,6 +93,10 @@ int main (void) printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 8 17 12" } */ + CHECK(res_dbl.a == 8); + CHECK(res_dbl.b == 17); + CHECK(res_dbl.c == 12); + res_dbl.a = 0; res_dbl.b = 0.0; res_dbl.c = 0; @@ -91,5 +108,10 @@ int main (void) printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 8 17 12" } */ + CHECK(res_dbl.a == 8); + CHECK(res_dbl.b == 17); + CHECK(res_dbl.c == 12); + + exit(0); } diff --git a/testsuite/libffi.closures/cls_18byte.c b/testsuite/libffi.closures/cls_18byte.c index 9f75da8..3783121 100644 --- a/testsuite/libffi.closures/cls_18byte.c +++ b/testsuite/libffi.closures/cls_18byte.c @@ -29,6 +29,22 @@ cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1, printf("%g %d %d %g %g %d %d %g: %g %d %d %g\n", a1.a, a1.b, a1.c, a1.d, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); + + CHECK(a1.a == 1); + CHECK(a1.b == 127); + CHECK(a1.c == 126); + CHECK(a1.d == 3); + + CHECK(a2.a == 4); + CHECK(a2.b == 125); + CHECK(a2.c == 124); + CHECK(a2.d == 5); + + CHECK(result.a == 5); + CHECK(result.b == 252); + CHECK(result.c == 250); + CHECK(result.d == 8); + return result; } @@ -84,6 +100,10 @@ int main (void) /* { dg-output "1 127 126 3 4 125 124 5: 5 252 250 8" } */ printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 5 252 250 8" } */ + CHECK(res_dbl.a == 5); + CHECK(res_dbl.b == 252); + CHECK(res_dbl.c == 250); + CHECK(res_dbl.d == 8); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_18byte_gn, NULL, code) == FFI_OK); @@ -91,6 +111,10 @@ int main (void) /* { dg-output "\n1 127 126 3 4 125 124 5: 5 252 250 8" } */ printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 5 252 250 8" } */ + CHECK(res_dbl.a == 5); + CHECK(res_dbl.b == 252); + CHECK(res_dbl.c == 250); + CHECK(res_dbl.d == 8); exit(0); } diff --git a/testsuite/libffi.closures/cls_19byte.c b/testsuite/libffi.closures/cls_19byte.c index 278794b..98ce65a 100644 --- a/testsuite/libffi.closures/cls_19byte.c +++ b/testsuite/libffi.closures/cls_19byte.c @@ -32,6 +32,25 @@ cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1, a1.a, a1.b, a1.c, a1.d, a1.e, a2.a, a2.b, a2.c, a2.d, a2.e, result.a, result.b, result.c, result.d, result.e); + + CHECK(a1.a == 1); + CHECK(a1.b == 127); + CHECK(a1.c == 126); + CHECK(a1.d == 3); + CHECK(a1.e == 120); + + CHECK(a2.a == 4); + CHECK(a2.b == 125); + CHECK(a2.c == 124); + CHECK(a2.d == 5); + CHECK(a2.e == 119); + + CHECK(result.a == 5); + CHECK(result.b == 252); + CHECK(result.c == 250); + CHECK(result.d == 8); + CHECK(result.e == 239); + return result; } @@ -89,6 +108,11 @@ int main (void) printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e); /* { dg-output "\nres: 5 252 250 8 239" } */ + CHECK(res_dbl.a == 5); + CHECK(res_dbl.b == 252); + CHECK(res_dbl.c == 250); + CHECK(res_dbl.d == 8); + CHECK(res_dbl.e == 239); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_19byte_gn, NULL, code) == FFI_OK); @@ -97,6 +121,11 @@ int main (void) printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e); /* { dg-output "\nres: 5 252 250 8 239" } */ + CHECK(res_dbl.a == 5); + CHECK(res_dbl.b == 252); + CHECK(res_dbl.c == 250); + CHECK(res_dbl.d == 8); + CHECK(res_dbl.e == 239); exit(0); } diff --git a/testsuite/libffi.closures/cls_1_1byte.c b/testsuite/libffi.closures/cls_1_1byte.c index 82492c0..49e33b9 100644 --- a/testsuite/libffi.closures/cls_1_1byte.c +++ b/testsuite/libffi.closures/cls_1_1byte.c @@ -23,6 +23,9 @@ cls_struct_1_1byte cls_struct_1_1byte_fn(struct cls_struct_1_1byte a1, result.a = a1.a + a2.a; printf("%d %d: %d\n", a1.a, a2.a, result.a); + CHECK(a1.a == 12); + CHECK(a2.a == 178); + CHECK(result.a == 190); return result; } @@ -84,6 +87,7 @@ int main (void) /* { dg-output "\n12 178: 190" } */ printf("res: %d\n", res_dbl.a); /* { dg-output "\nres: 190" } */ + CHECK(res_dbl.a == 190); exit(0); } diff --git a/testsuite/libffi.closures/cls_20byte.c b/testsuite/libffi.closures/cls_20byte.c index 3f8bb28..fdae6f7 100644 --- a/testsuite/libffi.closures/cls_20byte.c +++ b/testsuite/libffi.closures/cls_20byte.c @@ -14,7 +14,7 @@ typedef struct cls_struct_20byte { int c; } cls_struct_20byte; -cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, +static cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, struct cls_struct_20byte a2) { struct cls_struct_20byte result; @@ -25,6 +25,18 @@ cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, printf("%g %g %d %g %g %d: %g %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + + CHECK(a1.a == 1); + CHECK(a1.b == 2); + CHECK(a1.c == 3); + + CHECK(a2.a == 4); + CHECK(a2.b == 5); + CHECK(a2.c == 7); + + CHECK(result.a == 5); + CHECK(result.b == 7); + CHECK(result.c == 10); return result; } @@ -79,6 +91,9 @@ int main (void) /* { dg-output "1 2 3 4 5 7: 5 7 10" } */ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ + CHECK(res_dbl.a == 5); + CHECK(res_dbl.b == 7); + CHECK(res_dbl.c == 10); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK); @@ -86,6 +101,9 @@ int main (void) /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ + CHECK(res_dbl.a == 5); + CHECK(res_dbl.b == 7); + CHECK(res_dbl.c == 10); exit(0); } diff --git a/testsuite/libffi.closures/cls_20byte1.c b/testsuite/libffi.closures/cls_20byte1.c index 6562727..e6979b5 100644 --- a/testsuite/libffi.closures/cls_20byte1.c +++ b/testsuite/libffi.closures/cls_20byte1.c @@ -16,7 +16,7 @@ typedef struct cls_struct_20byte { double c; } cls_struct_20byte; -cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, +static cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, struct cls_struct_20byte a2) { struct cls_struct_20byte result; @@ -27,6 +27,19 @@ cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, printf("%d %g %g %d %g %g: %d %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + + CHECK(a1.a == 1); + CHECK(a1.b == 2); + CHECK(a1.c == 3); + + CHECK(a2.a == 4); + CHECK(a2.b == 5); + CHECK(a2.c == 7); + + CHECK(result.a == 5); + CHECK(result.b == 7); + CHECK(result.c == 10); + return result; } @@ -81,6 +94,9 @@ int main (void) /* { dg-output "1 2 3 4 5 7: 5 7 10" } */ printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ + CHECK(res_dbl.a == 5); + CHECK(res_dbl.b == 7); + CHECK(res_dbl.c == 10); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK); @@ -89,5 +105,9 @@ int main (void) printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 5 7 10" } */ + CHECK(res_dbl.a == 5); + CHECK(res_dbl.b == 7); + CHECK(res_dbl.c == 10); + exit(0); } diff --git a/testsuite/libffi.closures/cls_24byte.c b/testsuite/libffi.closures/cls_24byte.c index 1d82f6e..b204966 100644 --- a/testsuite/libffi.closures/cls_24byte.c +++ b/testsuite/libffi.closures/cls_24byte.c @@ -31,8 +31,32 @@ cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0, b0.a, b0.b, b0.c, b0.d, b1.a, b1.b, b1.c, b1.d, b2.a, b2.b, b2.c, b2.d, - b3.a, b3.b, b3.c, b2.d, + b3.a, b3.b, b3.c, b3.d, result.a, result.b, result.c, result.d); + CHECK_DOUBLE_EQ(b0.a, 9); + CHECK_DOUBLE_EQ(b0.b, 2); + CHECK(b0.c == 6); + CHECK_FLOAT_EQ(b0.d, 5); + + CHECK_DOUBLE_EQ(b1.a, 1); + CHECK_DOUBLE_EQ(b1.b, 2); + CHECK(b1.c == 3); + CHECK_FLOAT_EQ(b1.d, 7); + + CHECK_DOUBLE_EQ(b2.a, 4); + CHECK_DOUBLE_EQ(b2.b, 5); + CHECK(b2.c == 7); + CHECK_FLOAT_EQ(b2.d, 9); + + CHECK_DOUBLE_EQ(b3.a, 8); + CHECK_DOUBLE_EQ(b3.b, 6); + CHECK(b3.c == 1); + CHECK_FLOAT_EQ(b3.d, 4); + + CHECK_DOUBLE_EQ(result.a, 22); + CHECK_DOUBLE_EQ(result.b, 15); + CHECK(result.c == 17); + CHECK_FLOAT_EQ(result.d, 25); return result; } @@ -94,9 +118,13 @@ int main (void) args_dbl[4] = NULL; ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl); - /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */ + /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 4: 22 15 17 25" } */ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 22 15 17 25" } */ + CHECK_DOUBLE_EQ(res_dbl.a, 22); + CHECK_DOUBLE_EQ(res_dbl.b, 15); + CHECK(res_dbl.c == 17); + CHECK_FLOAT_EQ(res_dbl.d, 25); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_24byte_gn, NULL, code) == FFI_OK); @@ -105,9 +133,13 @@ int main (void) cls_struct_24byte, cls_struct_24byte)) (code))(e_dbl, f_dbl, g_dbl, h_dbl); - /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */ + /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 4: 22 15 17 25" } */ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 22 15 17 25" } */ + CHECK_DOUBLE_EQ(res_dbl.a, 22); + CHECK_DOUBLE_EQ(res_dbl.b, 15); + CHECK(res_dbl.c == 17); + CHECK_FLOAT_EQ(res_dbl.d, 25); exit(0); } diff --git a/testsuite/libffi.closures/cls_2byte.c b/testsuite/libffi.closures/cls_2byte.c index 81bb0a6..c5209b7 100644 --- a/testsuite/libffi.closures/cls_2byte.c +++ b/testsuite/libffi.closures/cls_2byte.c @@ -24,6 +24,15 @@ cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1, printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + CHECK(a1.a == 12); + CHECK(a1.b == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == 13); + + CHECK(result.a == 13); + CHECK(result.b == 140); + return result; } @@ -78,6 +87,8 @@ int main (void) /* { dg-output "12 127 1 13: 13 140" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_2byte_gn, NULL, code) == FFI_OK); @@ -85,6 +96,8 @@ int main (void) /* { dg-output "\n12 127 1 13: 13 140" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_3_1byte.c b/testsuite/libffi.closures/cls_3_1byte.c index b782746..aaa7ccc 100644 --- a/testsuite/libffi.closures/cls_3_1byte.c +++ b/testsuite/libffi.closures/cls_3_1byte.c @@ -28,6 +28,18 @@ cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1, a2.a, a2.b, a2.c, result.a, result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == 13); + CHECK(a1.c == 14); + + CHECK(a2.a == 178); + CHECK(a2.b == 179); + CHECK(a2.c == 180); + + CHECK(result.a == 190); + CHECK(result.b == 192); + CHECK(result.c == 194); + return result; } @@ -83,6 +95,9 @@ int main (void) /* { dg-output "12 13 14 178 179 180: 190 192 194" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 190 192 194" } */ + CHECK(res_dbl.a == 190); + CHECK(res_dbl.b == 192); + CHECK(res_dbl.c == 194); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3_1byte_gn, NULL, code) == FFI_OK); @@ -91,5 +106,9 @@ int main (void) printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 190 192 194" } */ + CHECK(res_dbl.a == 190); + CHECK(res_dbl.b == 192); + CHECK(res_dbl.c == 194); + exit(0); } diff --git a/testsuite/libffi.closures/cls_3byte1.c b/testsuite/libffi.closures/cls_3byte1.c index a02c463..b424917 100644 --- a/testsuite/libffi.closures/cls_3byte1.c +++ b/testsuite/libffi.closures/cls_3byte1.c @@ -24,6 +24,15 @@ cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1, printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + CHECK(a1.a == 12); + CHECK(a1.b == 119); + + CHECK(a2.a == 1); + CHECK(a2.b == 15); + + CHECK(result.a == 13); + CHECK(result.b == 134); + return result; } @@ -78,6 +87,8 @@ int main (void) /* { dg-output "12 119 1 15: 13 134" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 134" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 134); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn, NULL, code) == FFI_OK); @@ -85,6 +96,8 @@ int main (void) /* { dg-output "\n12 119 1 15: 13 134" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 13 134" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 134); exit(0); } diff --git a/testsuite/libffi.closures/cls_3byte2.c b/testsuite/libffi.closures/cls_3byte2.c index c7251ce..f13590e 100644 --- a/testsuite/libffi.closures/cls_3byte2.c +++ b/testsuite/libffi.closures/cls_3byte2.c @@ -24,6 +24,15 @@ cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1, printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + CHECK(a1.a == 15); + CHECK(a1.b == 125); + + CHECK(a2.a == 9); + CHECK(a2.b == 19); + + CHECK(result.a == 24); + CHECK(result.b == 144); + return result; } @@ -78,6 +87,8 @@ int main (void) /* { dg-output "15 125 9 19: 24 144" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 24 144" } */ + CHECK(res_dbl.a == 24); + CHECK(res_dbl.b == 144); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn1, NULL, code) == FFI_OK); @@ -85,6 +96,8 @@ int main (void) /* { dg-output "\n15 125 9 19: 24 144" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 24 144" } */ + CHECK(res_dbl.a == 24); + CHECK(res_dbl.b == 144); exit(0); } diff --git a/testsuite/libffi.closures/cls_3float.c b/testsuite/libffi.closures/cls_3float.c index 48888f8..63171bc 100644 --- a/testsuite/libffi.closures/cls_3float.c +++ b/testsuite/libffi.closures/cls_3float.c @@ -27,6 +27,18 @@ cls_struct_3float cls_struct_3float_fn(struct cls_struct_3float a1, printf("%g %g %g %g %g %g: %g %g %g\n", a1.f, a1.g, a1.h, a2.f, a2.g, a2.h, result.f, result.g, result.h); + CHECK_FLOAT_EQ(a1.f, 1); + CHECK_FLOAT_EQ(a1.g, 2); + CHECK_FLOAT_EQ(a1.h, 3); + + CHECK_FLOAT_EQ(a2.f, 1); + CHECK_FLOAT_EQ(a2.g, 2); + CHECK_FLOAT_EQ(a2.h, 3); + + CHECK_FLOAT_EQ(result.f, 2); + CHECK_FLOAT_EQ(result.g, 4); + CHECK_FLOAT_EQ(result.h, 6); + return result; } @@ -81,6 +93,9 @@ int main (void) /* { dg-output "1 2 3 1 2 3: 2 4 6" } */ printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h); /* { dg-output "\nres: 2 4 6" } */ + CHECK_FLOAT_EQ(res_dbl.f, 2); + CHECK_FLOAT_EQ(res_dbl.g, 4); + CHECK_FLOAT_EQ(res_dbl.h, 6); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3float_gn, NULL, code) == FFI_OK); @@ -90,6 +105,9 @@ int main (void) /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */ printf("res: %g %g %g\n", res_dbl.f, res_dbl.g, res_dbl.h); /* { dg-output "\nres: 2 4 6" } */ + CHECK_FLOAT_EQ(res_dbl.f, 2); + CHECK_FLOAT_EQ(res_dbl.g, 4); + CHECK_FLOAT_EQ(res_dbl.h, 6); exit(0); } diff --git a/testsuite/libffi.closures/cls_4_1byte.c b/testsuite/libffi.closures/cls_4_1byte.c index 2d6d8b6..b5d3f70 100644 --- a/testsuite/libffi.closures/cls_4_1byte.c +++ b/testsuite/libffi.closures/cls_4_1byte.c @@ -30,6 +30,20 @@ cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); + CHECK(a1.a == 12); + CHECK(a1.b == 13); + CHECK(a1.c == 14); + CHECK(a1.d == 15); + + CHECK(a2.a == 178); + CHECK(a2.b == 179); + CHECK(a2.c == 180); + CHECK(a2.d == 181); + + CHECK(result.a == 190); + CHECK(result.b == 192); + CHECK(result.c == 194); + CHECK(result.d == 196); return result; } @@ -86,6 +100,10 @@ int main (void) /* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 190 192 194 196" } */ + CHECK(res_dbl.a == 190); + CHECK(res_dbl.b == 192); + CHECK(res_dbl.c == 194); + CHECK(res_dbl.d == 196); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4_1byte_gn, NULL, code) == FFI_OK); @@ -93,6 +111,10 @@ int main (void) /* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 190 192 194 196" } */ + CHECK(res_dbl.a == 190); + CHECK(res_dbl.b == 192); + CHECK(res_dbl.c == 194); + CHECK(res_dbl.d == 196); exit(0); } diff --git a/testsuite/libffi.closures/cls_4byte.c b/testsuite/libffi.closures/cls_4byte.c index 4ac3787..4f8d173 100644 --- a/testsuite/libffi.closures/cls_4byte.c +++ b/testsuite/libffi.closures/cls_4byte.c @@ -24,6 +24,15 @@ cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1, printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + CHECK(a1.a == 127); + CHECK(a1.b == 120); + + CHECK(a2.a == 12); + CHECK(a2.b == 128); + + CHECK(result.a == 139); + CHECK(result.b == 248); + return result; } @@ -78,6 +87,8 @@ int main (void) /* { dg-output "127 120 12 128: 139 248" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 139 248" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4byte_gn, NULL, code) == FFI_OK); @@ -85,6 +96,8 @@ int main (void) /* { dg-output "\n127 120 12 128: 139 248" } */ printf("res: %d %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 139 248" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); exit(0); } diff --git a/testsuite/libffi.closures/cls_5_1_byte.c b/testsuite/libffi.closures/cls_5_1_byte.c index ad9d51c..07552cd 100644 --- a/testsuite/libffi.closures/cls_5_1_byte.c +++ b/testsuite/libffi.closures/cls_5_1_byte.c @@ -16,7 +16,7 @@ typedef struct cls_struct_5byte { unsigned char e; } cls_struct_5byte; -cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, +static cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, struct cls_struct_5byte a2) { struct cls_struct_5byte result; @@ -32,6 +32,24 @@ cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, a2.a, a2.b, a2.c, a2.d, a2.e, result.a, result.b, result.c, result.d, result.e); + CHECK(a1.a == 127); + CHECK(a1.b == 120); + CHECK(a1.c == 1); + CHECK(a1.d == 3); + CHECK(a1.e == 4); + + CHECK(a2.a == 12); + CHECK(a2.b == 128); + CHECK(a2.c == 9); + CHECK(a2.d == 3); + CHECK(a2.e == 4); + + CHECK(result.a == 139); + CHECK(result.b == 248); + CHECK(result.c == 10); + CHECK(result.d == 6); + CHECK(result.e == 8); + return result; } @@ -90,6 +108,11 @@ int main (void) printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e); /* { dg-output "\nres: 139 248 10 6 8" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 6); + CHECK(res_dbl.e == 8); res_dbl.a = 0; res_dbl.b = 0; @@ -104,6 +127,11 @@ int main (void) printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e); /* { dg-output "\nres: 139 248 10 6 8" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 6); + CHECK(res_dbl.e == 8); exit(0); } diff --git a/testsuite/libffi.closures/cls_5byte.c b/testsuite/libffi.closures/cls_5byte.c index 4e0c000..9f8936b 100644 --- a/testsuite/libffi.closures/cls_5byte.c +++ b/testsuite/libffi.closures/cls_5byte.c @@ -14,7 +14,7 @@ typedef struct cls_struct_5byte { unsigned char c; } cls_struct_5byte; -cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, +static cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, struct cls_struct_5byte a2) { struct cls_struct_5byte result; @@ -27,6 +27,18 @@ cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1, a2.a, a2.b, a2.c, result.a, result.b, result.c); + CHECK(a1.a == 127); + CHECK(a1.b == 120); + CHECK(a1.c == 1); + + CHECK(a2.a == 12); + CHECK(a2.b == 128); + CHECK(a2.c == 9); + + CHECK(result.a == 139); + CHECK(result.b == 248); + CHECK(result.c == 10); + return result; } @@ -82,6 +94,9 @@ int main (void) /* { dg-output "127 120 1 12 128 9: 139 248 10" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 139 248 10" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); res_dbl.a = 0; res_dbl.b = 0; @@ -93,6 +108,9 @@ int main (void) /* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 139 248 10" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); exit(0); } diff --git a/testsuite/libffi.closures/cls_64byte.c b/testsuite/libffi.closures/cls_64byte.c index a55edc2..5adedc9 100644 --- a/testsuite/libffi.closures/cls_64byte.c +++ b/testsuite/libffi.closures/cls_64byte.c @@ -38,6 +38,14 @@ cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0, printf("%g %g %g %g %g %g %g %g\n", result.a, result.b, result.c, result.d, result.e, result.f, result.g, result.h); + CHECK(result.a == 22); + CHECK(result.b == 15); + CHECK(result.c == 17); + CHECK(result.d == 25); + CHECK(result.e == 6); + CHECK(result.f == 13); + CHECK(result.g == 19); + CHECK(result.h == 18); return result; } @@ -107,6 +115,14 @@ int main (void) printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h); /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */ + CHECK(res_dbl.a == 22); + CHECK(res_dbl.b == 15); + CHECK(res_dbl.c == 17); + CHECK(res_dbl.d == 25); + CHECK(res_dbl.e == 6); + CHECK(res_dbl.f == 13); + CHECK(res_dbl.g == 19); + CHECK(res_dbl.h == 18); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_64byte_gn, NULL, code) == FFI_OK); @@ -119,6 +135,14 @@ int main (void) printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h); /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */ + CHECK(res_dbl.a == 22); + CHECK(res_dbl.b == 15); + CHECK(res_dbl.c == 17); + CHECK(res_dbl.d == 25); + CHECK(res_dbl.e == 6); + CHECK(res_dbl.f == 13); + CHECK(res_dbl.g == 19); + CHECK(res_dbl.h == 18); exit(0); } diff --git a/testsuite/libffi.closures/cls_6_1_byte.c b/testsuite/libffi.closures/cls_6_1_byte.c index b4dcdba..05e2945 100644 --- a/testsuite/libffi.closures/cls_6_1_byte.c +++ b/testsuite/libffi.closures/cls_6_1_byte.c @@ -17,7 +17,7 @@ typedef struct cls_struct_6byte { unsigned char f; } cls_struct_6byte; -cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, +static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, struct cls_struct_6byte a2) { struct cls_struct_6byte result; @@ -34,6 +34,27 @@ cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, result.a, result.b, result.c, result.d, result.e, result.f); + CHECK(a1.a == 127); + CHECK(a1.b == 120); + CHECK(a1.c == 1); + CHECK(a1.d == 3); + CHECK(a1.e == 4); + CHECK(a1.f == 5); + + CHECK(a2.a == 12); + CHECK(a2.b == 128); + CHECK(a2.c == 9); + CHECK(a2.d == 3); + CHECK(a2.e == 4); + CHECK(a2.f == 5); + + CHECK(result.a == 139); + CHECK(result.b == 248); + CHECK(result.c == 10); + CHECK(result.d == 6); + CHECK(result.e == 8); + CHECK(result.f == 10); + return result; } @@ -109,5 +130,11 @@ int main (void) res_dbl.d, res_dbl.e, res_dbl.f); /* { dg-output "\nres: 139 248 10 6 8 10" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 6); + CHECK(res_dbl.e == 8); + CHECK(res_dbl.f == 10); exit(0); } diff --git a/testsuite/libffi.closures/cls_6byte.c b/testsuite/libffi.closures/cls_6byte.c index 7406780..a8e3ea0 100644 --- a/testsuite/libffi.closures/cls_6byte.c +++ b/testsuite/libffi.closures/cls_6byte.c @@ -16,7 +16,7 @@ typedef struct cls_struct_6byte { unsigned char d; } cls_struct_6byte; -cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, +static cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, struct cls_struct_6byte a2) { struct cls_struct_6byte result; @@ -30,6 +30,21 @@ cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); + CHECK(a1.a == 127); + CHECK(a1.b == 120); + CHECK(a1.c == 1); + CHECK(a1.d == 128); + + CHECK(a2.a == 12); + CHECK(a2.b == 128); + CHECK(a2.c == 9); + CHECK(a2.d == 127); + + CHECK(result.a == 139); + CHECK(result.b == 248); + CHECK(result.c == 10); + CHECK(result.d == 255); + return result; } @@ -86,6 +101,10 @@ int main (void) /* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 139 248 10 255" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 255); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK); @@ -93,7 +112,10 @@ int main (void) /* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 139 248 10 255" } */ - + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 255); exit(0); } diff --git a/testsuite/libffi.closures/cls_7_1_byte.c b/testsuite/libffi.closures/cls_7_1_byte.c index 14a7e96..3f17964 100644 --- a/testsuite/libffi.closures/cls_7_1_byte.c +++ b/testsuite/libffi.closures/cls_7_1_byte.c @@ -18,7 +18,7 @@ typedef struct cls_struct_7byte { unsigned char g; } cls_struct_7byte; -cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, +static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, struct cls_struct_7byte a2) { struct cls_struct_7byte result; @@ -36,6 +36,30 @@ cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g, result.a, result.b, result.c, result.d, result.e, result.f, result.g); + CHECK(a1.a == 127); + CHECK(a1.b == 120); + CHECK(a1.c == 1); + CHECK(a1.d == 3); + CHECK(a1.e == 4); + CHECK(a1.f == 5); + CHECK(a1.g == 6); + + CHECK(a2.a == 12); + CHECK(a2.b == 128); + CHECK(a2.c == 9); + CHECK(a2.d == 3); + CHECK(a2.e == 4); + CHECK(a2.f == 5); + CHECK(a2.g == 6); + + CHECK(result.a == 139); + CHECK(result.b == 248); + CHECK(result.c == 10); + CHECK(result.d == 6); + CHECK(result.e == 8); + CHECK(result.f == 10); + CHECK(result.g == 12); + return result; } @@ -96,6 +120,13 @@ int main (void) printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); /* { dg-output "\nres: 139 248 10 6 8 10 12" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 6); + CHECK(res_dbl.e == 8); + CHECK(res_dbl.f == 10); + CHECK(res_dbl.g == 12); res_dbl.a = 0; res_dbl.b = 0; @@ -112,6 +143,13 @@ int main (void) printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); /* { dg-output "\nres: 139 248 10 6 8 10 12" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 6); + CHECK(res_dbl.e == 8); + CHECK(res_dbl.f == 10); + CHECK(res_dbl.g == 12); exit(0); } diff --git a/testsuite/libffi.closures/cls_7byte.c b/testsuite/libffi.closures/cls_7byte.c index 1645cc6..dcfc29b 100644 --- a/testsuite/libffi.closures/cls_7byte.c +++ b/testsuite/libffi.closures/cls_7byte.c @@ -15,7 +15,7 @@ typedef struct cls_struct_7byte { unsigned short d; } cls_struct_7byte; -cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, +static cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, struct cls_struct_7byte a2) { struct cls_struct_7byte result; @@ -29,6 +29,22 @@ cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1, a2.a, a2.b, a2.c, a2.d, result.a, result.b, result.c, result.d); + CHECK(a1.a == 127); + CHECK(a1.b == 120); + CHECK(a1.c == 1); + CHECK(a1.d == 254); + + CHECK(a2.a == 12); + CHECK(a2.b == 128); + CHECK(a2.c == 9); + CHECK(a2.d == 255); + + CHECK(result.a == 139); + CHECK(result.b == 248); + CHECK(result.c == 10); + CHECK(result.d == 509); + + return result; } @@ -85,6 +101,10 @@ int main (void) /* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 139 248 10 509" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 509); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK); @@ -92,6 +112,10 @@ int main (void) /* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d); /* { dg-output "\nres: 139 248 10 509" } */ + CHECK(res_dbl.a == 139); + CHECK(res_dbl.b == 248); + CHECK(res_dbl.c == 10); + CHECK(res_dbl.d == 509); exit(0); } diff --git a/testsuite/libffi.closures/cls_8byte.c b/testsuite/libffi.closures/cls_8byte.c index f6c1ea5..7a519e9 100644 --- a/testsuite/libffi.closures/cls_8byte.c +++ b/testsuite/libffi.closures/cls_8byte.c @@ -23,6 +23,15 @@ cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1, printf("%d %g %d %g: %d %g\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b); + CHECK(a1.a == 1); + CHECK_FLOAT_EQ(a1.b, 2); + + CHECK(a2.a == 4); + CHECK_FLOAT_EQ(a2.b, 5); + + CHECK(result.a == 5); + CHECK_FLOAT_EQ(result.b, 7); + return result; } @@ -76,6 +85,9 @@ int main (void) ffi_call(&cif, FFI_FN(cls_struct_8byte_fn), &res_dbl, args_dbl); /* { dg-output "1 2 4 5: 5 7" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); + CHECK(res_dbl.a == 5); + CHECK_FLOAT_EQ(res_dbl.b, 7); + /* { dg-output "\nres: 5 7" } */ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_8byte_gn, NULL, code) == FFI_OK); @@ -83,6 +95,8 @@ int main (void) /* { dg-output "\n1 2 4 5: 5 7" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 5 7" } */ + CHECK(res_dbl.a == 5); + CHECK_FLOAT_EQ(res_dbl.b, 7); exit(0); } diff --git a/testsuite/libffi.closures/cls_9byte1.c b/testsuite/libffi.closures/cls_9byte1.c index 0b85722..9d3b609 100644 --- a/testsuite/libffi.closures/cls_9byte1.c +++ b/testsuite/libffi.closures/cls_9byte1.c @@ -15,7 +15,7 @@ typedef struct cls_struct_9byte { double b; } cls_struct_9byte; -cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, +static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, struct cls_struct_9byte b2) { struct cls_struct_9byte result; @@ -26,6 +26,15 @@ cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b, result.a, result.b); + CHECK(b1.a == 7); + CHECK(b1.b == 8); + + CHECK(b2.a == 1); + CHECK(b2.b == 9); + + CHECK(result.a == 8); + CHECK(result.b == 17); + return result; } @@ -78,6 +87,8 @@ int main (void) /* { dg-output "7 8 1 9: 8 17" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ + CHECK(res_dbl.a == 8); + CHECK(res_dbl.b == 17); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK); @@ -85,6 +96,8 @@ int main (void) /* { dg-output "\n7 8 1 9: 8 17" } */ printf("res: %d %g\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ + CHECK(res_dbl.a == 8); + CHECK(res_dbl.b == 17); exit(0); } diff --git a/testsuite/libffi.closures/cls_9byte2.c b/testsuite/libffi.closures/cls_9byte2.c index edf991d..6cfaaf3 100644 --- a/testsuite/libffi.closures/cls_9byte2.c +++ b/testsuite/libffi.closures/cls_9byte2.c @@ -15,7 +15,7 @@ typedef struct cls_struct_9byte { int b; } cls_struct_9byte; -cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, +static cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, struct cls_struct_9byte b2) { struct cls_struct_9byte result; @@ -26,6 +26,15 @@ cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1, printf("%g %d %g %d: %g %d\n", b1.a, b1.b, b2.a, b2.b, result.a, result.b); + CHECK(b1.a == 7); + CHECK(b1.b == 8); + + CHECK(b2.a == 1); + CHECK(b2.b == 9); + + CHECK(result.a == 8); + CHECK(result.b == 17); + return result; } @@ -78,7 +87,8 @@ int main (void) /* { dg-output "7 8 1 9: 8 17" } */ printf("res: %g %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ - + CHECK(res_dbl.a == 8); + CHECK(res_dbl.b == 17); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK); @@ -86,6 +96,8 @@ int main (void) /* { dg-output "\n7 8 1 9: 8 17" } */ printf("res: %g %d\n", res_dbl.a, res_dbl.b); /* { dg-output "\nres: 8 17" } */ + CHECK(res_dbl.a == 8); + CHECK(res_dbl.b == 17); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_double.c b/testsuite/libffi.closures/cls_align_double.c index aad5f3c..036cca3 100644 --- a/testsuite/libffi.closures/cls_align_double.c +++ b/testsuite/libffi.closures/cls_align_double.c @@ -15,7 +15,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -26,6 +26,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == 4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == 9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK(result.b == 14271); + CHECK(result.c == 140); + return result; } @@ -81,6 +93,9 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -88,6 +103,9 @@ int main (void) /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_float.c b/testsuite/libffi.closures/cls_align_float.c index 37e0855..c7dbdfd 100644 --- a/testsuite/libffi.closures/cls_align_float.c +++ b/testsuite/libffi.closures/cls_align_float.c @@ -13,7 +13,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -24,6 +24,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c); + CHECK(a1.a == 12); + CHECK_FLOAT_EQ(a1.b, 4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK_FLOAT_EQ(a2.b, 9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK_FLOAT_EQ(result.b, 14271); + CHECK(result.c == 140); + return result; } @@ -79,6 +91,9 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK_FLOAT_EQ(res_dbl.b, 14271); + CHECK(res_dbl.c == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -86,6 +101,9 @@ int main (void) /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK_FLOAT_EQ(res_dbl.b, 14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_longdouble.c b/testsuite/libffi.closures/cls_align_longdouble.c index b3322d8..1cdb10b 100644 --- a/testsuite/libffi.closures/cls_align_longdouble.c +++ b/testsuite/libffi.closures/cls_align_longdouble.c @@ -14,7 +14,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -25,6 +25,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == 4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == 9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK(result.b == 14271); + CHECK(result.c == 140); + return result; } @@ -80,6 +92,10 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); + CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -87,6 +103,9 @@ int main (void) /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_longdouble_split.c b/testsuite/libffi.closures/cls_align_longdouble_split.c index cc1c43b..128d6e1 100644 --- a/testsuite/libffi.closures/cls_align_longdouble_split.c +++ b/testsuite/libffi.closures/cls_align_longdouble_split.c @@ -5,7 +5,7 @@ Originator: 20031203 */ /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ -/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */ #include "ffitest.h" @@ -19,7 +19,7 @@ typedef struct cls_struct_align { long double g; } cls_struct_align; -cls_struct_align cls_struct_align_fn( +static cls_struct_align cls_struct_align_fn( cls_struct_align a1, cls_struct_align a2) { @@ -39,32 +39,34 @@ cls_struct_align cls_struct_align_fn( a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g, r.a, r.b, r.c, r.d, r.e, r.f, r.g); - return r; -} + CHECK(a1.a == 1); + CHECK(a1.b == 2); + CHECK(a1.c == 3); + CHECK(a1.d == 4); + CHECK(a1.e == 5); + CHECK(a1.f == 6); + CHECK(a1.g == 7); -cls_struct_align cls_struct_align_fn2( - cls_struct_align a1) -{ - struct cls_struct_align r; - - r.a = a1.a + 1; - r.b = a1.b + 1; - r.c = a1.c + 1; - r.d = a1.d + 1; - r.e = a1.e + 1; - r.f = a1.f + 1; - r.g = a1.g + 1; - - printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg: " - "%Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", - a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g, - r.a, r.b, r.c, r.d, r.e, r.f, r.g); + CHECK(a2.a == 8); + CHECK(a2.b == 9); + CHECK(a2.c == 10); + CHECK(a2.d == 11); + CHECK(a2.e == 12); + CHECK(a2.f == 13); + CHECK(a2.g == 14); + CHECK(r.a == 9); + CHECK(r.b == 11); + CHECK(r.c == 13); + CHECK(r.d == 15); + CHECK(r.e == 17); + CHECK(r.f == 19); + CHECK(r.g == 21); return r; } static void -cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, +cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) { struct cls_struct_align a1, a2; @@ -119,6 +121,13 @@ int main (void) printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); /* { dg-output "\nres: 9 11 13 15 17 19 21" } */ + CHECK(res_dbl.a == 9); + CHECK(res_dbl.b == 11); + CHECK(res_dbl.c == 13); + CHECK(res_dbl.d == 15); + CHECK(res_dbl.e == 17); + CHECK(res_dbl.f == 19); + CHECK(res_dbl.g == 21); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -127,6 +136,12 @@ int main (void) printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); /* { dg-output "\nres: 9 11 13 15 17 19 21" } */ - + CHECK(res_dbl.a == 9); + CHECK(res_dbl.b == 11); + CHECK(res_dbl.c == 13); + CHECK(res_dbl.d == 15); + CHECK(res_dbl.e == 17); + CHECK(res_dbl.f == 19); + CHECK(res_dbl.g == 21); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_longdouble_split2.c b/testsuite/libffi.closures/cls_align_longdouble_split2.c index 5d3bec0..3562a57 100644 --- a/testsuite/libffi.closures/cls_align_longdouble_split2.c +++ b/testsuite/libffi.closures/cls_align_longdouble_split2.c @@ -6,7 +6,7 @@ */ /* { dg-do run { xfail strongarm*-*-* } } */ -/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */ #include "ffitest.h" @@ -20,7 +20,7 @@ typedef struct cls_struct_align { long double g; } cls_struct_align; -cls_struct_align cls_struct_align_fn( +static cls_struct_align cls_struct_align_fn( cls_struct_align a1, cls_struct_align a2) { @@ -40,6 +40,30 @@ cls_struct_align cls_struct_align_fn( a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g, r.a, r.b, r.c, r.d, r.e, r.f, r.g); + CHECK(a1.a == 1); + CHECK(a1.b == 2); + CHECK(a1.c == 3); + CHECK(a1.d == 4); + CHECK(a1.e == 5); + CHECK(a1.f == 6); + CHECK(a1.g == 7); + + CHECK(a2.a == 8); + CHECK(a2.b == 9); + CHECK(a2.c == 10); + CHECK(a2.d == 11); + CHECK(a2.e == 12); + CHECK(a2.f == 13); + CHECK(a2.g == 14); + + CHECK(r.a == 9); + CHECK(r.b == 11); + CHECK(r.c == 13); + CHECK(r.d == 15); + CHECK(r.e == 17); + CHECK(r.f == 19); + CHECK(r.g == 21); + return r; } @@ -99,6 +123,13 @@ int main (void) printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); /* { dg-output "\nres: 9 11 13 15 17 19 21" } */ + CHECK(res_dbl.a == 9); + CHECK(res_dbl.b == 11); + CHECK(res_dbl.c == 13); + CHECK(res_dbl.d == 15); + CHECK(res_dbl.e == 17); + CHECK(res_dbl.f == 19); + CHECK(res_dbl.g == 21); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -107,7 +138,13 @@ int main (void) printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g); /* { dg-output "\nres: 9 11 13 15 17 19 21" } */ - + CHECK(res_dbl.a == 9); + CHECK(res_dbl.b == 11); + CHECK(res_dbl.c == 13); + CHECK(res_dbl.d == 15); + CHECK(res_dbl.e == 17); + CHECK(res_dbl.f == 19); + CHECK(res_dbl.g == 21); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_pointer.c b/testsuite/libffi.closures/cls_align_pointer.c index 8fbf36a..5fb3f09 100644 --- a/testsuite/libffi.closures/cls_align_pointer.c +++ b/testsuite/libffi.closures/cls_align_pointer.c @@ -13,7 +13,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -28,6 +28,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, result.a, (uintptr_t)result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == (void *)4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == (void *)9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK(result.b == (void *)14271); + CHECK(result.c == 140); + return result; } @@ -83,6 +95,9 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == (void *)14271); + CHECK(res_dbl.c == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -90,6 +105,9 @@ int main (void) /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == (void *)14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_sint16.c b/testsuite/libffi.closures/cls_align_sint16.c index 039b874..d2c9bf4 100644 --- a/testsuite/libffi.closures/cls_align_sint16.c +++ b/testsuite/libffi.closures/cls_align_sint16.c @@ -13,7 +13,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -23,6 +23,17 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == 4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == 9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK(result.b == 14271); + CHECK(result.c == 140); return result; } @@ -79,6 +90,9 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -86,6 +100,9 @@ int main (void) /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_sint32.c b/testsuite/libffi.closures/cls_align_sint32.c index c96c6d1..570f45f 100644 --- a/testsuite/libffi.closures/cls_align_sint32.c +++ b/testsuite/libffi.closures/cls_align_sint32.c @@ -13,7 +13,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -23,6 +23,17 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == 4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == 9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK(result.b == 14271); + CHECK(result.c == 140); return result; } @@ -79,13 +90,17 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ - + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ - + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_sint64.c b/testsuite/libffi.closures/cls_align_sint64.c index 9aa7bdd..49ee561 100644 --- a/testsuite/libffi.closures/cls_align_sint64.c +++ b/testsuite/libffi.closures/cls_align_sint64.c @@ -14,7 +14,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -24,6 +24,17 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, result.c = a1.c + a2.c; printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == 4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == 9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK(result.b == 14271); + CHECK(result.c == 140); return result; } @@ -80,6 +91,9 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -87,6 +101,9 @@ int main (void) /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_uint16.c b/testsuite/libffi.closures/cls_align_uint16.c index 97620b7..2204dff 100644 --- a/testsuite/libffi.closures/cls_align_uint16.c +++ b/testsuite/libffi.closures/cls_align_uint16.c @@ -13,7 +13,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -23,6 +23,17 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, result.c = a1.c + a2.c; printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == 4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == 9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK(result.b == 14271); + CHECK(result.c == 140); return result; } @@ -79,6 +90,9 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -86,6 +100,9 @@ int main (void) /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_uint32.c b/testsuite/libffi.closures/cls_align_uint32.c index 5766fad..1ce23da 100644 --- a/testsuite/libffi.closures/cls_align_uint32.c +++ b/testsuite/libffi.closures/cls_align_uint32.c @@ -13,7 +13,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -24,6 +24,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == 4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == 9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK(result.b == 14271); + CHECK(result.c == 140); + return result; } @@ -79,6 +91,9 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -86,6 +101,9 @@ int main (void) /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_align_uint64.c b/testsuite/libffi.closures/cls_align_uint64.c index a52cb89..aee958a 100644 --- a/testsuite/libffi.closures/cls_align_uint64.c +++ b/testsuite/libffi.closures/cls_align_uint64.c @@ -15,7 +15,7 @@ typedef struct cls_struct_align { unsigned char c; } cls_struct_align; -cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, +static cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; @@ -26,6 +26,18 @@ cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); + CHECK(a1.a == 12); + CHECK(a1.b == 4951); + CHECK(a1.c == 127); + + CHECK(a2.a == 1); + CHECK(a2.b == 9320); + CHECK(a2.c == 13); + + CHECK(result.a == 13); + CHECK(result.b == 14271); + CHECK(result.c == 140); + return result; } @@ -81,6 +93,9 @@ int main (void) /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); @@ -88,6 +103,9 @@ int main (void) /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ + CHECK(res_dbl.a == 13); + CHECK(res_dbl.b == 14271); + CHECK(res_dbl.c == 140); exit(0); } diff --git a/testsuite/libffi.closures/cls_dbls_struct.c b/testsuite/libffi.closures/cls_dbls_struct.c index e451dea..00e247e 100644 --- a/testsuite/libffi.closures/cls_dbls_struct.c +++ b/testsuite/libffi.closures/cls_dbls_struct.c @@ -17,6 +17,8 @@ void closure_test_fn(Dbls p) { printf("%.1f %.1f\n", p.x, p.y); + CHECK(p.x == 1); + CHECK(p.y == 2); } void @@ -56,7 +58,7 @@ int main(int argc __UNUSED__, char** argv __UNUSED__) CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_gn, NULL, code) == FFI_OK); - ((void*(*)(Dbls))(code))(arg); + ((void (*)(Dbls))(code))(arg); /* { dg-output "1.0 2.0" } */ closure_test_fn(arg); diff --git a/testsuite/libffi.closures/cls_double_va.c b/testsuite/libffi.closures/cls_double_va.c index e077f92..a6c445b 100644 --- a/testsuite/libffi.closures/cls_double_va.c +++ b/testsuite/libffi.closures/cls_double_va.c @@ -10,14 +10,20 @@ #include "ffitest.h" +#define BUF_SIZE 50 +static char buffer[BUF_SIZE]; + static void -cls_double_va_fn(ffi_cif* cif __UNUSED__, void* resp, +cls_double_va_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) { char* format = *(char**)args[0]; double doubleValue = *(double*)args[1]; *(ffi_arg*)resp = printf(format, doubleValue); + CHECK(*(ffi_arg*)resp == 4); + snprintf(buffer, BUF_SIZE, format, doubleValue); + CHECK(strncmp(buffer, "7.0\n", 4) == 0); } int main (void) @@ -48,6 +54,7 @@ int main (void) /* { dg-output "7.0" } */ printf("res: %d\n", (int) res); /* { dg-output "\nres: 4" } */ + CHECK(res == 4); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL, code) == FFI_OK); @@ -56,6 +63,7 @@ int main (void) /* { dg-output "\n7.0" } */ printf("res: %d\n", (int) res); /* { dg-output "\nres: 4" } */ + CHECK(res == 4); exit(0); } diff --git a/testsuite/libffi.closures/cls_float.c b/testsuite/libffi.closures/cls_float.c index 0090fed..97c2ac0 100644 --- a/testsuite/libffi.closures/cls_float.c +++ b/testsuite/libffi.closures/cls_float.c @@ -14,6 +14,9 @@ static void cls_ret_float_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, printf("%g: %g\n",*(float *)args[0], *(float *)resp); + + CHECK((int)(*(float *)args[0]) == -2122); + CHECK((int)(*(float *)resp) == -2122); } typedef float (*cls_ret_float)(float); @@ -38,5 +41,6 @@ int main (void) /* { dg-output "\\-2122.12: \\-2122.12" } */ printf("res: %.6f\n", res); /* { dg-output "\nres: \-2122.120117" } */ + CHECK((int)res == -2122); exit(0); } diff --git a/testsuite/libffi.closures/cls_longdouble.c b/testsuite/libffi.closures/cls_longdouble.c index d24e72e..2cfac4b 100644 --- a/testsuite/libffi.closures/cls_longdouble.c +++ b/testsuite/libffi.closures/cls_longdouble.c @@ -7,7 +7,7 @@ /* This test is known to PASS on armv7l-unknown-linux-gnueabihf, so I have remove the xfail for arm*-*-* below, until we know more. */ /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ -/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */ #include "ffitest.h" @@ -25,6 +25,14 @@ long double cls_ldouble_fn( printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: %Lg\n", a1, a2, a3, a4, a5, a6, a7, a8, r); + CHECK(a1 == 1); + CHECK(a2 == 2); + CHECK(a3 == 3); + CHECK(a4 == 4); + CHECK(a5 == 5); + CHECK(a6 == 6); + CHECK(a7 == 7); + CHECK(a8 == 8); return r; } @@ -91,6 +99,7 @@ int main(void) /* { dg-output "1 2 3 4 5 6 7 8: 36" } */ printf("res: %Lg\n", res); /* { dg-output "\nres: 36" } */ + CHECK(res == 36); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ldouble_gn, NULL, code) == FFI_OK); @@ -100,6 +109,7 @@ int main(void) /* { dg-output "\n1 2 3 4 5 6 7 8: 36" } */ printf("res: %Lg\n", res); /* { dg-output "\nres: 36" } */ + CHECK(res == 36); return 0; } diff --git a/testsuite/libffi.closures/cls_longdouble_va.c b/testsuite/libffi.closures/cls_longdouble_va.c index 39b438b..493f0f6 100644 --- a/testsuite/libffi.closures/cls_longdouble_va.c +++ b/testsuite/libffi.closures/cls_longdouble_va.c @@ -5,19 +5,25 @@ Originator: Blake Chaffin 6/6/2007 */ /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ -/* { dg-output "" { xfail avr32*-*-* x86_64-*-mingw* } } */ +/* { dg-output "" { xfail avr32*-*-* } } */ /* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */ #include "ffitest.h" +#define BUF_SIZE 50 +static char buffer[BUF_SIZE]; + static void -cls_longdouble_va_fn(ffi_cif* cif __UNUSED__, void* resp, +cls_longdouble_va_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) { char* format = *(char**)args[0]; long double ldValue = *(long double*)args[1]; *(ffi_arg*)resp = printf(format, ldValue); + CHECK(*(ffi_arg*)resp == 4); + snprintf(buffer, BUF_SIZE, format, ldValue); + CHECK(strncmp(buffer, "7.0\n", BUF_SIZE) == 0); } int main (void) @@ -48,6 +54,7 @@ int main (void) /* { dg-output "7.0" } */ printf("res: %d\n", (int) res); /* { dg-output "\nres: 4" } */ + CHECK(res == 4); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL, code) == FFI_OK); @@ -56,6 +63,7 @@ int main (void) /* { dg-output "\n7.0" } */ printf("res: %d\n", (int) res); /* { dg-output "\nres: 4" } */ + CHECK(res == 4); exit(0); } diff --git a/testsuite/libffi.closures/cls_multi_schar.c b/testsuite/libffi.closures/cls_multi_schar.c index 71df7b6..921777a 100644 --- a/testsuite/libffi.closures/cls_multi_schar.c +++ b/testsuite/libffi.closures/cls_multi_schar.c @@ -7,7 +7,7 @@ /* { dg-do run } */ #include "ffitest.h" -signed char test_func_fn(signed char a1, signed char a2) +static signed char test_func_fn(signed char a1, signed char a2) { signed char result; @@ -26,6 +26,8 @@ static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals, a1 = *(signed char *)avals[0]; a2 = *(signed char *)avals[1]; + CHECK(a1 == 2); + CHECK(a2 == 125); *(ffi_arg *)rval = test_func_fn(a1, a2); @@ -62,6 +64,7 @@ int main (void) /* { dg-output "2 125: 127" } */ printf("res: %d\n", (signed char)res_call); /* { dg-output "\nres: 127" } */ + CHECK(res_call == 127); CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); @@ -69,6 +72,7 @@ int main (void) /* { dg-output "\n2 125: 127" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 127" } */ + CHECK(res_closure == 127); exit(0); } diff --git a/testsuite/libffi.closures/cls_multi_sshort.c b/testsuite/libffi.closures/cls_multi_sshort.c index 4c39153..d78c62d 100644 --- a/testsuite/libffi.closures/cls_multi_sshort.c +++ b/testsuite/libffi.closures/cls_multi_sshort.c @@ -7,13 +7,16 @@ /* { dg-do run } */ #include "ffitest.h" -signed short test_func_fn(signed short a1, signed short a2) +static signed short test_func_fn(signed short a1, signed short a2) { signed short result; result = a1 + a2; printf("%d %d: %d\n", a1, a2, result); + CHECK(a1 == 2); + CHECK(a2 == 32765); + CHECK(result == 32767); return result; @@ -62,6 +65,7 @@ int main (void) /* { dg-output "2 32765: 32767" } */ printf("res: %d\n", (unsigned short)res_call); /* { dg-output "\nres: 32767" } */ + CHECK(res_call == 32767); CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); @@ -69,6 +73,7 @@ int main (void) /* { dg-output "\n2 32765: 32767" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 32767" } */ + CHECK(res_closure == 32767); exit(0); } diff --git a/testsuite/libffi.closures/cls_multi_sshortchar.c b/testsuite/libffi.closures/cls_multi_sshortchar.c index 1c3aeb5..a2b3708 100644 --- a/testsuite/libffi.closures/cls_multi_sshortchar.c +++ b/testsuite/libffi.closures/cls_multi_sshortchar.c @@ -7,7 +7,7 @@ /* { dg-do run } */ #include "ffitest.h" -signed short test_func_fn(signed char a1, signed short a2, +static signed short test_func_fn(signed char a1, signed short a2, signed char a3, signed short a4) { signed short result; @@ -16,6 +16,12 @@ signed short test_func_fn(signed char a1, signed short a2, printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result); + CHECK(a1 == 1); + CHECK(a2 == 32765); + CHECK(a3 == 127); + CHECK(a4 == -128); + CHECK(result == 32765); + return result; } @@ -74,6 +80,7 @@ int main (void) /* { dg-output "1 32765 127 -128: 32765" } */ printf("res: %d\n", (signed short)res_call); /* { dg-output "\nres: 32765" } */ + CHECK(res_call == 32765); CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); @@ -81,6 +88,7 @@ int main (void) /* { dg-output "\n1 32765 127 -128: 32765" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 32765" } */ + CHECK(res_closure == 32765); exit(0); } diff --git a/testsuite/libffi.closures/cls_multi_uchar.c b/testsuite/libffi.closures/cls_multi_uchar.c index 009c02c..76f90a0 100644 --- a/testsuite/libffi.closures/cls_multi_uchar.c +++ b/testsuite/libffi.closures/cls_multi_uchar.c @@ -7,7 +7,7 @@ /* { dg-do run } */ #include "ffitest.h" -unsigned char test_func_fn(unsigned char a1, unsigned char a2, +static unsigned char test_func_fn(unsigned char a1, unsigned char a2, unsigned char a3, unsigned char a4) { unsigned char result; @@ -16,6 +16,12 @@ unsigned char test_func_fn(unsigned char a1, unsigned char a2, printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result); + CHECK(a1 == 1); + CHECK(a2 == 2); + CHECK(a3 == 127); + CHECK(a4 == 125); + CHECK(result == 255); + return result; } @@ -79,6 +85,7 @@ int main (void) /* { dg-output "1 2 127 125: 255" } */ printf("res: %d\n", (unsigned char)res_call); /* { dg-output "\nres: 255" } */ + CHECK((unsigned char)res_call == 255); CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); @@ -86,6 +93,7 @@ int main (void) /* { dg-output "\n1 2 127 125: 255" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 255" } */ + CHECK(res_closure == 255); exit(0); } diff --git a/testsuite/libffi.closures/cls_multi_ushort.c b/testsuite/libffi.closures/cls_multi_ushort.c index dd10ca7..f61a627 100644 --- a/testsuite/libffi.closures/cls_multi_ushort.c +++ b/testsuite/libffi.closures/cls_multi_ushort.c @@ -7,7 +7,7 @@ /* { dg-do run } */ #include "ffitest.h" -unsigned short test_func_fn(unsigned short a1, unsigned short a2) +static unsigned short test_func_fn(unsigned short a1, unsigned short a2) { unsigned short result; @@ -15,8 +15,11 @@ unsigned short test_func_fn(unsigned short a1, unsigned short a2) printf("%d %d: %d\n", a1, a2, result); - return result; + CHECK(a1 == 2); + CHECK(a2 == 32765); + CHECK(result == 32767); + return result; } static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals, @@ -69,6 +72,7 @@ int main (void) /* { dg-output "\n2 32765: 32767" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 32767" } */ + CHECK(res_closure == 32767); exit(0); } diff --git a/testsuite/libffi.closures/cls_multi_ushortchar.c b/testsuite/libffi.closures/cls_multi_ushortchar.c index 2588e97..3315c99 100644 --- a/testsuite/libffi.closures/cls_multi_ushortchar.c +++ b/testsuite/libffi.closures/cls_multi_ushortchar.c @@ -7,7 +7,7 @@ /* { dg-do run } */ #include "ffitest.h" -unsigned short test_func_fn(unsigned char a1, unsigned short a2, +static unsigned short test_func_fn(unsigned char a1, unsigned short a2, unsigned char a3, unsigned short a4) { unsigned short result; @@ -16,6 +16,12 @@ unsigned short test_func_fn(unsigned char a1, unsigned short a2, printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result); + CHECK(a1 == 1); + CHECK(a2 == 2); + CHECK(a3 == 127); + CHECK(a4 == 128); + CHECK(result == 258); + return result; } @@ -74,6 +80,7 @@ int main (void) /* { dg-output "1 2 127 128: 258" } */ printf("res: %d\n", (unsigned short)res_call); /* { dg-output "\nres: 258" } */ + CHECK(res_call == 258); CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK); @@ -81,6 +88,7 @@ int main (void) /* { dg-output "\n1 2 127 128: 258" } */ printf("res: %d\n", res_closure); /* { dg-output "\nres: 258" } */ + CHECK(res_closure == 258); exit(0); } diff --git a/testsuite/libffi.closures/cls_pointer.c b/testsuite/libffi.closures/cls_pointer.c index d82a87a..73a4cba 100644 --- a/testsuite/libffi.closures/cls_pointer.c +++ b/testsuite/libffi.closures/cls_pointer.c @@ -16,6 +16,10 @@ void* cls_pointer_fn(void* a1, void* a2) (unsigned int)(uintptr_t) a2, (unsigned int)(uintptr_t) result); + CHECK((unsigned int)(uintptr_t) a1 == 0x12345678); + CHECK((unsigned int)(uintptr_t) a2 == 0x89abcdef); + CHECK((unsigned int)(uintptr_t) result == 0x9be02467); + return result; } @@ -69,6 +73,7 @@ int main (void) /* { dg-output "\n0x12345678 0x89abcdef: 0x9be02467" } */ printf("res: 0x%08x\n", (unsigned int) res); /* { dg-output "\nres: 0x9be02467" } */ + CHECK(res == 0x9be02467); exit(0); } diff --git a/testsuite/libffi.closures/cls_pointer_stack.c b/testsuite/libffi.closures/cls_pointer_stack.c index 1f1d915..2054f25 100644 --- a/testsuite/libffi.closures/cls_pointer_stack.c +++ b/testsuite/libffi.closures/cls_pointer_stack.c @@ -40,6 +40,10 @@ void* cls_pointer_fn2(void* a1, void* a2) (unsigned int)(uintptr_t) a2, (unsigned int)(uintptr_t) result); + CHECK((unsigned int)(uintptr_t) a1 == 0x8acf1356); + CHECK((unsigned int)(uintptr_t) a2 == 0x01234567); + CHECK((unsigned int)(uintptr_t) result == 0x8bf258bd); + return result; } @@ -65,6 +69,10 @@ void* cls_pointer_fn1(void* a1, void* a2) (unsigned int)(intptr_t) a2, (unsigned int)(intptr_t) result); + CHECK((unsigned int)(uintptr_t) a1 == 0x01234567); + CHECK((unsigned int)(uintptr_t) a2 == 0x89abcdef); + CHECK((unsigned int)(uintptr_t) result == 0x8acf1356); + result = cls_pointer_fn2(result, a1); return result; @@ -128,6 +136,7 @@ int main (void) /* { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" } */ /* { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" } */ /* { dg-output "\nres: 0x8bf258bd" } */ + CHECK(res == 0x8bf258bd); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK); @@ -137,6 +146,7 @@ int main (void) /* { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" } */ /* { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" } */ /* { dg-output "\nres: 0x8bf258bd" } */ + CHECK(res == 0x8bf258bd); exit(0); } diff --git a/testsuite/libffi.closures/cls_schar.c b/testsuite/libffi.closures/cls_schar.c index 82986b1..22446c3 100644 --- a/testsuite/libffi.closures/cls_schar.c +++ b/testsuite/libffi.closures/cls_schar.c @@ -15,6 +15,8 @@ static void cls_ret_schar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, *(ffi_arg*)resp = *(signed char *)args[0]; printf("%d: %d\n",*(signed char *)args[0], (int)*(ffi_arg *)(resp)); + CHECK(*(signed char *)args[0] == 127); + CHECK((int)*(ffi_arg *)(resp) == 127); } typedef signed char (*cls_ret_schar)(signed char); @@ -39,6 +41,7 @@ int main (void) /* { dg-output "127: 127" } */ printf("res: %d\n", res); /* { dg-output "\nres: 127" } */ + CHECK(res == 127); exit(0); } diff --git a/testsuite/libffi.closures/cls_sint.c b/testsuite/libffi.closures/cls_sint.c index c7e13b7..a3f72c1 100644 --- a/testsuite/libffi.closures/cls_sint.c +++ b/testsuite/libffi.closures/cls_sint.c @@ -13,6 +13,8 @@ static void cls_ret_sint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, *(ffi_arg*)resp = *(signed int *)args[0]; printf("%d: %d\n",*(signed int *)args[0], (int)*(ffi_arg *)(resp)); + CHECK(*(signed int *)args[0] == 65534); + CHECK((int)*(ffi_arg *)(resp) == 65534); } typedef signed int (*cls_ret_sint)(signed int); diff --git a/testsuite/libffi.closures/cls_sshort.c b/testsuite/libffi.closures/cls_sshort.c index 846d57e..8061a02 100644 --- a/testsuite/libffi.closures/cls_sshort.c +++ b/testsuite/libffi.closures/cls_sshort.c @@ -13,6 +13,8 @@ static void cls_ret_sshort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, *(ffi_arg*)resp = *(signed short *)args[0]; printf("%d: %d\n",*(signed short *)args[0], (int)*(ffi_arg *)(resp)); + CHECK(*(signed short *)args[0] == 255); + CHECK((int)*(ffi_arg *)(resp) == 255); } typedef signed short (*cls_ret_sshort)(signed short); @@ -37,6 +39,7 @@ int main (void) /* { dg-output "255: 255" } */ printf("res: %d\n",res); /* { dg-output "\nres: 255" } */ + CHECK(res == 255); exit(0); } diff --git a/testsuite/libffi.closures/cls_struct_va1.c b/testsuite/libffi.closures/cls_struct_va1.c index 6d1fdae..c59a27f 100644 --- a/testsuite/libffi.closures/cls_struct_va1.c +++ b/testsuite/libffi.closures/cls_struct_va1.c @@ -35,6 +35,16 @@ test_fn (ffi_cif* cif __UNUSED__, void* resp, printf ("%d %d %d %d %d %d %d %d %d %d\n", n, s1.a, s1.b, l1.a, l1.b, l1.c, l1.d, l1.e, s2.a, s2.b); + CHECK(n == 4); + CHECK(s1.a == 5); + CHECK(s1.b == 6); + CHECK(l1.a == 10); + CHECK(l1.b == 11); + CHECK(l1.c == 12); + CHECK(l1.d == 13); + CHECK(l1.e == 14); + CHECK(s2.a == 20); + CHECK(s2.b == 21); * (ffi_arg*) resp = 42; } @@ -109,6 +119,7 @@ main (void) /* { dg-output "4 5 6 10 11 12 13 14 20 21" } */ printf("res: %d\n", (int) res); /* { dg-output "\nres: 42" } */ + CHECK(res == 42); exit(0); } diff --git a/testsuite/libffi.closures/cls_uchar.c b/testsuite/libffi.closures/cls_uchar.c index c1317e7..aa2023f 100644 --- a/testsuite/libffi.closures/cls_uchar.c +++ b/testsuite/libffi.closures/cls_uchar.c @@ -13,6 +13,8 @@ static void cls_ret_uchar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, *(ffi_arg*)resp = *(unsigned char *)args[0]; printf("%d: %d\n",*(unsigned char *)args[0], (int)*(ffi_arg *)(resp)); + CHECK(*(unsigned char *)args[0] == 127); + CHECK((int)*(ffi_arg *)(resp) == 127); } typedef unsigned char (*cls_ret_uchar)(unsigned char); @@ -37,6 +39,7 @@ int main (void) /* { dg-output "127: 127" } */ printf("res: %d\n",res); /* { dg-output "\nres: 127" } */ + CHECK(res == 127); exit(0); } diff --git a/testsuite/libffi.closures/cls_uchar_va.c b/testsuite/libffi.closures/cls_uchar_va.c deleted file mode 100644 index 6491c5b..0000000 --- a/testsuite/libffi.closures/cls_uchar_va.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Area: closure_call - Purpose: Test anonymous unsigned char argument. - Limitations: none. - PR: none. - Originator: ARM Ltd. */ - -/* { dg-do run } */ -#include "ffitest.h" - -typedef unsigned char T; - -static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, - void* userdata __UNUSED__) - { - *(ffi_arg *)resp = *(T *)args[0]; - - printf("%d: %d %d\n", (int)(*(ffi_arg *)resp), *(T *)args[0], *(T *)args[1]); - } - -typedef T (*cls_ret_T)(T, ...); - -int main (void) -{ - ffi_cif cif; - void *code; - ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); - ffi_type * cl_arg_types[3]; - T res; - - cl_arg_types[0] = &ffi_type_uchar; - cl_arg_types[1] = &ffi_type_uchar; - cl_arg_types[2] = NULL; - - /* Initialize the cif */ - CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, - &ffi_type_uchar, cl_arg_types) == FFI_OK); - - CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK); - res = ((((cls_ret_T)code)(67, 4))); - /* { dg-output "67: 67 4" } */ - printf("res: %d\n", res); - /* { dg-output "\nres: 67" } */ - exit(0); -} diff --git a/testsuite/libffi.closures/cls_uint.c b/testsuite/libffi.closures/cls_uint.c index 885cff5..23b88de 100644 --- a/testsuite/libffi.closures/cls_uint.c +++ b/testsuite/libffi.closures/cls_uint.c @@ -14,6 +14,9 @@ static void cls_ret_uint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, printf("%d: %d\n",*(unsigned int *)args[0], (int)*(ffi_arg *)(resp)); + + CHECK(*(unsigned int *)args[0] == 2147483647); + CHECK((int)*(ffi_arg *)(resp) == 2147483647); } typedef unsigned int (*cls_ret_uint)(unsigned int); @@ -38,6 +41,7 @@ int main (void) /* { dg-output "2147483647: 2147483647" } */ printf("res: %d\n",res); /* { dg-output "\nres: 2147483647" } */ + CHECK(res == 2147483647); exit(0); } diff --git a/testsuite/libffi.closures/cls_uint_va.c b/testsuite/libffi.closures/cls_uint_va.c index b04cfd1..0048a02 100644 --- a/testsuite/libffi.closures/cls_uint_va.c +++ b/testsuite/libffi.closures/cls_uint_va.c @@ -16,6 +16,9 @@ static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, *(ffi_arg *)resp = *(T *)args[0]; printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]); + CHECK(*(T *)args[0] == 67); + CHECK(*(T *)args[1] == 4); + CHECK((int)*(ffi_arg *)resp == 67); } typedef T (*cls_ret_T)(T, ...); @@ -41,5 +44,6 @@ int main (void) /* { dg-output "67: 67 4" } */ printf("res: %d\n", res); /* { dg-output "\nres: 67" } */ + CHECK(res == 67); exit(0); } diff --git a/testsuite/libffi.closures/cls_ulong_va.c b/testsuite/libffi.closures/cls_ulong_va.c index 0315082..79f4170 100644 --- a/testsuite/libffi.closures/cls_ulong_va.c +++ b/testsuite/libffi.closures/cls_ulong_va.c @@ -16,6 +16,9 @@ static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, *(T *)resp = *(T *)args[0]; printf("%ld: %ld %ld\n", *(T *)resp, *(T *)args[0], *(T *)args[1]); + CHECK(*(T *)args[0] == 67); + CHECK(*(T *)args[1] == 4); + CHECK(*(T *)resp == 67); } typedef T (*cls_ret_T)(T, ...); @@ -41,5 +44,6 @@ int main (void) /* { dg-output "67: 67 4" } */ printf("res: %ld\n", res); /* { dg-output "\nres: 67" } */ + CHECK(res == 67); exit(0); } diff --git a/testsuite/libffi.closures/cls_ulonglong.c b/testsuite/libffi.closures/cls_ulonglong.c index 62f2cae..813bb2e 100644 --- a/testsuite/libffi.closures/cls_ulonglong.c +++ b/testsuite/libffi.closures/cls_ulonglong.c @@ -37,11 +37,13 @@ int main (void) /* { dg-output "214: 1152921504606846761" } */ printf("res: %" PRIdLL "\n", res); /* { dg-output "\nres: 1152921504606846761" } */ + CHECK(res == 1152921504606846761LL); res = (*((cls_ret_ulonglong)code))(9223372035854775808LL); /* { dg-output "\n9223372035854775808: 8070450533247928831" } */ printf("res: %" PRIdLL "\n", res); /* { dg-output "\nres: 8070450533247928831" } */ + CHECK(res == 8070450533247928831LL); exit(0); } diff --git a/testsuite/libffi.closures/cls_ushort.c b/testsuite/libffi.closures/cls_ushort.c index a00100e..bfe5e65 100644 --- a/testsuite/libffi.closures/cls_ushort.c +++ b/testsuite/libffi.closures/cls_ushort.c @@ -14,6 +14,8 @@ static void cls_ret_ushort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, printf("%d: %d\n",*(unsigned short *)args[0], (int)*(ffi_arg *)(resp)); + CHECK(*(unsigned short *)args[0] == 65535); + CHECK((int)*(ffi_arg *)(resp) == 65535); } typedef unsigned short (*cls_ret_ushort)(unsigned short); @@ -38,6 +40,7 @@ int main (void) /* { dg-output "65535: 65535" } */ printf("res: %d\n",res); /* { dg-output "\nres: 65535" } */ + CHECK(res == 65535); exit(0); } diff --git a/testsuite/libffi.closures/cls_ushort_va.c b/testsuite/libffi.closures/cls_ushort_va.c deleted file mode 100644 index 37aa106..0000000 --- a/testsuite/libffi.closures/cls_ushort_va.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Area: closure_call - Purpose: Test anonymous unsigned short argument. - Limitations: none. - PR: none. - Originator: ARM Ltd. */ - -/* { dg-do run } */ -#include "ffitest.h" - -typedef unsigned short T; - -static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, - void* userdata __UNUSED__) - { - *(ffi_arg *)resp = *(T *)args[0]; - - printf("%d: %d %d\n", (int)(*(ffi_arg *)resp), *(T *)args[0], *(T *)args[1]); - } - -typedef T (*cls_ret_T)(T, ...); - -int main (void) -{ - ffi_cif cif; - void *code; - ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); - ffi_type * cl_arg_types[3]; - T res; - - cl_arg_types[0] = &ffi_type_ushort; - cl_arg_types[1] = &ffi_type_ushort; - cl_arg_types[2] = NULL; - - /* Initialize the cif */ - CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, - &ffi_type_ushort, cl_arg_types) == FFI_OK); - - CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK); - res = ((((cls_ret_T)code)(67, 4))); - /* { dg-output "67: 67 4" } */ - printf("res: %d\n", res); - /* { dg-output "\nres: 67" } */ - exit(0); -} diff --git a/testsuite/libffi.closures/ffitest.h b/testsuite/libffi.closures/ffitest.h index cfce1ad..d27d362 100644 --- a/testsuite/libffi.closures/ffitest.h +++ b/testsuite/libffi.closures/ffitest.h @@ -1,138 +1 @@ -#include -#include -#include -#include -#include -#include "fficonfig.h" - -#if defined HAVE_STDINT_H -#include -#endif - -#if defined HAVE_INTTYPES_H -#include -#endif - -#define MAX_ARGS 256 - -#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0) - -/* Define macros so that compilers other than gcc can run the tests. */ -#undef __UNUSED__ -#if defined(__GNUC__) -#define __UNUSED__ __attribute__((__unused__)) -#define __STDCALL__ __attribute__((stdcall)) -#define __THISCALL__ __attribute__((thiscall)) -#define __FASTCALL__ __attribute__((fastcall)) -#define __MSABI__ __attribute__((ms_abi)) -#else -#define __UNUSED__ -#define __STDCALL__ __stdcall -#define __THISCALL__ __thiscall -#define __FASTCALL__ __fastcall -#endif - -#ifndef ABI_NUM -#define ABI_NUM FFI_DEFAULT_ABI -#define ABI_ATTR -#endif - -/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a - file open. */ -#ifdef HAVE_MMAP_ANON -# undef HAVE_MMAP_DEV_ZERO - -# include -# ifndef MAP_FAILED -# define MAP_FAILED -1 -# endif -# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) -# define MAP_ANONYMOUS MAP_ANON -# endif -# define USING_MMAP - -#endif - -#ifdef HAVE_MMAP_DEV_ZERO - -# include -# ifndef MAP_FAILED -# define MAP_FAILED -1 -# endif -# define USING_MMAP - -#endif - -/* MinGW kludge. */ -#if defined(_WIN64) | defined(_WIN32) -#define PRIdLL "I64d" -#define PRIuLL "I64u" -#else -#define PRIdLL "lld" -#define PRIuLL "llu" -#endif - -/* Tru64 UNIX kludge. */ -#if defined(__alpha__) && defined(__osf__) -/* Tru64 UNIX V4.0 doesn't support %lld/%lld, but long is 64-bit. */ -#undef PRIdLL -#define PRIdLL "ld" -#undef PRIuLL -#define PRIuLL "lu" -#define PRId8 "hd" -#define PRIu8 "hu" -#define PRId64 "ld" -#define PRIu64 "lu" -#define PRIuPTR "lu" -#endif - -/* PA HP-UX kludge. */ -#if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR) -#define PRIuPTR "lu" -#endif - -/* IRIX kludge. */ -#if defined(__sgi) -/* IRIX 6.5 provides all definitions, but only for C99 - compilations. */ -#define PRId8 "hhd" -#define PRIu8 "hhu" -#if (_MIPS_SZLONG == 32) -#define PRId64 "lld" -#define PRIu64 "llu" -#endif -/* This doesn't match , which always has "lld" here, but the - arguments are uint64_t, int64_t, which are unsigned long, long for - 64-bit in . */ -#if (_MIPS_SZLONG == 64) -#define PRId64 "ld" -#define PRIu64 "lu" -#endif -/* This doesn't match , which has "u" here, but the arguments - are uintptr_t, which is always unsigned long. */ -#define PRIuPTR "lu" -#endif - -/* Solaris < 10 kludge. */ -#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR) -#if defined(__arch64__) || defined (__x86_64__) -#define PRIuPTR "lu" -#else -#define PRIuPTR "u" -#endif -#endif - -/* MSVC kludge. */ -#if defined _MSC_VER -#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) -#define PRIuPTR "lu" -#define PRIu8 "u" -#define PRId8 "d" -#define PRIu64 "I64u" -#define PRId64 "I64d" -#endif -#endif - -#ifndef PRIuPTR -#define PRIuPTR "u" -#endif +#include "../libffi.call/ffitest.h" diff --git a/testsuite/libffi.closures/huge_struct.c b/testsuite/libffi.closures/huge_struct.c index 1915c3f..71cae26 100644 --- a/testsuite/libffi.closures/huge_struct.c +++ b/testsuite/libffi.closures/huge_struct.c @@ -5,10 +5,12 @@ Originator: Blake Chaffin 6/18/2007 */ -/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ -/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ +/* { dg-do run { xfail strongarm*-*-* xscale*-*-* wasm32*-*-* } } */ +/* { dg-options -mlong-double-128 { target powerpc64*-*-linux-gnu* } } */ /* { dg-options -Wformat=0 { target moxie*-*-elf or1k-*-* } } */ +#include + #include "ffitest.h" typedef struct BigStruct{ @@ -119,13 +121,13 @@ test_large_fn( { BigStruct retVal = { ui8_1 + 1, si8_1 + 1, ui16_1 + 1, si16_1 + 1, ui32_1 + 1, si32_1 + 1, - ui64_1 + 1, si64_1 + 1, f_1 + 1, d_1 + 1, ld_1 + 1, (char*)((intptr_t)p_1 + 1), + ui64_1 + 1, si64_1 + 1, f_1 + 1, d_1 + 1, ld_1 + 1, (char*)((intptr_t)p_1 + 1), ui8_2 + 2, si8_2 + 2, ui16_2 + 2, si16_2 + 2, ui32_2 + 2, si32_2 + 2, - ui64_2 + 2, si64_2 + 2, f_2 + 2, d_2 + 2, ld_2 + 2, (char*)((intptr_t)p_2 + 2), + ui64_2 + 2, si64_2 + 2, f_2 + 2, d_2 + 2, ld_2 + 2, (char*)((intptr_t)p_2 + 2), ui8_3 + 3, si8_3 + 3, ui16_3 + 3, si16_3 + 3, ui32_3 + 3, si32_3 + 3, - ui64_3 + 3, si64_3 + 3, f_3 + 3, d_3 + 3, ld_3 + 3, (char*)((intptr_t)p_3 + 3), + ui64_3 + 3, si64_3 + 3, f_3 + 3, d_3 + 3, ld_3 + 3, (char*)((intptr_t)p_3 + 3), ui8_4 + 4, si8_4 + 4, ui16_4 + 4, si16_4 + 4, ui32_4 + 4, si32_4 + 4, - ui64_4 + 4, si64_4 + 4, f_4 + 4, d_4 + 4, ld_4 + 4, (char*)((intptr_t)p_4 + 4), + ui64_4 + 4, si64_4 + 4, f_4 + 4, d_4 + 4, ld_4 + 4, (char*)((intptr_t)p_4 + 4), ui8_5 + 5, si8_5 + 5}; printf("%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " @@ -136,18 +138,18 @@ test_large_fn( "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n", - ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, (unsigned long)p_1, - ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, (unsigned long)p_2, - ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, (unsigned long)p_3, - ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, (unsigned long)p_4, ui8_5, si8_5, + ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, (long)(intptr_t)p_1, + ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, (long)(intptr_t)p_2, + ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, (long)(intptr_t)p_3, + ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, (long)(intptr_t)p_4, ui8_5, si8_5, retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f, - retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l, + retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (long)(intptr_t)retVal.l, retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r, - retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x, + retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (long)(intptr_t)retVal.x, retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd, - retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj, + retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (long)(intptr_t)retVal.jj, retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp, - retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx); + retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (long)(intptr_t)retVal.vv, retVal.ww, retVal.xx); return retVal; } @@ -300,13 +302,13 @@ main(int argc __UNUSED__, const char** argv __UNUSED__) "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n", retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f, - retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l, + retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (long)(intptr_t)retVal.l, retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r, - retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x, + retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (long)(intptr_t)retVal.x, retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd, - retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj, + retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (long)(intptr_t)retVal.jj, retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp, - retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx); + retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (long)(intptr_t)retVal.vv, retVal.ww, retVal.xx); /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_large_fn, NULL, code) == FFI_OK); @@ -328,13 +330,13 @@ main(int argc __UNUSED__, const char** argv __UNUSED__) "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx " "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n", retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f, - retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l, + retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (long)(intptr_t)retVal.l, retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r, - retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x, + retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (long)(intptr_t)retVal.x, retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd, - retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj, + retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (long)(intptr_t)retVal.jj, retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp, - retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx); + retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (long)(intptr_t)retVal.vv, retVal.ww, retVal.xx); /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */ return 0; diff --git a/testsuite/libffi.closures/nested_struct.c b/testsuite/libffi.closures/nested_struct.c index c15e3a0..8b1b4ba 100644 --- a/testsuite/libffi.closures/nested_struct.c +++ b/testsuite/libffi.closures/nested_struct.c @@ -25,7 +25,7 @@ typedef struct cls_struct_combined { cls_struct_16byte2 e; } cls_struct_combined; -cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0, +static cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0, struct cls_struct_16byte2 b1, struct cls_struct_combined b2) { @@ -46,6 +46,29 @@ cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0, result.d.a, result.d.b, result.d.c, result.e.ii, result.e.dd, result.e.ff); + CHECK_DOUBLE_EQ(b0.a, 9); + CHECK_FLOAT_EQ(b0.b, 2); + CHECK(b0.c == 6); + + CHECK(b1.ii == 1); + CHECK_DOUBLE_EQ(b1.dd, 2); + CHECK_FLOAT_EQ(b1.ff, 3); + + CHECK_DOUBLE_EQ(b2.d.a, 4); + CHECK_FLOAT_EQ(b2.d.b, 5); + CHECK(b2.d.c == 6); + + CHECK(b2.e.ii == 3); + CHECK_DOUBLE_EQ(b2.e.dd, 1); + CHECK_FLOAT_EQ(b2.e.ff, 8); + + CHECK_DOUBLE_EQ(result.d.a, 15); + CHECK_FLOAT_EQ(result.d.b, 10); + CHECK(result.d.c == 13); + CHECK(result.e.ii == 10); + CHECK_DOUBLE_EQ(result.e.dd, 12); + CHECK_FLOAT_EQ(result.e.ff, 13); + return result; } @@ -128,12 +151,12 @@ int main (void) ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl); /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */ - CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); - CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); + CHECK_DOUBLE_EQ( res_dbl.d.a, (e_dbl.a + f_dbl.dd + g_dbl.d.a)); + CHECK_FLOAT_EQ( res_dbl.d.b, (e_dbl.b + f_dbl.ff + g_dbl.d.b)); CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); - CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); - CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); + CHECK_DOUBLE_EQ( res_dbl.e.dd, (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); + CHECK_FLOAT_EQ( res_dbl.e.ff, (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK); @@ -142,11 +165,11 @@ int main (void) cls_struct_combined)) (code))(e_dbl, f_dbl, g_dbl); /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */ - CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a)); - CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b)); + CHECK_DOUBLE_EQ( res_dbl.d.a, (e_dbl.a + f_dbl.dd + g_dbl.d.a)); + CHECK_FLOAT_EQ( res_dbl.d.b, (e_dbl.b + f_dbl.ff + g_dbl.d.b)); CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c)); CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii)); - CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); - CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); + CHECK_DOUBLE_EQ( res_dbl.e.dd, (e_dbl.a + f_dbl.dd + g_dbl.e.dd)); + CHECK_FLOAT_EQ( res_dbl.e.ff, (e_dbl.b + f_dbl.ff + g_dbl.e.ff)); exit(0); } diff --git a/testsuite/libffi.closures/nested_struct1.c b/testsuite/libffi.closures/nested_struct1.c index 477a6b9..df8ab59 100644 --- a/testsuite/libffi.closures/nested_struct1.c +++ b/testsuite/libffi.closures/nested_struct1.c @@ -25,7 +25,7 @@ typedef struct cls_struct_combined { cls_struct_16byte2 e; } cls_struct_combined; -cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0, +static cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0, struct cls_struct_16byte2 b1, struct cls_struct_combined b2, struct cls_struct_16byte1 b3) diff --git a/testsuite/libffi.closures/nested_struct10.c b/testsuite/libffi.closures/nested_struct10.c index 3cf2b44..a2cdc64 100644 --- a/testsuite/libffi.closures/nested_struct10.c +++ b/testsuite/libffi.closures/nested_struct10.c @@ -38,6 +38,18 @@ static B B_fn(struct A b2, struct B b3, struct C b4) (int)b3.x.a, b3.x.b, b3.y, b3.z, (int)b4.d, b4.e, (int)result.x.a, result.x.b, result.y); + CHECK((int)b2.a == 1); + CHECK(b2.b == 7); + CHECK((int)b3.x.a == 12); + CHECK(b3.x.b == 127); + CHECK(b3.y == 99); + CHECK(b3.z == 255); + CHECK((int)b4.d == 2); + CHECK(b4.e == 9); + CHECK((int)result.x.a == 270); + CHECK(result.x.b == 242); + CHECK(result.y == 143); + return result; } diff --git a/testsuite/libffi.closures/nested_struct11.c b/testsuite/libffi.closures/nested_struct11.c index 3510493..c9821e4 100644 --- a/testsuite/libffi.closures/nested_struct11.c +++ b/testsuite/libffi.closures/nested_struct11.c @@ -35,6 +35,13 @@ static C C_fn (int x, int y, int z, C source, int i, int j, int k) printf ("%d, %d, %d, %d, %d, %d\n", x, y, z, i, j, k); + CHECK(x == 1); + CHECK(y == 1); + CHECK(z == 1); + CHECK(i == 1); + CHECK(j == 1); + CHECK(k == 1); + printf ("%.1f, %.1f, %.1f, %.1f, " "%.1f, %.1f, %.1f, %.1f\n", source.a.a_x, source.a.a_y, @@ -42,6 +49,15 @@ static C C_fn (int x, int y, int z, C source, int i, int j, int k) result.a.a_x, result.a.a_y, result.b.b_x, result.b.b_y); + CHECK_FLOAT_EQ(source.a.a_x, 1.0); + CHECK_FLOAT_EQ(source.a.a_y, 2.0); + CHECK_FLOAT_EQ(source.b.b_x, 4.0); + CHECK_FLOAT_EQ(source.b.b_y, 8.0); + CHECK_FLOAT_EQ(result.a.a_x, 1.0); + CHECK_FLOAT_EQ(result.a.a_y, 2.0); + CHECK_FLOAT_EQ(result.b.b_x, 4.0); + CHECK_FLOAT_EQ(result.b.b_y, 8.0); + return result; } @@ -113,9 +129,9 @@ int main (void) ffi_call (&cif, FFI_FN (C_fn), &result, args); /* { dg-output "1, 1, 1, 1, 1, 1\n" } */ /* { dg-output "1.0, 2.0, 4.0, 8.0, 1.0, 2.0, 4.0, 8.0" } */ - CHECK (result.a.a_x == source.a.a_x); - CHECK (result.a.a_y == source.a.a_y); - CHECK (result.b.b_x == source.b.b_x); - CHECK (result.b.b_y == source.b.b_y); - exit (0); + CHECK_FLOAT_EQ(result.a.a_x, source.a.a_x); + CHECK_FLOAT_EQ(result.a.a_y, source.a.a_y); + CHECK_FLOAT_EQ(result.b.b_x, source.b.b_x); + CHECK_FLOAT_EQ(result.b.b_y, source.b.b_y); + exit(0); } diff --git a/testsuite/libffi.closures/nested_struct12.c b/testsuite/libffi.closures/nested_struct12.c new file mode 100644 index 0000000..7ca16c1 --- /dev/null +++ b/testsuite/libffi.closures/nested_struct12.c @@ -0,0 +1,86 @@ +/* Area: ffi_call + Purpose: Check nested float struct. + Limitations: none. + PR: none. + Originator: Cheng Jin */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct stru_FF stru_FF; +typedef struct stru_Nested_F stru_Nested_F; + +struct stru_FF { + float elem1; + float elem2; +}; + +struct stru_Nested_F { + float elem1; + stru_FF elem2; +}; + +static float testNestedFloatStruct(float arg1, stru_Nested_F arg2) +{ + float floatSum = arg1 + arg2.elem1 + arg2.elem2.elem1 + arg2.elem2.elem2; + return floatSum; +} + +int main (void) +{ + float ts12_result = 0; + int structElemNum = 2; + int nestedStructElemNum = 2; + int argNum = 2; + + ffi_cif cif; + ffi_type **struct_float1 = (ffi_type **)malloc(sizeof(ffi_type *) * (structElemNum + 1)); + ffi_type **struct_float2 = (ffi_type **)malloc(sizeof(ffi_type *) * (nestedStructElemNum + 1)); + ffi_type **args = (ffi_type **)malloc(sizeof(ffi_type *) * (argNum + 1)); + void **values = (void **)malloc(sizeof(void *) * (argNum + 1)); + ffi_type struct_float_type1, struct_float_type2; + ffi_type *retType = &ffi_type_float; + float arg1; + float *arg2 = (float *)malloc(sizeof(stru_Nested_F)); + + struct_float2[0] = &ffi_type_float; + struct_float2[1] = &ffi_type_float; + struct_float2[2] = NULL; + + struct_float_type2.size = 0; + struct_float_type2.alignment = 0; + struct_float_type2.type = FFI_TYPE_STRUCT; + struct_float_type2.elements = struct_float2; + + struct_float1[0] = &ffi_type_float; + struct_float1[1] = &struct_float_type2; + struct_float1[2] = NULL; + + struct_float_type1.size = 0; + struct_float_type1.alignment = 0; + struct_float_type1.type = FFI_TYPE_STRUCT; + struct_float_type1.elements = struct_float1; + + args[0] = &ffi_type_float; + args[1] = &struct_float_type1; + args[2] = NULL; + + arg1 = 37.88; + arg2[0] = 31.22; + arg2[1] = 33.44; + arg2[2] = 35.66; + values[0] = &arg1; + values[1] = arg2; + values[2] = NULL; + + CHECK( ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, retType, args) == FFI_OK); + ffi_call(&cif, FFI_FN(testNestedFloatStruct), &ts12_result, values); + CHECK_FLOAT_EQ(ts12_result, 138.2f); + + free(struct_float1); + free(struct_float2); + free(args); + free(values); + + exit(0); +} diff --git a/testsuite/libffi.closures/nested_struct13.c b/testsuite/libffi.closures/nested_struct13.c new file mode 100644 index 0000000..6edfdcb --- /dev/null +++ b/testsuite/libffi.closures/nested_struct13.c @@ -0,0 +1,115 @@ +/* Area: ffi_call, closure_call + Purpose: Check structure passing. + Limitations: none. + PR: none. + Originator: and 20210609 */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + float a, b; +} A; + +typedef struct B { + float x; + struct A y; +} B; + +B B_fn(float b0, struct B b1) +{ + struct B result; + + result.x = b0 + b1.x; + result.y.a = b0 + b1.y.a; + result.y.b = b0 + b1.y.b; + + printf("%g %g %g %g: %g %g %g\n", b0, b1.x, b1.y.a, b1.y.b, + result.x, result.y.a, result.y.b); + + CHECK_FLOAT_EQ(b0, 12.125); + CHECK_FLOAT_EQ(b1.x, 24.75); + CHECK_FLOAT_EQ(b1.y.a, 31.625); + CHECK_FLOAT_EQ(b1.y.b, 32.25); + CHECK_FLOAT_EQ(result.x, 36.875); + CHECK_FLOAT_EQ(result.y.a, 43.75); + CHECK_FLOAT_EQ(result.y.b, 44.375); + + return result; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + float b0; + struct B b1; + + b0 = *(float*)(args[0]); + b1 = *(struct B*)(args[1]); + + *(B*)resp = B_fn(b0, b1); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[3]; + ffi_type cls_struct_type, cls_struct_type1; + ffi_type* dbl_arg_types[3]; + + float e_dbl = 12.125f; + struct B f_dbl = { 24.75f, { 31.625f, 32.25f } }; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_fields[0] = &ffi_type_float; + cls_struct_fields[1] = &ffi_type_float; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &ffi_type_float; + cls_struct_fields1[1] = &cls_struct_type; + cls_struct_fields1[2] = NULL; + + + dbl_arg_types[0] = &ffi_type_float; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = NULL; + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + /* { dg-output "12.125 24.75 31.625 32.25: 36.875 43.75 44.375" } */ + CHECK_FLOAT_EQ( res_dbl.x, (e_dbl + f_dbl.x)); + CHECK_FLOAT_EQ( res_dbl.y.a, (e_dbl + f_dbl.y.a)); + CHECK_FLOAT_EQ( res_dbl.y.b, (e_dbl + f_dbl.y.b)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(float, B))(code))(e_dbl, f_dbl); + /* { dg-output "\n12.125 24.75 31.625 32.25: 36.875 43.75 44.375" } */ + CHECK_FLOAT_EQ( res_dbl.x, (e_dbl + f_dbl.x)); + CHECK_FLOAT_EQ( res_dbl.y.a, (e_dbl + f_dbl.y.a)); + CHECK_FLOAT_EQ( res_dbl.y.b, (e_dbl + f_dbl.y.b)); + + exit(0); +} diff --git a/testsuite/libffi.closures/nested_struct2.c b/testsuite/libffi.closures/nested_struct2.c index 69268cd..93a913d 100644 --- a/testsuite/libffi.closures/nested_struct2.c +++ b/testsuite/libffi.closures/nested_struct2.c @@ -19,7 +19,7 @@ typedef struct B { unsigned char y; } B; -B B_fn(struct A b0, struct B b1) +static B B_fn(struct A b0, struct B b1) { struct B result; @@ -30,6 +30,15 @@ B B_fn(struct A b0, struct B b1) printf("%lu %d %lu %d %d: %lu %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y, result.x.a, result.x.b, result.y); + CHECK(b0.a == 1); + CHECK(b0.b == 7); + CHECK(b1.x.a == 12); + CHECK(b1.x.b == 127); + CHECK(b1.y == 99); + CHECK(result.x.a == 13); + CHECK(result.x.b == 233); + CHECK(result.y == 134); + return result; } diff --git a/testsuite/libffi.closures/nested_struct3.c b/testsuite/libffi.closures/nested_struct3.c index ab18cad..d39a9cc 100644 --- a/testsuite/libffi.closures/nested_struct3.c +++ b/testsuite/libffi.closures/nested_struct3.c @@ -19,7 +19,7 @@ typedef struct B { unsigned char y; } B; -B B_fn(struct A b0, struct B b1) +static B B_fn(struct A b0, struct B b1) { struct B result; @@ -31,6 +31,15 @@ B B_fn(struct A b0, struct B b1) (int)b1.x.a, b1.x.b, b1.y, (int)result.x.a, result.x.b, result.y); + CHECK((int)b0.a == 1); + CHECK(b0.b == 7); + CHECK((int)b1.x.a == 12); + CHECK(b1.x.b == 127); + CHECK(b1.y == 99); + CHECK((int)result.x.a == 13); + CHECK(result.x.b == 233); + CHECK(result.y == 134); + return result; } diff --git a/testsuite/libffi.closures/nested_struct4.c b/testsuite/libffi.closures/nested_struct4.c index 2ffb4d6..d5c960d 100644 --- a/testsuite/libffi.closures/nested_struct4.c +++ b/testsuite/libffi.closures/nested_struct4.c @@ -31,6 +31,15 @@ static B B_fn(struct A b2, struct B b3) (int)b3.x.a, b3.x.b, b3.y, (int)result.x.a, result.x.b, result.y); + CHECK((int)b2.a == 1); + CHECK(b2.b == 7); + CHECK((int)b3.x.a == 12); + CHECK(b3.x.b == 127); + CHECK(b3.y == 99); + CHECK((int)result.x.a == 13); + CHECK(result.x.b == 233); + CHECK(result.y == 134); + return result; } diff --git a/testsuite/libffi.closures/nested_struct5.c b/testsuite/libffi.closures/nested_struct5.c index 6c79845..b053f52 100644 --- a/testsuite/libffi.closures/nested_struct5.c +++ b/testsuite/libffi.closures/nested_struct5.c @@ -31,6 +31,15 @@ static B B_fn(struct A b2, struct B b3) (int)b3.x.a, b3.x.b, b3.y, (int)result.x.a, result.x.b, result.y); + CHECK((int)b2.a == 1); + CHECK(b2.b == 7); + CHECK((int)b3.x.a == 12); + CHECK(b3.x.b == 127); + CHECK(b3.y == 99); + CHECK((int)result.x.a == 13); + CHECK(result.x.b == 233); + CHECK(result.y == 134); + return result; } diff --git a/testsuite/libffi.closures/nested_struct6.c b/testsuite/libffi.closures/nested_struct6.c index 59d3579..690ec0b 100644 --- a/testsuite/libffi.closures/nested_struct6.c +++ b/testsuite/libffi.closures/nested_struct6.c @@ -36,6 +36,17 @@ static B B_fn(struct A b2, struct B b3, struct C b4) (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e, (int)result.x.a, result.x.b, result.y); + CHECK((int)b2.a == 1); + CHECK(b2.b == 7); + CHECK((int)b3.x.a == 12); + CHECK(b3.x.b == 127); + CHECK(b3.y == 99); + CHECK((int)b4.d == 2); + CHECK(b4.e == 9); + CHECK((int)result.x.a == 15); + CHECK(result.x.b == 242); + CHECK(result.y == 143); + return result; } diff --git a/testsuite/libffi.closures/nested_struct7.c b/testsuite/libffi.closures/nested_struct7.c index 27595e6..b3ddd03 100644 --- a/testsuite/libffi.closures/nested_struct7.c +++ b/testsuite/libffi.closures/nested_struct7.c @@ -31,6 +31,15 @@ static B B_fn(struct A b2, struct B b3) (int)b3.x.a, b3.x.b, b3.y, (int)result.x.a, result.x.b, result.y); + CHECK((int)b2.a == 1); + CHECK(b2.b == 7); + CHECK((int)b3.x.a == 12); + CHECK(b3.x.b == 127); + CHECK(b3.y == 99); + CHECK((int)result.x.a == 13); + CHECK(result.x.b == 233); + CHECK(result.y == 134); + return result; } diff --git a/testsuite/libffi.closures/nested_struct8.c b/testsuite/libffi.closures/nested_struct8.c index 0e6c682..768f333 100644 --- a/testsuite/libffi.closures/nested_struct8.c +++ b/testsuite/libffi.closures/nested_struct8.c @@ -36,6 +36,17 @@ static B B_fn(struct A b2, struct B b3, struct C b4) (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e, (int)result.x.a, result.x.b, result.y); + CHECK((int)b2.a == 1); + CHECK(b2.b == 7); + CHECK((int)b3.x.a == 12); + CHECK(b3.x.b == 127); + CHECK(b3.y == 99); + CHECK((int)b4.d == 2); + CHECK(b4.e == 9); + CHECK((int)result.x.a == 15); + CHECK(result.x.b == 242); + CHECK(result.y == 143); + return result; } diff --git a/testsuite/libffi.closures/nested_struct9.c b/testsuite/libffi.closures/nested_struct9.c index 5f7ac67..f88ab0a 100644 --- a/testsuite/libffi.closures/nested_struct9.c +++ b/testsuite/libffi.closures/nested_struct9.c @@ -36,6 +36,17 @@ static B B_fn(struct A b2, struct B b3, struct C b4) b3.x.a, (int)b3.x.b, b3.y, (int)b4.d, b4.e, result.x.a, (int)result.x.b, result.y); + CHECK((int)b2.a == 1); + CHECK(b2.b == 7); + CHECK((int)b3.x.a == 12); + CHECK(b3.x.b == 127); + CHECK(b3.y == 99); + CHECK((int)b4.d == 2); + CHECK(b4.e == 9); + CHECK((int)result.x.a == 15); + CHECK(result.x.b == 242); + CHECK(result.y == 143); + return result; } diff --git a/testsuite/libffi.closures/single_entry_structs1.c b/testsuite/libffi.closures/single_entry_structs1.c new file mode 100644 index 0000000..00c4e17 --- /dev/null +++ b/testsuite/libffi.closures/single_entry_structs1.c @@ -0,0 +1,86 @@ +/* Area: ffi_call, closure_call + Purpose: Single argument structs have a different ABI in emscripten. + Limitations: none. + PR: none. + Originator: */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + int a; +} A; + +static struct A A_fn(int b0, struct A b1) +{ + b1.a += b0; + return b1; +} + +static void +A_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + int b0; + struct A b1; + + b0 = *(int*)(args[0]); + b1 = *(struct A*)(args[1]); + + *(A*)resp = A_fn(b0, b1); +} + +int main (void) +{ + printf("123\n"); + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[2]; + ffi_type cls_struct_type; + ffi_type* dbl_arg_types[3]; + + int e_dbl = 12125; + struct A f_dbl = { 31625 }; + + struct A res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_fields[0] = &ffi_type_sint; + cls_struct_fields[1] = NULL; + + dbl_arg_types[0] = &ffi_type_sint; + dbl_arg_types[1] = &cls_struct_type; + dbl_arg_types[2] = NULL; + + res_dbl = A_fn(e_dbl, f_dbl); + printf("0 res: %d\n", res_dbl.a); + /* { dg-output "0 res: 43750" } */ + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + + ffi_call(&cif, FFI_FN(A_fn), &res_dbl, args_dbl); + printf("1 res: %d\n", res_dbl.a); + /* { dg-output "\n1 res: 43750" } */ + CHECK( res_dbl.a == (e_dbl + f_dbl.a)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, A_gn, NULL, code) == FFI_OK); + + res_dbl = ((A(*)(int, A))(code))(e_dbl, f_dbl); + printf("2 res: %d\n", res_dbl.a); + /* { dg-output "\n2 res: 43750" } */ + CHECK( res_dbl.a == (e_dbl + f_dbl.a)); + + exit(0); +} diff --git a/testsuite/libffi.closures/single_entry_structs2.c b/testsuite/libffi.closures/single_entry_structs2.c new file mode 100644 index 0000000..ab6556b --- /dev/null +++ b/testsuite/libffi.closures/single_entry_structs2.c @@ -0,0 +1,102 @@ +/* Area: ffi_call, closure_call + Purpose: Single argument structs have a different ABI in emscripten. + Limitations: none. + PR: none. + Originator: */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + int a, b; +} A; + +typedef struct B { + struct A y; +} B; + +static struct B B_fn(int b0, struct B b1) +{ + b1.y.a += b0; + b1.y.b -= b0; + return b1; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + int b0; + struct B b1; + + b0 = *(int*)(args[0]); + b1 = *(struct B*)(args[1]); + + *(B*)resp = B_fn(b0, b1); +} + +int main (void) +{ + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[3]; + ffi_type* cls_struct_fields1[2]; + ffi_type cls_struct_type, cls_struct_type1; + ffi_type* dbl_arg_types[3]; + + int e_dbl = 12125; + struct B f_dbl = { { 31625, 16723 } }; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_fields[0] = &ffi_type_sint; + cls_struct_fields[1] = &ffi_type_sint; + cls_struct_fields[2] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = NULL; + + + dbl_arg_types[0] = &ffi_type_sint; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = NULL; + + res_dbl = B_fn(e_dbl, f_dbl); + printf("0 res: %d %d\n", res_dbl.y.a, res_dbl.y.b); + /* { dg-output "0 res: 43750 4598" } */ + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + printf("1 res: %d %d\n", res_dbl.y.a, res_dbl.y.b); + /* { dg-output "\n1 res: 43750 4598" } */ + CHECK( res_dbl.y.a == (f_dbl.y.a + e_dbl)); + CHECK( res_dbl.y.b == (f_dbl.y.b - e_dbl)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(int, B))(code))(e_dbl, f_dbl); + printf("2 res: %d %d\n", res_dbl.y.a, res_dbl.y.b); + /* { dg-output "\n2 res: 43750 4598" } */ + CHECK( res_dbl.y.a == (f_dbl.y.a + e_dbl)); + CHECK( res_dbl.y.b == (f_dbl.y.b - e_dbl)); + + exit(0); +} diff --git a/testsuite/libffi.closures/single_entry_structs3.c b/testsuite/libffi.closures/single_entry_structs3.c new file mode 100644 index 0000000..4f619cb --- /dev/null +++ b/testsuite/libffi.closures/single_entry_structs3.c @@ -0,0 +1,101 @@ +/* Area: ffi_call, closure_call + Purpose: Single argument structs have a different ABI in emscripten. + Limitations: none. + PR: none. + Originator: */ + +/* { dg-do run } */ +#include "ffitest.h" + +typedef struct A { + int a; +} A; + +typedef struct B { + struct A y; +} B; + +static struct B B_fn(int b0, struct B b1) +{ + b1.y.a += b0; + return b1; +} + +static void +B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) +{ + int b0; + struct B b1; + + b0 = *(int*)(args[0]); + b1 = *(struct B*)(args[1]); + + *(B*)resp = B_fn(b0, b1); +} + +int main (void) +{ + printf("123\n"); + ffi_cif cif; + void *code; + ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); + void* args_dbl[3]; + ffi_type* cls_struct_fields[2]; + ffi_type* cls_struct_fields1[2]; + ffi_type cls_struct_type, cls_struct_type1; + ffi_type* dbl_arg_types[3]; + + int e_dbl = 12125; + struct B f_dbl = { { 31625 } }; + + struct B res_dbl; + + cls_struct_type.size = 0; + cls_struct_type.alignment = 0; + cls_struct_type.type = FFI_TYPE_STRUCT; + cls_struct_type.elements = cls_struct_fields; + + cls_struct_type1.size = 0; + cls_struct_type1.alignment = 0; + cls_struct_type1.type = FFI_TYPE_STRUCT; + cls_struct_type1.elements = cls_struct_fields1; + + cls_struct_fields[0] = &ffi_type_sint; + cls_struct_fields[1] = NULL; + + cls_struct_fields1[0] = &cls_struct_type; + cls_struct_fields1[1] = NULL; + + + dbl_arg_types[0] = &ffi_type_sint; + dbl_arg_types[1] = &cls_struct_type1; + dbl_arg_types[2] = NULL; + + res_dbl = B_fn(e_dbl, f_dbl); + printf("0 res: %d\n", res_dbl.y.a); + /* { dg-output "0 res: 43750" } */ + + + CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1, + dbl_arg_types) == FFI_OK); + + args_dbl[0] = &e_dbl; + args_dbl[1] = &f_dbl; + args_dbl[2] = NULL; + + + ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl); + printf("1 res: %d\n", res_dbl.y.a); + /* { dg-output "\n1 res: 43750" } */ + CHECK( res_dbl.y.a == (e_dbl + f_dbl.y.a)); + + CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK); + + res_dbl = ((B(*)(int, B))(code))(e_dbl, f_dbl); + printf("2 res: %d\n", res_dbl.y.a); + /* { dg-output "\n2 res: 43750" } */ + CHECK( res_dbl.y.a == (e_dbl + f_dbl.y.a)); + + exit(0); +} diff --git a/testsuite/libffi.closures/stret_medium.c b/testsuite/libffi.closures/stret_medium.c index 973ee02..56e3d9d 100644 --- a/testsuite/libffi.closures/stret_medium.c +++ b/testsuite/libffi.closures/stret_medium.c @@ -21,7 +21,7 @@ typedef struct struct_72byte { double i; } struct_72byte; -struct_72byte cls_struct_72byte_fn( +static struct_72byte cls_struct_72byte_fn( struct_72byte b0, struct_72byte b1, struct_72byte b2, diff --git a/testsuite/libffi.closures/stret_medium2.c b/testsuite/libffi.closures/stret_medium2.c index 84323d1..0746b6e 100644 --- a/testsuite/libffi.closures/stret_medium2.c +++ b/testsuite/libffi.closures/stret_medium2.c @@ -22,7 +22,7 @@ typedef struct struct_72byte { long long i; } struct_72byte; -struct_72byte cls_struct_72byte_fn( +static struct_72byte cls_struct_72byte_fn( struct_72byte b0, struct_72byte b1, struct_72byte b2, diff --git a/testsuite/libffi.closures/testclosure.c b/testsuite/libffi.closures/testclosure.c index ca31056..e738a01 100644 --- a/testsuite/libffi.closures/testclosure.c +++ b/testsuite/libffi.closures/testclosure.c @@ -14,12 +14,17 @@ typedef struct cls_struct_combined { float d; } cls_struct_combined; -void cls_struct_combined_fn(struct cls_struct_combined arg) +static void cls_struct_combined_fn(struct cls_struct_combined arg) { printf("%g %g %g %g\n", arg.a, arg.b, arg.c, arg.d); fflush(stdout); + + CHECK_FLOAT_EQ(arg.a, 4); + CHECK_FLOAT_EQ(arg.b, 5); + CHECK_FLOAT_EQ(arg.c, 1); + CHECK_FLOAT_EQ(arg.d, 8); } static void diff --git a/testsuite/libffi.closures/unwindtest.cc b/testsuite/libffi.closures/unwindtest.cc index e114565..6c97c61 100644 --- a/testsuite/libffi.closures/unwindtest.cc +++ b/testsuite/libffi.closures/unwindtest.cc @@ -4,7 +4,7 @@ PR: none. Originator: Jeff Sturm */ -/* { dg-do run { xfail x86_64-apple-darwin* moxie*-*-* } } */ +/* { dg-do run { xfail moxie*-*-* } } */ #include "ffitest.h"