vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi! I build my task using a shared obj. Now I make a call to some function in some library in one of the source files that make up the shared object. However the library that is satisfying this dependency was not linked when task was built. So whenever I rebuild a shared obj. I want to relink task only if needed: if my shared obj has references that cannot be satisfied by existing set of libraries, then add the library needed and relink it. On SUN I can acheive this using ldd -r taskname and it shows if any references that cannot be satisfied by existing set of libraries exist. How do I do this on AIX/IBM's. Thanks, Sunil |
| |||
| In article <d924fa71.0401211306.5e6d7abb@posting.google.com >, sunil wrote: > Hi! > I build my task using a shared obj. Now I make a call to some > function in some library in one of the source files that make up the > shared object. However the library that is satisfying this dependency > was not linked when task was built. So whenever I rebuild a shared > obj. I want to relink task only if needed: if my shared obj has > references that cannot be satisfied by existing set of libraries, then > add the library needed and relink it. On SUN I can acheive this using > ldd -r taskname and it shows if any references that cannot be > satisfied by existing set of libraries exist. How do I do this on > AIX/IBM's. > Thanks, > Sunil Try setting LIB_PATH to the directory where your *.so exists. |
| |||
| Mike wrote: > > Try setting LIB_PATH to the directory where your *.so exists. Um, it's "LIBPATH". -- Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE __________________________________________________ ______________________ |
| |||
| sunil wrote: > I build my task using a shared obj. Do you mean you built your program? I.e. main executable? Or do you mean you've built a shared (loadable) module? Now I make a call to some > function in some library in one of the source files that make up the > shared object. However the library that is satisfying this dependency > was not linked when task was built. You normally can't do this on AIX. By default, all references are required to be resolved at link time. If you're missing a definition, you'll know about it when the module gets built. All that said, I would strongly suggest _not_ using the -brtl option until you're more comfortable with constructing applications on AIX. Also, for more info see http://www-106.ibm.com/developerwork...dfs/aix_ll.pdf -- Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE __________________________________________________ ______________________ |
| ||||
| Thanks for all of your responses. Here is the situation (These compile/link lines are not accurate.I am a newbie to AIX/IBM, I am using these commands to just explain problem in simple terms) cc -o main main.c -lmylib -llib1 -llib2 cc -c mylib.c ld -G -o libmylib.so mylib.o Now I modify mylib.c to make a call to function foo() foo() is defined in liblib3.so that was not linked above. Since linking takes a long time in my case (I have some 60 libraries) I want to relink only if necessary. So now I recompile mylib.c and rebuild mylib.so. I want to relink executable only if needed. On SUN I can do this as: ldd -r main | grep "symbol not found" and if this succeeds relink. Is it possible to do something like this on AIX? Thanks, Sunil. "Gary R. Hook" <nospam@nospammers.net> wrote in message news:<cHUPb.2594$nD7.909785248@newssvr11.news.prod igy.com>... > sunil wrote: > > > I build my task using a shared obj. > > Do you mean you built your program? I.e. main executable? Or > do you mean you've built a shared (loadable) module? > > Now I make a call to some > > function in some library in one of the source files that make up the > > shared object. However the library that is satisfying this dependency > > was not linked when task was built. > > You normally can't do this on AIX. By default, all references > are required to be resolved at link time. If you're missing > a definition, you'll know about it when the module gets built. > All that said, I would strongly suggest _not_ using the -brtl > option until you're more comfortable with constructing > applications on AIX. > > Also, for more info see > http://www-106.ibm.com/developerwork...dfs/aix_ll.pdf |