- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- linking after a gcc compilation
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2008 06:24 AM
тАО09-05-2008 06:24 AM
linking after a gcc compilation
Having downloaded and installed the gcc 4.2.3 depot for 11.11 I am having problems linking my very simple initial test program (HelloWorld). If I attempt to compile and link using gcc I see this...
HP-C8000<58> gcc file_type_c++.cpp
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (/var/tmp/ccErrvH3.o)
was detected. The linked output may not run on a PA 1.x system.
/usr/ccs/bin/ld: Unsatisfied symbols:
__gxx_personality_v0 (code)
collect2: ld returned 1 exit status
Whereas if I attempt to split up the process, the compilation procedes without errors but using g++ to link I get this...
HP-C8000<57> g++ file_type_c++.o
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (file_type_c++.o) was
detected. The linked output may not run on a PA 1.x system.
/usr/ccs/bin/ld: Unrecognized argument: +init
/usr/ccs/bin/ld: Usage: /usr/ccs/bin/ld [options] [flags] files
collect2: ld returned 1 exit status
I was surprised to see the gcc depot did not include a GNU ld and it appears this is causing the error. What am I missing. I presume the ld in /usr/bin is that bundled with 11.11 but not sure where the /usr/ccs/bin ld is from?
Thanks in advance for any help you can give.
Ed
- Tags:
- gcc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2008 09:22 AM
тАО09-05-2008 09:22 AM
Re: linking after a gcc compilation
784 lr-xr-xr-t 1 root sys 15 Jul 23 12:38 /usr/bin/ld -> /usr/ccs/bin/ld
# swlist -l file|grep /usr/ccs/bin/ld
OS-Core.C-KRN: /usr/ccs/bin/ld
OS-Core.CMDS2-AUX: /usr/ccs/bin/ldd
OS-Core.LINKER-PAOBJ: /usr/ccs/pa/usr/ccs/bin/ld
OS-Core.LINKER-PAOBJ: /usr/ccs/pa/usr/ccs/bin/ldd
PHSS_36336.C-KRN: /usr/ccs/bin/ld
PHSS_36336.LINKER-PAOBJ: /usr/ccs/pa/usr/ccs/bin/ld
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2008 10:09 AM
тАО09-05-2008 10:09 AM
Re: linking after a gcc compilation
You should use g++ to compile AND link C++ sources and gcc only for C.
>ld: Unrecognized argument: +init
I assume what Tim forgot to mention is that you need a newer linker that supports +init.
And that you must use HP's linker tools on HP-UX, not foreign devil tools.
- Tags:
- foreign devil tools
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 04:31 AM
тАО09-09-2008 04:31 AM
Re: linking after a gcc compilation
Thanks for the replies. Interpreting them as i can with a limited knowledge of the technologies in question leads me to more questions.
Tim I presume you are giving me example results from your system. Here is the output from my own system
# ll /usr/bin/ld
lr-xr-xr-t 1 root sys 15 Jun 22 2006 /usr/bin/ld -> /usr/cc
s/bin/ld
# swlist -l file|grep /usr/ccs/bin/ld
OS-Core.C-KRN: /usr/ccs/bin/ld
OS-Core.CMDS-AUX: /usr/ccs/bin/ldd
# ld -V
92453-07 linker command s800.sgs ld PA64 B.11.18 REL 000922
ld: 92453-07 linker linker ld B.11.18 000922
ld: Usage: ld [options] [flags] files
Can you confirm that the PHSS lines in your post refer to linker patches. If this is the case can I download and install them from the HP website?
Dennis you confirm that I need a newer linker. Will patching my existing linker (assuming this is possible) be sufficent?
You also suggest I should be compiling using g++ and linking only using the HP linker. Below is the output from a compile and link using g++ and my existing linker.
HP-C8000<28> g++ -c file_type_c++.cpp
HP-C8000<35> ld file_type_c++.o
ld: (Warning) At least one PA 2.0 object file (file_type_c++.o) was detected. Th
e linked output may not run on a PA 1.x system.
ld: Unsatisfied symbols:
__gxx_personality_v0 (code)
printf (code)
ld: No $UNWIND_END$ subspace has been defined (probably missing /usr/ccs/lib/crt
0.o)
Any further information you can give would be great.
Ed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 04:50 AM
тАО09-09-2008 04:50 AM
Re: linking after a gcc compilation
> sources [...]
> HP-C8000<28> g++ -c file_type_c++.cpp
> HP-C8000<35> ld file_type_c++.o
I could be totally wrong, but I believe that
"use g++ to [...] link" meant that you should
use g++ to link instead of a bare "ld", as
in, for example:
g++ file_type_c++.o
The compiler (driver) knows what exotic
options must be passed to ld. You don't.
Otherwise, it might pay to read the
documentation for g++, where it probably
tells you how to get a program linked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 08:27 AM
тАО09-09-2008 08:27 AM
Re: linking after a gcc compilation
Is there an equivalent flag or do I need to download a 64 bit gcc binary?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2008 01:24 PM
тАО09-09-2008 01:24 PM
Re: linking after a gcc compilation
It will solve that "Unrecognized argument: +init" error.
>You also suggest I should be compiling using g++ and linking only using the HP linker.
My point was only that you should not use GNU's ld.
>I need to download a 64 bit gcc binary?
You would have to download it from:
http://www.hp.com/go/gcc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2008 02:35 AM
тАО09-11-2008 02:35 AM
Re: linking after a gcc compilation
Thanks again for your help and patience.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2008 02:37 AM
тАО09-11-2008 02:37 AM