Path: utzoo!utgpu!watserv1!watmath!att!bellcore!rutgers!cs.utexas.edu!ut-emx!infotel!smunews!ti-csl!osage!west From: west@osage.csc.ti.com (Roger West) Newsgroups: comp.unix.i386 Subject: mkshlib on SCO Unix 3.2, "#objects noload" not working? Keywords: mkshlib Message-ID: <127832@ti-csl.csc.ti.com> Date: 13 Jun 90 17:26:12 GMT Sender: news@ti-csl.csc.ti.com Organization: TI Computer Science Center, Dallas Lines: 99 I have run into a problem trying to build shared libraries on SCO Unix 3.2. The "#objects noload" directive in the library specification file does not seem to be working correctly. The following source gives an example. I am trying to build a simple shared library libf_s containing a single function funct(). This function calls printf() from the standard c shared library /shlib/libc_s... -------------------------Makefile------------------------------------ CFLAGS = -g # -DIMPORT a.out: main.o libf_s.a $(CC) -o $@ main.o -L. -lf_s -lc_s libf_s.a: funct.o rm -f libf_s.a libf_s mkshlib -s libf.sl -t libf_s -h libf_s.a -------------------------libf.sl------------------------------------- #target libf_s #address .text 0x80600000 #address .data 0x80a00000 #branch funct 1 #objects funct.o #objects noload -lc_s #init funct.o _libf__iob _iob _libf_printf printf -------------------------import.h------------------------------------ #if !defined(import_h) && defined(IMPORT) #define import_h #define printf (* _libf_printf ) #define _iob (* _libf__iob ) #endif -------------------------funct.c------------------------------------- #include "import.h" #include #ifdef IMPORT int printf(const char *format, ...) = 0; FILE _iob[_NFILE] = 0; #endif void funct( msg ) char* msg; { printf( "%s\n", msg ); } -------------------------main.c-------------------------------------- #include "import.h" #include extern void funct(); char string[] = "Don't call me DUDE!"; int main() { int i, k; for( i=0; i<200; ++i ) { for( k=0; k