Skip to content

native extension doesn't compile on Fedora Core 11, 64bit #1

Description

@gregretkowski

When trying to install the gem on FC11/64 I get the following error while building the native extensions:

    gcc -shared -o zookeeper_c.so zookeeper_c.o -L/usr/lib/ruby/gems/1.8/gems/zookeeper-0.2.2/ext/lib -L/usr/lib/ruby/gems/1.8/gems/zookeeper-0.2.2/ext/lib -L.  -rdynamic -Wl,-export-dynamic -L.  -rdynamic -Wl,-export-dynamic    -lruby  -lpthread -lrt -ldl -lcrypt -lm   -lc -lzookeeper_mt_gem
/usr/bin/ld: /usr/lib/ruby/gems/1.8/gems/zookeeper-0.2.2/ext/lib/libzookeeper_mt_gem.a(libzkmt_la-zk_log.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/ruby/gems/1.8/gems/zookeeper-0.2.2/ext/lib/libzookeeper_mt_gem.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

Applying this change to extconf.rb allowed it to build:

    --- ext/extconf.rb.orig 2010-07-01 15:25:56.460951524 -0700
    +++ ext/extconf.rb  2010-07-01 16:38:26.343882722 -0700
    @@ -33,7 +33,7 @@
         raise "'#{cmd}' failed" unless system(cmd)
     
         Dir.chdir(BUNDLE_PATH) do        
    -      puts(cmd = "env CFLAGS='-fPIC #{$CFLAGS}' LDFLAGS='-fPIC #{$LDFLAGS}' ./configure --prefix=#{HERE} --without-cppunit --disable-shared --disable-dependency-tracking #{$EXTRA_CONF} 2>&1")
    +      puts(cmd = "env CFLAGS='-fPIC #{$CFLAGS}' LDFLAGS='-fPIC #{$LDFLAGS}' ./configure --prefix=#{HERE} --without-cppunit --disable-dependency-tracking #{$EXTRA_CONF} 2>&1")
       raise "'#{cmd}' failed" unless system(cmd)
       puts(cmd = "make CXXFLAGS='#{$CXXFLAGS}' || true 2>&1")
       raise "'#{cmd}' failed" unless system(cmd)

... However now the unit tests fail with:

let's try using a lock
/usr/lib/ruby/gems/1.8/gems/zookeeper-0.2.2/test/../lib/zookeeper.rb:46:in `try_acquire': undefined method `ls' for # (NoMethodError)
    from ./test/test_basic.rb:55

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions