testsuite/lib/libffi.exp


Log

Author Commit Date CI Message
Hood Chatham 678dad5a 2023-02-02T14:48:07 Use libffi-dg-prune to handle Emscripten INFO messages rather than patching emcc.py (#766)
Hood Chatham 2687cfc5 2023-02-02T09:10:00 Add wasm32 emscripten support (#763) * added build script * Apply libffi-emscripten patch * Some changes to wasm32/ffi.c * Remove exit(0); from test suites * Fix LONGDOUBLE argument type * Use more macros in ffi.c * Use switch statements instead of if chains * Implemented struct args * Finish struct implementation * Partially working closures * Got closures working (most of closures test suite passes) * Revert changes to test suite * Update .gitignore * Apply code formatter * Use stackSave and stackRestore rather than directly adjusting stack pointer * Add missing break * Fix visibility of ffi_closure_alloc and ffi_closure_free * Fix FFI_TYPE_STRUCT and FFI_TYPE_LONGDOUBLE when WASM_BIGINT is not used sig needs to be vi here for FFI_TYPE_STRUCT and FFI_TYPE_LONGDOUBLE, noticed this while running the test suite without WASM_BIGINT support. * Always use dynCall rather than direct wasmTable lookup (function pointer cast emulation changes dynCall) * Prevent closures.c from duplicating symbols * Try to set up CI * Add test with bigint * Make test methods static * Remove BigInt shorthand because it messes up terser * Add selenium tests * Update tests a bit to try to make CI work * WASM_BIGINT is a linker flag not a compile flag * Finish getting CI working (#1) * update gitignore * Avoid adding "use strict;" to generated JS This should be controlled by -s STRICT_JS in Emscripten. * Make JavaScript ES5 compliant * Remove redundant EXPORTED_RUNTIME_METHODS settings * Fix definition of DEREF_I16 * Avoid marshalling FFI_TYPE_LONGDOUBLE when WASM_BIGINT is not used * Add missing FFI_TYPE_STRUCT signature * Improve test scripts * Remove redundant EXPORTED_RUNTIME_METHODS settings * Add missing EOL * Add struct unpacking tests * Update ci config to try to actually use WASM_BIGINT * Revert "Avoid marshalling FFI_TYPE_LONGDOUBLE when WASM_BIGINT is not used" This reverts commit 61bd5a3e20891623715604581b6e872ab3dfab80. * Fix single_entry_structs tests * Fix return from closure call * Fix 64 bit return from closures * only allocate as much space on stack for return pointer as needed * Revert "only allocate as much space on stack for return pointer as needed" This reverts commit e54a30faea3803e7ac33eed191bde9e573850fc1. * xfail two tests * Fix err_bad_abi test * Remove test logging junk * Try to set up long double marshalling for closures * xfail err_bad_abi * Fix reference errors in previous commit * Add missing argument pointer assignment * Fix signature of function pointer in cls_dbls_struct * Fix longdouble argument * Try some changes to bigint handling * Fix BigInt handling * Fix cls_longdouble test * Fix long double closure arg with no WASM_BIGINT * Use EM_JS to factor out js helpers * Support for varargs closure calls * Fix varargs calls * Fix err_bad_abi test * Fix typo in previous commit * Add more assertions to closures test suite * Fix some asserts * Add assertions to a few more tests * Fix some tests * Fix more floating point assertions * Update more tests * Var args for ffi_call * Don't do node tests * Macro for allocating on stack * Add some comments, simplify struct handling * Try again to fix varargs calls, add comments * Consolidate WASM_BIGINT conditionals into LOAD_U64 and STORE_U64 macros * A bit of cleanup * Fix another typo * Some fixes to the testsuite * Another testsuite fix * Fix varags with closures? * Another attempt at getting closure varargs to work * sig is initialized later * Allow libffi.closures tests to be run * Improve build script * Remove redundant semicolons * Fix a few libffi.closures test failures * Cleanup * Legacy dynCall API is no longer used * Fix FFI_TYPE_LONGDOUBLE offset * xfail 2 tests for WASM - closure_loc_fn0; not applicable -- codeloc doesn't point to closure. - huge_struct; function signature too long. * Revert some redundant dg-output/printf statements Helps Node. * Revert "Don't do node tests" This reverts commit a341ef4b. * Fix assertions in cls_24byte * More tiny formating fixes to test suite * Revert "Revert "Don't do node tests"" This reverts commit 7722e685ea04e2420e042886816d8c4dd31f5dcb. * Fix 64 bit returns when WASM_BIGINT is absent * Fix print statement in cls_24byte * Add CALL_FUNC_PTR macro to allow pyodide to define custom calling behavior to handle fpcast * Update single_entry_structs tests * More explanations * Fix compile error in last commit * Add more support for pyodide fpcast emulation, update CI to try to test it * Clone via https * Fix path to pyodide emsdk_env * Add asserts to the rest of the test suite * Fix test compile errors * Fix some tests * Fix cls_ulonglong * Fix alignment of <4 byte args * fix cls_ulonglong again * Use snprintf instead of sprintf * Should assert than strncmp returned 0 * Fix va_struct1 and va_struct3 * Change double and long double tests These tests are failing because of a strange bug with prinft and doubles, but I am not convinced it necessarily has anything to do with libffi. This version casts the double to int before printing it and avoids the issue * Enable node tests * Revert "Change double and long double tests" This reverts commit 8f3ff89c6577dc99564181cd9974f2f1ba21f1e9. * Fix PYODIDE_FPCAST flag * add conftest.py back in * Fix emcc error: setting `EXPORTED_FUNCTIONS` expects `<class 'list'>` but got `<class 'str'>` See discussion on https://github.com/pyodide/pyodide/pull/1596 * Remove test.html * Remove duplicate test file * More changes from upstream * Fix some whitespace * Add some basic debug logging statements * Reapply libffi.exp changes * Don't build docs (#7) Works around build issue makeinfo: command not found. * Update long double alignment Emscripten 2.0.26 reduces the aligmnet of long double to 8. Quoting from `ChangeLog.md`: > The alignment of `long double`, which is a 128-bit floating-point > value implemented in software, is reduced from 16 to 8. The lower > alignment allows `max_align_t` to properly match the alignment we > use for malloc, which is 8 (raising malloc's alignment to achieve > correctness the other way would come with a performance regression). > (#10072) * Update long double alignment Emscripten 2.0.26 reduces the aligmnet of long double to 8. Quoting from `ChangeLog.md`: > The alignment of `long double`, which is a 128-bit floating-point > value implemented in software, is reduced from 16 to 8. The lower > alignment allows `max_align_t` to properly match the alignment we > use for malloc, which is 8 (raising malloc's alignment to achieve > correctness the other way would come with a performance regression). > (#10072) * Improve error handling a bit (#8) * Fix handling of signed arguments to ffi_call (#11) * Fix struct argument handling in ffi_call (#10) * Remove fpcast emulation tests * Align the stack to MAX_ALIGN before making call (#12) * Increase MAX_ARGS * Cleanup (#14) * Fix Closure compiler error with -sASSERTIONS=1 (#15) * Remove function pointer cast emulation (#13) This reverts commit 593b402 and cbc54da, as it's no longer needed after PR pyodide/pyodide#2019. * Prefer the `__EMSCRIPTEN__` definition over `EMSCRIPTEN` (#18) "The preprocessor define EMSCRIPTEN is deprecated. Don't pass it to code in strict mode. Code should use the define __EMSCRIPTEN__ instead." https://github.com/emscripten-core/emscripten/blob/84a634167a1cd9e8c47d37a559688153a4ceace6/emcc.py#L887-L890 * Install autoconf 2.71 * Try again with installing autoconf 2.71 * Fix compatibility with Emscripten 3.1.28 * CI: remove use of `EM_CONFIG` env See commit: https://github.com/emscripten-core/emsdk/commit/3d87d5ea8143b3636f872fb05b896eb4a19a070b * Fix cls_multi_schar: cast rest_call to signed char * Remove test xfails (#17) * Fix long double when used as a varargs argument * Enable unwindtest and fix it * Add EM_JS_DEPS * Also require convertJsFunctionToWasm * Run tests very very verbose * Echo the .emscripten file * Remove --experimental-wasm-bigint insertion * Build with assertions * Move verbosity flags back out of LDFLAGS * Remove debug print statement * Use up to date pyodide docker image * Explicitly cast res_call to fix test failure * Put back name of main function in cls_longdouble_va.c * Fix alignment The stack pointer apparently needs to be aligned to 16. There were some terrible subtle bugs caused by not respecting this. stackAlloc knows that the stack should be 16 aligned, so we can use stackAlloc(0) to enforce this. This way if alignment requirements change, as long as Emscripten updates stackAlloc to continue to enforce them we should be okay. * Fix handling of systems with no Js bigint integration When we run the node tests we use node v14 tests (since node v14 is vendored with Emscripten). Node v14 has no Js bigint integration unless the --experimental-wasm-bigint flag is passed. So only the node tests really notice if we get this right. Turns out, it didn't work. We can't call a JavaScript function with 64 bit integer arguments without bigint integration. In ffi_call, we are trying to call a wasm function that takes 64 bit integer arguments. dynCall is designed to do this. We need to go back to tracking the signature when we don't have WASM_BIGINT, and then use dynCall. This works better now that emscripten can dynamically fill in extra dynCall wrappers: https://github.com/emscripten-core/emscripten/pull/17328 On the other hand, for the closures we are not getting a function pointer as a first argument. We need to make our own wasm legalizer adaptor that splits 64 bit integer arguments and then calls the JavaScript trampoline, then the JavaScript trampoline reassembles them, calls the closure, then splits the result (if it's a 64 bit integer) and the adaptor puts it back together. * Improvements to emscripten test shell scripts (#21) This fixes the C++ unwinding tests and makes other minor improvements to the Emscripten test shell scripts. * Rename the test folder and move test files into emscripten test folder * Use docker image that has autoconf-2.71 * Cleanup * Pin emscripten 3.1.30 * Fix build.sh path * Rearrange ci pipeline * Fix bpo_38748 test * Cleanup * Improvements to comments, add static asserts, and update copyright * Use `*_js` instead of `*_helper` for EM_JS functions (#22) * Minor code simplification * Xfail first dejagnu test to work around emscripten cache messages See https://github.com/emscripten-core/emscripten/issues/18607 * Remove unneeded xfails * Shorten conftest.py by using pytest-pyodide * Apply formatters and linters to emscripten directory * Fix Emscripten xfail hack * Fix build-tests script * Patch emscripten to quiet info messages * Clean up compiler flags in scripts and remove some settings from circleci config * Rename emscripten quiet script * Add missing export * Don't remove go.exp * Add reference to emscripten logging issue --------- Co-authored-by: Kleis Auke Wolthuizen <info@kleisauke.nl> Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl> Co-authored-by: Christian Heimes <christian@python.org>
Iain Sandoe 7effe999 2023-02-02T11:42:46 Darwin: Search for both shared and convenience libraries in each path. (#761) For several Darwin linker versions, the default behaviour is to first traverse the set of library paths, looking for shared libraries, and then a second time looking for archives. This means that if the library is configured --disable-shared the installed system version /usr/lib/libffi.dylib will be found before the archive under test. Using the linker option '-search-paths-first' alters the strategy to search each path for dylib and then archive before moving on to the next.
Anthony Green a1467200 2022-09-26T11:41:48 Never link pthread for android
Anthony Green b2344575 2022-09-06T12:43:08 Fix unwindtest on macos
Anthony Green b4cf3d64 2022-09-04T07:32:18 Prune warnings from sparc64 linux ld
Sergei Trofimovich 58dfdf6a 2021-03-24T23:19:54 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 <slyfox@gentoo.org>
Anthony Green 2e90bb55 2020-06-07T14:31:06 Add gcc bug tests back
Anthony Green 1761a106 2019-11-22T18:53:09 Remove gccbug detection. GCC is good now.
Anthony Green 825b2a35 2019-10-16T16:05:46 Test on arm32v7-linux-gnu, ppc64le-linux-gnu and aarch64-linux-gnu. Use docker images and qemu to test libffi for non-x86 architectures on travis-ci. Use the LIBFFI_TEST_OPTIMIZATION environment variable to force specific optimization levels at test time.
Anthony Green 042ef8c3 2019-02-12T08:50:30 Remove -Os testing. No ABI impact, and helps trim log lengths.
Anthony Green 8206253f 2018-05-09T10:50:46 Mark some cases as xfail due to GCC bug
hjl-tools d3c54cf3 2018-05-02T06:19:58 Re-enable msabi testing (#436) * Revert "disable msabi testing for now" This reverts commit 7b7638eb0eac2adfa72f7ec9f254ba287c9947e2. * x86: Correct testing for 64-bit x86-64 Since passing -m32 to x86-64 compiler will generate i386 code, we need to check both __ILP32__ and __i386__ for 64-bit x86-64. * x86: Check __i386__ instead of i?86-*-* targets Since passing -m32 to x86-64 compiler will generate i386 code, we need to check __i386__ instead of i?86-*-* targets for i386 targets. * i386: Properly passing integer parameters in registers For thiscall and fastcall, if the paramter passed as 64-bit integer or struct, all following integer paramters will be passed on stack. * test: Add ABI_ATTR to callback_code Add ABI_ATTR to callback_code to properly test different ABIs.
Anthony Green 7b7638eb 2018-04-02T08:24:44 disable msabi testing for now
Anthony Green 48bdb028 2018-03-29T07:22:57 Trim some optimization tests
H.J. Lu b2a343ff 2017-10-25T04:36:49 Don't include WIN64/EFI64 for x32 Since x32 doesn't support WIN64/EFI64, don't include it for x32. Also x32 has sizeof size_t == 4. But TARGET should be X86_64.
Anthony Green c9c2aa24 2017-03-15T09:58:39 Revert previous two changes. clang/MacOS problem can only be solved within dejagnu.
Anthony Green 5a8fca94 2017-03-15T09:52:39 Fix typo
Anthony Green 5b10a019 2017-03-15T09:34:01 Work around dejagnu/clang problems
Yuriy Kolerov f74ea2dc 2016-07-28T20:57:09 Allow setting an arbitary value for blddirffi in testsuite It is useful when tests are executed not from build directory. So the path of the build directory may be passed through site.exp or runtest. Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Yuriy Kolerov 31362d78 2016-07-28T18:48:23 ARC: Link tests with pthread library Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Tom Tromey 02089a1b 2016-05-23T09:58:51 Merge pull request #237 from tschwinge/libffi_feature_test Simplify/fix libffi_feature_test
Richard Henderson e5843a3a 2016-04-15T16:10:08 x86: Fix calling convention for ffi_closure_win64_inner Also enable testing for the cross-abi calls.
Thomas Schwinge c8845517 2016-02-25T20:10:18 Simplify/fix libffi_feature_test As detailed in <http://news.gmane.org/find-root.php?message_id=%3C87wppswqqt.fsf%40kepler.schwinge.homeip.net%3E>, the original code (originally added in commit f1301a54bb80e6ae23f7687c68f36875dae69134 as part of pull request #145) does not work (at least not for me, in the GCC environment).
Filipe Brandenburger 89b76050 2015-10-19T15:33:23 Fix dejagnu test support for --tool_opts Right now it concatenates it with the existing options and then appends it to that list, fix it to simply append it as is, same as it is done with the other variables. Tested by running the following command which includes gcc options: $ make check RUNTESTFLAGS="--tool_opts '-Werror'" Without this patch, all the tests fail. With it, the test succeed. Inspecting the logs shows that -Werror was indeed used when compiling the test sources.
Richard Henderson f1301a54 2014-11-14T10:50:29 testsuite: Use feature test rather than enumeration for complex
Richard Henderson b5ade2fb 2014-11-13T09:06:10 testsuite: Detect clang Clang doesn't like the -Wno-psabi argument that we want to pass to GCC. Since clang is detected as GCC via __GNUC__, use ax_cv_c_compiler_vendor.
Anthony Green fbbf48fb 2014-09-20T07:43:51 Compile tests with -Wno-psabi when using GCC
Josh Triplett 7d698125 2014-03-26T23:17:56 Use the proper C++ compiler to run C++ tests Running the C compiler with -shared-libgcc -lstdc++ does not work on non-GCC compilers.
Josh Triplett e48918ec 2014-03-16T20:29:27 testsuite: Add ABIs to the test matrix; unify tests across ABIs This eliminates all the *_win32.c tests in favor of the tests they were branched from, and expands test coverage to run many more tests on stdcall, thiscall, and fastcall. This same mechanism also supports testing any other target that has multiple ABIs.
Josh Triplett 5695ec14 2014-03-16T16:04:58 testsuite: Factor out a function to run a matrix of tests This commons up code from libffi.call/call.exp and libffi.special/special.exp, unifies the optimization option matrix between the two, and makes it easier to add more axes to the matrix in the future.
Anthony Green f26c7ca6 2013-01-08T14:47:05 Make compiler options in dejagnu runs compiler specific
Anthony Green 58e8b66f 2012-10-30T07:07:19 AArch64 port
Anthony Green fa5d7479 2012-10-30T07:07:19 AArch64 port
Anthony Green 857fe3de 2011-02-08T19:39:20 Clean ups
Anthony Green bc9d0be2 2011-02-08T17:04:26 3.0.10rc0 changes
Anthony Green 2db72615 2010-11-21T10:50:56 Rebase