Dt_textrel problem with ruby module

I’m attempting to debug a problem with a ruby module I wrote in C and
am receiving a warning from ld which may be causing the segfault. Does
anyone know what can cause this warning?

…/bin/ld: warning: creating a DT_TEXTREL in object.

Jeff.

“j” == jm [email protected] writes:

j> …/bin/ld: warning: creating a DT_TEXTREL in object.

try to add -fPIC when you compile it.

Guy Decoux

On 27/05/2006, at 7:51 PM, ts wrote:

“j” == jm [email protected] writes:

j> …/bin/ld: warning: creating a DT_TEXTREL in object.

try to add -fPIC when you compile it.

The extconf file already contains directive -fPIC

$ cat extconf.rb
require ‘mkmf’

$CFLAGS=“-O2 -pipe -fPIC”

The resulting make compile is

$ make
i686-pc-linux-gnu-gcc -fPIC -O2 -pipe -fPIC -I.
-I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/1.8/i686-linux -I. -c
Vflow.c
i686-pc-linux-gnu-gcc -shared -L’/usr/lib’ -Wl,-R’/usr/lib’ -o
Vflow.so Vflow.o -Wl,-R -Wl,/usr/lib -L/usr/lib -L. -lruby18 -lft -lz
-ldl -lcrypt -lm -lc
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/…/…/…/…/i686-pc-
linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object.

I’d seen the -FPIC thing in the few web pages I’d manage to find that
mentioned this error. Unfortunately this doesn;t seem to fix the
problem. I’m scratching my head over this one. gcc, glibc and ld have
all been upgraded to the latest.

gcc version 3.3.5-20050130
GNU ld version 2.16.1

This is on a gentoo box. I’ve also got access to a fedora core 5 box
and the next chance I get I’ll be testing there to see if it’s a
platform related problem.

If anyone has any advise please speak up. Anyway, thanks for the
suggestion Guy.

Jeff.

On 28/05/2006, at 2:26 PM, jm wrote:

platform related problem.
Got around to testing this on a Fedora Core 5 box today and there
doesn’t seem to be a problem. This seems to imply that the problem is
platform specific. That gentoo (at least in the version I’m running) is
only platform that is affected. As I’ve got no idea what is causing
this I’m simple going to avoid it by not running this code on that box.

This reply is more for future reference for anyone else that may
stubble across this problem than anything else.

Jeff.