[bug-notifications] [gcc4g++ 0004875]: GCC 4.6.2 C++ : dynamic link issue

Mantis Bug Tracker noreply at opencsw.org
Sun Dec 4 17:47:49 CET 2011


A NOTE has been added to this issue. 
====================================================================== 
https://www.opencsw.org/mantis/view.php?id=4875 
====================================================================== 
Reported By:                pfelecan
Assigned To:                maciej
====================================================================== 
Project:                    gcc4g++
Issue ID:                   4875
Category:                   regular use
Reproducibility:            always
Severity:                   block
Priority:                   high
Status:                     assigned
====================================================================== 
Date Submitted:             2011-12-03 09:26 CET
Last Modified:              2011-12-04 17:47 CET
====================================================================== 
Summary:                    GCC 4.6.2 C++ : dynamic link  issue
Description: 
The minimal program:

int main() {}

compiles, links (g++ -o c c.cc) but doesn't run; the following error
message is reported:

        ld.so.1: c: fatal: libstdc++.so.6: open failed: No such file or
        directory

and ldd reports:
	libstdc++.so.6 =>	 (file not found)
	libm.so.2 =>	 /lib/libm.so.2
	libgcc_s.so.1 =>	 (file not found)
	libc.so.1 =>	 /lib/libc.so.1

$ type g++
g++ is /opt/csw/bin/g++

$ g++ --version
g++ (GCC) 4.6.2
====================================================================== 

---------------------------------------------------------------------- 
 (0009456) pfelecan (developer) - 2011-12-04 17:47
 https://www.opencsw.org/mantis/view.php?id=4875#c9456 
---------------------------------------------------------------------- 
a temporary solution to this is:

gcc -dumpspecs > /opt/csw/lib/gcc/i386-pc-solaris2.10/4.6.2/specs

change the directive *link_arch from :

%{m64:%{G:-G}    %{YP,*}    %{R*}  %{compat-bsd:      %{!YP,*:%{p|pg:-Y
P,/opt/csw/lib:/usr/ucblib/64:/usr/lib/libp/64:/lib/64:/usr/lib/64}        
     %{!p:%{!pg:-Y P,/usr/ucblib/64:/lib:/usr/lib/64}}}              -R
/usr/ucblib/64}    %{!compat-bsd:      %{!YP,*:%{p|pg:-Y
P,/usr/lib/libp/64:/lib/64:/usr/lib/64}              %{!p:%{!pg:-Y
P,/lib/64:/usr/lib/64}}}}}%{!m64:%{G:-G}    %{YP,*}    %{R*}   
%{compat-bsd:      %{!YP,*:%{p|pg:-Y
P,%R/usr/ucblib:%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/usr/lib}
             %{!p:%{!pg:-Y P,%R/usr/ucblib:%R/usr/ccs/lib:%R/usr/lib}}}    
         -R %R/usr/ucblib}    %{!compat-bsd:      %{!YP,*:%{p|pg:-Y
P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/usr/lib}           
  %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/usr/lib}}}}}

to :

%{m64:%{G:-G}    %{YP,*}    %{R*} -R /opt/csw/lib   %{compat-bsd:     
%{!YP,*:%{p|pg:-Y
P,/opt/csw/lib:/usr/ucblib/64:/usr/lib/libp/64:/lib/64:/usr/lib/64}        
     %{!p:%{!pg:-Y P,/usr/ucblib/64:/lib:/usr/lib/64}}}              -R
/usr/ucblib/64}    %{!compat-bsd:      %{!YP,*:%{p|pg:-Y
P,/usr/lib/libp/64:/lib/64:/usr/lib/64}              %{!p:%{!pg:-Y
P,/lib/64:/usr/lib/64}}}}}%{!m64:%{G:-G}    %{YP,*}    %{R*}   
%{compat-bsd:      %{!YP,*:%{p|pg:-Y
P,%R/usr/ucblib:%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/usr/lib}
             %{!p:%{!pg:-Y P,%R/usr/ucblib:%R/usr/ccs/lib:%R/usr/lib}}}    
         -R %R/usr/ucblib}    %{!compat-bsd:      %{!YP,*:%{p|pg:-Y
P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/usr/lib}           
  %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/usr/lib}}}}}

Note that this is not complete and specific to the Intel architecture.

To complete, you must manage 32 and 64 bit, profiling and debugging.

For the SPARC architecture the file's path is slightly different.



More information about the bug-notifications mailing list