This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49967] New: The -static-libstdc++ does not work on HP-UX (IA64 B.11.23, probably others)
- From: "jvb at cyberscience dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 3 Aug 2011 16:47:56 +0000
- Subject: [Bug c++/49967] New: The -static-libstdc++ does not work on HP-UX (IA64 B.11.23, probably others)
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49967
Summary: The -static-libstdc++ does not work on HP-UX (IA64
B.11.23, probably others)
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jvb@cyberscience.com
Host: HP-UX IA64
Target: HP-UX IA64
The -static-libstdc++ option is silently ignored on HP-IX, IA64 platform.
The reason for this seems to be that g++spec.c relies on HAVE_LD_STATIC_DYNAMIC
from auto-host.h, and if this is not set silently fails to implement
-static-libstdc++.
The HP linker does have options to implement HAVE_LD_STATIC_DYNAMIC, but
configure has not detected them. Presumably this is because they are not the
usual -Bstatic and -Bdynamic, the HP options are -aarchive and -ashared_archive
(not -ashared which disables archive libs completely). Changing auto-host.h to
use:
#define HAVE_LD_STATIC_DYNAMIC 1
#define LD_DYNAMIC_OPTION "-ashared_archive"
#define LD_STATIC_OPTION "-aarchive"
resolves the issue, but of course is not the right fix since this file is
generated. So, this is really a configuration time issue.
As an additional fix though, I would really expect g++ to error or warn if
-static-libstdc++ can't be implemented, instead of silently ignoring. Also it
could provide the archive name to the linker in place of -lstdc++ for systems
where HAVE_LD_STATIC_DYNAMIC really doesn't exist - but possibly if this were
fixed for HP there might not be any systems with this restriction.