Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Create shared libs on AIX (with certain libs which are statically linked)

Create shared libs on AIX (with certain libs which are statically linked)

Create shared libs on AIX (with certain libs which are statically linked)

I want to create a shared lib with certain libs statically linked to it. I can generate a fully shared lib as follows:

gcc -maix64 -DHAVE_CONFIG_H -I. -I./src -DHAVE_OPENSSL -I/usr/include/openssl -I/usr/include -I/usr/include/apr-1 -D_LARGEFILE64_SOURCE -I/usr/java8_64/include -shared -o libnetty_tcnative.so src/jnilib.c src/bb.c src/error.c src/native_constants.c src/ssl.c src/sslcontext.c src/sslutils.c -lc -L/opt/freeware/lib64 -lapr-1 -lssl -lcrypto -lpthread -Wl,-bnoentry -maix64 -O3 -pthread -Wl,-bnoquiet

If I do ldd on this lib, I get:

libnetty_tcnative.so needs:

Now, let's say I want to remove the dependency from libs in the folder /opt/freeware. For this, I am thinking to statically link libgcc_s.a, libssl.a and libcrypto.a. What flags can I pass to gcc so that it links these libs statically? It might also be okay to link everything statically so there is no dependence on any external libs. Also, would like to mention that I use /usr/bin/ld (native) with gcc.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close