This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: non standard libs
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: non standard libs
- From: Nicholas Mc Guire <der dot herr at hofr dot at>
- Date: Mon, 25 Dec 2000 03:53:45 -0700 (MST)
- CC: Nicholas Mc Guire <der dot herr at www dot hofr dot at>, gcc-help at gcc dot gnu dot org
> On Dec 24, 2000, Nicholas Mc Guire <der.herr@hofr.at> wrote:
>
> > which compiles ok , but does not use the glibc-2.0.7 libs but the normal system
> > libs in /lib (blibc-2.1.3) and thus segfaults on the old system.
>
> > could someone point out to me whats wrong with the compiler flags I was using ?
>
> Nothing's wrong with your flags. You just failed to tell the linker
> to add a note in the program that, at run-time, it should look for
> libc in this other directory. Set LD_RUN_PATH or use -rpath to
> accomplish that.
>
Hi !
I guess I'm seeing a differnet problem then . It looks like
I need to tell gcc what the default libs are. from the info page
it loooks like libgcc.a is required to fix up a few things so
this also is now copied into the glibc-2.0.7 directory and now used
gcc -nostdlib -nodefaultlibs -L../../glibc-2.0.7/ -lc -lgcc -s -o hello hello.c
which works fine if I DON't use
return 0;
at the end of the program but rather put in
exit(0);
if I use return it will run and then segfault at me . So I guess its not enough
to have -lc (for libc) and -lgcc (for libgcc) in the compiler flags .
any hint ?
thx !
hofrat