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

1.9.25 fails to build in darwin 18 #647

Closed
ChrisBFusion opened this issue Aug 7, 2018 · 9 comments
Closed

1.9.25 fails to build in darwin 18 #647

ChrisBFusion opened this issue Aug 7, 2018 · 9 comments

Comments

@ChrisBFusion
Copy link

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

current directory: /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c

/opt/local/bin/ruby2.5 -r ./siteconf20180807-1890-pqj732.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 ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
creating extconf.h
creating Makefile

current directory: /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c
make "DESTDIR=" clean

current directory: /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c
make "DESTDIR="
mkdir -p "/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c"/libffi-x86_64; (if [ ! -f "/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi"/configure ]; then echo "Running autoreconf for libffi"; cd "/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi" && /bin/sh /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/autogen.sh > /dev/null; fi); (if [ ! -f "/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c"/libffi-x86_64/Makefile ]; then echo "Configuring libffi for x86_64"; cd "/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c"/libffi-x86_64 && env CC=" /usr/bin/clang" CFLAGS="-arch x86_64 " LDFLAGS="-arch x86_64" "/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --disable-docs --host=x86_64-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 /Applications/Xcode-beta.app/Contents/Developer/usr/bin/make -C "/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/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 'AR_FLAGS=' 'CC_FOR_BUILD=' 'CFLAGS=-arch x86_64 -Wall -fexceptions' 'CXXFLAGS=-g -O2' 'CFLAGS_FOR_BUILD=' 'CFLAGS_FOR_TARGET=' 'INSTALL=/opt/local/bin/ginstall -c' 'INSTALL_DATA=/opt/local/bin/ginstall -c -m 644' 'INSTALL_PROGRAM=/opt/local/bin/ginstall -c' 'INSTALL_SCRIPT=/opt/local/bin/ginstall -c' 'JC1FLAGS=' 'LDFLAGS=-arch x86_64' 'LIBCFLAGS=' 'LIBCFLAGS_FOR_TARGET=' 'MAKE=/Applications/Xcode-beta.app/Contents/Developer/usr/bin/make' 'MAKEINFO=/bin/sh /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/missing makeinfo ' 'PICFLAG=' 'PICFLAG_FOR_TARGET=' 'RUNTESTFLAGS=' 'SHELL=/bin/sh' 'exec_prefix=/usr/local' 'infodir=/usr/local/share/info' 'libdir=/usr/local/lib' 'mandir=/usr/local/share/man' 'prefix=/usr/local' 'AR=ar' 'AS=as' 'CC=/usr/bin/clang' 'CXX=g++' 'LD=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld' 'NM=nm' 'RANLIB=ranlib' 'DESTDIR=' 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 /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c -o src/prep_cif.lo /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/prep_cif.c libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/prep_cif.c -fno-common -DPIC -o src/.libs/prep_cif.o /bin/sh ./libtool --tag=CC --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c -o src/types.lo /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/types.c libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/types.c -fno-common -DPIC -o src/.libs/types.o /bin/sh ./libtool --tag=CC --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c -o src/raw_api.lo /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/raw_api.c libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/raw_api.c -fno-common -DPIC -o src/.libs/raw_api.o /bin/sh ./libtool --tag=CC --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c -o src/java_raw_api.lo /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/java_raw_api.c libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/java_raw_api.c -fno-common -DPIC -o src/.libs/java_raw_api.o /bin/sh ./libtool --tag=CC --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c -o src/closures.lo /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/closures.c libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/closures.c -fno-common -DPIC -o src/.libs/closures.o /bin/sh ./libtool --tag=CC --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c -o src/x86/ffi64.lo /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/ffi64.c libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/ffi64.c -fno-common -DPIC -o src/x86/.libs/ffi64.o /bin/sh ./libtool --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -c -o src/x86/unix64.lo /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/unix64.S libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -c /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/unix64.S -fno-common -DPIC -o src/x86/.libs/unix64.o /bin/sh ./libtool --tag=CC --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c -o src/x86/ffiw64.lo /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/ffiw64.c libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/ffiw64.c -fno-common -DPIC -o src/x86/.libs/ffiw64.o /bin/sh ./libtool --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -c -o src/x86/win64.lo /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/win64.S libtool: compile: /usr/bin/clang -DHAVE_CONFIG_H -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -I. -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/include -Iinclude -I/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src -arch x86_64 -c /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c/libffi/src/x86/win64.S -fno-common -DPIC -o src/x86/.libs/win64.o /bin/sh ./libtool --tag=CC --mode=link /usr/bin/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 /usr/bin/clang -arch x86_64 -Wall -fexceptions -no-undefined -version-info grep -v '^#' /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/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: /usr/bin/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
ld: library not found for -lgcc_s.10.4
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libffi.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** ["/opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25/ext/ffi_c"/libffi-x86_64/.libs/libffi_convenience.a] Error 2

make failed, exit code 2

Gem files will remain installed in /opt/local/lib/ruby2.5/gems/2.5.0/gems/ffi-1.9.25 for inspection.
Results logged to /opt/local/lib/ruby2.5/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0/ffi-1.9.25/gem_make.out

@ChrisBFusion ChrisBFusion changed the title Fails to build in darwin 18 1.9.25 fails to build in darwin 18 Aug 7, 2018
@twe4ked
Copy link

twe4ked commented Sep 21, 2018

I had a similar stacktrace. I solved the issue by reinstalling Xcode CLI tools.

xcode-select --install

@dcloud
Copy link

dcloud commented Nov 7, 2018

I'm also having this issue, and xcode-select --install didn't help.

I reinstalled libffi from homebrew and made sure to export LDFLAGS="-L/usr/local/opt/libffi/lib" and export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" before installing this gem. I hope this helps others.

@raulsouzalima
Copy link

Thanks @dcloud
It helped on Mojave!

@tduehr
Copy link
Member

tduehr commented Jan 25, 2019

This is libffi and ruby installed through homebrew?

@dcloud
Copy link

dcloud commented Jan 25, 2019

My situation was the libffi and ruby installed through homebrew. The ticket creator's post included /opt/local/ paths, suggesting he is not using homebrew, unless he has customized the installation location of ruby or homebrew. To my knowledge homebrew does not use /opt. Hope that helps!

@ChrisBFusion
Copy link
Author

In my case, Ruby is installed as a MacPorts package.

@vladhadzhiyski
Copy link

I'm also having this issue, and xcode-select --install didn't help.

I reinstalled libffi from homebrew and made sure to export LDFLAGS="-L/usr/local/opt/libffi/lib" and export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" before installing this gem. I hope this helps others.

Yes, the above worked for me. Summary:

$ brew reinstall libffi
==> Reinstalling libffi
==> Downloading https://homebrew.bintray.com/bottles/libffi-3.2.1.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libffi-3.2.1.mojave.bottle.tar.gz
==> Caveats
libffi is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of libffi.

For compilers to find libffi you may need to set:
  export LDFLAGS="-L/usr/local/opt/libffi/lib"

For pkg-config to find libffi you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/libffi/3.2.1: 16 files, 296.8KB
$ export LDFLAGS="-L/usr/local/opt/libffi/lib"
$ export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"

$ bundle install
......IT WORKED!....

Thanks!

@stevecheckoway
Copy link

stevecheckoway commented Mar 11, 2019

The real issue here is this is trying to build for Mac OS X 10.4.

diff --git a/ext/ffi_c/libffi.darwin.mk b/ext/ffi_c/libffi.darwin.mk
index 59e51fc..893a8e1 100644
--- a/ext/ffi_c/libffi.darwin.mk
+++ b/ext/ffi_c/libffi.darwin.mk
@@ -58,7 +58,7 @@ build_ffi = \
              env CC="$(CCACHE) $(CC)" CFLAGS="-arch $(1) $(LIBFFI_CFLAGS)" LDFLAGS="-arch $(1)" \
                $(LIBFFI_CONFIGURE) --host=$(1)-apple-darwin > /dev/null; \
        fi); \
-       env MACOSX_DEPLOYMENT_TARGET=10.4 $(MAKE) -C "$(BUILD_DIR)"/libffi-$(1)
+       $(MAKE) -C "$(BUILD_DIR)"/libffi-$(1)

 target_ffi = "$(BUILD_DIR)"/libffi-$(1)/.libs/libffi_convenience.a:; $(call build_ffi,$(1))

diff --git a/spec/ffi/fixtures/GNUmakefile b/spec/ffi/fixtures/GNUmakefile
index d730419..20899d1 100644
--- a/spec/ffi/fixtures/GNUmakefile
+++ b/spec/ffi/fixtures/GNUmakefile
@@ -23,8 +23,6 @@ PREFIX = lib
 LIBEXT ?= so
 LIBNAME = $(PREFIX)test.$(LIBEXT)

-export MACOSX_DEPLOYMENT_TARGET=10.4
-
 CCACHE := $(strip $(realpath $(shell which ccache 2> /dev/null)))

 TEST_SRCS = $(wildcard $(SRC_DIR)/*.c)

Unfortunately, this isn't quite sufficient because it tries to build tests for i386 which seems not to be supported any longer.

@ylg
Copy link

ylg commented Jun 8, 2019

I think this is needs a proper fix (perhaps stevecheckoway's) or a different workaround; sure, the workarounds above do "get past" building the gem, but they produce ffi gems that segfault on any invocation.

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

8 participants