- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Why HP-UX must use its own linker for gcc?
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
Forums
Discussions
Discussions
Discussions
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
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
10-05-2018 12:46 AM
10-05-2018 12:46 AM
Anyone can explain why GNU do not provide or support itself's linker within the binutils for HP-UX?
The related post reference link:
https://community.hpe.com/t5/Languages-and-Scripting/HPUX-linker-with-gnu-compilers/m-p/2797432#M3941
https://community.hpe.com/t5/System-Administration/How2-install-gnu-linker-on-B-11-23-ia64/td-p/3389167
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2018 07:03 PM - edited 10-07-2018 07:06 PM
10-07-2018 07:03 PM - edited 10-07-2018 07:06 PM
Re: Why HP-UX must use its own linker for gcc?
For what architecture? For PA32, it uses SOM format, not ELF.
For PA64 and Integrity, it uses ELF.
What fancy features do you need from GNU ld?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2018 01:48 AM
10-08-2018 01:48 AM
Re: Why HP-UX must use its own linker for gcc?
Because the linker for HP-UX itself must use the following shared library file!
And this file libu2comp.so is just bundled with the HP-UX aCC commercial software!
# gcc scsi_test.c -o scsi_test
ld: Unable to load shared library "/opt/langtools/lib/hpux64/libu2comp.so"
Fatal error.
collect2: ld returned 1 exit status
Notes: There is also no GNU linker within the binutils for either IA/PA64 or PA32!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2018 12:16 PM
10-08-2018 12:16 PM
Re: Why HP-UX must use its own linker for gcc?
> Because the linker for HP-UX itself must use the following shared library file
This is a user error and it's not true. Newer lds were suppose to have an error message saying mixing PA32 with ELF.
> # gcc scsi_test.c
Compile with -c and use "file scsi_test.o" to see what the architecture is. Are you trying to build PA32 on Integrity?
>There is also no GNU linker within the binutils for either IA/PA64 or PA32
Why would you need one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2018 03:02 AM - edited 10-09-2018 03:16 AM
10-09-2018 03:02 AM - edited 10-09-2018 03:16 AM
Re: Why HP-UX must use its own linker for gcc?
1) It is directly built on IA64:
#
# file scsi_test.o
scsi_test.o: ELF-32 relocatable object file - IA64
#
And referring to the following posts:
https://community.hpe.com/t5/General/from-PA-RISC-to-Itanium-Unable-to-load-shared-library/td-p/4866432 <<<< no this cause
https://community.hpe.com/t5/Languages-and-Scripting/Unable-to-load-quot-libu2comp-so-quot/td-p/6971384 <<<< this might be
2) I think that the GNU linker should not use this shared library file that bundled with HP-UX aCC!
Notes: It seems that the GNU linker integrates with the binutils for the most UNIXes except HP-UX!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2018 09:32 AM - edited 10-09-2018 09:35 AM
10-09-2018 09:32 AM - edited 10-09-2018 09:35 AM
Re: Why HP-UX must use its own linker for gcc?
> 1) It is directly built on IA64: scsi_test.o: ELF-32 relocatable object file - IA64
Ok but there may be other objects that confuse ld(1).
Note: Your URLs contain junk chars on the end. You can fix that by editing your post with Edit Reply and using the hyperlink menu to edit them.
https://community.hpe.com/t5/General/from-PA-RISC-to-Itanium-Unable-to-load-shared-library/td-p/4866432 <<<< no this cause
This could be a case where that shlib was actually needed to optimize?
https://community.hpe.com/t5/Languages-and-Scripting/Unable-to-load-quot-libu2comp-so-quot/td-p/6971384 <<<< this might be
Yes, here is where I explain how to find the bad object:
https://community.hpe.com/t5/Languages-and-Scripting/Unable-to-load-quot-libu2comp-so-quot/td-p/6971384#U6972297
> 2) I think that the GNU linker should not use this shared library file that bundled with HP-UX aCC
That's not the problem. The problem is that ld(1) is not giving you an error when you're passing in the wrong architecture objects, archives or shlibs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2018 01:08 AM
10-10-2018 01:08 AM
Re: Why HP-UX must use its own linker for gcc?
1) Bad object ?
#
#
# export LDOPTS="+vtype files"
#
#
# gcc scsi_test.c -o scsi_test_sp
Loading /usr/lib/hpux32/unix98.o:
ld: Unable to load shared library "/opt/langtools/lib/hpux64/libu2comp.so"
Fatal error.
collect2: ld returned 1 exit status
#
#
#
# ls -l /usr/lib/hpux32/unix98.o
-r--r--r-- 1 bin bin 1560 Jan 21 2014 /usr/lib/hpux32/unix98.o
#
#
#
# export LDOPTS="-V -T"
#
#
# echo $LDOPTS
-V -T
#
#
# gcc scsi_test.c -o scsi_test_sp
ld: 92453-07 linker ld HP Itanium(R) B.12.61 IPF/IPF
ld: Unable to load shared library "/opt/langtools/lib/hpux64/libu2comp.so"
Fatal error.
collect2: ld returned 1 exit status
#
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2018 10:50 PM - edited 10-14-2018 10:51 PM
10-14-2018 10:50 PM - edited 10-14-2018 10:51 PM
Re: Why HP-UX must use its own linker for gcc?
> Loading /usr/lib/hpux32/unix98.o:
> ld: Unable to load shared library "/opt/langtools/lib/hpux64/libu2comp.so"
This indicates that unix98.o is bad but I'm not sure how.
Trying using "-Wl,-v" with gcc, to have linker verbose output. I only need to see first 10 or so lines.
And next step is to use gcc to compile your object but link with cc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2018 02:06 AM
10-17-2018 02:06 AM
Re: Why HP-UX must use its own linker for gcc?
Now this time I feel that we might find the hidden problem soon ......!
#
#
# gcc -Wl,-v scsi_test.c -o scsi_test_exec
collect2 version 4.3.1 (IA-64) HP-UX
/usr/ccs/bin/ld -z +Accept TypeMismatch -u main -o scsi_test_exec /usr/lib/hpux32/unix98.o -L/opt/hp-gcc-4.3.1/lib/gcc/ia64-hp-hpux11.23/4.3.1 -L/usr/ccs/lib -L/opt/hp-gcc-4.3.1/lib/gcc/ia64-hp-hpux11.23/4.3.1/../../.. -v scsi_test.c -lgcc -lgcc_eh -lunwind -lc -lgcc -lgcc_eh -lunwind
/usr/ccs/bin/ld -z +Accept TypeMismatch -u main -o scsi_test_exec /usr/lib/hpux32/unix98.o -L/opt/hp-gcc-4.3.1/lib/gcc/ia64-hp-hpux11.23/4.3.1 -L/usr/ccs/lib -L/opt/hp-gcc-4.3.1/lib/gcc/ia64-hp-hpux11.23/4.3.1/../../.. -v scsi_test.c -lgcc -lgcc_eh -lunwind -lc -lgcc -lgcc_eh -lunwind
LPATH is :
Loading /usr/lib/hpux32/unix98.o:
/usr/lib/hpux32/unix98.o:
__xpg4_extended_mask is DEFINED GLOBAL OBJECT
/usr/lib/hpux32/unix98.o:
section .sdata PROGBITS AWS 4 8 added to data segment
section .debug_line PROGBITS 26 8 added to nonsegment segment
section .debug_actual PROGBITS 24 8 added to nonsegment segment
section .note NOTE 848 4 added to note segment
ld: Unable to load shared library "/opt/langtools/lib/hpux64/libu2comp.so"
Fatal error.
collect2: ld returned 1 exit status
#
#
# gcc -c scsi_test.c -o scsi_test_relocate.o
gcc: scsi_test.c: linker input file unused because linking not done
#
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2018 07:52 AM
10-18-2018 07:52 AM
Re: Why HP-UX must use its own linker for gcc?
Eventually I found that I had made an embarrassing low-level mistake!
It seems that the original soruce filename(scsi_test.c) was wrong with some invisible charactors!
Now I just delete this original soruce file and then recreate it, so at last al l right!
But I still do not understand why gcc would report such ld libu2comp.so error under this situation!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2018 11:21 AM
10-20-2018 11:21 AM
Re: Why HP-UX must use its own linker for gcc?
gcc got misled by the unexpected content in the file and considered it an object file, so passed it to the linker; the linker in turn took it for an instrumented object file to be (re-)processed by the compiler backend - that is the case when it tried to load libucomp.so .
how did you locate the problem?
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2018 07:49 PM - edited 10-20-2018 07:51 PM
10-20-2018 07:49 PM - edited 10-20-2018 07:51 PM
Solution> It seems that the original source filename (scsi_test.c) was wrong with some invisible characters.
Yes, that would confused the driver if it didn't end in ".c". cc(1)/c99(1) work the same way.
> I still do not understand why gcc would report such ld libu2comp.so error under this situation
Because ld(1) is broken and doesn't make sure it is an ELF file.
> the linker in turn took it for an instrumented object file to be (re-)processed by the compiler backend - that is the case when it tried to load libucomp.so .
Wasn't this fixed years ago?
> how did you locate the problem?
Well, the source file was listed on the verbose ld output. :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2018 11:58 PM
10-20-2018 11:58 PM
Re: Why HP-UX must use its own linker for gcc?
@Dennis Handly wrote:> It seems that the original source filename (scsi_test.c) was wrong with some invisible characters.
Yes, that would confused the driver if it didn't end in ".c". cc(1)/c99(1) work the same way.
> I still do not understand why gcc would report such ld libu2comp.so error under this situation
Because ld(1) is broken and doesn't make sure it is an ELF file.
> the linker in turn took it for an instrumented object file to be (re-)processed by the compiler backend - that is the case when it tried to load libucomp.so .
Wasn't this fixed years ago?
At least now.
[ cathh02 tmp ] $ gcc -Wl,-V test.cx ld: 92453-07 linker ld HP Itanium(R) B.12.63 IPF/IPF ld: Mismatched ABI (not an ELF file) for test.cx Fatal error. collect2: error: ld returned 1 exit status
I got the same results with 12.58, couldn't find 12.61 though.
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2018 07:46 AM
10-23-2018 07:46 AM
Re: Why HP-UX must use its own linker for gcc?
I noticed the following error message that returned via gcc -c :
gcc: scsi_test.c: linker input file unused because linking not done
Then the below related post at stackoverflow should implied what cause my problem might be due to!
https://stackoverflow.com/questions/10739072/gcclinker-input-file-unused-because-linking-not-done
But I still really cannot explain why the source file was listed on the verbose ld output.
By the way, it seems that the earlier version of binutils for HP-UX provided the GNU linker long ago!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2018 09:12 AM
10-23-2018 09:12 AM
Re: Why HP-UX must use its own linker for gcc?
> But I still really cannot explain why the source file was listed on the verbose ld output.
Because it's not a source file because it doesn't end in ".c". You said there was junk on the end?
ll -b will show the unprintable chars.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2018 07:50 AM
10-25-2018 07:50 AM
Re: Why HP-UX must use its own linker for gcc?
Now I wonder what the other error messages would be returned via ld with the same problematic source file if the system has installed with the shared library of libu2comp.so ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2018 09:56 PM
10-25-2018 09:56 PM
Re: Why HP-UX must use its own linker for gcc?
@liuyl_it wrote:Now I wonder what the other error messages would be returned via ld with the same problematic source file if the system has installed with the shared library of libu2comp.so ?
As long as the file is properly named, any errors that can be detected with the installed compilter would be reported already.
If the file is not named correctly, error reports may not be reliable. So don't bother about the errors when the file is incorrectly named.
From the compiler manual page cc_bundled(1):
Other Suffixes All other arguments, such as those names ending with .o, .a, or .so are taken to be relocatable object files and are passed to ld (see ld(1)) to be included in the link operation.
The behaviour of the linker for unrecognized input formats seems to be undocumented.
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2018 07:16 PM - edited 10-29-2018 07:26 PM
10-29-2018 07:16 PM - edited 10-29-2018 07:26 PM
Re: Why HP-UX must use its own linker for gcc?
These days I have searched the knowledges for the instrumented object/code/execution!
But I just only found few information about them including the following reference link:
So could you tell me the significance of the "instrumented object file" concept in my this issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2018 07:38 PM
10-29-2018 07:38 PM
Re: Why HP-UX must use its own linker for gcc?
So could you tell me the significance of the "instrumented object file" concept in my this issue?
In your case there is no instrumented object file. Because of the bad filename, the compiler passed the source file to the linker. The linker mistakenly assumed it to be an instrumented object file. If your original problem goes away after renaming the source file, you don't have to bother about it any more.
--
ranga