https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26472

--- Comment #19 from dave.anglin at bell dot net ---
On 11-Aug-14, at 7:26 PM, wzis at hotmail dot com wrote:

> Not sure whether the issue I got is related to this bug: When using  
> GCC to
> compile a C program, the binary got is linked with a libgcc_s.4  
> under the
> HP-GCC 4.7.1 installed directory /opt/hp-gccxxx/xx/yy/../zz/aa/../,  
> and to run
> the program on another machine, that machine has to install the GCC  
> also,
> that's very bad. My question is why can't GCC generate a static lib  
> for those
> functions that must be used for the binary to run and linked with  
> the program
> statically? Isn't that will remove the dependency to GCC package for  
> running
> the program? I'm using hp-gcc-4.7.1.


The main problem is the HP linker hard codes shared library paths into  
applications
and shared libraries.

There are ways to manipulate the shared library search path with chatr  
and link options.
Check out the man pages for chatr and ld.

A static libgcc.a is installed and will be used with -static or - 
static-libgcc linker options.
This will avoid the hard-coded dependence on the installation path to  
libgcc_s.4.

Dave
--
John David Anglin    dave.ang...@bell.net

Reply via email to