[#7708] Bug in libsnmp-ruby1.8 — Hadmut Danisch <hadmut@...>

Hi,

8 messages 2006/04/11
[#7709] Re: Bug in libsnmp-ruby1.8 — Eric Hodel <drbrain@...7.net> 2006/04/11

On Apr 11, 2006, at 6:23 AM, Hadmut Danisch wrote:

[#7770] Re: possible defect in array.c — "Brown, Warren" <warrenbrown@...>

> rb_range_beg_len (in range.c) does set beg and len.

13 messages 2006/04/26
[#7771] Re: possible defect in array.c — "Pat Eyler" <rubypate@...> 2006/04/26

On 4/26/06, Brown, Warren <warrenbrown@aquire.com> wrote:

[PATCH] use -shared to gcc for shared link Solaris

From: "Andrew Morrow" <andrew.c.morrow@...>
Date: 2006-04-27 13:34:55 UTC
List: ruby-core #7791
While trying to build a 64 bit ruby from cvs on Solaris 10 x86 with a
recent gcc-4.2 snapshot (configured to use the solaris linker) the
build fails:

making ruby
gmake[1]: Entering directory `/home/acm/ruby/build/targets'
/usr/local/gcc-4.2-20060415/bin/gcc -std=gnu99 -m64  -fPIC
-DRUBY_EXPORT  -std=gnu99 -m64 -R/home/acm/ruby/build/install/lib -L.
 main.o  -lruby -lrt -lpthread -lsocket -ldl -lm   -o ruby
gmake[1]: Leaving directory `/home/acm/ruby/build/targets'
ld.so.1: ruby: fatal: relocation error: R_AMD64_PC32: file
./libruby.so.1: symbol main: value 0x280011941c0 does not fit

This appears to be because the shared link step for libruby was
driven with -Wl,-G instead of -shared:

/usr/local/gcc-4.2-20060415/bin/gcc -Wl,-G -std=gnu99 -m64
-Wl,-h,libruby.so.1 <list-of-files> -lrt -lpthread -lsocket -ldl -lm
 -o libruby.so.1

gcc wants to know that this is a shared link, not just the linker, and
changing the shared link command LDSHARED from '$CC -Wl,-G' to '$CC
-shared' in configure.in fixes the problem.

The attached patch unconditionally sets LDSHARED to '$CC -shared' when
using gcc on Solaris, instead of only using -shared when GNU ld is
detected.

Thanks,
Andrew

Attachments (1)

configure.in.patch (635 Bytes, text/x-diff)
Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.299
diff -u -r1.299 configure.in
--- configure.in	2 Feb 2006 05:51:44 -0000	1.299
+++ configure.in	26 Apr 2006 13:32:21 -0000
@@ -888,10 +888,9 @@
 			: ${LIBPATHENV=SHLIB_PATH}
 			rb_cv_dlopen=yes;;
 	solaris*) 	if test "$GCC" = yes; then
-			   : ${LDSHARED='$(CC) -Wl,-G'}
+			   : ${LDSHARED='$(CC) -shared'}
 			   if test "$rb_cv_prog_gnu_ld" = yes; then
 	 		       LDFLAGS="$LDFLAGS -Wl,-E"
-			       LDSHARED="$LDSHARED -shared"
 			   fi
 			else
 			   : ${LDSHARED='ld -G'}


In This Thread

Prev Next