c++/7512: ld getting passed incorrect options with hppa64-hp-hpux11.00

keith_richling@agilent.com keith_richling@agilent.com
Tue Aug 6 15:46:00 GMT 2002


>Number:         7512
>Category:       c++
>Synopsis:       ld getting passed incorrect options with hppa64-hp-hpux11.00
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 06 15:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Keith Richling
>Release:        3.1.1
>Organization:
>Environment:

>Description:
When g++ is asked to build a shared library through the
-shared option on hppa64-hp-hpux11.00 I get the following
error:

ld: Unrecognized argument: -shared
Fatal error.
collect2: ld returned 1 exit status
>How-To-Repeat:
// Begin foo.C
#include <iostream>
int main() {
  std::cout << "Hello world." << std::endl;
}
// End foo.C

I built g++ using the configure options of
--host=hppa64-hp-hpux11.00
--disable-shared
--disable-threads
--without-gnu-ld
--with-ld=/usr/ccs/bin/ld
--with-gnu-as
--with-as=/PATH_TO_BINUTILS/as
--enable-languages=c,c++

I get the error with the following compile lines:
g++ -c foo.C
g++ -shared foo.o -o foo.sl
>Fix:
Applied the following change to gcc/config/pa/pa64-hpux.h

26c26
<   "-E %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-shared}"
---
>   "-E %{mlinker-opt:-O} %{!shared:-u main} %{static:-a archive} %{shared:-b}"
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list