This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs 2.91.57 installed, but...
- To: Lin Zhe Min <ljm at marx dot ljm dot wownet dot net>, egcs at cygnus dot com
- Subject: Re: egcs 2.91.57 installed, but...
- From: Kurt Garloff <garloff at hft dot e-technik dot uni-dortmund dot de>
- Date: Mon, 14 Sep 1998 17:26:58 +0200
- Cc: linux-gcc at vger dot rutgers dot edu
- References: <Pine.LNX.3.91.980912070618.30077A-100000@marx.ljm.wownet.net>
On Sat, Sep 12, 1998 at 07:19:45AM +0000, Lin Zhe Min wrote:
> #include <stdio.h>
> main() { puts("Hello world."); }
> are statically linked so that are huge in space. And trying adding
> -shared in compilation, a larger binary is generated with segmentation
> error in execusion.
-shared is meant to built shared libraries, not binaries linked to shared
libs. You need to use -fPIC while compiling and -shared for linking a shared
lib. If you use -shared on a to link a binary it will segfault.
Make sure you have a .so file, e.g. libfoo.so->libfoo.so.6->libfoo.so.6.1.2
(symlinks) and link with -L/path/to/lib -lfoo in order to get a binary
linked to a shared lib.
--
+--------------------------------------------------------------+
| cand.phys. Kurt Garloff C1-O4-101 (Chemiegeb"aude) |
|Lehrstuhl Hochfrequenztechnik (Fakult"at f"ur Elektrotechnik)|
| Universit"at Dortmund D - 44221 Dortmund |
| Tel.: (0231) 755-3947 Fax: (0231) 755-4631 |
| garloff@hft.e-technik.uni-dortmund.de |
| Public PGP key available ! |
+--------------------------------------------------------------+