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: non standard libs


> 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

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