[comp.unix.microport] does gcc work with -lc_s?

vjs@calcite.UUCP (Vernon Schryver) (11/02/88)

My first attempt to use 3.0e's gcc (Greenhill's, not gnu) is with a
simple terminal emulator using curses.  Compiling with 
	gcc {,-g,-ga} {-OLM,} foo.c -lcurses -lc_s -o foo
produces a bad program.  After some trivial ioctl(TCSETA)'s, it calls
initscr(3X), which seems to call an internal routine (or something
sdb can't name), and then suffers a "Segmentation Violation".  Compiling
without '-lc_s' or with 'cc' instead of 'gcc' produces something which
works fine.  (Of course, the code is quite portable and passes lint.)

Does the gcc in Microport 3.0e understand shared libraries?

Vernon Schryver
vjs@calcite.uucp   ...!sgi!calcite!vjs

zeeff@b-tech.ann-arbor.mi.us (Jon Zeeff) (11/03/88)

In article <30@calcite.UUCP> vjs@calcite.UUCP (Vernon Schryver) writes:
>
>Does the gcc in Microport 3.0e understand shared libraries?
>

Only if you change things around.  Try this:

/*
   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 /bin/ld /bin/ld.real
   6) mv this program (ld) to /bin/ld
   7) cp /bin/gcc to /usr/gcc/cc
   8) use -lc_s on your cc lines. 
   9) set your path to use /usr/gcc before /bin

    Anything you compile should now used shared libraries

*/

#include <stdio.h>

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.real",new_argv);

return 1;

}

-- 
Jon Zeeff      			Ann Arbor, MI
umix!b-tech!zeeff  		zeeff@b-tech.ann-arbor.mi.us

ken@uport.UUCP (Ken Chapin) (11/04/88)

In article <30@calcite.UUCP> vjs@calcite.UUCP (Vernon Schryver) writes:
!>	gcc {,-g,-ga} {-OLM,} foo.c -lcurses -lc_s -o foo
!>produces a bad program.  After some trivial ioctl(TCSETA)'s, it calls
!>initscr(3X), which seems to call an internal routine (or something
!>sdb can't name), and then suffers a "Segmentation Violation".  Compiling
!>without '-lc_s' or with 'cc' instead of 'gcc' produces something which
!>works fine.  (Of course, the code is quite portable and passes lint.)
!>
!>Does the gcc in Microport 3.0e understand shared libraries?


We think that Gcc doesn't know about shared libraries and are working on 
it with Green Hills.