HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ld - converting .a to .sl
Operating System - HP-UX
1833742
Members
2696
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
08-09-2002 12:56 AM
08-09-2002 12:56 AM
ld - converting .a to .sl
Hi All,
Can anyone tell me how I could convert .a archive library containing .o files into a .sl.
My problem is, I downloaded gettext from DSPP and I'm now trying to use bash from the porting center and it requires the shared lib libintl.sl, however gettext from DSPP only supplies the .a
Thanks in advance.
P.S. the other option of course is to build bash from source... however I really need to learn more about ld :).
Can anyone tell me how I could convert .a archive library containing .o files into a .sl.
My problem is, I downloaded gettext from DSPP and I'm now trying to use bash from the porting center and it requires the shared lib libintl.sl, however gettext from DSPP only supplies the .a
Thanks in advance.
P.S. the other option of course is to build bash from source... however I really need to learn more about ld :).
"The physicist's greatest tool is his wastebasket." - Albert Einstein.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2002 01:08 AM
08-09-2002 01:08 AM
Re: ld - converting .a to .sl
Hi,
I think you will have to recompile the
source-code in this case.
The reason is that objects in a shared lib (.sl) have to be compiled with an option
for "position-independent code"
Most likely the objects in your .a file are
not compiled with this option.
Regards
Olav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2002 01:18 AM
08-09-2002 01:18 AM
Re: ld - converting .a to .sl
see ld man pages
ld -b produces a shared library.
Your objects ".o" must be compiled with the +Z option, (PIC) Position Independent Code otherwise you cannot build the shared lib.
see cc man pages
Jean-Luc
ld -b produces a shared library.
Your objects ".o" must be compiled with the +Z option, (PIC) Position Independent Code otherwise you cannot build the shared lib.
see cc man pages
Jean-Luc
fiat lux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2002 02:43 AM
08-09-2002 02:43 AM
Re: ld - converting .a to .sl
Jean-Luc is 100% OK
If and only if the objects are created with +z or +Z (-fpic or -fPIC for gcc) you might be able to convert:
# cd /usr/local/lib
# mkdir tmp
# cd tmp
# ar xf ../libmylib.a
# ld -b -o libmylib.sl *.o
# mv libmylib.sl ..
# cd ..
# rm -rf tmp
# ls -al libmylib.*
If and only if the objects are created with +z or +Z (-fpic or -fPIC for gcc) you might be able to convert:
# cd /usr/local/lib
# mkdir tmp
# cd tmp
# ar xf ../libmylib.a
# ld -b -o libmylib.sl *.o
# mv libmylib.sl ..
# cd ..
# rm -rf tmp
# ls -al libmylib.*
Enjoy, Have FUN! H.Merijn
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP