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

unknown type name 'size_t' on macOS 10.13.3 #609

Closed
swissspidy opened this issue Feb 7, 2018 · 15 comments
Closed

unknown type name 'size_t' on macOS 10.13.3 #609

swissspidy opened this issue Feb 7, 2018 · 15 comments

Comments

@swissspidy
Copy link

swissspidy commented Feb 7, 2018

I've read every issue here that seemed only slightly related, but to no avail.

I'm unable to install ffi as compilation fails every time. I'm using macOS 10.13.3 and the following ruby version:

$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]

$ gem -v
2.7.5

$ bundle -v
Bundler version 1.16.1

Ruby has been installed via Homebrew and resides in /usr/local/bin/ruby.

When I try to run sudo gem install ffi -v '1.9.18' or just sudo gem install ffi, I get the following error:

current directory: /usr/local/lib/ruby/gems/2.5.0/gems/ffi-1.9.18/ext/ffi_c
/usr/local/opt/ruby/bin/ruby -r ./siteconf20180207-9274-1xmicng.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... yes
checking for ffi_call() in -lffi... yes
checking for ffi_prep_closure()... yes
checking for ffi_raw_call()... no
checking for shlwapi.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.5.0/gems/ffi-1.9.18/ext/ffi_c
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.5.0/gems/ffi-1.9.18/ext/ffi_c
make "DESTDIR="
compiling AbstractMemory.c
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
Call.c:355:5: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
    rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL);
    ^
./Thread.h:78:39: note: expanded from macro 'rbffi_thread_blocking_region'
# define rbffi_thread_blocking_region rb_thread_call_without_gvl
                                      ^
1 warning generated.
compiling ClosurePool.c
compiling DataConverter.c
compiling DynamicLibrary.c
compiling Function.c
Function.c:563:9: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
        rb_thread_call_without_gvl(async_cb_wait, &w, async_cb_stop, &w);
        ^
1 warning generated.
compiling FunctionInfo.c
compiling LastError.c
compiling LongDouble.c
compiling MappedType.c
compiling MemoryPointer.c
compiling MethodHandle.c
compiling Platform.c
compiling Pointer.c
compiling Struct.c
compiling StructByReference.c
compiling StructByValue.c
compiling StructLayout.c
compiling Thread.c
In file included from Thread.c:38:
/usr/include/pthread.h:226:66: error: unknown type name 'size_t'
int pthread_attr_getguardsize(const pthread_attr_t * __restrict, size_t * __restrict);
                                                                 ^
/usr/include/pthread.h:243:43: error: unknown type name 'size_t'
                void * _Nullable * _Nonnull __restrict, size_t * __restrict);
                                                        ^
/usr/include/pthread.h:250:66: error: unknown type name 'size_t'
int pthread_attr_getstacksize(const pthread_attr_t * __restrict, size_t * __restrict);
                                                                 ^
/usr/include/pthread.h:511:1: error: unknown type name 'size_t'
size_t pthread_get_stacksize_np(pthread_t);
^
4 errors generated.
make: *** [Thread.o] Error 1

make failed, exit code 2

This happens with both built-in GCC 4.2 and 7.3 installed via Homebrew.

I know that this might be a setup issue more than a problem with the library, but any help is greatly appreciated.

@Iolaum
Copy link

Iolaum commented Feb 20, 2018

Have the same problem on Ubuntu Mate 17.10

$ ruby -v
ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
$ gem -v
2.5.2.1
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.2.0-8ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3) 
$ 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: /var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20180220-3650-oo5k7z.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_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
creating extconf.h
creating Makefile

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

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/mkmf.log

current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR="
Running autoreconf for libffi
/var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c/libffi/autogen.sh: 2: exec: autoreconf: not found
libffi.mk:6: recipe for target '"/var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-linux-gnu"/.libs/libffi_convenience.a' failed
make: *** ["/var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-linux-gnu"/.libs/libffi_convenience.a] Error 127

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.21 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/gem_make.out

@swissspidy
Copy link
Author

@Iolaum Perhaps https://askubuntu.com/questions/265471/autoreconf-not-found-error-during-making-qemu-1-4-0/490839 helps in your case, as the cause seems to be a different one.

@Iolaum
Copy link

Iolaum commented Feb 20, 2018

Installing autoconf didn't work.

But $ sudo gem install ffi --version='1.9.18' did work so I am not sure what to make of the problem.

@larskanis
Copy link
Member

@Iolaum please try

sudo apt-get install libffi-dev

before gem install.

@headius
Copy link
Contributor

headius commented Feb 20, 2018

@larskanis We need to fix this so that libffi on the system is not required, as it worked before.

@coderanger
Copy link

@Iolaum That issue should already be fixed in master but a new release isn't up yet.

@Iolaum
Copy link

Iolaum commented Feb 20, 2018

@larskanis You were right, installing 'libffi-dev` solved this issue and ffi 1.9.21 installed successfully.

@trsoluti
Copy link

Please expedite this fix! Ruby on Rails on Mac is effectively dead until you do.

@larskanis
Copy link
Member

OK, just pushed ffi-1.9.22, which should solve this issue. Could you please re-try?

@trsoluti
Copy link

rails new new-site now works! Thanks!

@larskanis
Copy link
Member

@swissspidy I the original issue fixed in ffi-1.9.22?

/usr/include/pthread.h:226:66: error: unknown type name 'size_t'
int pthread_attr_getguardsize(const pthread_attr_t * __restrict, size_t * __restrict);
                                                                 ^

@swissspidy
Copy link
Author

Hmm now I get a different error:

current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c
make "DESTDIR="
mkdir -p "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-i386; (if [ ! -f "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-i386/configure ]; then echo "Running autoreconf for libffi"; cd "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi" && /bin/sh /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/autogen.sh > /dev/null; fi); (if [ ! -f "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-i386/Makefile ]; then echo "Configuring libffi for i386"; cd "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-i386 && env CC=" xcrun clang" CFLAGS="-arch i386 " LDFLAGS="-arch i386" "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi"/configure --disable-static --with-pic=yes --disable-dependency-tracking --disable-docs --host=i386-apple-darwin > /dev/null; fi); env MACOSX_DEPLOYMENT_TARGET=10.4 /Applications/Xcode.app/Contents/Developer/usr/bin/make -C "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-i386
Running autoreconf for libffi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: glibtoolize --copy
autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf
autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:31: installing './compile'
Makefile.am: installing './depcomp'
doc/Makefile.am:3: installing 'doc/mdate-sh'
doc/Makefile.am:3: installing 'doc/texinfo.tex'
autoreconf: Leaving directory `.'
Configuring libffi for i386
clang: error: unsupported option '-print-multi-os-directory'
clang: error: no input files
/Applications/Xcode.app/Contents/Developer/usr/bin/make 'AR_FLAGS=' 'CC_FOR_BUILD=' 'CFLAGS=-arch i386  -Wall -fexceptions' 'CXXFLAGS=-g -O2' 'CFLAGS_FOR_BUILD=' 'CFLAGS_FOR_TARGET=' 'INSTALL=/usr/local/bin/ginstall -c' 'INSTALL_DATA=/usr/local/bin/ginstall -c -m 644' 'INSTALL_PROGRAM=/usr/local/bin/ginstall -c' 'INSTALL_SCRIPT=/usr/local/bin/ginstall -c' 'JC1FLAGS=' 'LDFLAGS=-arch i386' 'LIBCFLAGS=' 'LIBCFLAGS_FOR_TARGET=' 'MAKE=/Applications/Xcode.app/Contents/Developer/usr/bin/make' 'MAKEINFO=/bin/sh /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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=xcrun clang' 'CXX=g++' 'LD=/Applications/Xcode.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 xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/prep_cif.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/prep_cif.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/types.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/types.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/raw_api.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/raw_api.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/java_raw_api.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/java_raw_api.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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 xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/closures.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/closures.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch i386  -Wall -fexceptions -c -o src/x86/ffi.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/ffi.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch i386 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/ffi.c  -fno-common -DPIC -o src/x86/.libs/ffi.o
/bin/sh ./libtool    --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch i386  -c -o src/x86/sysv.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/sysv.S
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch i386 -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/sysv.S  -fno-common -DPIC -o src/x86/.libs/sysv.o
/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/sysv.S:808:11: warning: section "__textcoal_nt" is deprecated
 .section __TEXT,__textcoal_nt,coalesced,pure_instructions; .weak_definition ___x86.get_pc_thunk.bx; .private_extern ___x86.get_pc_thunk.bx
          ^      ~~~~~~~~~~~~~
/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/sysv.S:808:11: note: change section name to "__text"
 .section __TEXT,__textcoal_nt,coalesced,pure_instructions; .weak_definition ___x86.get_pc_thunk.bx; .private_extern ___x86.get_pc_thunk.bx
          ^      ~~~~~~~~~~~~~
/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/sysv.S:814:11: warning: section "__textcoal_nt" is deprecated
 .section __TEXT,__textcoal_nt,coalesced,pure_instructions; .weak_definition ___x86.get_pc_thunk.dx; .private_extern ___x86.get_pc_thunk.dx
          ^      ~~~~~~~~~~~~~
/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/sysv.S:814:11: note: change section name to "__text"
 .section __TEXT,__textcoal_nt,coalesced,pure_instructions; .weak_definition ___x86.get_pc_thunk.dx; .private_extern ___x86.get_pc_thunk.dx
          ^      ~~~~~~~~~~~~~
/bin/sh ./libtool  --tag=CC   --mode=link xcrun clang  -arch i386  -Wall -fexceptions  -arch i386 -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/ffi.lo src/x86/sysv.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/ffi.o src/x86/.libs/sysv.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 i386  -Wall -fexceptions -no-undefined -version-info `grep -v '^#' /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/libtool-version`   '-arch' 'i386'  -arch i386 -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/ffi.lo src/x86/sysv.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/ffi.o src/x86/.libs/sysv.o    -arch i386 -arch i386 -arch i386   -install_name  /usr/local/lib/libffi.7.dylib -compatibility_version 9 -current_version 9.0 -Wl,-single_module
ld: warning: could not create compact unwind for _ffi_call_i386: non-standard register 5 being saved in prolog
ld: warning: could not create compact unwind for _ffi_go_closure_EAX: does not use EBP or ESP based frame
ld: warning: could not create compact unwind for _ffi_go_closure_ECX: does not use EBP or ESP based frame
ld: warning: could not create compact unwind for _ffi_closure_i386: does not use EBP or ESP based frame
ld: warning: could not create compact unwind for _ffi_go_closure_STDCALL: does not use EBP or ESP based frame
ld: warning: could not create compact unwind for _ffi_closure_REGISTER: register saved more than once (might be shrink wrap)
ld: warning: could not create compact unwind for _ffi_closure_STDCALL: does not use EBP or ESP based frame
ld: warning: could not create compact unwind for _ffi_closure_raw_SYSV: does not use EBP or ESP based frame
ld: warning: could not create compact unwind for _ffi_closure_raw_THISCALL: register saved more than once (might be shrink wrap)
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" )
mkdir -p "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-x86_64; (if [ ! -f "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-x86_64/configure ]; then echo "Running autoreconf for libffi"; cd "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi" && /bin/sh /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/autogen.sh > /dev/null; fi); (if [ ! -f "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-x86_64/Makefile ]; then echo "Configuring libffi for x86_64"; cd "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-x86_64 && env CC=" xcrun clang" CFLAGS="-arch x86_64 " LDFLAGS="-arch x86_64" "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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.app/Contents/Developer/usr/bin/make -C "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-x86_64
Running autoreconf for libffi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4
autoreconf: configure.ac: tracing
autoreconf: running: glibtoolize --copy
autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoconf
autoreconf: running: /usr/local/Cellar/autoconf/2.69/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
autoreconf: Leaving directory `.'
Configuring libffi for x86_64
clang: error: unsupported option '-print-multi-os-directory'
clang: error: no input files
/Applications/Xcode.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=/usr/local/bin/ginstall -c' 'INSTALL_DATA=/usr/local/bin/ginstall -c -m 644' 'INSTALL_PROGRAM=/usr/local/bin/ginstall -c' 'INSTALL_SCRIPT=/usr/local/bin/ginstall -c' 'JC1FLAGS=' 'LDFLAGS=-arch x86_64' 'LIBCFLAGS=' 'LIBCFLAGS_FOR_TARGET=' 'MAKE=/Applications/Xcode.app/Contents/Developer/usr/bin/make' 'MAKEINFO=/bin/sh /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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=xcrun clang' 'CXX=g++' 'LD=/Applications/Xcode.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 xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/prep_cif.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/prep_cif.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/types.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/types.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/raw_api.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/raw_api.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/java_raw_api.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/java_raw_api.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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 xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/closures.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/closures.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/x86/ffi64.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/ffi64.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/ffi64.c  -fno-common -DPIC -o src/x86/.libs/ffi64.o
/bin/sh ./libtool    --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64  -c -o src/x86/unix64.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/unix64.S
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64 -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src   -arch x86_64  -Wall -fexceptions -c -o src/x86/ffiw64.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/ffiw64.c
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64 -Wall -fexceptions -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/ffiw64.c  -fno-common -DPIC -o src/x86/.libs/ffiw64.o
/bin/sh ./libtool    --mode=compile xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src  -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64  -c -o src/x86/win64.lo /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src/x86/win64.S
libtool: compile:  xcrun clang -DHAVE_CONFIG_H -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -I. -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/include -Iinclude -I/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi/src -arch x86_64 -c /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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 '^#' /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/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
ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
ld: warning: could not create compact unwind for _ffi_closure_win64_inner: non-standard register 4 being saved in prolog
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 "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi-universal-darwin17"/.libs/libffi_convenience.a \
	    "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-i386/.libs/libffi_convenience.a "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c"/libffi-x86_64/.libs/libffi_convenience.a
rm -f "/Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22/ext/ffi_c/libffi-universal-darwin17"/include/ffi.h
compiling Thread.c
In file included from Thread.c:38:
/usr/include/pthread.h:226:66: error: unknown type name 'size_t'
int pthread_attr_getguardsize(const pthread_attr_t * __restrict, size_t * __restrict);
                                                                 ^
/usr/include/pthread.h:243:43: error: unknown type name 'size_t'
                void * _Nullable * _Nonnull __restrict, size_t * __restrict);
                                                        ^
/usr/include/pthread.h:250:66: error: unknown type name 'size_t'
int pthread_attr_getstacksize(const pthread_attr_t * __restrict, size_t * __restrict);
                                                                 ^
/usr/include/pthread.h:511:1: error: unknown type name 'size_t'
size_t pthread_get_stacksize_np(pthread_t);
^
4 errors generated.
make: *** [Thread.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.22 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/ffi-1.9.22/gem_make.out

@larskanis larskanis changed the title Unable to compile 1.9.x unknown type name 'size_t' on macOS 10.13.3 Feb 23, 2018
larskanis added a commit that referenced this issue Feb 23, 2018
This triggered unnecessary rebuild of configure in darwin multi arch.
It stood out in issue #609 but is probably unrelated to the size_t issue there.

This issue was introduced in commit ad53a3f and was fixed for other
build targets in bfc330a.
@ku
Copy link

ku commented Mar 5, 2018

I'm using macOS 10.13.3 + XCode9.3 beta2 and solved the problem unknown type name 'size_t' by following steps.

  1. follow the official instructions and checkout the code.
  2. add stddef.h to Thread.c
diff --git a/ext/ffi_c/Thread.c b/ext/ffi_c/Thread.c
index 32ae05f..e85ea40 100644
--- a/ext/ffi_c/Thread.c
+++ b/ext/ffi_c/Thread.c
@@ -27,6 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <stddef.h>
 #ifndef _MSC_VER
 #include <stdbool.h>
 #else
  1. rake install

Hope this helps.

@swissspidy
Copy link
Author

I can confirm that running rake install after adding the stddef.h include works.

@wingleungchoi
Copy link

I forced re-install xcode-select to solve the problem.
Hope it help!
ref: https://stackoverflow.com/questions/34617452/how-to-update-xcode-from-command-line

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