HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: creating shared library with 'cc' instead of '...
Operating System - HP-UX
1828220
Members
2094
Online
109975
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
05-25-2001 04:41 AM
05-25-2001 04:41 AM
creating shared library with 'cc' instead of 'ld'
Hello there,
I am attempting to create a shared library using the cc comand;
cc -Wl,-b,-I -o
I am attempting to create a shared library using the cc comand;
cc -Wl,-b,-I -o
- Tags:
- shlib
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2004 12:02 AM
09-07-2004 12:02 AM
Re: creating shared library with 'cc' instead of 'ld'
Hello steve,
You mean that ,All source are compiled with +z option, then
you could use the following command to create the shared library.
ld -b -o
You mean that ,All source are compiled with +z option, then
you could use the following command to create the shared library.
ld -b -o
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2004 12:18 AM
09-07-2004 12:18 AM
Re: creating shared library with 'cc' instead of 'ld'
Hi,
I just tried to build few object files with +Z and then use your compile line to create a library and was able to do so.
1. cc +Z -c a.c b.c
2. cc -Wl,-b,-I -o lib.so a.o b.o
crt0.o is required to build the final binary and is invoked by the linker please have a look at ld manpage.
manish
I just tried to build few object files with +Z and then use your compile line to create a library and was able to do so.
1. cc +Z -c a.c b.c
2. cc -Wl,-b,-I -o lib.so a.o b.o
crt0.o is required to build the final binary and is invoked by the linker please have a look at ld manpage.
manish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2004 01:39 AM
09-08-2004 01:39 AM
Re: creating shared library with 'cc' instead of 'ld'
the crt0 is passed to the linker by the compiler, it is used only when building an executable. the linker does very few things by itself (like using milli.a).
i dont understand why your compile options are like this: -Wl,-b,-l. what is '-l' doing there ?
do not pass the '-b' option to the linker, put it in the compile options. the compiler will understand that '+z' is to be used. it will pass on the '-b' to the linker as well. it will also NOT add the crt0 to the link line.
if you dont say '-b' to the compiler, it will assume you are building an executable and add crt0 to the link line.
--
ranga
[i work for hpe]
i dont understand why your compile options are like this: -Wl,-b,-l. what is '-l' doing there ?
do not pass the '-b' option to the linker, put it in the compile options. the compiler will understand that '+z' is to be used. it will pass on the '-b' to the linker as well. it will also NOT add the crt0 to the link line.
if you dont say '-b' to the compiler, it will assume you are building an executable and add crt0 to the link line.
--
ranga
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP