I've just tried setting up a new development machine and I'm stuck installing 
the ffi
gem for ruby.

According to a bug I found (can't find it now I'm afraid) the gentoo devs do not
support installing gems via the gem command and directed the user to use the
dev-ruby/ffi package. Unfortnately, that package is absolutely ancient and 
unusable.

Anyway, I've got the ffi library install from portage, but when I try to `gem 
install
ffi`, I get the output seen in the attachement.

The same gem installs just fine on an ubuntu box, but...well it's ubuntu and I 
don't
want to use that (besides it's just a VM).

I'd really like to get this fixed so I can get started on a new project.

Grateful for any help

Matt
ERROR:  Error installing ffi:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby18 extconf.rb
checking for ffi_call() in -lffi... yes
checking for ffi_prep_closure()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
checking for rb_thread_blocking_region()... no
checking for ruby_thread_has_gvl_p()... no
checking for ruby_native_thread_p()... no
checking for rb_thread_call_with_gvl()... no
creating extconf.h
creating Makefile

make
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c DynamicLibrary.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Buffer.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c MemoryPointer.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c StructByReference.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c StructByValue.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c StructLayout.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Thread.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c DataConverter.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Types.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c AbstractMemory.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Platform.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c ArrayType.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c ffi.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c LastError.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c FunctionInfo.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c MappedType.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Variadic.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Function.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Call.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Type.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Pointer.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c MethodHandle.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c ClosurePool.c
i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. 
-DRUBY_EXTCONF_H=\"extconf.h\"  -D_FILE_OFFSET_BITS=64  -fPIC -O2 -march=i686 
-pipe -fno-strict-aliasing  -fPIC  -I/usr/lib/libffi-3.0.9/include   
-Wno-declaration-after-statement   -c Struct.c
i686-pc-linux-gnu-gcc -shared -o ffi_c.so DynamicLibrary.o Buffer.o 
MemoryPointer.o StructByReference.o StructByValue.o StructLayout.o Thread.o 
DataConverter.o Types.o AbstractMemory.o Platform.o ArrayType.o ffi.o 
LastError.o FunctionInfo.o MappedType.o Variadic.o Function.o Call.o Type.o 
Pointer.o MethodHandle.o ClosurePool.o Struct.o -L. -L/usr/lib -Wl,-R/usr/lib 
-L. -Wl,-O1 -Wl,--as-needed -rdynamic -Wl,-export-dynamic -Wl,--no-undefined    
 -Wl,-R -Wl,/usr/lib -L/usr/lib -lruby18 -lffi  -lffi   -lrt -ldl -lcrypt -lm   
-lc
Thread.o: In function `rbffi_thread_blocking_region':
Thread.c:(.text+0x115): undefined reference to `pthread_create'
Thread.c:(.text+0x159): undefined reference to `pthread_join'
Thread.o: In function `cleanup_blocking_thread':
Thread.c:(.text+0x2f6): undefined reference to `pthread_kill'
Thread.o: In function `rbffi_blocking_thread':
Thread.c:(.text+0x348): undefined reference to `pthread_testcancel'
collect2: ld returned 1 exit status
make: *** [ffi_c.so] Error 1


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ffi-1.0.7 for 
inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/ffi-1.0.7/ext/ffi_c/gem_make.out
Building native extensions.  This could take a while...

Attachment: pgpppCBOw4Yyj.pgp
Description: PGP signature

Reply via email to