Hi,

Does anybody have experience compiling the Ruby libv8 JavaScript
engine  (https://github.com/cowboyd/libv8) on OpenBSD 5.5?

It says it can't find a supported compiler despite repeated attempts
to point it to `gcc` or `g++` 4.8.2 or 4.6.4
(https://github.com/cowboyd/libv8#bring-your-own-compiler), either via
the environment variable below or through symlinking:

% export cxx=/usr/local/bin/eg++

% /usr/local/bin/eg++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/bin/eg++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i386-unknown-openbsd5.5/4.8.2/lto-wrapper
Target: i386-unknown-openbsd5.5
Configured with: /usr/obj/gcc-4.8.2/gcc-4.8.2/configure
--enable-libgcj --without-jar --verbose
--program-transform-name='s,^,e,' --disable-nls --disable-checking
--with-system-zlib --disable-libmudflap --disable-libgomp
--disable-tls --with-as=/usr/bin/as --with-ld=/usr/bin/ld
--with-gnu-ld --with-gnu-as --enable-threads=posix --enable-wchar_t
--with-gmp=/usr/local --enable-languages=c,c++,fortran,objc,java,ada
--disable-libstdcxx-pch --enable-cpp --enable-shared
--prefix=/usr/local --sysconfdir=/etc --mandir=/usr/local/man
--infodir=/usr/local/info --localstatedir=/var --disable-silent-rules
Thread model: posix
gcc version 4.8.2 (GCC)

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

    /home/dev/.rubies/ruby-2.1.1/bin/ruby extconf.rb
creating Makefile
Compiling v8 for ia32
Using python 2.7.6
Using compiler: /usr/local/bin/eg++ (GCC version 5.5)
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
In file included from ../src/mark-compact.h:32:0,
                 from ../src/incremental-marking.h:33,
                 from ../src/heap.h:35,
                 from ../src/elements.h:33,
                 from ../src/objects-inl.h:38,
                 from ../src/v8.h:60,
                 from ../src/accessors.cc:28:
../src/spaces.h: In member function 'bool
v8::internal::MemoryChunk::TryParallelSweeping()':
../src/spaces.h:467:62: error: invalid conversion from 'intptr_t* {aka
long int*}' to 'volatile Atomic32* {aka volatile int*}' [-fpermissive]
     return NoBarrier_CompareAndSwap(&parallel_sweeping_, 1, 0) == 1;
                                                              ^
In file included from ../src/v8.h:62:0,
                 from ../src/accessors.cc:28:
../src/heap-inl.h: In member function 'intptr_t
v8::internal::Heap::AdjustAmountOfExternalAllocatedMemory(intptr_t)':
../src/heap-inl.h:516:49: warning: format '%d' expects argument of
type 'int', but argument 2 has type 'long int' [-Wformat=]
            reinterpret_cast(isolate()));
                                                 ^
../src/heap-inl.h:516:49: warning: format '%d' expects argument of
type 'int', but argument 3 has type 'long int' [-Wformat=]
../src/heap-inl.h:516:49: warning: format '%x' expects argument of
type 'unsigned int', but argument 4 has type 'intptr_t {aka long int}'
[-Wformat=]
gmake[1]: ***
[/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/v8_base/src/accessors.o]
Error 1
gmake: *** [ia32.release] Error 2
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/ext/libv8/location.rb:36:in
`block in verify_installation!': libv8 did not install properly,
expected binary v8 archive
'/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a'to
exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
        from
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/ext/libv8/location.rb:35:in
`each'
        from
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/ext/libv8/location.rb:35:in
`verify_installation!'
        from
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/ext/libv8/location.rb:26:in
`install!'
        from extconf.rb:7:in `'
GYP_GENERATORS=make 
build/gyp/gyp --generator-output="out" build/all.gyp 
              -Ibuild/standalone.gypi --depth=. 
              -Dv8_target_arch=ia32 
              -S.ia32  -Dv8_enable_backtrace=1
-Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2
-Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3 -Dwerror=''
gmake[1]: Entering directory
'/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out'
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/allocation.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/bignum.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/bignum-dtoa.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/cached-powers.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/conversions.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/diy-fp.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/dtoa.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/fast-dtoa.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/fixed-dtoa.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/once.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/preparse-data.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/preparser.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/preparser-api.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/scanner.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/strtod.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/token.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/unicode.o
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/utils.o
  AR(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/tools/gyp/libpreparser_lib.a
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser/preparser/preparser-process.o
  LINK(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/preparser
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/v8_base/src/accessors.o
tools/gyp/v8_base.target.ia32.mk:222: recipe for target
'/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/v8_base/src/accessors.o'
failed
gmake[1]: Leaving directory
'/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out'
Makefile:195: recipe for target 'ia32.release' failed

extconf failed, exit code 1

Gem files will remain installed in
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7 for inspection.
Results logged to
/home/dev/.gem/ruby/2.1.1/extensions/x86-openbsd-5.5/2.1.0-static/libv8-3.16.14.7/gem_make.out
OpenBSD's default compiler is 4.2.1 and produces the following:

# gcc -v
Reading specs from
/usr/lib/gcc-lib/i386-unknown-openbsd5.5/4.2.1/specs
Target: i386-unknown-openbsd5.5
Configured with: OpenBSD/i386 system compiler
Thread model: posix
gcc version 4.2.1 20070719

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

    /home/dev/.rubies/ruby-2.1.1/bin/ruby extconf.rb
creating Makefile
Compiling v8 for ia32
Using python 2.7.6
Using compiler: /usr/bin/c++ (GCC version 5.5)
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
cc1plus: error: unrecognized command line option
"-Wno-unused-local-typedefs"
gmake[1]: ***
[/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/allocation.o]
Error 1
gmake: *** [ia32.release] Error 2
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/ext/libv8/location.rb:36:in
`block in verify_installation!': libv8 did not install properly,
expected binary v8 archive
'/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a'to
exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
        from
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/ext/libv8/location.rb:35:in
`each'
        from
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/ext/libv8/location.rb:35:in
`verify_installation!'
        from
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/ext/libv8/location.rb:26:in
`install!'
        from extconf.rb:7:in `'
GYP_GENERATORS=make 
build/gyp/gyp --generator-output="out" build/all.gyp 
              -Ibuild/standalone.gypi --depth=. 
              -Dv8_target_arch=ia32 
              -S.ia32  -Dv8_enable_backtrace=1
-Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2
-Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3 -Dwerror=''
gmake[1]: Entering directory
'/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out'
  CXX(target)
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/allocation.o
tools/gyp/preparser_lib.target.ia32.mk:111: recipe for target
'/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out/ia32.release/obj.target/preparser_lib/src/allocation.o'
failed
gmake[1]: Leaving directory
'/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7/vendor/v8/out'
Makefile:195: recipe for target 'ia32.release' failed

extconf failed, exit code 1

Gem files will remain installed in
/home/dev/.gem/ruby/2.1.1/gems/libv8-3.16.14.7 for inspection.
Results logged to
/home/dev/.gem/ruby/2.1.1/extensions/x86-openbsd-5.5/2.1.0-static/libv8-3.16.14.7/gem_make.out
Thanks!

O.D.

Reply via email to