Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/include/ffi.hAdded+515
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/include/ffitarget.hAdded+147
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/about.jsonAdded+115
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/filesAdded+13
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/gitAdded
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/has_prefixAdded+1
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/hash_input.jsonAdded+6
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/index.jsonAdded+15
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/paths.jsonAdded+85
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/recipe/build.shAdded+44
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/recipe/conda_build_config.yamlAdded+103
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/recipe/configure_includedir_option.patchAdded+37
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/recipe/meta.yamlAdded+69
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/recipe/meta.yaml.templateAdded+54
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/recipe/patches/0001-check-for-existence-of-type-before-setting.patchAdded+25
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/recipe/recipe_log.txtAdded+267
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/repodata_record.jsonAdded+22
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/run_exports.jsonAdded+1
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/info/test/run_test.shAdded+11
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/lib/libffi.aAdded
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/lib/libffi.soAdded
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/lib/libffi.so.6Added
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/lib/libffi.so.7Added
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/lib/libffi.so.7.1.0Added
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/lib/pkgconfig/libffi.pcAdded+11
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/share/info/libffi.infoAdded+1016
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/share/man/man3/ffi.3Added+41
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/share/man/man3/ffi_call.3Added+103
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/share/man/man3/ffi_prep_cif.3Added+68
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libffi-3.3-he6710b0_2/share/man/man3/ffi_prep_cif_var.3Added+73
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/about.jsonAdded+139
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/filesAdded+53
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/gitAdded
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/hash_input.jsonAdded+3
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/index.jsonAdded+12
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/paths.jsonAdded+323
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/conda_build_config.yamlAdded+101
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/install-libgcc.shAdded+57
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/meta.yamlAdded+22
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/build.shAdded+133
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/c11threads.cAdded+6
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/conda_build_config.cos6.i686.yamlAdded+11
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/conda_build_config.cos6.x86_64.yamlAdded+11
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/conda_build_config.cos7.ppc64le.yamlAdded+15
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/conda_build_config.cos9.x86_64.yamlAdded+11
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/conda_build_config.gcc5.yamlAdded+2
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/conda_build_config.gcc54.yamlAdded+2
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/config.oldAdded+530
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/hello-world.cppAdded+7
- docker/overlay2/5477bcafbdf820cef392849c85094c2cd573a682f23f2ec90412e611799281ce/diff/root/miniconda3/pkgs/libgcc-ng-9.1.0-hdf63c60_0/info/recipe/parent/install-binutils.shAdded+15
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515/* -----------------------------------------------------------------*-C-*- libffi 3.3 - Copyright (c) 2011, 2014, 2019 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 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.
----------------------------------------------------------------------- */
/* ------------------------------------------------------------------- Most of the API is documented in doc/libffi.texi.
The raw API is designed to bypass some of the argument packing and unpacking on architectures for which it can be avoided. Routines are provided to emulate the raw API if the underlying platform doesn't allow faster implementation.
More details on the raw API can be found in:
http://gcc.gnu.org/ml/java/1999-q3/msg00138.html
and
http://gcc.gnu.org/ml/java/1999-q3/msg00174.html -------------------------------------------------------------------- */
#ifndef LIBFFI_H#define LIBFFI_H
#ifdef __cplusplusextern "C" {#endif
/* Specify which architecture libffi is configured for. */#ifndef X86_64#define X86_64#endif
/* ---- System configuration information --------------------------------- */
#include <ffitarget.h>
#ifndef LIBFFI_ASM
#if defined(_MSC_VER) && !defined(__clang__)#define __attribute__(X)#endif
#include <stddef.h>#include <limits.h>
/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). But we can find it either under the correct ANSI name, or under GNU C's internal name. */
#define FFI_64_BIT_MAX 9223372036854775807
#ifdef LONG_LONG_MAX# define FFI_LONG_LONG_MAX LONG_LONG_MAX#else# ifdef LLONG_MAX# define FFI_LONG_LONG_MAX LLONG_MAX# ifdef _AIX52 /* or newer has C99 LLONG_MAX */# undef FFI_64_BIT_MAX# define FFI_64_BIT_MAX 9223372036854775807LL# endif /* _AIX52 or newer */# else# ifdef __GNUC__# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__# endif# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */# ifndef __PPC64__# if defined (__IBMC__) || defined (__IBMCPP__)# define FFI_LONG_LONG_MAX LONGLONG_MAX# endif# endif /* __PPC64__ */# undef FFI_64_BIT_MAX# define FFI_64_BIT_MAX 9223372036854775807LL# endif# endif#endif
/* The closure code assumes that this works on pointers, i.e. a size_t can hold a pointer. */
typedef struct _ffi_type{ size_t size; unsigned short alignment; unsigned short type; struct _ffi_type **elements;} ffi_type;
/* Need minimal decorations for DLLs to work on Windows. GCC has autoimport and autoexport. Always mark externally visible symbols as dllimport for MSVC clients, even if it means an extra indirection when using the static version of the library. Besides, as a workaround, they can define FFI_BUILDING if they *know* they are going to link with the static library. */#if defined _MSC_VER# if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */# define FFI_API __declspec(dllexport)# elif !defined FFI_BUILDING /* Importing libffi.DLL */# define FFI_API __declspec(dllimport)# else /* Building/linking static library */# define FFI_API# endif#else# define FFI_API#endif
/* The externally visible type declarations also need the MSVC DLL decorations, or they will not be exported from the object file. */#if defined LIBFFI_HIDE_BASIC_TYPES# define FFI_EXTERN FFI_API#else# define FFI_EXTERN extern FFI_API#endif
#ifndef LIBFFI_HIDE_BASIC_TYPES#if SCHAR_MAX == 127# define ffi_type_uchar ffi_type_uint8# define ffi_type_schar ffi_type_sint8#else #error "char size not supported"#endif
#if SHRT_MAX == 32767# define ffi_type_ushort ffi_type_uint16# define ffi_type_sshort ffi_type_sint16#elif SHRT_MAX == 2147483647# define ffi_type_ushort ffi_type_uint32# define ffi_type_sshort ffi_type_sint32#else #error "short size not supported"#endif
#if INT_MAX == 32767# define ffi_type_uint ffi_type_uint16# define ffi_type_sint ffi_type_sint16#elif INT_MAX == 2147483647# define ffi_type_uint ffi_type_uint32# define ffi_type_sint ffi_type_sint32#elif INT_MAX == 9223372036854775807# define ffi_type_uint ffi_type_uint64# define ffi_type_sint ffi_type_sint64#else #error "int size not supported"#endif
#if LONG_MAX == 2147483647# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX #error "no 64-bit data type supported"# endif#elif LONG_MAX != FFI_64_BIT_MAX #error "long size not supported"#endif
#if LONG_MAX == 2147483647# define ffi_type_ulong ffi_type_uint32# define ffi_type_slong ffi_type_sint32#elif LONG_MAX == FFI_64_BIT_MAX# define ffi_type_ulong ffi_type_uint64# define ffi_type_slong ffi_type_sint64#else #error "long size not supported"#endif
/* These are defined in types.c. */FFI_EXTERN ffi_type ffi_type_void;FFI_EXTERN ffi_type ffi_type_uint8;FFI_EXTERN ffi_type ffi_type_sint8;FFI_EXTERN ffi_type ffi_type_uint16;FFI_EXTERN ffi_type ffi_type_sint16;FFI_EXTERN ffi_type ffi_type_uint32;FFI_EXTERN ffi_type ffi_type_sint32;FFI_EXTERN ffi_type ffi_type_uint64;FFI_EXTERN ffi_type ffi_type_sint64;FFI_EXTERN ffi_type ffi_type_float;FFI_EXTERN ffi_type ffi_type_double;FFI_EXTERN ffi_type ffi_type_pointer;
#if 1FFI_EXTERN ffi_type ffi_type_longdouble;#else#define ffi_type_longdouble ffi_type_double#endif
#ifdef FFI_TARGET_HAS_COMPLEX_TYPEFFI_EXTERN ffi_type ffi_type_complex_float;FFI_EXTERN ffi_type ffi_type_complex_double;#if 1FFI_EXTERN ffi_type ffi_type_complex_longdouble;#else#define ffi_type_complex_longdouble ffi_type_complex_double#endif#endif#endif /* LIBFFI_HIDE_BASIC_TYPES */
typedef enum { FFI_OK = 0, FFI_BAD_TYPEDEF, FFI_BAD_ABI} ffi_status;
typedef struct { ffi_abi abi; unsigned nargs; ffi_type **arg_types; ffi_type *rtype; unsigned bytes; unsigned flags;#ifdef FFI_EXTRA_CIF_FIELDS FFI_EXTRA_CIF_FIELDS;#endif} ffi_cif;
/* ---- Definitions for the raw API -------------------------------------- */
#ifndef FFI_SIZEOF_ARG# if LONG_MAX == 2147483647# define FFI_SIZEOF_ARG 4# elif LONG_MAX == FFI_64_BIT_MAX# define FFI_SIZEOF_ARG 8# endif#endif
#ifndef FFI_SIZEOF_JAVA_RAW# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG#endif
typedef union { ffi_sarg sint; ffi_arg uint; float flt; char data[FFI_SIZEOF_ARG]; void* ptr;} ffi_raw;
#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8/* This is a special case for mips64/n32 ABI (and perhaps others) where sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */typedef union { signed int sint; unsigned int uint; float flt; char data[FFI_SIZEOF_JAVA_RAW]; void* ptr;} ffi_java_raw;#elsetypedef ffi_raw ffi_java_raw;#endif
FFI_API void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *avalue);
FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);FFI_API size_t ffi_raw_size (ffi_cif *cif);
/* This is analogous to the raw API, except it uses Java parameter packing, even on 64-bit machines. I.e. on 64-bit machines longs and doubles are followed by an empty 64-bit word. */
#if !FFI_NATIVE_RAW_APIFFI_APIvoid ffi_java_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_java_raw *avalue) __attribute__((deprecated));#endif
FFI_APIvoid ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated));FFI_APIvoid ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) __attribute__((deprecated));FFI_APIsize_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
/* ---- Definitions for closures ----------------------------------------- */
#if FFI_CLOSURES
#ifdef _MSC_VER__declspec(align(8))#endiftypedef struct {#if 0 void *trampoline_table; void *trampoline_table_entry;#else char tramp[FFI_TRAMPOLINE_SIZE];#endif ffi_cif *cif; void (*fun)(ffi_cif*,void*,void**,void*); void *user_data;} ffi_closure#ifdef __GNUC__ __attribute__((aligned (8)))#endif ;
#ifndef __GNUC__# ifdef __sgi# pragma pack 0# endif#endif
FFI_API void *ffi_closure_alloc (size_t size, void **code);FFI_API void ffi_closure_free (void *);
FFI_API ffi_statusffi_prep_closure (ffi_closure*, ffi_cif *, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data)#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405) __attribute__((deprecated ("use ffi_prep_closure_loc instead")))#elif defined(__GNUC__) && __GNUC__ >= 3 __attribute__((deprecated))#endif ;
FFI_API ffi_statusffi_prep_closure_loc (ffi_closure*, ffi_cif *, void (*fun)(ffi_cif*,void*,void**,void*), void *user_data, void*codeloc);
#ifdef __sgi# pragma pack 8#endiftypedef struct {#if 0 void *trampoline_table; void *trampoline_table_entry;#else char tramp[FFI_TRAMPOLINE_SIZE];#endif ffi_cif *cif;
#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*. */
void (*translate_args)(ffi_cif*,void*,void**,void*); void *this_closure;
#endif
void (*fun)(ffi_cif*,void*,ffi_raw*,void*); void *user_data;
} ffi_raw_closure;
typedef struct {#if 0 void *trampoline_table; void *trampoline_table_entry;#else char tramp[FFI_TRAMPOLINE_SIZE];#endif
ffi_cif *cif;
#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 translation, void** -> ffi_raw*. */
void (*translate_args)(ffi_cif*,void*,void**,void*); void *this_closure;
#endif
void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*); void *user_data;
} ffi_java_raw_closure;
FFI_API ffi_statusffi_prep_raw_closure (ffi_raw_closure*, ffi_cif *cif, void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data);
FFI_API ffi_statusffi_prep_raw_closure_loc (ffi_raw_closure*, ffi_cif *cif, void (*fun)(ffi_cif*,void*,ffi_raw*,void*), void *user_data, void *codeloc);
#if !FFI_NATIVE_RAW_APIFFI_API ffi_statusffi_prep_java_raw_closure (ffi_java_raw_closure*, ffi_cif *cif, void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), void *user_data) __attribute__((deprecated));
FFI_API ffi_statusffi_prep_java_raw_closure_loc (ffi_java_raw_closure*, ffi_cif *cif, void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), void *user_data, void *codeloc) __attribute__((deprecated));#endif
#endif /* FFI_CLOSURES */
#if FFI_GO_CLOSURES
typedef struct { void *tramp; ffi_cif *cif; void (*fun)(ffi_cif*,void*,void**,void*);} ffi_go_closure;
FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *, void (*fun)(ffi_cif*,void*,void**,void*));
FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue, void *closure);
#endif /* FFI_GO_CLOSURES */
/* ---- Public interface definition -------------------------------------- */
FFI_API ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes);
FFI_APIffi_status ffi_prep_cif_var(ffi_cif *cif, ffi_abi abi, unsigned int nfixedargs, unsigned int ntotalargs, ffi_type *rtype, ffi_type **atypes);
FFI_APIvoid ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue);
FFI_APIffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets);
/* Useful for eliminating compiler warnings. */#define FFI_FN(f) ((void (*)(void))f)
/* ---- Definitions shared with assembly code ---------------------------- */
#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 1#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
#endif123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147/* -----------------------------------------------------------------*-C-*- ffitarget.h - Copyright (c) 2012, 2014, 2018 Anthony Green Copyright (c) 1996-2003, 2010 Red Hat, Inc. Copyright (C) 2008 Free Software Foundation, Inc.
Target configuration macros for x86 and x86-64.
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 ----------------------------------- */
/* For code common to all platforms on x86 and x86_64. */#define X86_ANY
#if defined (X86_64) && defined (__i386__)#undef X86_64#define X86#endif
#ifdef X86_WIN64#define FFI_SIZEOF_ARG 8#define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */#endif
#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION#ifndef _MSC_VER#define FFI_TARGET_HAS_COMPLEX_TYPE#endif
/* ---- Generic type definitions ----------------------------------------- */
#ifndef LIBFFI_ASM#ifdef X86_WIN64#ifdef _MSC_VERtypedef unsigned __int64 ffi_arg;typedef __int64 ffi_sarg;#elsetypedef unsigned long long ffi_arg;typedef long long ffi_sarg;#endif#else#if defined __x86_64__ && defined __ILP32__#define FFI_SIZEOF_ARG 8#define FFI_SIZEOF_JAVA_RAW 4typedef unsigned long long ffi_arg;typedef long long ffi_sarg;#elsetypedef unsigned long ffi_arg;typedef signed long ffi_sarg;#endif#endif
typedef enum ffi_abi {#if defined(X86_WIN64) FFI_FIRST_ABI = 0, FFI_WIN64, /* sizeof(long double) == 8 - microsoft compilers */ FFI_GNUW64, /* sizeof(long double) == 16 - GNU compilers */ FFI_LAST_ABI,#ifdef __GNUC__ FFI_DEFAULT_ABI = FFI_GNUW64#else FFI_DEFAULT_ABI = FFI_WIN64#endif
#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN)) FFI_FIRST_ABI = 1, FFI_UNIX64, FFI_WIN64, FFI_EFI64 = FFI_WIN64, FFI_GNUW64, FFI_LAST_ABI, FFI_DEFAULT_ABI = FFI_UNIX64
#elif defined(X86_WIN32) FFI_FIRST_ABI = 0, FFI_SYSV = 1, FFI_STDCALL = 2, FFI_THISCALL = 3, FFI_FASTCALL = 4, FFI_MS_CDECL = 5, FFI_PASCAL = 6, FFI_REGISTER = 7, FFI_LAST_ABI, FFI_DEFAULT_ABI = FFI_MS_CDECL#else FFI_FIRST_ABI = 0, FFI_SYSV = 1, FFI_THISCALL = 3, FFI_FASTCALL = 4, FFI_STDCALL = 5, FFI_PASCAL = 6, FFI_REGISTER = 7, FFI_MS_CDECL = 8, FFI_LAST_ABI, FFI_DEFAULT_ABI = FFI_SYSV#endif} ffi_abi;#endif
/* ---- Definitions for closures ----------------------------------------- */
#define FFI_CLOSURES 1#define FFI_GO_CLOSURES 1
#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1)#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2)#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3)#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4)
#if defined (X86_64) || defined(X86_WIN64) \ || (defined (__x86_64__) && defined (X86_DARWIN))# define FFI_TRAMPOLINE_SIZE 24# define FFI_NATIVE_RAW_API 0#else# define FFI_TRAMPOLINE_SIZE 12# define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */#endif
#endif
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115{ "channels": [ "defaults" ], "conda_build_version": "3.18.11", "conda_private": false, "conda_version": "4.8.3", "description": "The libffi library provides a portable, high level programming interface\nto various calling conventions. This allows a programmer to call any\nfunction specified by a call interface description at run-time.\n", "dev_url": "https://github.com/libffi/libffi", "doc_url": "https://sourceware.org/libffi/", "env_vars": { "CIO_TEST": "<not set>" }, "extra": { "copy_test_source_files": true, "final": true, "recipe-maintainers": [ "stefan-balke", "scopatz" ] }, "home": "https://sourceware.org/libffi/", "identifiers": [], "keywords": [], "license": "Custom", "root_pkgs": [ "_libgcc_mutex 0.1 main", "anaconda-client 1.7.2 py37_0", "binutils_impl_linux-64 2.31.1 h6176602_1", "binutils_linux-64 2.31.1 h6176602_8", "bzip2 1.0.8 h7b6447c_0", "chardet 3.0.4 py37_1003", "clyent 1.2.2 py37_1", "curl 7.65.3 hbc83047_0", "filelock 3.0.12 py_0", "gcc_impl_linux-64 7.3.0 habb00fd_1", "gcc_linux-64 7.3.0 h553295d_8", "git 2.20.1 pl526hacde149_0", "glob2 0.7 py_0", "gxx_impl_linux-64 7.3.0 hdf63c60_1", "gxx_linux-64 7.3.0 h553295d_8", "ipython_genutils 0.2.0 py37_0", "libcurl 7.65.3 h20c2e04_0", "libgcc-ng 9.1.0 hdf63c60_0", "libstdcxx-ng 9.1.0 hdf63c60_0", "markupsafe 1.1.1 py37h7b6447c_0", "perl 5.26.2 h14c3975_0", "pip 19.2.2 py37_0", "pkginfo 1.5.0.1 py37_0", "zlib 1.2.11 h7b6447c_3", "ca-certificates 2020.6.24 0", "ld_impl_linux-64 2.33.1 h53a641e_7", "ripgrep 11.0.2 he32d670_0", "expat 2.2.9 he6710b0_2", "icu 58.2 he6710b0_3", "libffi 3.3 he6710b0_1", "liblief 0.10.1 he6710b0_0", "lz4-c 1.9.2 he6710b0_0", "ncurses 6.2 he6710b0_1", "openssl 1.1.1g h7b6447c_0", "patchelf 0.11 he6710b0_0", "xz 5.2.5 h7b6447c_0", "yaml 0.2.5 h7b6447c_0", "libedit 3.1.20191231 h7b6447c_0", "libssh2 1.9.0 h1ba5d50_1", "libxml2 2.9.10 he19cac6_1", "readline 8.0 h7b6447c_0", "tk 8.6.10 hbc83047_0", "zstd 1.4.4 h0b5b093_3", "krb5 1.16.4 h173b8e3_0", "libarchive 3.4.2 h62408e4_0", "sqlite 3.32.3 h62c20be_0", "python 3.7.7 hcff3b4d_5", "attrs 19.3.0 py_0", "certifi 2020.6.20 py37_0", "decorator 4.4.2 py_0", "idna 2.10 py_0", "psutil 5.7.0 py37h7b6447c_0", "py-lief 0.10.1 py37h403a769_0", "pycosat 0.6.3 py37h7b6447c_0", "pycparser 2.20 py_0", "pysocks 1.7.1 py37_0", "python-libarchive-c 2.9 py_0", "pytz 2020.1 py_0", "pyyaml 5.3.1 py37h7b6447c_1", "ruamel_yaml 0.15.87 py37h7b6447c_1", "six 1.15.0 py_0", "soupsieve 2.0.1 py_0", "tqdm 4.47.0 py_0", "zipp 3.1.0 py_0", "beautifulsoup4 4.9.1 py37_0", "cffi 1.14.0 py37he30daa8_1", "conda-package-handling 1.6.1 py37h7b6447c_0", "importlib-metadata 1.7.0 py37_0", "pyrsistent 0.16.0 py37h7b6447c_0", "python-dateutil 2.8.1 py_0", "setuptools 47.3.1 py37_0", "traitlets 4.3.3 py37_0", "brotlipy 0.7.0 py37h7b6447c_1000", "cryptography 2.9.2 py37h1ba5d50_0", "importlib_metadata 1.7.0 0", "jinja2 2.11.2 py_0", "jupyter_core 4.6.3 py37_0", "wheel 0.34.2 py37_0", "jsonschema 3.2.0 py37_0", "pyopenssl 19.1.0 py37_0", "nbformat 5.0.7 py_0", "urllib3 1.25.9 py_0", "requests 2.24.0 py_0", "conda 4.8.3 py37_0", "conda-build 3.18.11 py37_0" ], "summary": "A Portable Foreign Function Interface Library.", "tags": []}12345678910111213include/ffi.hinclude/ffitarget.hlib/libffi.alib/libffi.solib/libffi.so.6lib/libffi.so.7lib/libffi.so.7.1.0lib/pkgconfig/libffi.pcshare/info/libffi.infoshare/man/man3/ffi.3share/man/man3/ffi_call.3share/man/man3/ffi_prep_cif.3share/man/man3/ffi_prep_cif_var.31/opt/anaconda1anaconda2anaconda3 text lib/pkgconfig/libffi.pc123456{ "cxx_compiler": "gxx", "cxx_compiler_version": "7.3.0", "c_compiler_version": "7.3.0", "c_compiler": "gcc"}123456789101112131415{ "arch": "x86_64", "build": "he6710b0_2", "build_number": 2, "depends": [ "libgcc-ng >=7.3.0", "libstdcxx-ng >=7.3.0" ], "license": "Custom", "name": "libffi", "platform": "linux", "subdir": "linux-64", "timestamp": 1594054267890, "version": "3.3"}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485{ "paths": [ { "_path": "include/ffi.h", "path_type": "hardlink", "sha256": "6ac535a9dfeb6a80bc1ecc1eff71626ddd8a15131e3265298536e2966170179b", "size_in_bytes": 13934 }, { "_path": "include/ffitarget.h", "path_type": "hardlink", "sha256": "ce9a87677a9b9af9dcc6f8f632b62948214824174b65fe4361d3b662cc72aec0", "size_in_bytes": 4343 }, { "_path": "lib/libffi.a", "path_type": "hardlink", "sha256": "9a9860830bb52c790eef8dbbd97f778ed3442ffeb09b1c2372f42e88860bb65b", "size_in_bytes": 67214 }, { "_path": "lib/libffi.so", "path_type": "softlink", "sha256": "c0ea74fe025d75cf3aa003379b697a4576d8a2eca7939135d5c35dfafe6872cb", "size_in_bytes": 50664 }, { "_path": "lib/libffi.so.6", "path_type": "softlink", "sha256": "c0ea74fe025d75cf3aa003379b697a4576d8a2eca7939135d5c35dfafe6872cb", "size_in_bytes": 50664 }, { "_path": "lib/libffi.so.7", "path_type": "softlink", "sha256": "c0ea74fe025d75cf3aa003379b697a4576d8a2eca7939135d5c35dfafe6872cb", "size_in_bytes": 50664 }, { "_path": "lib/libffi.so.7.1.0", "path_type": "hardlink", "sha256": "c0ea74fe025d75cf3aa003379b697a4576d8a2eca7939135d5c35dfafe6872cb", "size_in_bytes": 50664 }, { "_path": "lib/pkgconfig/libffi.pc", "file_mode": "text", "path_type": "hardlink", "prefix_placeholder": "/opt/anaconda1anaconda2anaconda3", "sha256": "189c5407784da1867aa504aa5dde3d737e88edc1102e12b84c91e36e3f4f391f", "size_in_bytes": 308 }, { "_path": "share/info/libffi.info", "path_type": "hardlink", "sha256": "89073c08c3d24d4a28775340aeaef49360504271a173b974b5f9f5203358727b", "size_in_bytes": 36885 }, { "_path": "share/man/man3/ffi.3", "path_type": "hardlink", "sha256": "aa4730e114c305943a2226a524ed8447dc6b66a184523999868e5433c2c9de74", "size_in_bytes": 850 }, { "_path": "share/man/man3/ffi_call.3", "path_type": "hardlink", "sha256": "2817ce7b78cb737d7b85b18b45899470f5f565f990d056d3d8cfabf6d779477f", "size_in_bytes": 2333 }, { "_path": "share/man/man3/ffi_prep_cif.3", "path_type": "hardlink", "sha256": "f60c5bb9d04b55988da13511a2c3edfa0f39fb6f51abfb8ac24d0b161c4169c0", "size_in_bytes": 1158 }, { "_path": "share/man/man3/ffi_prep_cif_var.3", "path_type": "hardlink", "sha256": "9365685252f33f13627c9303bc01883b764227132069260c19e94100ff442a51", "size_in_bytes": 1321 } ], "paths_version": 1}1234567891011121314151617181920212223242526272829303132333435363738394041424344#!/usr/bin/env bash
shopt -s extglob
export CFLAGS="${CFLAGS//-fvisibility=+([! ])/}"export CXXFLAGS="${CXXFLAGS//-fvisibility=+([! ])/}"
if [[ $(uname) == "Linux" ]]; then # this changes the install dir from ${PREFIX}/lib64 to ${PREFIX}/lib sed -i 's:@toolexeclibdir@:$(libdir):g' Makefile.in */Makefile.in sed -i 's:@toolexeclibdir@:${libdir}:g' libffi.pc.infi
./configure --build=${BUILD} --host=${HOST} \ --disable-debug --disable-dependency-tracking \ --prefix="${PREFIX}" --includedir="${PREFIX}/include" \ || { cat config.log; exit 1;}
make -j${CPU_COUNT} ${VERBOSE_AT}
if [[ -n "${QEMU_LD_PREFIX}" ]] && [[ "${HOST}" != "${BUILD}" ]]; then # Yuck. Dejagnu should instead pass '-Wl,-rpath=\$ORIGIN/../.libs' when building # tests or at least provide a way for us to pass that. In non-cross scenarios it # sets LD_LIBRARY_PATH (see set_ld_library_path_env_vars), and has no provisions # for QEMU at all. QEMU_SET_ENV="LD_LIBRARY_PATH=${SRC_DIR}/${HOST}/.libs" make checkelse make checkfi
make install
# This overlaps with libgcc-ng:rm -rf ${PREFIX}/share/info/dir
# libffi 3.3 is ABI compatible with libffi 3.2.x but changed SONAMEs (.6->.7).# For compatibility with packages which do not have corrected dependency# information, include a libffi.so.6/libffi.6.dylib symlink.if [[ $(uname) == "Linux" ]]; then ln -s ${PREFIX}/lib/libffi.so.7 ${PREFIX}/lib/libffi.so.6else ln -s ${PREFIX}/lib/libffi.7.dylib ${PREFIX}/lib/libffi.6.dylibfi
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103MACOSX_DEPLOYMENT_TARGET: '10.9'VERBOSE_AT: V=1VERBOSE_CM: VERBOSE=1apr: 1.6.3blas_impl: openblasboost: '1.67'boost_cpp: '1.67'bzip2: '1.0'c_compiler: gccc_compiler_version: 7.3.0cairo: '1.14'channel_targets: defaultsclang_variant: clangcpu_optimization_target: noconacran_mirror: https://mran.microsoft.com/snapshot/2018-01-01cxx_compiler: gxxcxx_compiler_version: 7.3.0cyrus_sasl: 2.1.26dbus: '1'expat: '2.2'extend_keys:- ignore_build_only_deps- ignore_version- pin_run_as_build- extend_keysfontconfig: '2.13'fortran_compiler: gfortranfortran_compiler_version: 7.3.0freetype: '2.10'g2clib: '1.6'geos: 3.8.0giflib: '5.1'glib: '2'gmp: '6.1'gnu: 2.12.2gst_plugins_base: '1.14'gstreamer: '1.14'harfbuzz: '2.4'hdf4: '4.2'hdf5: 1.10.6hdfeos2: '2.20'hdfeos5: '5.1'icu: '58'ignore_build_only_deps:- numpy- pythonjpeg: '9'libdap4: '3.19'libffi: '3.3'libgd: 2.2.5libgdal: '3.0'libgsasl: '1.8'libkml: '1.3'libnetcdf: '4.6'libpng: '1.6'libprotobuf: 3.11.2libtiff: '4.1'libwebp: 1.0.0libxml2: '2.9'libxslt: '1.1'llvm_variant: llvmlua: '5'lzo: '2'macos_machine: x86_64-apple-darwin13.4.0macos_min_version: '10.9'mkl: '2019'mpfr: '4'noarch_python: pythonnodejs: '8.12'numpy: '1.14'numpy_sha: 34e96e9dae65c4839bd80012023aadd6ee2ccb73ce7fdf3074c62f301e63120bnumpy_version: 1.18.5openblas: 0.3.3openjpeg: '2.3'openssl: 1.1.1perl: '5.26'pin_run_as_build: python: max_pin: x.x min_pin: x.x r-base: max_pin: x.x min_pin: x.x libboost: max_pin: x.x.xpixman: '0.34'proj: 6.2.1proj4: 5.2.0python: '3.8'python_implementation: cpythonqtwebkit: 'true'r_base: '3.5'r_implementation: mro-baser_version: 3.5.0readline: '8.0'rust_compiler: rustrust_compiler_version: 1.40.0serf: 1.3.9sqlite: '3'target_platform: linux-64tk: '8.6'xz: '5'zlib: '1.2'12345678910111213141516171819202122232425262728293031323334353637diff --git a/include/Makefile.am b/include/Makefile.amindex fd28024..15301d6 100644--- a/include/Makefile.am+++ b/include/Makefile.am@@ -5,5 +5,5 @@ AUTOMAKE_OPTIONS=foreign DISTCLEANFILES=ffitarget.h EXTRA_DIST=ffi.h.in ffi_common.h -includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include+includesdir = $(includedir) nodist_includes_HEADERS = ffi.h ffitarget.hdiff --git a/include/Makefile.in b/include/Makefile.inindex 9d747e8..f8f4af0 100644--- a/include/Makefile.in+++ b/include/Makefile.in@@ -314,7 +314,7 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign DISTCLEANFILES = ffitarget.h EXTRA_DIST = ffi.h.in ffi_common.h-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include+includesdir = $(includedir) nodist_includes_HEADERS = ffi.h ffitarget.h all: all-am diff --git a/libffi.pc.in b/libffi.pc.inindex edf6fde..0b58ac2 100644--- a/libffi.pc.in+++ b/libffi.pc.in@@ -2,7 +2,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ toolexeclibdir=@toolexeclibdir@-includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include+includedir=@exec_prefix@/include Name: @PACKAGE_NAME@ Description: Library supporting Foreign Function Interfaces123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869# This file created by conda-build 3.18.11# meta.yaml template originally from:# /tmp/build/80754af9/rsync-recipes/libffi-3.3-on-linux_64, last modified Mon Jul 6 16:38:18 2020# ------------------------------------------------
package: name: libffi version: '3.3'source: fn: libffi-3.3.tar.gz patches: - patches/0001-check-for-existence-of-type-before-setting.patch sha1: 8df6cb570c8d6596a67d1c0773bf00650154f7aa url: ftp://sourceware.org/pub/libffi/libffi-3.3.tar.gzbuild: number: '2' run_exports: - libffi >=3.3,<3.4.0a0 string: he6710b0_2requirements: build: - _libgcc_mutex 0.1 main - autoconf 2.69 pl526hebd4dad_5 - automake 1.16.2 pl526_0 - binutils_impl_linux-64 2.33.1 he6710b0_7 - binutils_linux-64 2.33.1 h9595d00_15 - gcc_impl_linux-64 7.3.0 habb00fd_1 - gcc_linux-64 7.3.0 h553295d_15 - gxx_impl_linux-64 7.3.0 hdf63c60_1 - gxx_linux-64 7.3.0 h553295d_15 - ld_impl_linux-64 2.33.1 h53a641e_7 - libgcc-ng 9.1.0 hdf63c60_0 - libstdcxx-ng 9.1.0 hdf63c60_0 - libtool 2.4.6 h7b6447c_5 - m4 1.4.18 h4e445db_0 - make 4.2.1 h1bed415_1 - perl 5.26.2 h14c3975_0 host: - _libgcc_mutex 0.1 main - libgcc-ng 9.1.0 hdf63c60_0 - libstdcxx-ng 9.1.0 hdf63c60_0 run: - libgcc-ng >=7.3.0 - libstdcxx-ng >=7.3.0test: commands: - test -e $PREFIX/lib/libffi.so - test -e $PREFIX/lib/libffi.a - test -e $PREFIX/include/ffi.h - test -e $PREFIX/include/ffitarget.habout: description: '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.
' dev_url: https://github.com/libffi/libffi doc_url: https://sourceware.org/libffi/ home: https://sourceware.org/libffi/ license: Custom summary: A Portable Foreign Function Interface Library.extra: copy_test_source_files: true final: true recipe-maintainers: - scopatz - stefan-balke123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354{% set name = "libffi" %}{% set version = "3.3" %}
package: name: {{ name|lower }} version: {{ version }}
source: fn: {{ name }}-{{ version }}.tar.gz url: ftp://sourceware.org/pub/{{ name }}/{{ name }}-{{ version }}.tar.gz sha1: 8df6cb570c8d6596a67d1c0773bf00650154f7aa patches: - patches/0001-check-for-existence-of-type-before-setting.patch
build: number: 2 skip: True # [win] run_exports: # good history: https://abi-laboratory.pro/tracker/timeline/libffi/ - {{ pin_subpackage('libffi', max_pin='x.x') }}
requirements: build: - autoconf - automake - libtool - make - {{ compiler('c') }} - {{ compiler('cxx') }}
test: commands: - test -e $PREFIX/lib/libffi.so # [linux] - test -e $PREFIX/lib/libffi.a # [unix] - test -e $PREFIX/lib/libffi.dylib # [osx] - test -e $PREFIX/include/ffi.h - test -e $PREFIX/include/ffitarget.h
about: home: https://sourceware.org/libffi/ license: Custom summary: A Portable Foreign Function Interface Library. description: | 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. doc_url: https://sourceware.org/libffi/ dev_url: https://github.com/libffi/libffi
extra: recipe-maintainers: - stefan-balke - scopatz12345678910111213141516171819202122232425From 61a47c0a9e19f6fafd4d1d5b6c2fa7bdf949d1e1 Mon Sep 17 00:00:00 2001From: Angela Gloyna <angela.gloyna@gmail.com>Date: Wed, 22 Apr 2020 13:16:21 -0500Subject: [PATCH] check for existence of type before setting
--- 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.hindex 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;-- 2.20.1 (Apple Git-117)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267commit 26aaf02612894e42bba1c5fcd37259ddf3293120Author: Angela Gloyna <angela.gloyna@gmail.com>Date: Wed Apr 22 16:50:50 2020 -0500
updated build number to 1 and set max pin to x.x
commit 0e9ea530681b36ea08a45eda4c28c4b9065f2144Author: Angela Gloyna <angela.gloyna@gmail.com>Date: Wed Apr 22 14:19:35 2020 -0500
updated libffi to 3.3 and accounted for missing float128 in powerpc
commit 5be971b24ab93d1db78b77cc6bf3c31a2bdf170bAuthor: Kai Tietz <ktietz@anaconda.com>Date: Fri Feb 14 15:27:20 2020 +0100
Update to version 3.3
commit b2b2d3b8934dc12d08c401364273396bc6e95d72Author: Nehal J Wani <nehaljw.kkd1@gmail.com>Date: Wed Feb 7 15:27:00 2018 -0500
Remove share/info/dir
commit 132529b8873a4dcee15154eacd33bb2700551f37Author: Michael Sarahan <msarahan@gmail.com>Date: Wed Nov 8 15:38:41 2017 -0600
add run_exports
commit 5e036fa9d1e5fd880120b77c6ad443bc116eaa0cMerge: 2928cf8 ba27335Author: Ray Donnelly <mingw.android@gmail.com>Date: Thu Aug 31 01:32:57 2017 +0100
Merge pull request #1 from Maggie-M/patch-1 Update meta.yaml
commit ba27335ee7d530123c6149c69838b93ffe5eaa44Author: Maggie-M <maggie.mari@continuum.io>Date: Wed Aug 30 16:18:35 2017 -0500
Update meta.yaml
commit 2928cf8b5e368f3b4e9a9b5f20a5281d0a1904adAuthor: Ray Donnelly <mingw.android@gmail.com>Date: Sun Aug 27 17:27:36 2017 +0100
Generalize logging
commit 4ad10020643bad538a02a828152c2edf493193c4Author: Ray Donnelly <mingw.android@gmail.com>Date: Sun Apr 2 14:47:34 2017 +0100
Add support cross-compilation Testing is done via QEMU via Dejagnu and requires some special handling.
commit dcf68f71f1f776924a445f3857f7f08fcf587f3aAuthor: Ray Donnelly <mingw.android@gmail.com>Date: Sun Apr 2 14:46:28 2017 +0100
Strip -fvisibility flags
commit 8d44878425275cdcd38a7ead7ad7cc6157b2f6a8Merge: 1bcc771 a3e81b3Author: Anthony Scopatz <scopatz@gmail.com>Date: Thu Jan 5 11:10:11 2017 -0800
Merge pull request #10 from shadowwalkersb/fix-includes Fix includes
commit a3e81b32576f8e5cdec37fe39805602ff9e30a85Author: shadow_walker <shadowwalkersb@gmail.com>Date: Thu Jan 5 10:30:23 2017 -0600
fix selector for testing static lib
commit 6072e33dd3be64138545b0d28d08a2a67a0eb74aAuthor: shadow_walker <shadowwalkersb@gmail.com>Date: Thu Jan 5 09:00:57 2017 -0600
bump build #: 3
commit 29937c8a99f74426ae52c90ef11a477d3ad9da27Author: shadow_walker <shadowwalkersb@gmail.com>Date: Thu Jan 5 01:41:03 2017 -0600
patch pkgconfig includedir
commit 4fb3e1fea6d25146e66458fccb8738fdc0efc9c2Author: shadow_walker <shadowwalkersb@gmail.com>Date: Thu Jan 5 00:19:39 2017 -0600
patch to fix configure option includedir
commit 249f76f6ddb5825517558f84967a995f4e007e06Author: shadow_walker <shadowwalkersb@gmail.com>Date: Wed Dec 28 17:40:30 2016 -0600
specify include dir
commit f74f90f8dce16f3a07bd0dae4779d0e2f4e062fdAuthor: shadow_walker <shadowwalkersb@gmail.com>Date: Thu Jan 5 00:22:16 2017 -0600
Revert "move include directory manually into place" This reverts commit 8ff659fe306f5bc9c8a98ed5c66caeb4d4771ed1.
commit 8ff659fe306f5bc9c8a98ed5c66caeb4d4771ed1Author: shadow_walker <shadowwalkersb@gmail.com>Date: Wed Dec 28 17:52:06 2016 -0600
move include directory manually into place
commit 79fa9336d6110b767ec4013513a67964aaa0e26bAuthor: shadow_walker <shadowwalkersb@gmail.com>Date: Wed Dec 28 17:50:10 2016 -0600
Revert "specify include dir" This reverts commit 83dca57b6b82a28ede4b0d6ce51b3a9b679d1594.
commit 4f8b721afa390973ac99242f33cfd740bfad772bAuthor: shadow_walker <shadowwalkersb@gmail.com>Date: Wed Dec 28 17:43:51 2016 -0600
add variable for name in recipe
commit 83dca57b6b82a28ede4b0d6ce51b3a9b679d1594Author: shadow_walker <shadowwalkersb@gmail.com>Date: Wed Dec 28 17:40:30 2016 -0600
specify include dir
commit 8db771bfbf7468130cfa86517536ab3b5520b074Author: shadow_walker <shadowwalkersb@gmail.com>Date: Wed Dec 28 17:34:31 2016 -0600
test for include files
commit 1bcc771855bb5aae49391f06c42d23b1ed1d3519Merge: 82b6f91 525b36aAuthor: jakirkham <jakirkham@gmail.com>Date: Sun Dec 4 17:46:37 2016 -0500
Merge pull request #9 from conda-forge-admin/feedstock_rerender_master MNT: Re-render the feedstock [ci skip]
commit 525b36a3aaccd82b1b461bf257f76b7c304867a4Author: conda-forge-admin <pelson.pub+conda-forge@gmail.com>Date: Fri Dec 2 01:34:51 2016 +0000
MNT: Updated the feedstock for conda-smithy version 1.6.1.
commit 82b6f915abc457fc5df47685f563c9700b03bf07Merge: 848a473 9e2b12aAuthor: Stefan Balke <stefan.balke@audiolabs-erlangen.de>Date: Thu Oct 13 12:41:27 2016 +0200
Merge pull request #8 from conda-forge-admin/feedstock_rerender_master MNT: Re-render the feedstock [ci skip]
commit 9e2b12a07e613183581290b462a79c8b80f272c9Author: conda-forge-admin <pelson.pub+conda-forge@gmail.com>Date: Thu Oct 13 01:37:38 2016 +0000
MNT: Updated the feedstock for conda-smithy version 1.3.2.
commit 848a4730ad473a79f8d71e48dd9ffd033018460eMerge: c28b2fb cad2603Author: Anthony Scopatz <scopatz@gmail.com>Date: Sun Jun 5 08:14:00 2016 -0700
Merge pull request #6 from conda-forge-admin/feedstock_rerender_master MNT: Re-render the feedstock
commit cad260395670b2cd184e91af51a9c50bd00d9213Author: conda-forge-admin <pelson.pub+conda-forge@gmail.com>Date: Mon May 16 05:42:58 2016 +0000
MNT: Updated the feedstock for conda-smithy version 0.10.3. [ci skip]
commit c28b2fb036bcf25f0edea70799bbfc38370f7a3fMerge: 56bca6c 80846fdAuthor: stefan-balke <stefan.balke@audiolabs-erlangen.de>Date: Tue May 10 19:47:31 2016 +0200
Merge pull request #4 from scopatz/master more lib64 fixes
commit 80846fdc33a7501530dd1c0918242f64d7b3bf26Author: Anthony Scopatz <scopatz@gmail.com>Date: Tue May 10 12:47:04 2016 -0400
more lib64 fixes
commit 56bca6cba710e067d649d405d9b3e61f37ff4e1cMerge: d2f10ff 465b078Author: stefan-balke <stefan.balke@audiolabs-erlangen.de>Date: Tue May 10 08:15:48 2016 +0200
Merge pull request #3 from scopatz/master try to remove lib64
commit 465b078545879ec571d9d60e7129fcedf1777f75Author: Anthony Scopatz <scopatz@gmail.com>Date: Mon May 9 23:06:52 2016 -0400
change install loc
commit 65b25d29ae00eb1a5f4d7e15d7f3bd3a8407683fAuthor: Anthony Scopatz <scopatz@gmail.com>Date: Mon May 9 23:01:44 2016 -0400
insert
commit 91c7cef7ea3b2e106d6499b53c0d1de2d7fb49d3Author: Anthony Scopatz <scopatz@gmail.com>Date: Mon May 9 22:51:08 2016 -0400
added backslash
commit 0715f9c59c2d3e2cb280c1f15899bb44f40c5e65Author: Anthony Scopatz <scopatz@gmail.com>Date: Mon May 9 22:43:58 2016 -0400
try to remove lib64
commit d2f10fffa493a6ba1803a9e40a99ccf69021cf08Merge: 179f22e 4ba1ccdAuthor: Filipe <ocefpaf@gmail.com>Date: Tue Apr 12 12:29:57 2016 -0300
Merge pull request #2 from conda-forge-admin/feedstock_rerender_master MNT: Re-render the feedstock
commit 4ba1ccddbb65ce23fc01f36bad77c9e68847a769Author: conda-forge-admin <pelson.pub+conda-forge@gmail.com>Date: Sat Apr 2 12:43:16 2016 +0100
MNT: Updated the feedstock for conda-smithy version 0.8.0. [ci skip]
commit 179f22ee58850c1f2716bd80eb614f282a5356d7Author: Travis-CI on github.com/conda-forge/staged-recipes <conda-forge@googlegroups.com>Date: Thu Mar 31 13:49:43 2016 +0000
Re-render the feedstock after CI registration.
commit 07083ba21d32f8d188eea23d6a1c84efcf77b44aAuthor: Travis-CI on github.com/conda-forge/staged-recipes <conda-forge@googlegroups.com>Date: Thu Mar 31 13:48:45 2016 +0000
Initial commit of the libffi feedstock.12345678910111213141516171819202122{ "arch": "x86_64", "build": "he6710b0_2", "build_number": 2, "channel": "https://repo.anaconda.com/pkgs/main/linux-64", "constrains": [], "depends": [ "libgcc-ng >=7.3.0", "libstdcxx-ng >=7.3.0" ], "fn": "libffi-3.3-he6710b0_2.conda", "license": "Custom", "md5": "88a54b8f50e351c650e16f4ee781440c", "name": "libffi", "platform": "linux", "sha256": "2cef7c80db19e83a38b6e02110f0e9828d3ef4045c38791d5b01006c44529093", "size": 51543, "subdir": "linux-64", "timestamp": 1594054267000, "url": "https://repo.anaconda.com/pkgs/main/linux-64/libffi-3.3-he6710b0_2.conda", "version": "3.3"}1{"weak": ["libffi >=3.3,<3.4.0a0"]}1234567891011
set -ex
test -e $PREFIX/lib/libffi.sotest -e $PREFIX/lib/libffi.atest -e $PREFIX/include/ffi.htest -e $PREFIX/include/ffitarget.hexit 01234567891011prefix=/opt/anaconda1anaconda2anaconda3exec_prefix=${prefix}libdir=${exec_prefix}/libtoolexeclibdir=${libdir}includedir=/opt/anaconda1anaconda2anaconda3/include
Name: libffiDescription: Library supporting Foreign Function InterfacesVersion: 3.3Libs: -L${toolexeclibdir} -lffiCflags: -I${includedir}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016This is libffi.info, produced by makeinfo version 6.6 from libffi.texi.
This manual is for libffi, a portable foreign function interfacelibrary.
Copyright (C) 2008-2019 Anthony Green and Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:
The above copyright notice and this permission notice shall beincluded 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 OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
INFO-DIR-SECTION DevelopmentSTART-INFO-DIR-ENTRY* libffi: (libffi). Portable foreign function interface library.END-INFO-DIR-ENTRY
File: libffi.info, Node: Top, Next: Introduction, Up: (dir)
libffi******
This manual is for libffi, a portable foreign function interfacelibrary.
Copyright (C) 2008-2019 Anthony Green and Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:
The above copyright notice and this permission notice shall beincluded 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 OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Menu:
* Introduction:: What is libffi?* Using libffi:: How to use libffi.* Missing Features:: Things libffi can't do.* Index:: Index.
File: libffi.info, Node: Introduction, Next: Using libffi, Prev: Top, Up: Top
1 What is libffi?*****************
Compilers for high level languages generate code that follow certainconventions. These conventions are necessary, in part, for separatecompilation to work. One such convention is the "calling convention".The calling convention is a set of assumptions made by the compilerabout where function arguments will be found on entry to a function. Acalling convention also specifies where the return value for a functionis found. The calling convention is also sometimes called the "ABI" or"Application Binary Interface".
Some programs may not know at the time of compilation what argumentsare to be passed to a function. For instance, an interpreter may betold at run-time about the number and types of arguments used to call agiven function. 'Libffi' can be used in such programs to provide abridge from the interpreter program to compiled code.
The 'libffi' library provides a portable, high level programminginterface to various calling conventions. This allows a programmer tocall any function specified by a call interface description at run time.
FFI stands for Foreign Function Interface. A foreign functioninterface is the popular name for the interface that allows code writtenin one language to call code written in another language. The 'libffi'library really only provides the lowest, machine dependent layer of afully featured foreign function interface. A layer must exist above'libffi' that handles type conversions for values passed between the twolanguages.
File: libffi.info, Node: Using libffi, Next: Missing Features, Prev: Introduction, Up: Top
2 Using libffi**************
* Menu:
* The Basics:: The basic libffi API.* Simple Example:: A simple example.* Types:: libffi type descriptions.* Multiple ABIs:: Different passing styles on one platform.* The Closure API:: Writing a generic function.* Closure Example:: A closure example.* Thread Safety:: Thread safety.
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 tocall and that you know the number and types of arguments to pass it, aswell as the return type of the function.
The first thing you must do is create an 'ffi_cif' object thatmatches the signature of the function you wish to call. This is aseparate step because it is common to make multiple calls using a single'ffi_cif'. The "cif" in 'ffi_cif' stands for Call InterFace. Toprepare a call interface object, use the function 'ffi_prep_cif'.
-- Function: ffi_status ffi_prep_cif (ffi_cif *CIF, ffi_abi ABI, unsigned int NARGS, ffi_type *RTYPE, ffi_type **ARGTYPES) This initializes CIF according to the given parameters.
ABI is the ABI to use; normally 'FFI_DEFAULT_ABI' is what you want. *note Multiple ABIs:: for more information.
NARGS is the number of arguments that this function accepts.
RTYPE is a pointer to an 'ffi_type' structure that describes the return type of the function. *Note Types::.
ARGTYPES is a vector of 'ffi_type' pointers. ARGTYPES must have NARGS elements. If NARGS is 0, this argument is ignored.
'ffi_prep_cif' returns a 'libffi' status code, of type 'ffi_status'. This will be either 'FFI_OK' if everything worked properly; 'FFI_BAD_TYPEDEF' if one of the 'ffi_type' objects is incorrect; or 'FFI_BAD_ABI' if the ABI parameter is invalid.
If the function being called is variadic (varargs) then'ffi_prep_cif_var' must be used instead of 'ffi_prep_cif'.
-- Function: ffi_status ffi_prep_cif_var (ffi_cif *CIF, ffi_abi ABI, unsigned int NFIXEDARGS, unsigned int NTOTALARGS, ffi_type *RTYPE, ffi_type **ARGTYPES) This initializes CIF according to the given parameters for a call to a variadic function. In general its operation is the same as for 'ffi_prep_cif' except that:
NFIXEDARGS is the number of fixed arguments, prior to any variadic arguments. It must be greater than zero.
NTOTALARGS the total number of arguments, including variadic and fixed arguments. ARGTYPES must have this many elements.
Note that, different cif's must be prepped for calls to the same function when different numbers of arguments are passed.
Also note that a call to 'ffi_prep_cif_var' with NFIXEDARGS=NOTOTALARGS is NOT equivalent to a call to 'ffi_prep_cif'.
Note that the resulting 'ffi_cif' holds pointers to all the'ffi_type' objects that were used during initialization. You mustensure that these type objects have a lifetime at least as long as thatof the 'ffi_cif'.
To call a function using an initialized 'ffi_cif', use the 'ffi_call'function:
-- Function: void ffi_call (ffi_cif *CIF, void *FN, void *RVALUE, void **AVALUES) This calls the function FN according to the description given in CIF. CIF must have already been prepared using 'ffi_prep_cif'.
RVALUE is a pointer to a chunk of memory that will hold the result of the function call. This must be large enough to hold the result, no smaller than the system register size (generally 32 or 64 bits), and must be suitably aligned; it is the caller's responsibility to ensure this. If CIF declares that the function returns 'void' (using 'ffi_type_void'), then RVALUE is ignored.
In most situations, 'libffi' will handle promotion according to the ABI. However, for historical reasons, there is a special case with return values that must be handled by your code. In particular, for integral (not 'struct') types that are narrower than the system register size, the return value will be widened by 'libffi'. 'libffi' provides a type, 'ffi_arg', that can be used as the return type. For example, if the CIF was defined with a return type of 'char', 'libffi' will try to store a full 'ffi_arg' into the return value.
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.
Note that while the return value must be register-sized, arguments should exactly match their declared type. For example, if an argument is a 'short', then the entry in AVALUES should point to an object declared as 'short'; but if the return type is 'short', then RVALUE should point to an object declared as a larger type - usually 'ffi_arg'.
File: libffi.info, Node: Simple Example, Next: Types, Prev: The Basics, Up: Using libffi
2.2 Simple Example==================
Here is a trivial example that calls 'puts' a few times.
#include <stdio.h> #include <ffi.h>
int main() { ffi_cif cif; ffi_type *args[1]; void *values[1]; char *s; ffi_arg rc;
/* Initialize the argument info vectors */ args[0] = &ffi_type_pointer; values[0] = &s;
/* Initialize the cif */ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint, args) == FFI_OK) { s = "Hello World!"; ffi_call(&cif, puts, &rc, values); /* rc now holds the result of the call to puts */
/* values holds a pointer to the function's arg, so to call puts() again all we need to do is change the value of s */ s = "This is cool!"; ffi_call(&cif, puts, &rc, values); }
return 0; }
File: libffi.info, Node: Types, Next: Multiple ABIs, Prev: Simple Example, Up: Using libffi
2.3 Types=========
* Menu:
* Primitive Types:: Built-in types.* Structures:: Structure types.* Size and Alignment:: Size and alignment of types.* Arrays Unions Enums:: Arrays, unions, and enumerations.* Type Example:: Structure type example.* Complex:: Complex types.* Complex Type Example:: Complex type example.
File: libffi.info, Node: Primitive Types, Next: Structures, Up: Types
2.3.1 Primitive Types---------------------
'Libffi' provides a number of built-in type descriptors that can be usedto describe argument and return types:
'ffi_type_void' The type 'void'. This cannot be used for argument types, only for return values.
'ffi_type_uint8' An unsigned, 8-bit integer type.
'ffi_type_sint8' A signed, 8-bit integer type.
'ffi_type_uint16' An unsigned, 16-bit integer type.
'ffi_type_sint16' A signed, 16-bit integer type.
'ffi_type_uint32' An unsigned, 32-bit integer type.
'ffi_type_sint32' A signed, 32-bit integer type.
'ffi_type_uint64' An unsigned, 64-bit integer type.
'ffi_type_sint64' A signed, 64-bit integer type.
'ffi_type_float' The C 'float' type.
'ffi_type_double' The C 'double' type.
'ffi_type_uchar' The C 'unsigned char' type.
'ffi_type_schar' The C 'signed char' type. (Note that there is not an exact equivalent to the C 'char' type in 'libffi'; ordinarily you should either use 'ffi_type_schar' or 'ffi_type_uchar' depending on whether 'char' is signed.)
'ffi_type_ushort' The C 'unsigned short' type.
'ffi_type_sshort' The C 'short' type.
'ffi_type_uint' The C 'unsigned int' type.
'ffi_type_sint' The C 'int' type.
'ffi_type_ulong' The C 'unsigned long' type.
'ffi_type_slong' The C 'long' type.
'ffi_type_longdouble' On platforms that have a C 'long double' type, this is defined. On other platforms, it is not.
'ffi_type_pointer' A generic 'void *' pointer. You should use this for all pointers, regardless of their real type.
'ffi_type_complex_float' The C '_Complex float' type.
'ffi_type_complex_double' The C '_Complex double' type.
'ffi_type_complex_longdouble' The C '_Complex long double' type. On platforms that have a C 'long double' type, this is defined. On other platforms, it is not.
Each of these is of type 'ffi_type', so you must take the addresswhen passing to 'ffi_prep_cif'.
File: libffi.info, Node: Structures, Next: Size and Alignment, Prev: Primitive Types, Up: Types
2.3.2 Structures----------------
'libffi' is perfectly happy passing structures back and forth. You mustfirst describe the structure to 'libffi' by creating a new 'ffi_type'object for it.
-- Data type: ffi_type The 'ffi_type' has the following members: 'size_t size' This is set by 'libffi'; you should initialize it to zero.
'unsigned short alignment' This is set by 'libffi'; you should initialize it to zero.
'unsigned short type' For a structure, this should be set to 'FFI_TYPE_STRUCT'.
'ffi_type **elements' This is a 'NULL'-terminated array of pointers to 'ffi_type' objects. There is one element per field of the struct.
Note that 'libffi' has no special support for bit-fields. You must manage these manually.
The 'size' and 'alignment' fields will be filled in by 'ffi_prep_cif'or 'ffi_prep_cif_var', as needed.
File: libffi.info, Node: Size and Alignment, Next: Arrays Unions Enums, Prev: Structures, Up: Types
2.3.3 Size and Alignment------------------------
'libffi' will set the 'size' and 'alignment' fields of an 'ffi_type'object for you. It does so using its knowledge of the ABI.
You might expect that you can simply read these fields for a typethat has been laid out by 'libffi'. However, there are some caveats.
* The size or alignment of some of the built-in types may vary depending on the chosen ABI.
* The size and alignment of a new structure type will not be set by 'libffi' until it has been passed to 'ffi_prep_cif' or 'ffi_get_struct_offsets'.
* A structure type cannot be shared across ABIs. Instead each ABI needs its own copy of the structure type.
So, before examining these fields, it is safest to pass the'ffi_type' object to 'ffi_prep_cif' or 'ffi_get_struct_offsets' first.This function will do all the needed setup.
ffi_type *desired_type; ffi_abi desired_abi; ... ffi_cif cif; if (ffi_prep_cif (&cif, desired_abi, 0, desired_type, NULL) == FFI_OK) { size_t size = desired_type->size; unsigned short alignment = desired_type->alignment; }
'libffi' also provides a way to get the offsets of the members of astructure.
-- Function: ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, size_t *offsets) Compute the offset of each element of the given structure type. ABI is the ABI to use; this is needed because in some cases the layout depends on the ABI.
OFFSETS is an out parameter. The caller is responsible for providing enough space for all the results to be written - one element per element type in STRUCT_TYPE. If OFFSETS is 'NULL', then the type will be laid out but not otherwise modified. This can be useful for accessing the type's size or layout, as mentioned above.
This function returns 'FFI_OK' on success; 'FFI_BAD_ABI' if ABI is invalid; or 'FFI_BAD_TYPEDEF' if STRUCT_TYPE is invalid in some way. Note that only 'FFI_STRUCT' types are valid here.
File: libffi.info, Node: Arrays Unions Enums, Next: Type Example, Prev: Size and Alignment, Up: Types
2.3.4 Arrays, Unions, and Enumerations--------------------------------------
2.3.4.1 Arrays..............
'libffi' does not have direct support for arrays or unions. However,they can be emulated using structures.
To emulate an array, simply create an 'ffi_type' using'FFI_TYPE_STRUCT' with as many members as there are elements in thearray.
ffi_type array_type; ffi_type **elements int i;
elements = malloc ((n + 1) * sizeof (ffi_type *)); for (i = 0; i < n; ++i) elements[i] = array_element_type; elements[n] = NULL;
array_type.size = array_type.alignment = 0; array_type.type = FFI_TYPE_STRUCT; array_type.elements = elements;
Note that arrays cannot be passed or returned by value in C -structure types created like this should only be used to refer tomembers of real 'FFI_TYPE_STRUCT' objects.
However, a phony array type like this will not cause any errors from'libffi' if you use it as an argument or return type. This may beconfusing.
2.3.4.2 Unions..............
A union can also be emulated using 'FFI_TYPE_STRUCT'. In this case,however, you must make sure that the size and alignment match the realrequirements of the union.
One simple way to do this is to ensue that each element type is laidout. Then, give the new structure type a single element; the size ofthe largest element; and the largest alignment seen as well.
This example uses the 'ffi_prep_cif' trick to ensure that eachelement type is laid out.
ffi_abi desired_abi; ffi_type union_type; ffi_type **union_elements;
int i; ffi_type element_types[2];
element_types[1] = NULL;
union_type.size = union_type.alignment = 0; union_type.type = FFI_TYPE_STRUCT; union_type.elements = element_types;
for (i = 0; union_elements[i]; ++i) { ffi_cif cif; if (ffi_prep_cif (&cif, desired_abi, 0, union_elements[i], NULL) == FFI_OK) { if (union_elements[i]->size > union_type.size) { union_type.size = union_elements[i]; size = union_elements[i]->size; } if (union_elements[i]->alignment > union_type.alignment) union_type.alignment = union_elements[i]->alignment; } }
2.3.4.3 Enumerations....................
'libffi' does not have any special support for C 'enum's. Although anygiven 'enum' is implemented using a specific underlying integral type,exactly which type will be used cannot be determined by 'libffi' - itmay depend on the values in the enumeration or on compiler flags such as'-fshort-enums'. *Note (gcc)Structures unions enumerations andbit-fields implementation::, for more information about how GCC handlesenumerations.
File: libffi.info, Node: Type Example, Next: Complex, Prev: Arrays Unions Enums, Up: Types
2.3.5 Type Example------------------
The following example initializes a 'ffi_type' object representing the'tm' struct from Linux's 'time.h'.
Here is how the struct is defined:
struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; /* Those are for future use. */ long int __tm_gmtoff__; __const char *__tm_zone__; };
Here is the corresponding code to describe this struct to 'libffi':
{ ffi_type tm_type; ffi_type *tm_type_elements[12]; int i;
tm_type.size = tm_type.alignment = 0; tm_type.type = FFI_TYPE_STRUCT; tm_type.elements = &tm_type_elements;
for (i = 0; i < 9; i++) tm_type_elements[i] = &ffi_type_sint;
tm_type_elements[9] = &ffi_type_slong; tm_type_elements[10] = &ffi_type_pointer; tm_type_elements[11] = NULL;
/* tm_type can now be used to represent tm argument types and return types for ffi_prep_cif() */ }
File: libffi.info, Node: Complex, Next: Complex Type Example, Prev: Type Example, Up: Types
2.3.6 Complex Types-------------------
'libffi' supports the complex types defined by the C99 standard('_Complex float', '_Complex double' and '_Complex long double' with thebuilt-in type descriptors 'ffi_type_complex_float','ffi_type_complex_double' and 'ffi_type_complex_longdouble'.
Custom complex types like '_Complex int' can also be used. An'ffi_type' object has to be defined to describe the complex type to'libffi'.
-- Data type: ffi_type 'size_t size' This must be manually set to the size of the complex type.
'unsigned short alignment' This must be manually set to the alignment of the complex type.
'unsigned short type' For a complex type, this must be set to 'FFI_TYPE_COMPLEX'.
'ffi_type **elements'
This is a 'NULL'-terminated array of pointers to 'ffi_type' objects. The first element is set to the 'ffi_type' of the complex's base type. The second element must be set to 'NULL'.
The section *note Complex Type Example:: shows a way to determine the'size' and 'alignment' members in a platform independent way.
For platforms that have no complex support in 'libffi' yet, thefunctions 'ffi_prep_cif' and 'ffi_prep_args' abort the program if theyencounter a complex type.
File: libffi.info, Node: Complex Type Example, Prev: Complex, Up: Types
2.3.7 Complex Type Example--------------------------
This example demonstrates how to use complex types:
#include <stdio.h> #include <ffi.h> #include <complex.h>
void complex_fn(_Complex float cf, _Complex double cd, _Complex long double cld) { printf("cf=%f+%fi\ncd=%f+%fi\ncld=%f+%fi\n", (float)creal (cf), (float)cimag (cf), (float)creal (cd), (float)cimag (cd), (float)creal (cld), (float)cimag (cld)); }
int main() { ffi_cif cif; ffi_type *args[3]; void *values[3]; _Complex float cf; _Complex double cd; _Complex long double cld;
/* Initialize the argument info vectors */ args[0] = &ffi_type_complex_float; args[1] = &ffi_type_complex_double; args[2] = &ffi_type_complex_longdouble; values[0] = &cf; values[1] = &cd; values[2] = &cld;
/* Initialize the cif */ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &ffi_type_void, args) == FFI_OK) { cf = 1.0 + 20.0 * I; cd = 300.0 + 4000.0 * I; cld = 50000.0 + 600000.0 * I; /* Call the function */ ffi_call(&cif, (void (*)(void))complex_fn, 0, values); }
return 0; }
This is an example for defining a custom complex type descriptor forcompilers that support them:
/* * This macro can be used to define new complex type descriptors * in a platform independent way. * * name: Name of the new descriptor is ffi_type_complex_<name>. * type: The C base type of the complex type. */ #define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \ static ffi_type *ffi_elements_complex_##name [2] = { \ (ffi_type *)(&ffitype), NULL \ }; \ struct struct_align_complex_##name { \ char c; \ _Complex type x; \ }; \ ffi_type ffi_type_complex_##name = { \ sizeof(_Complex type), \ offsetof(struct struct_align_complex_##name, x), \ FFI_TYPE_COMPLEX, \ (ffi_type **)ffi_elements_complex_##name \ }
/* Define new complex type descriptors using the macro: */ /* ffi_type_complex_sint */ FFI_COMPLEX_TYPEDEF(sint, int, ffi_type_sint); /* ffi_type_complex_uchar */ FFI_COMPLEX_TYPEDEF(uchar, unsigned char, ffi_type_uint8);
The new type descriptors can then be used like one of the built-intype descriptors in the previous example.
File: libffi.info, Node: Multiple ABIs, Next: The Closure API, Prev: Types, Up: Using libffi
2.4 Multiple ABIs=================
A given platform may provide multiple different ABIs at once. Forinstance, the x86 platform has both 'stdcall' and 'fastcall' functions.
'libffi' provides some support for this. However, this isnecessarily platform-specific.
File: libffi.info, Node: The Closure API, Next: Closure Example, Prev: Multiple ABIs, Up: Using libffi
2.5 The Closure API===================
'libffi' also provides a way to write a generic function - a functionthat can accept and decode any combination of arguments. This can beuseful when writing an interpreter, or to provide wrappers for arbitraryfunctions.
This facility is called the "closure API". Closures are not supportedon all platforms; you can check the 'FFI_CLOSURES' define to determinewhether they are supported on the current platform.
Because closures work by assembling a tiny function at runtime, theyrequire special allocation on platforms that have a non-executable heap.Memory management for closures is handled by a pair of functions:
-- Function: void *ffi_closure_alloc (size_t SIZE, void **CODE) Allocate a chunk of memory holding SIZE bytes. This returns a pointer to the writable address, and sets *CODE to the corresponding executable address.
SIZE should be sufficient to hold a 'ffi_closure' object.
-- Function: void ffi_closure_free (void *WRITABLE) Free memory allocated using 'ffi_closure_alloc'. The argument is the writable address that was returned.
Once you have allocated the memory for a closure, you must constructa 'ffi_cif' describing the function call. Finally you can prepare theclosure function:
-- Function: ffi_status ffi_prep_closure_loc (ffi_closure *CLOSURE, ffi_cif *CIF, void (*FUN) (ffi_cif *CIF, void *RET, void **ARGS, void *USER_DATA), void *USER_DATA, void *CODELOC) Prepare a closure function. The arguments to 'ffi_prep_closure_loc' are:
CLOSURE The address of a 'ffi_closure' object; this is the writable address returned by 'ffi_closure_alloc'.
CIF The 'ffi_cif' describing the function parameters. Note that this object, and the types to which it refers, must be kept alive until the closure itself is freed.
USER_DATA An arbitrary datum that is passed, uninterpreted, to your closure function.
CODELOC The executable address returned by 'ffi_closure_alloc'.
FUN The function which will be called when the closure is invoked. It is called with the arguments:
CIF The 'ffi_cif' passed to 'ffi_prep_closure_loc'.
RET A pointer to the memory used for the function's return value.
If the function is declared as returning 'void', then this value is garbage and should not be used.
Otherwise, FUN must fill the object to which this points, following the same special promotion behavior as 'ffi_call'. That is, in most cases, RET points to an object of exactly the size of the type specified when CIF was constructed. However, integral types narrower than the system register size are widened. In these cases your program may assume that RET points to an 'ffi_arg' object.
ARGS A vector of pointers to memory holding the arguments to the function.
USER_DATA The same USER_DATA that was passed to 'ffi_prep_closure_loc'.
'ffi_prep_closure_loc' will return 'FFI_OK' if everything went ok, and one of the other 'ffi_status' values on error.
After calling 'ffi_prep_closure_loc', you can cast CODELOC to the appropriate pointer-to-function type.
You may see old code referring to 'ffi_prep_closure'. This functionis deprecated, as it cannot handle the need for separate writable andexecutable addresses.
File: libffi.info, Node: Closure Example, Next: Thread Safety, Prev: The Closure API, Up: Using libffi
2.6 Closure Example===================
A trivial example that creates a new 'puts' by binding 'fputs' with'stdout'.
#include <stdio.h> #include <ffi.h>
/* Acts like puts with the file given at time of enclosure. */ void puts_binding(ffi_cif *cif, void *ret, void* args[], void *stream) { *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream); }
typedef int (*puts_t)(char *);
int main() { ffi_cif cif; ffi_type *args[1]; ffi_closure *closure;
void *bound_puts; int rc;
/* Allocate closure and bound_puts */ closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
if (closure) { /* Initialize the argument info vectors */ args[0] = &ffi_type_pointer;
/* Initialize the cif */ if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_sint, args) == FFI_OK) { /* Initialize the closure, setting stream to stdout */ if (ffi_prep_closure_loc(closure, &cif, puts_binding, stdout, bound_puts) == FFI_OK) { rc = ((puts_t)bound_puts)("Hello World!"); /* rc now holds the result of the call to fputs */ } } }
/* Deallocate both closure, and bound_puts */ ffi_closure_free(closure);
return 0; }
File: libffi.info, Node: Thread Safety, Prev: Closure Example, Up: Using libffi
2.7 Thread Safety=================
'libffi' is not completely thread-safe. However, many parts are, and ifyou follow some simple rules, you can use it safely in a multi-threadedprogram.
* 'ffi_prep_cif' may modify the 'ffi_type' objects passed to it. It is best to ensure that only a single thread prepares a given 'ffi_cif' at a time.
* On some platforms, 'ffi_prep_cif' may modify the size and alignment of some types, depending on the chosen ABI. On these platforms, if you switch between ABIs, you must ensure that there is only one call to 'ffi_prep_cif' at a time.
Currently the only affected platform is PowerPC and the only affected type is 'long double'.
File: libffi.info, Node: Missing Features, Next: Index, Prev: Using libffi, Up: Top
3 Missing Features******************
'libffi' is missing a few features. We welcome patches to add supportfor these.
* Variadic closures.
* There is no support for bit fields in structures.
* The "raw" API is undocumented.
* The Go API is undocumented.
Note that variadic support is very new and tested on a relativelysmall number of platforms.
File: libffi.info, Node: Index, Prev: Missing Features, Up: Top
Index*****