This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: testing out incompatible glibc with shared executables...possible? SOLVED


Thanks, that does it.  I had another problem as well (-fPIC and -shared
are wrong to give to gcc when building an executable, that's why I seg
faulted, duh).  For the record, here's the makefile that allows this
all to work:

testglibc = /usr/local/glibc2.2.3
gcc = gcc

.PHONY: all
all: hello

hello: hello.o
 $(gcc) -Wl,--dynamic-linker=$(testglibc)/lib/ld-linux.so.2 \
  -B$(testglibc)/lib/ \
  -Wl,-rpath=$(testglibc)/lib \
  $< -o $@

hello.o: hello.c
 $(gcc) -c -g -O0 -I$(testglibc)/include $< -o $@

	Ken

> -----Original Message-----
> From: libc-alpha-owner@sources.redhat.com
> [mailto:libc-alpha-owner@sources.redhat.com]On Behalf Of Andreas Jaeger
> Sent: Thursday, April 26, 2001 10:49 PM
> To: Ken Whaley
> Cc: libc-alpha@sourceware.cygnus.com
> Subject: Re: testing out incompatible glibc with shared
> executables...possible?
>
>
> "Ken Whaley" <ken@believe.com> writes:
>
> > I'm trying to build and run a dynamically shared executable based on
> > an install of a "test" build of glibc (2.2.1 in this case) on a
> x86-linux
> > system (redhat 6.2) based on glibc 2.1.x.  I'm using gcc
> 2.95.2.  I've read
> > the glibc FAQ, and didn't find any usable solution in there.
> >
> > The static build runs fine, but I can't get the shared version of a
> > hello world app to work (it links w/out error but seg faults when run
> > (the glibc 2.1.x gdb on the system is of no help in debugging it, no
> > surprise there)).
>
> Add -Wl,--dynamic-linker=/usr/local/testglibc2.2.1/lib/ld-linux.so.2
>
> Andreas
> --
>  Andreas Jaeger
>   SuSE Labs aj@suse.de
>    private aj@arthur.inka.de
>     http://www.suse.de/~aj
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]