views:

684

answers:

1

My compiler:xlc version 10.1 Environment: AIX5.3 Linker: ld

When i work on Linux , with gcc (4.4.1) i use the following option

-Wl,-rpath

(-Wl for the linker options) it adds a directory to the runtime library search path.

What's the equivalent for xlc compiler ?

or what's the equivalent to -rpath for the linker.

Thank you.

+5  A: 

My first answer was: The AIX linker option for that one is -blibpath. (If it's any help, for the Sun compiler, it's -R. Just in case!)

I now have edited it to respond to the OP's comment: Right you are. Actually, reading the AIX linker manual (man ld) it looks like -L is the right option already!

   -LDirectory
        Adds Directory to the list of search directories used for finding
        libraries designated by the -l (lowercase letter L) flag. The list
        of directories, including the standard library directories, is
        also recorded in the output object file loader section for use by
        the system loader unless you use the -blibpath, -bnolibpath, or
        -bsvr4 option. You can repeat this flag.
FX
it is not really the same ,because you must specify something like:-blibpath:/usr/lib:/lib/:my_lib etc ....I dont want to break existing library path
Nadir SOUALEM
Right about `-blibpath`, I edited my answer accordingly.
FX
You do it ! -L seems enough, -blibpath, -bnolibpath, or -bsvr4 option inihibits this option.
Nadir SOUALEM