Subject: Re: [ruby-ffi] Re: Arch build error due to ruby trunk compile options |
From: Jon |
Date: 8/22/12 3:03 PM |
To: ruby-ffi@googlegroups.com |
eek => MethodHandle.c:340:5: error: 'ffiStatus' undeclared (first use in this function)
[jon@archee ~]$ gem i ffi --pre --user-install
Fetching: ffi-1.2.0.dev3.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby 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()... yes
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
checking for ffi_prep_cif_var()... yes
creating extconf.h
creating Makefile
make
compiling Pointer.c
compiling Platform.c
compiling Types.c
compiling MappedType.c
compiling Buffer.c
compiling Call.c
Call.c: In function 'do_blocking_call':
Call.c:281:5: warning: 'rb_thread_blocking_region' is deprecated (declared at /usr/local/include/ruby-2.0.0/ruby/intern.h:823) [-Wdeprecated-declarations]
compiling LongDouble.c
compiling ClosurePool.c
compiling StructByReference.c
compiling ArrayType.c
compiling Variadic.c
compiling MemoryPointer.c
compiling Struct.c
compiling AbstractMemory.c
compiling MethodHandle.c
MethodHandle.c: In function 'rbffi_MethodHandle_Init':
MethodHandle.c:340:5: error: 'ffiStatus' undeclared (first use in this function)
MethodHandle.c:340:5: note: each undeclared identifier is reported only once for each function it appears in
make: *** [MethodHandle.o] Error 1
Can you try 1.2.0.dev3 ? It should eliminate the warnflags MRI puts in there. On Friday, 10 August 2012 06:16:10 UTC+10, Jon wrote:With ruby trunk the last few ffi gem releases have failed to build on my Arch 3.4.7 32bit dev system with gcc 4.7.1 (20120721). Given the details and workaround info below, the root cause appears to be recent `configure.in` ansi compliance mods: https://github.com/ruby/ruby/blob/trunk/configure.in#L619-635 Looks like others are running into as well https://github.com/flori/json/issues/142 While I've only briefly investigated, I don't have time to fully look into it. But I don't want to forget about it. *** GEM UPDATE FAILURE *** [jon@archee ~]$ gem update ffi --user-install Updating installed gems Updating ffi Fetching: ffi-1.1.5.gem (100%) Building native extensions. This could take a while... ERROR: Error installing ffi: ERROR: Failed to build gem native extension. /usr/local/bin/ruby 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()... yes checking for ruby_native_thread_p()... yes checking for rb_thread_call_with_gvl()... yes creating extconf.h creating Makefile make compiling Pointer.c In file included from Pointer.c:34:0: rbffi_endian.h:46:4: error: #error "Cannot determine the endian-ness of this platform" Pointer.c: In function 'ptr_order': Pointer.c:339:59: error: 'BYTE_ORDER' undeclared (first use in this function) Pointer.c:339:59: note: each undeclared identifier is reported only once for each function it appears in Pointer.c:339:72: error: 'BIG_ENDIAN' undeclared (first use in this function) Pointer.c:351:25: error: 'LITTLE_ENDIAN' undeclared (first use in this function) Pointer.c:368:1: warning: control reaches end of non-void function [-Wreturn-type] make: *** [Pointer.o] Error 1 Gem files will remain installed in /home/jon/.gem/ruby/2.0.0/gems/ffi-1.1.5 for inspection. Results logged to /home/jon/.gem/ruby/2.0.0/gems/ffi-1.1.5/ext/ffi_c/gem_make.out Nothing to update *** WORKAROUND *** gem update ffi --user-install -- --with-cflags='--std=gnu99' *** SYSTEM INFO *** # rbconfig.rb contents: CONFIG["warnflags"] = "-Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration -ansi -std=iso9899:199409" CONFIG["WERRORFLAG"] = "-Werror" [jon@archee ~]$ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.8.24 - RUBY VERSION: 2.0.0 (2012-08-10 patchlevel -1) [i686-linux] - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.0.0 - RUBY EXECUTABLE: /usr/local/bin/ruby - EXECUTABLE DIRECTORY: /usr/local/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /usr/local/lib/ruby/gems/2.0.0 - /home/jon/.gem/ruby/2.0.0 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - :sources => ["http://rubygems.org"] - "gem" => "--no-ri --no-rdoc" - REMOTE SOURCES: - http://rubygems.org Jon --- Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat. http://thecodeshop.github.com | http://jonforums.github.com/ twitter: @jonforums
Jon --- Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat. http://thecodeshop.github.com | http://jonforums.github.com/ twitter: @jonforums