Path: utzoo!attcan!uunet!husc6!mailrus!b-tech!zeeff
From: zeeff@b-tech.UUCP (Jon Zeeff)
Newsgroups: comp.unix.microport
Subject: Re: shared libraries with gcc (Green Hills)
Keywords: gcc shared 386
Message-ID: <4768@b-tech.UUCP>
Date: 18 Sep 88 21:56:41 GMT
References: <4766@b-tech.UUCP>
Reply-To: zeeff@b-tech.UUCP (Jon Zeeff)
Organization: Branch Technology Ann Arbor, MI
Lines: 61

In article <4766@b-tech.UUCP> zeeff@b-tech.UUCP (Jon Zeeff) writes:
>To take advantage of shared libraries, I normally have /lib/libc.a be 
>the shared version.  With the Green Hills gcc, this doesn't work 

bigtex!james (James Van Artsdalen) writes:
>
>Currently GNU C is in very good shape, with no bugs in 1.28 that I 
>know of (though I'm sure they're there - I just haven't found any).  
>
>Ah, the advantages of having source.  GNU C didn't handle shared libraries
>right at first either.  So I fixed it.  :-)
>
>It's always possible Greenhills is using crt0.o instead of crt1.o and crtn.o.
>

James has it right - if you use this program, things will work.  Copying 
libc_s.a on top of libc.a may not be a good idea - libc.a includes a few
routines that libc_s.a doesn't.


/*
   This allows gcc to be used with shared libraries 

   To install,

   1) compile this program creating ld
   3) cp /usr/ghs/BIN/386/lib/crt0.o to crt0.o.bak
   4) cp /lib/crt1.o to /usr/ghs/BIN/386/lib/crt0.o
   5) mv this program (ld) to /usr/gcc
   6) mv /bin/gcc to /usr/gcc/cc
   7) use -lc_s on your cc lines. 
   8) set your path to use /usr/gcc before /bin

    Anything you compile should now used shared libraries

*/

#include 

main(argc,argv)
int argc;
char **argv;
{
int i;
char *new_argv[500];

for (i = 0; i < argc; ++i) {
   new_argv[i] = argv[i];
}

new_argv[i++] = "/lib/crtn.o";
new_argv[i] = NULL;

execv("/bin/ld",new_argv);

return 1;

}
-- 
Jon Zeeff      			Branch Technology,
umix!b-tech!zeeff  		zeeff@b-tech.ann-arbor.mi.us