Forum: Ruby dt_textrel problem with ruby module

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
28bb07a60e74c2467cc944364fe4075a?d=identicon&s=25 jm (Guest)
on 2006-05-27 06:18
(Received via mailing list)
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.
956f185be9eac1760a2a54e287c4c844?d=identicon&s=25 ts (Guest)
on 2006-05-27 11:53
(Received via mailing list)
>>>>> "j" == jm  <jeffm@ghostgun.com> writes:

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

 try to add -fPIC when you compile it.


Guy Decoux
28bb07a60e74c2467cc944364fe4075a?d=identicon&s=25 jm (Guest)
on 2006-05-28 06:28
(Received via mailing list)
On 27/05/2006, at 7:51 PM, ts wrote:

>>>>>> "j" == jm  <jeffm@ghostgun.com> 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.
28bb07a60e74c2467cc944364fe4075a?d=identicon&s=25 jm (Guest)
on 2006-06-03 05:25
(Received via mailing list)
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.
This topic is locked and can not be replied to.