This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: Backwards compatibility


Andreas Jaeger wrote:
> 
> >>>>> Jonathan Larmour writes:
> 
>  > One of the FAQs that isn't actually in the glibc FAQ is what to do if you
>  > have a glibc2 system and want to create binaries usable on glibc1. I
>  > certainly don't know the answer :-).
> 
> See FAQ 4.4 and check the glibc2 HowTo and Frodo's pages for AFAIK
> detailed information.

I had already seen those, but they only talked about libc5<->glibc stuff,
rather than glibc1<->glibc2. To give you an idea of the issues I faced, the
following works:

egcs -nostartfiles -nostdlib -nostdinc -I/tmp/glibc/usr/include/
-I/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include -L/tmp/glibc/lib
/tmp/glibc/usr/lib/crt1.o /tmp/glibc/usr/lib/crti.o
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/crtbegin.o -o helloworld
helloworld.c  -lgcc /tmp/glibc/lib/libc.so.6 -lgcc
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/crtend.o
/tmp/glibc/usr/lib/crtn.o

whereas the following doesn't:

egcs -nostartfiles -nostdlib -nostdinc -I/tmp/glibc/usr/include/
-I/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include -L/tmp/glibc/lib
/tmp/glibc/usr/lib/crt1.o /tmp/glibc/usr/lib/crti.o
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/crtbegin.o -o helloworld
helloworld.c  -lgcc -lc -lgcc
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/crtend.o
/tmp/glibc/usr/lib/crtn.o/lib/libc.so.6: undefined reference to
`_r_debug@@GLIBC_2.0'
/lib/libc.so.6: undefined reference to `_dl_unload_cache@@GLIBC_2.1'
/lib/libc.so.6: undefined reference to `_dl_init_next@@GLIBC_2.0'
[snip]

The only difference being the replacement of -lc with an explicit
/tmp/glibc/lib/libc.so.6 (in this example). This all seems very different to
the processes described on HowTos. And I'm sure the type of thing I did
above is not the "right" way to do it - e.g if I now add "-lresolv" it
similarly tries to link in the one from /usr/lib rather than /tmp/glibc/lib.

So what I was hoping is that someone knows a more appropriate "cookbook"
method to put in the FAQ.

Jifl
-- 
Cygnus Solutions, 35 Cambridge Place, Cambridge, UK.  Tel: +44 (1223) 728762
"I used to have an open mind but || Get yer free open source RTOS's here...
 my brains kept falling out."    || http://sourceware.cygnus.com/ecos
Help fight spam! http://spam.abuse.net/  These opinions are all my own fault

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