Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS 11 - Big Sur Beta 3 - Compile Failure #814

Closed
realityworks opened this issue Jul 27, 2020 · 21 comments
Closed

MacOS 11 - Big Sur Beta 3 - Compile Failure #814

realityworks opened this issue Jul 27, 2020 · 21 comments

Comments

@realityworks
Copy link

realityworks commented Jul 27, 2020

Building with Ruby 2.6.0.

The following compile error results:

/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.12.2/gem_make.out

An error occurred while installing ffi (1.12.2), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.12.2' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  cocoapods was resolved to 1.9.1, which depends on
    cocoapods-core was resolved to 1.9.1, which depends on
      typhoeus was resolved to 1.4.0, which depends on
        ethon was resolved to 0.12.0, which depends on
          ffi
myuser@mycomputer app % nano /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.12.2/gem_make.out
myuser@mycomputer app % cat /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.12.2/gem_make.out 
current directory: /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200727-1004-fcv0em.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for shlwapi.h... no
checking for rb_thread_call_without_gvl()... yes
checking for ruby_native_thread_p()... yes
checking for ruby_thread_has_gvl_p()... yes
creating extconf.h
creating Makefile

current directory: /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c
make "DESTDIR=" clean

current directory: /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c
make "DESTDIR="
mkdir -p "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c"/libffi-x86_64; (if [ ! -f "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi"/configure ]; then echo "Running autoreconf for libffi"; cd "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi" && /bin/sh /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/autogen.sh > /dev/null; fi); (if [ ! -f "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c"/libffi-x86_64/Makefile ]; then echo "Configuring libffi for x86_64"; cd "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c"/libffi-x86_64 && env CC=" xcrun clang" CFLAGS="-arch x86_64 " LDFLAGS="-arch x86_64" "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --disable-docs --host=x86_64-apple-darwin > /dev/null; fi); /Applications/Xcode-beta.app/Contents/Developer/usr/bin/make -C "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c"/libffi-x86_64
Configuring libffi for x86_64
clang: error: unsupported option '-print-multi-os-directory'
clang: error: no input files
/Applications/Xcode-beta.app/Contents/Developer/usr/bin/make  all-recursive
Making all in include
make[3]: Nothing to be done for `all'.
Making all in testsuite
make[3]: Nothing to be done for `all'.
Making all in man
make[3]: Nothing to be done for `all'.
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/prep_cif.lo /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/prep_cif.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/prep_cif.c  -fno-common -DPIC -o src/.libs/prep_cif.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/types.lo /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/types.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/types.c  -fno-common -DPIC -o src/.libs/types.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/raw_api.lo /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/raw_api.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/raw_api.c  -fno-common -DPIC -o src/.libs/raw_api.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/java_raw_api.lo /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/java_raw_api.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/java_raw_api.c  -fno-common -DPIC -o src/.libs/java_raw_api.o
/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/java_raw_api.c:328:46: warning: 'ffi_java_raw_size' is deprecated [-Wdeprecated-declarations]
  ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
                                             ^
include/ffi.h:299:56: note: 'ffi_java_raw_size' has been explicitly marked deprecated here
size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
                                                       ^
/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/java_raw_api.c:331:3: warning: 'ffi_java_ptrarray_to_raw' is deprecated [-Wdeprecated-declarations]
  ffi_java_ptrarray_to_raw (cif, avalue, raw);
  ^
include/ffi.h:295:93: note: 'ffi_java_ptrarray_to_raw' has been explicitly marked deprecated here
void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated));
                                                                                            ^
2 warnings generated.
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/closures.lo /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/closures.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/closures.c  -fno-common -DPIC -o src/.libs/closures.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/x86/ffi64.lo /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/x86/ffi64.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/x86/ffi64.c  -fno-common -DPIC -o src/x86/.libs/ffi64.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64  -c -o src/x86/unix64.lo /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/x86/unix64.S
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64 -c /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/x86/unix64.S  -fno-common -DPIC -o src/x86/.libs/unix64.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/x86/ffiw64.lo /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/x86/ffiw64.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/x86/ffiw64.c  -fno-common -DPIC -o src/x86/.libs/ffiw64.o
/bin/sh ./libtool  --tag=CC   --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src  -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64  -c -o src/x86/win64.lo /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/x86/win64.S
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -I. -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/include -Iinclude -I/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src -arch x86_64 -c /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/src/x86/win64.S  -fno-common -DPIC -o src/x86/.libs/win64.o
/bin/sh ./libtool  --tag=CC   --mode=link xcrun clang  -arch x86_64  -Wall -fexceptions  -arch x86_64 -o libffi_convenience.la  src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo   src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffiw64.lo src/x86/win64.lo 
libtool: link: ar cru .libs/libffi_convenience.a src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi64.o src/x86/.libs/unix64.o src/x86/.libs/ffiw64.o src/x86/.libs/win64.o 
libtool: link: ranlib .libs/libffi_convenience.a
libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
/bin/sh ./libtool  --tag=CC   --mode=link xcrun clang  -arch x86_64  -Wall -fexceptions -no-undefined -version-info `grep -v '^#' /Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi/libtool-version`   '-arch' 'x86_64'  -arch x86_64 -o libffi.la -rpath /usr/local/lib src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo  src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffiw64.lo src/x86/win64.lo 
libtool: link:  xcrun clang -dynamiclib  -o .libs/libffi.7.dylib  src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi64.o src/x86/.libs/unix64.o src/x86/.libs/ffiw64.o src/x86/.libs/win64.o    -arch x86_64 -arch x86_64 -arch x86_64   -install_name  /usr/local/lib/libffi.7.dylib -compatibility_version 9 -current_version 9.0 -Wl,-single_module
libtool: link: (cd ".libs" && rm -f "libffi.dylib" && ln -s "libffi.7.dylib" "libffi.dylib")
libtool: link: ( cd ".libs" && rm -f "libffi.la" && ln -s "../libffi.la" "libffi.la" )
# Assemble into a FAT (x86_64, i386, ppc) library
/usr/bin/libtool -static -o "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi-universal-darwin20"/.libs/libffi_convenience.a \
	    "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c"/libffi-x86_64/.libs/libffi_convenience.a
rm -f "/Users/myuser/Dev/app/vendor/cache/ruby/2.6.0/gems/ffi-1.12.2/ext/ffi_c/libffi-universal-darwin20"/include/ffi.h
compiling AbstractMemory.c
In file included from AbstractMemory.c:47:
In file included from ./AbstractMemory.h:42:
In file included from ./Types.h:79:
./Type.h:50:5: error: unknown type name 'ffi_type'
    ffi_type* ffiType;
    ^
In file included from AbstractMemory.c:49:
In file included from ./Function.h:48:
./Call.h:93:5: error: unknown type name 'ffi_cif'
    ffi_cif cif;
    ^
In file included from AbstractMemory.c:49:
./Function.h:59:5: error: unknown type name 'ffi_type'
    ffi_type* ffiReturnType;
    ^
./Function.h:60:5: error: unknown type name 'ffi_type'
    ffi_type** ffiParameterTypes;
    ^
./Function.h:61:5: error: unknown type name 'ffi_cif'
    ffi_cif ffi_cif;
    ^
./Function.h:66:5: error: unknown type name 'ffi_abi'
    ffi_abi abi;
    ^
6 errors generated.
make: *** [AbstractMemory.o] Error 1

make failed, exit code 2
@nicZn
Copy link

nicZn commented Jul 28, 2020

`

brew install libffi

ln -s /usr/local//Cellar/libffi/3.3/include/ffi.h /usr/local/include/ffi.h

ln -s /usr/local//Cellar/libffi/3.3/include/ffitarget.h /usr/local/include/ffitarget.h

`
this helps me.

@isnifer
Copy link

isnifer commented Jul 28, 2020

As described in README

gem install ffi -- --enable-system-libffi

Helped me

@realityworks
Copy link
Author

realityworks commented Aug 7, 2020

@isnifer

As described in README

gem install ffi -- --enable-system-libffi

Helped me

Unfortunately this doesn't work either :

Fetching ffi-1.13.1.gem
Building native extensions with: '--enable-system-libffi'
This could take a while...
ERROR:  Error installing ffi:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200807-11100-p896gb.rb extconf.rb --enable-system-libffi
checking for ffi_prep_closure_loc() in -lffi... no
checking for ffi_prep_closure_loc() in -llibffi... no
checking for ffi_prep_closure_loc() in -llibffi-8... no
system libffi is not usable
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

@michaelw90
Copy link

michaelw90 commented Aug 8, 2020

I updated Ruby on my MacBook Air to 2.7.1 using rbenv and then it successfully installed. I'd start there if you can @realityworks 👍🏼

@BytesGuy
Copy link

BytesGuy commented Aug 19, 2020

Seems like it doesn't work at all when using Xcode 12 b3 and above command line tools. Same issue on both Big Sur and Catalina when using the System ruby. Using chruby with 2.7 seems to resolve it, but it would be nice to resolve this for the system ruby if possible. gem install ffi -- --enable-system-libffi as mentioned above does not seem to resolve the issue in the cases I have tested.

@tduehr
Copy link
Member

tduehr commented Aug 19, 2020

Since the release of El Capitan, ffi has not worked well with system Ruby due to security features added in that release. See also #461. Using system Ruby for things outside of secure paths (i.e., nearly everything you install) is not recommended.

@Niek
Copy link

Niek commented Aug 20, 2020

brew install libffi
ln -s $(brew --cellar libffi)/*/include/ffi.h /usr/local/include/ffi.h
ln -s $(brew --cellar libffi)/*/include/ffitarget.h /usr/local/include/ffitarget.h

This fixed it for me

@poskefi
Copy link

poskefi commented Dec 9, 2020

This should work
sudo su
gem install ffi -- --enable-system-libffi

At leases it did for me

@cvvijayanand
Copy link

This should work
sudo su
gem install ffi -- --enable-system-libffi

At leases it did for me

this did work for me. Thanks.

@trandaison
Copy link

trandaison commented Jun 4, 2021

I am using rvm and in my case, this worked for me

  • Step 1
    Run in terminal: brew info libffi which will output the following:

    For compilers to find libffi you may need to set:

    export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
    export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
    

    For pkg-config to find libffi you may need to set:

    export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
    
  • Step 2
    Run all 3 export commands in terminal to set the env variables.

  • Step 3
    Finally, run the ruby installation command. In my case, it was: rvm install ruby-2.5.3

Hope it helps.

Reference: #869 (comment)

@msi753
Copy link

msi753 commented Jun 8, 2021

As described in README

gem install ffi -- --enable-system-libffi

Helped me

Didn't help me...
gem install ffi -- --disable-system-libffi

@realityworks
Copy link
Author

This is a really old item and BigSur is now no longer an evolving OS. Monterey will be the next platform to support.

@tibbon
Copy link

tibbon commented Jun 24, 2021

I'm on an Intel / Big Sur 11.4 setup and still seeing this today. I get it that Monterey is the upcoming OS, but is Big Sur no longer supported as a target?

@msi753 's suggestion of gem install ffi -- --disable-system-libffi did work for me to get it installed. Could we add some check flags in the installation process to do this automatically for those on Big Sur?

@msi753
Copy link

msi753 commented Jun 25, 2021

@tibbon
I'm a m1/ Big Sur user by the way...
bundle update ffi ethon which make it possible to use CocoaPod without Rosseta didn't work for me...
so I tried gem install ffi -- --enable-system-libffi but it didn't work for me either...(for the same reason above)
so I gem install ffi -- --disable-system-libffi to undo it...
I think it worked for you because you are a Intel user.
https://github.com/ffi/ffi
You better check it out

@cobbr2
Copy link

cobbr2 commented Aug 19, 2021

Is there any reason to believe this is fixed in Monterey?

@trinitronx
Copy link

trinitronx commented Dec 14, 2021

Is there any reason to believe this is fixed in Monterey?

I managed to get ffi gem to install on Monterey 12.0.1 with this line in Gemfile:

gem 'ffi', '>= 1.15.2'

Make sure to install Command Line Tools if you want to use system ffi.h headers:

$ xcode-select --print-path
/Library/Developer/CommandLineTools

$ find /Library/Developer/CommandLineTools -iname 'ffi.h'
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/ffi/ffi.h
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/ffi/ffi.h
/Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk/usr/include/ffi/ffi.h

@a1iraxa
Copy link

a1iraxa commented May 19, 2022

Try:
gem install ffi -v 'specify_version_here' -- --with-cflags="-Wno-error=implicit-function-declaration"

for example in my case:
gem install ffi -v '1.9.18' -- --with-cflags="-Wno-error=implicit-function-declaration"

and finally hit:
bundle install

@od-c0d3r
Copy link

od-c0d3r commented Dec 5, 2022

Using MacOS Ventura 13.0.1

running bundle outputs errors in ffi 1.11.1 installing process

2 warnings and 1 error generated.
make: *** [Function.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/username/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/ffi-1.11.1 for inspection.
Results logged to /Users/username/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-22/2.7.0/ffi-1.11.1/gem_make.out

An error occurred while installing ffi (1.11.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.11.1' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  activeadmin was resolved to 2.4.0, which depends on
    sassc-rails was resolved to 2.1.2, which depends on
      sassc was resolved to 2.2.1, which depends on
        ffi

@JulienItard
Copy link

Using MacOS Ventura 13.0.1

running bundle outputs errors in ffi 1.11.1 installing process

2 warnings and 1 error generated.
make: *** [Function.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/username/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/ffi-1.11.1 for inspection.
Results logged to /Users/username/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-22/2.7.0/ffi-1.11.1/gem_make.out

An error occurred while installing ffi (1.11.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.11.1' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  activeadmin was resolved to 2.4.0, which depends on
    sassc-rails was resolved to 2.1.2, which depends on
      sassc was resolved to 2.2.1, which depends on
        ffi

Same for me !

@sondnm
Copy link

sondnm commented May 6, 2023

Using MacOS Ventura 13.0.1

running bundle outputs errors in ffi 1.11.1 installing process

2 warnings and 1 error generated.
make: *** [Function.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/username/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/ffi-1.11.1 for inspection.
Results logged to /Users/username/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-22/2.7.0/ffi-1.11.1/gem_make.out

An error occurred while installing ffi (1.11.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.11.1' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  activeadmin was resolved to 2.4.0, which depends on
    sassc-rails was resolved to 2.1.2, which depends on
      sassc was resolved to 2.2.1, which depends on
        ffi

This works for me:
gem install ffi -- --with-cflags="-Wno-error=implicit-function-declaration"

@artoodeeto
Copy link

hello anyone has the issue as mine. Im trying to install ffi version 1.11.1 but I'm getting this error:

Building native extensions.  This could take a while...
ERROR:  Error installing ffi:
	ERROR: Failed to build gem native extension.

    current directory: /Users/marialuisagako/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/ffi-1.11.1/ext/ffi_c
/Users/marialuisagako/.rbenv/versions/2.3.6/bin/ruby -r ./siteconf20231230-97077-15g1yv5.rb extconf.rb
checking for ffi_call() in -lffi... yes
checking for ffi_closure_alloc()... yes
checking for shlwapi.h... no
checking for rb_thread_call_without_gvl()... yes
checking for ruby_native_thread_p()... yes
checking for ruby_thread_has_gvl_p()... yes
checking for ffi_prep_cif_var()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
creating extconf.h
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/marialuisagako/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/extensions/-darwin-23/2.3.0-static/ffi-1.11.1/mkmf.log

current directory: /Users/marialuisagako/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/ffi-1.11.1/ext/ffi_c
make "DESTDIR=" clean

current directory: /Users/marialuisagako/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/ffi-1.11.1/ext/ffi_c
make "DESTDIR="
compiling Thread.c
compiling Buffer.c
Buffer.c:266:45: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
        return order == BIG_ENDIAN ? ID2SYM(rb_intern("big")) : ID2SYM(rb_intern("little"));
                                            ^~~~~~~~~~~~~~~~
/Users/marialuisagako/.rbenv/versions/2.3.6/include/ruby-2.3.0/ruby/ruby.h:1733:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
/Users/marialuisagako/.rbenv/versions/2.3.6/include/ruby-2.3.0/ruby/ruby.h:406:29: note: expanded from macro 'ID2SYM'
#define ID2SYM(x) RB_ID2SYM(x)
                            ^
/Users/marialuisagako/.rbenv/versions/2.3.6/include/ruby-2.3.0/ruby/ruby.h:401:33: note: expanded from macro 'RB_ID2SYM'
#define RB_ID2SYM(x) (rb_id2sym(x))
                                ^
Buffer.c:266:45: note: '{' token is here
        return order == BIG_ENDIAN ? ID2SYM(rb_intern("big")) : ID2SYM(rb_intern("little"));
                                            ^~~~~~~~~~~~~~~~
/Users/marialuisagako/.rbenv/versions/2.3.6/include/ruby-2.3.0/ruby/ruby.h:1733:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~

ruby version: 2.3.6 installed using rbenv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests