- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: static linking libc on a itanium
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
09-29-2009 03:47 AM
09-29-2009 03:47 AM
static linking libc on a itanium
I need to link with the static libc.a, but there is no libc.a available on the ia64 system.
It should be a shell which should reside in /sbin/ as /sbin/sh.
/sbin/sh is statically linked.
How can I do this.
Regards
Karl-Heinz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 04:19 AM
09-29-2009 04:19 AM
Re: static linking libc on a itanium
On "Integrity" there's only libc.so... }:|
The compiler flag used on this platform to use "minimally shared libs" is -minshared.
Greets back to Germany,
Kobylka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 04:35 AM
09-29-2009 04:35 AM
Re: static linking libc on a itanium
How do they compile the binaries in /sbin/ ??
They are all static linked.
Regards
Karl-Heinz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 05:39 AM
09-29-2009 05:39 AM
Re: static linking libc on a itanium
If you want to do something like this I think you'll need to approach HP formally and ask the questions...
As to the reason why - I'm not sure - Dennis H will know and might chip in here later...
Why do you need to compile your own code that will run in single user mode???
I guess an alternative would be to figure out which shared libs you need and make sure they are located somewhere in the root filesystem as well... dynamic linking still *works* in single user mode - its just most of the libs aren't available...
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 06:40 AM
09-29-2009 06:40 AM
Re: static linking libc on a itanium
So, as I understand you, if I copy these two libs to e.g. /etc, which is in the root partition, and link it with -l:/etc/libc.so -l:/etc/libdl.so this should work while booting into single user mode??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2009 01:53 PM
09-29-2009 01:53 PM
Re: static linking libc on a itanium
>It should be a shell
The only real shell you should use is the posix shell, why would you need another?
>The only libs we need are the libc.so.1, and with it, the libdl.so.1
That's not enough and libdl.so.1 should really be used.
>... this should work while booting into single user mode?
No.
>Duncan: If you want to do something like this I think you'll need to approach HP formally
Right. Or explain what you are trying to do and perhaps there is a simpler command that can do what you want, while you stick with the real shell.
>As to the reason why
Because mixing shared vs archive versions of system libs caused problems.
>I guess an alternative would be to figure out which shared libs
That won't work since dld.so must be there too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 12:06 AM
09-30-2009 12:06 AM
Re: static linking libc on a itanium
ld -o jetsh checkexp.o filebackup.o gethost.o privops.o vxsch.o js_md5.o clog.o +b /etc/jets -lc
libc is the only lib needed by the program.
If I set /etc/jets to SHLIB_PATH:
ldd jetsh
libc.so.1 => /etc/jets/libc.so.1
libdl.so.1 => /etc/jets/libdl.so.1
ls -la /etc/jets
total 10992
drwxr-xr-x 2 root sys 96 Sep 30 03:41 .
dr-xr-xr-x 31 bin bin 8192 Sep 29 10:00 ..
-r-xr-xr-x 1 root sys 925808 Sep 30 03:42 dld.so
-r-xr-xr-x 1 root sys 4600380 Sep 29 10:00 libc.so.1
-r-xr-xr-x 1 root sys 76704 Sep 29 10:00 libdl.so.1
With this programm we want to control the /sbin/sh.
mv /sbin/sh /sbin/jetsh_sh
cp jetsh /sbin/sh
jetsh (/sbin/sh) calls the /sbin/jetsh_sh and logs some things, set in a config file.
This runs well, but if we want to reboot, it does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2009 10:20 AM
09-30-2009 10:20 AM
Re: static linking libc on a itanium
This isn't going to solve my statement:
That won't work since dld.so must be there too.
(You have dld.so but you need more than that. And you have to tell ld where you are placing dld.so.)
>If I set /etc/jets to SHLIB_PATH:
If you are using +b, you don't need that.
Also, you should really be copying the shlibs into a directory like:
/etc/jets/lib/hpux32/
>mv /sbin/sh /sbin/jetsh_sh
You absolutely don't want to move /sbin/sh, nor replace it!
>if we want to reboot, it does not work.
Of course, what you are trying to do isn't easy, nor safe. I would assume after your boot fails, you must reinstall/reignite the system?
Sysadmins need to know nobody has fiddled with /sbin/sh and replaced it with a look alike with unknown functionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2009 10:11 PM
10-01-2009 10:11 PM
Re: static linking libc on a itanium
Thank you