Add shared members from library to same library in a different directory


 
Thread Tools Search this Thread
Operating Systems AIX Add shared members from library to same library in a different directory
# 1  
Old 06-28-2012
Add shared members from library to same library in a different directory

I'm trying to install libiconv to AIX 7.1 from an rpm off of the perzl site. The rpm appears to install but I get this error message.

Code:
add shr4.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
add shr.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
add shr4_64.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a

How do I go about adding these shared members to the /opt/freeware/lib/libiconv.a?
Edit: my first thought is to link the two using ln as below, but I would appreciate anyone's input.
Code:
ln -sf /usr/lib/libiconv.a /opt/freeware/lib/libiconv.a

Thanks!

Moderator's Comments:
Mod Comment Please view this code tag video for how to use code tags when posting code and data.

Last edited by kneemoe; 06-29-2012 at 11:17 AM.. Reason: code tags
# 2  
Old 07-09-2012
Quote:
Originally Posted by kneemoe
I'm trying to install libiconv to AIX 7.1 from an rpm off of the perzl site. The rpm appears to install but I get this error message.

Code:
add shr4.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
add shr.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
add shr4_64.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a

How do I go about adding these shared members to the /opt/freeware/lib/libiconv.a?
Edit: my first thought is to link the two using ln as below, but I would appreciate anyone's input.
Code:
ln -sf /usr/lib/libiconv.a /opt/freeware/lib/libiconv.a

Thanks!

Adding that link didn't work. I get the following error when I try to do a make of php 5.3.14
Code:
/softwarelocal/apache/SQL_and_PHP/php-5.3.14# ./configure --prefix=/opt/freeware/php --with-apxs2=/opt/freeware/sbin/apxs --with-config-file-path=/opt/freeware/etc/httpd/conf --with-gd --with-zlib-dir=/opt/freeware/lib --enable-shared --disable-static --with-png-dir=/opt/freeware/lib --with-zlib --with-bz2=/opt/freeware/bin  --with-libxml-dir=/opt/freeware/lib --with-jpeg-dir=/opt/freeware/lib --with-png-dir=/opt/freeware/lib --with-xpm-dir=/opt/freeware/lib --with-freetype-dir=/opt/freeware/lib --with-mysql=/opt/freeware/mysql/mysql5.1 --host=powerpc-ibm-aix7.1.0.0

Code:
/softwarelocal/apache/SQL_and_PHP/php-5.3.14#/opt/freeware/bin/make
~
ld: 0711-317 ERROR: Undefined symbol: .libiconv_open
ld: 0711-317 ERROR: Undefined symbol: .libiconv
ld: 0711-317 ERROR: Undefined symbol: .libiconv_close
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
make: *** [sapi/cli/php] Error 1

I then did a 'make clean' (specifying the full path of make again, so as to not use AIX's make) and then removed the link and reinstalled the libiconv rpm.
I then used the same configure args above and run into the following
Code:
/softwarelocal/apache/SQL_and_PHP/php-5.3.14#/opt/freeware/bin/make
~
Generating phar.php
exec(): 0509-036 Cannot load program /softwarelocal/apache/SQL_and_PHP/php-5.3.14/sapi/cli/php because of the following errors:
        0509-022 Cannot load module /opt/freeware/lib/libfreetype.a(libfreetype.so.6).
        0509-150   Dependent module /usr/local/mysql/lib/libz.a(libz.so.1) could not be loaded.
        0509-152   Member libz.so.1 is not found in archive
        0509-022 Cannot load module php.
        0509-150   Dependent module /opt/freeware/lib/libfreetype.a(libfreetype.so.6) could not be loaded.
        0509-022 Cannot load module .
make: *** [ext/phar/phar.php] Error 255

I've also tried building it just using AIX's compiler, contrary to all the write-ups I've seen, but that always fails with the following:
Code:
/bin/sh /softwarelocal/apache/SQL_and_PHP/php-5.3.14/libtool --silent --preserve-dup-deps --mode=compile /softwarelocal/apache/SQL_and_PHP/php-5.3.14/meta_ccld  -Imain/ -I/softwarelocal/apache/SQL_and_PHP/php-5.3.14/main/ -DPHP_ATOM_INC -I/softwarelocal/apache/SQL_and_PHP/php-5.3.14/include -I/softwarelocal/apache/SQL_and_PHP/php-5.3.14/main -I/softwarelocal/apache/SQL_and_PHP/php-5.3.14 -I/softwarelocal/apache/SQL_and_PHP/php-5.3.14/ext/date/lib -I/softwarelocal/apache/SQL_and_PHP/php-5.3.14/ext/ereg/regex -I/opt/freeware/include/libxml2 -I/usr/include/freetype2 -I/opt/freeware/mysql/mysql5.1/include -I/softwarelocal/apache/SQL_and_PHP/php-5.3.14/ext/sqlite3/libsqlite -I/softwarelocal/apache/SQL_and_PHP/php-5.3.14/TSRM -I/softwarelocal/apache/SQL_and_PHP/php-5.3.14/Zend  -D_THREAD_SAFE  -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS   -c main/internal_functions_cli.c -o main/internal_functions_cli.lo
        echo '\
\
Generating phar.php
/bin/sh[14]: /softwarelocal/apache/SQL_and_PHP/php-5.3.14/sapi/cli/php:  not found.
make: 1254-004 The error code from the last command is 127.


Stop.

Any suggestions?

EDIT: the basic instructions I've been going off of are here - ibm.com/developerworks/wikis/display/WikiPtype/aixopen

Last edited by kneemoe; 07-09-2012 at 11:19 AM.. Reason: adding the ibm.com AMP instructions
# 3  
Old 07-10-2012
I wonder why it doesn't suffice to add the library and its path to the "LIBPATH" (or similar) environment variable, so that it is found when needed. I don't know if using softlinks instead has any chance of working, but it "feels wrong" from the start IMHO.

Use the ar command to extract the mentioned objects from the library /usr/lib/libiconv.a, then put them into the library /opt/freeware/lib/libiconv.a. If this library doesn't exist create it from scratch. This should work.

See the man page of ar for details and the AIX compiler reference manual for details about the linkage editor of the Xlc compiler.

I hope this helps.

bakunin
# 4  
Old 07-11-2012
Quote:
Originally Posted by bakunin
I wonder why it doesn't suffice to add the library and its path to the "LIBPATH" (or similar) environment variable, so that it is found when needed. I don't know if using softlinks instead has any chance of working, but it "feels wrong" from the start IMHO.
...

bakunin
After digging into this a little further it is (now) my understanding that the libraries are slightly different, so linking or pointing to the /usr/lib by updating the variable creates a mess when I try to get something to compile using the GNU libiconv.

I'll try your suggestion using ar shortly and update the thread accordingly. Thank you for your help,
Dan
This User Gave Thanks to kneemoe For This Post:
# 5  
Old 08-23-2012
Solution to your problem?

Dan,

I am running into the exact same problem when trying to compile PHP 2.4.3.

Quote:
Generating phar.php
exec(): 0509-036 Cannot load program /softwarelocal/apache/SQL_and_PHP/php-5.3.14/sapi/cli/php because of the following errors:
0509-022 Cannot load module /opt/freeware/lib/libfreetype.a(libfreetype.so.6).
0509-150 Dependent module /usr/local/mysql/lib/libz.a(libz.so.1) could not be loaded.
0509-152 Member libz.so.1 is not found in archive
0509-022 Cannot load module php.
0509-150 Dependent module /opt/freeware/lib/libfreetype.a(libfreetype.so.6) could not be loaded.
0509-022 Cannot load module .
make: *** [ext/phar/phar.php] Error 255
Have you had any luck fixing this problem? What steps did you take to get it to work? I am running the latest AIX RPM of libiconv. I do not appear to have a /usr/lib/libiconv.a on my system. I do have one in /opt/freeware/lib.

Thanks!
# 6  
Old 08-25-2012
Have you set the variables "LD_LIBRARY_PATH" and "LIBPATH" both to the respective locations?

Some programs from the Solaris/Linux world expect $LD_LIBRARY_PATH to evaluate to the library location and don't care for the AIX pendant $LIBPATH, which is why it is a good safety measure to set both.

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Shared-library error

Hi All, i am facing shared library error, below is the output of the command I am executing on my client # /usr/software/bin/sudo /usr/software/bin/sudo: error while loading shared libraries: libaudit.so.1: cannot open shared object file: No such file or directory # I tried install... (4 Replies)
Discussion started by: muzaffar.k
4 Replies

2. Programming

Shared library with acces to shared memory.

Hello. I am new to this forum and I would like to ask for advice about low level POSIX programming. I have to implement a POSIX compliant C shared library. A file will have some variables and the shared library will have some functions which need those variables. There is one special... (5 Replies)
Discussion started by: iamjag
5 Replies

3. OS X (Apple)

Linking to a shared library

I'm trying to get Valgrind to work with an openmpi application in OS X. However I want to hardcode the path to a shared library called libmpiwrap-amd64-darwin.so into my application so that it is available at runtime. In Linux this is relatively simple, I would just add the option... (0 Replies)
Discussion started by: Valgrinder
0 Replies

4. Shell Programming and Scripting

How to change a Makefile from building static library to shared library?

Hi: I have a library that it only offers Makefile for building static library. It built libxxx.a file. How do I in any way build a shared library? (either changin the Makefile or direct script or command to build shared library) Thanks. (1 Reply)
Discussion started by: cpthk
1 Replies

5. HP-UX

Shared Library Issue HP UX

I have never seen this issue before, but here is what is happening. I link an executable against two dynamic mlib libraries veclib and lapack. We place a newer version of these libraries in a write only directory and point the shlib_path at that directory. When the executable runs, it gets a... (3 Replies)
Discussion started by: sambarusty
3 Replies

6. Programming

Shared memory for shared library

I am writing a shared library in Linux (but compatible with other UNIXes) and I want to allow multiple instances to share a piece of memory -- 1 byte is enough. What's the "best" way to do this? I want to optimize for speed and portability. Obviously, I'll have to worry about mutual exclusion. (0 Replies)
Discussion started by: otheus
0 Replies

7. Programming

shared library not found

Hello, On a Centos 5.0 box, I have two versions of a library (sqlite): (1) in /usr/lib that was installed using yum (maybe from php but I am not really sure) (2) in /usr/local/lib that I installed myself by compiling from the source code. My C++ program contains the following lines: ... (12 Replies)
Discussion started by: JCR
12 Replies

8. Programming

Shared memory in shared library

I need to create a shared library to access an in memory DB. The DB is not huge, but big enough to make it cumbersome to carry around in every single process using the shared library. Luckily, it is pretty static information, so I don't need to worry much about synchronizing the data between... (12 Replies)
Discussion started by: DreamWarrior
12 Replies

9. UNIX for Advanced & Expert Users

shared library

What is the primary difference between static library and dynamic library? and how to write static shared library? (1 Reply)
Discussion started by: areef4u
1 Replies

10. Programming

Shared Library

hello all I want to work in shared libraries how can i work in Linux Environment ? (2 Replies)
Discussion started by: rajashekaran
2 Replies
Login or Register to Ask a Question