This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


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

RE: using different lib version


>-----Original Message-----
>From: Der Herr Hofrat [mailto:der.herr@hofr.at]
>Sent: 17 April 2001 14:06

> I already once posted the question of how to compile glibc 2.0.7 apps on 
> a box running 2.1.X . What I was told is to use -nostdlib and pass the 
> path to glibc-2.0.7 with -L and then list all libs explicidly (-lc etc.)
> this works for many apps, but always generates errors durinc copilation
> and in some cases results in apps not working corectly .

>the apps compiled directly on the glibc 2.0.7 box all work 
>fine , the ones compiles on the glibc 2.1.3 kind of work, but 
>some core dump on exit , some simply don't work at all.

>on the glibc 2.1.3 box:
>
>--snip of Makefile --
>reserve: reserve.c reserve.h
>	$(CC) -g -ggdb -O2 -Wall -nostdlib ${INCLUDE} 
>-L../../glibc-2.0.7/lib/ -L../../glibc-2.0.7/gcc/ -lc 
>reserve.c -o reserve1
>
>
>make reserve output
>
>gcc -g -ggdb -O2 -Wall -nostdlib 
>-I/home/rtl3.0/minirtl-3.0/linux/include 
>-I/home/rtl3.0/minirtl-3.0/include 
>-I/home/rtl3.0/minirtl-3.0/include/compat  
>-L../../glibc-2.0.7/lib/ -lc reserve.c -o reserve1
>/usr/bin/ld: warning: cannot find entry symbol _start; 
>defaulting to 08048960

  The _start symbol should be defined in the crt?.o startup file.  Try
adding that as the first object file to your link command.  In order to
see exactly what startup file to use, remove -nostdlib and add -v to the
command line above and see what crt? files gcc puts in the link command,
and what order it places them (order IS significant).  Also, you should try
using "-lgcc -lc -lgcc" instead of just -lc; gcc does something along those
lines internally, as you can see from this:

>here is what the output looks like on a glibc 2.0.7 box
     [snip]
> /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/collect2 -m elf_i386 
>-dynamic-linker /lib/ld-linux.so.2 -o reserve1 /usr/lib/crt1.o 
>/usr/lib/crti.o 
>/usr/lib/gcc-lib/i486-linux/egcs-2.91.66/crtbegin.o 
>-L/usr/lib/gcc-lib/i486-linux/egcs-2.91.66 
>-L/usr/i486-linux/lib /tmp/ccJK5SuT.o -lgcc -warn-common -lc 
>-lgcc /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/crtend.o /usr/lib/crtn.o

>Can anybody point to a doc describing a clean multilib setup 
>?? , that is actually multiple gcc versions AND multiple libs 
>on one box.

  Another thing that might cause problems is shared libraries; you may
need different versions compiled against each of the libc versions.  Apart
from that, I'm afraid I can't offer any deeper help; I don't know of
any docs myself, and what you are trying to do is *very* tricky indeed;
the choice of C library permeates through to an awful lot of other parts
of the build environment / toolchain.

      DaveK
-- 
"screams erupted at a Seattle hotel where Microsoft founder Bill Gates was
addressing an education and technology conference. He was whisked away as
his audience bolted for the exits. Some audience members were knocked down
by others trying to get out."
       -- CNN 2/28/01


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


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