🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: latrobe.linux
Article #10

gcc compiling statically

#10
From: Mark W Stiebel
Date: Sat, 15 Feb 1997 00:00
26 lines
1667 bytes
I went through upgrading all packages suggested in the kernel v2.1.24
Changes file the other, and upgraded the following..
	ld.so,binutils,libc,gcc to the recommended.

Now, whenever compiling anything, gcc defaults to compiling statically. And
if I add -shared to the linking, weird stuff happens. For example, when
compiling 'vim':

[/usr/src/vim-4.2/src][6] > ldd vim gcc -o vim *.o -L/usr/X11R6/lib  -lSM \
-lICE -lX11  -ltermcap  
[/usr/src/vim-4.2/src][7] > ldd vim
        statically linked (ELF)
[/usr/src/vim-4.2/src][8] > gcc -shared -o vim *.o -L/usr/X11R6/lib \
-lSM -lICE -lX11 -ltermcap
[/usr/src/vim-4.2/src][9] > ldd vim
        ./vim => ./vim
        libc.so.5 => /lib/libc.so.5

Is there anything I have missed such that libc is shared, whilst all the
other libraries seem to be linked in statically? All applicable libraries
are there when I do a 'ldconfig -v'. And I don't really have _that_ much
disk space to be able to have a completely static system :)

  -= Mark Stiebel
   -= stiebelm@lion.cs.latrobe.edu.au
Technical Details
Message-ID: <5e4lr7$bjo@lion.cs.latrobe.edu.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 135ade,c21d82213f523a5,start
X-Google-Attributes: gid135ade,public
X-Google-Thread: 1103af,c21d82213f523a5,start
X-Google-Attributes: gid1103af,public
X-Google-Thread: 102983,c21d82213f523a5,start
X-Google-Attributes: gid102983,public
From: stiebelm@lion.cs.latrobe.edu.au (Mark W Stiebel)
Subject: gcc compiling statically
Date: 1997/02/15
Message-ID: <5e4lr7$bjo@lion.cs.latrobe.edu.au>
X-Deja-AN: 218993702
Organization: Comp.Sci & Comp.Eng, La Trobe Uni, Australia
Newsgroups: latrobe.linux,comp.os.linux.misc,aus.computers.linux