glenn@cs.utexas.edu (Glenn G. Lai) (02/26/91)
I have a question about compiling X clients for X386 1.1 on ESIX 3.2.D using gcc-1.39. When I was generating the executable, the linker complained that certain routines "first used in /usr/lib/X11/libX11.a" weren't defined, some of which were "socket,""connect," and "gethostbyname." I understand that such routines are in "libnet.a," but when I added the "-lnet" switch, a new set of undefined symbols were generated. What's the correct way to go about this? One other thing: How do I use shared libraries to reduce code size? Any help is appreciated. Glenn glenn@cs.utexas.edu
pozar@kumr.lns.com (Tim Pozar) (03/02/91)
In article <18136@cs.utexas.edu> glenn@cs.utexas.edu (Glenn G. Lai) writes: >I have a question about compiling X clients for X386 1.1 on ESIX 3.2.D using >gcc-1.39. When I was generating the executable, the linker complained that >certain routines "first used in /usr/lib/X11/libX11.a" weren't defined, some >of which were "socket,""connect," and "gethostbyname." I understand that such >routines are in "libnet.a," but when I added the "-lnet" switch, a new set of >undefined symbols were generated. What's the correct way to go about this? I talked to Jeff at Esix and he told me to line these libs: -lX11 -lnet -lnsl_s -lc -lbsd Tim -- pozar@lns.com Fido: 1:125/555 PaBell: 415-788-3904 USNail: KKSF-FM / 77 Maiden Lane / San Francisco CA 94108
fangchin@leland.Stanford.EDU (Chin Fang) (03/03/91)
In article <1991Mar1.173835.623@kumr.lns.com> pozar@kumr.lns.com (Tim Pozar) writes: >In article <18136@cs.utexas.edu> glenn@cs.utexas.edu (Glenn G. Lai) writes: >>I have a question about compiling X clients for X386 1.1 on ESIX 3.2.D using >>gcc-1.39. When I was generating the executable, the linker complained that >>certain routines "first used in /usr/lib/X11/libX11.a" weren't defined, some >>of which were "socket,""connect," and "gethostbyname." I understand that such >>routines are in "libnet.a," but when I added the "-lnet" switch, a new set of >>undefined symbols were generated. What's the correct way to go about this? > > I talked to Jeff at Esix and he told me to line these libs: > > -lX11 -lnet -lnsl_s -lc -lbsd > Since before setting up X386 v1.1, the SHLBMAX tunable parm has to be set to 8, so one should be able to modify above to include more shared libs so that disk space and run time memory requirement both can be somewhat reduced. X386 v1.x provides libX11_s.a, so it can be used. libnet_s.a is provided by ESIX in /shlib and /usr/lib, so are libc_s.a and libnsl_s.a. libbsd.a is in /usr/lib only as a non-shared lib, if I remember correctly. It is interesting to note that since ESIC SHLBMAX default is 3, so calling up ESIX tech support, most likely one will be told that only up to three shared libs could be used for compiling X apps. And the /etc/conf/cf.d/mtune shows the maximum of SHLBMAX as 6, but using 8 has not cause any problems so far on my ESIX box (and many others'). Hmm.. after compilation and testing, how about applying cprs/mcs/strip in row to make the client disk file as small as possible? (lots hard disk churning however, a no fun process!) Chin Fang Mechanical Engineering Department Stanford University fangchin@leland.stanford.edu
james@bigtex.cactus.org (James Van Artsdalen) (03/04/91)
In <1991Mar3.152618.4187@world.std.com>, gwr@world.std.com (Gordon W. Ross) wrote: > If you are using gcc and shared libraries, make sure the -shlib flag > causes gcc.c to link programs using: > /lib/crt1.o (program-objects) /lib/crtn.o -lc_s No, use /lib/crt1.o (program-objects) -lc_s -lc /lib/crtn.o which is what gcc uses as distributed by FSF (I assume the bug above is a typo). -- James R. Van Artsdalen james@bigtex.cactus.org "Live Free or Die" Dell Computer Co 9505 Arboretum Blvd Austin TX 78759 512-338-8789