Comment 0 for bug 1692751

Revision history for this message
vydd (vidovicd) wrote :

Loading cffi on openSuse Tumbleweed results in two errors.

The first one,

(FL-ERROR "Unable to load any of the alternatives:~% ~S" ("libffi.so.6" "libffi32.so.6" "libffi.so.5" "libffi32.so.5"))

is easily solved by providing ("libffi.so") as a value to be used instead.

This is because Tumbleweed comes with libffi7, from git. As far as I can tell from
their package changelog, it's https://github.com/libffi/libffi/tree/60e4250a77eb3fde500bfd68ec40519fe34b21bd .

This leads to another problem:

grov.c: In function ‘main’:
grov.c:72:41: error: ‘FFI_SYSV’ undeclared (first use in this function)
   fprintf(output, "%"PRIiMAX, (intmax_t)FFI_SYSV);

FFI_SYSV isn't defined because ffi_abi struct in ffitarget.h resolves to

#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
  FFI_FIRST_ABI = 1,
  FFI_UNIX64,
  FFI_WIN64,
  FFI_EFI64 = FFI_WIN64,
  FFI_LAST_ABI,
  FFI_DEFAULT_ABI = FFI_UNIX64

leaving FFI_SYSV undefined.

As a temporary fix, I added #define FFI_SYSV 1 to grovel/common.h, and compiling worked
just fine for my case (https://github.com/vydd/sketch/issues/17#issuecomment-303260982),
but a proper patch is needed.