Question about LD_LIBRARY_PATH
What's it for actually ? With FreePascal I'm trying to cross-compile for arm-linux. Compiling goes fine, but when linking, there is an error : libdl.so is wrong. It turns out that the linker finds the libdl.so for i386-linux. If I rename libdl.so, the linker finds the one for arm-linux. I tried to include the path to the arm-linux libdl.so in LD_LIBRARY_PATH, but then I can't compile any more. I can't even grep any more : I made a script to set that path, and I wanted to verify it : set | grep LIB. The errormessage : ELF file OS ABI invalid. This seems specific for Suse, on a Mandrake system there seems no problem, but I don't have that. I tried on Suse 9.1 and 9.2. I could copy the libdl.so or make a link in the current directory, but that's only a workaround. AFAIK standard linux-tools (assembler, linker,...) are used. Any suggestions ? TIA -- Met vriendelijke groeten, Koenraad Lelong R&D Manager ACE electronics n.v.
On Thursday 27 January 2005 14:34, Koenraad Lelong wrote:
What's it for actually ? With FreePascal I'm trying to cross-compile for arm-linux. Compiling goes fine, but when linking, there is an error : libdl.so is wrong. It turns out that the linker finds the libdl.so for i386-linux. If I rename libdl.so, the linker finds the one for arm-linux. I tried to include the path to the arm-linux libdl.so in LD_LIBRARY_PATH, but then I can't compile any more. I can't even grep any more : I made a script to set that path, and I wanted to verify it : set | grep LIB. The errormessage
: ELF file OS ABI invalid.
This seems specific for Suse, on a Mandrake system there seems no problem, but I don't have that. I tried on Suse 9.1 and 9.2. I could copy the libdl.so or make a link in the current directory, but that's only a workaround. AFAIK standard linux-tools (assembler, linker,...) are used. Any suggestions ?
The solution is probably to find an option in FreePascal to tell it where it should get the library. As you discovered, LD_LIBRARY_PATH may be used for it but it is also used by every other program on your machine so it's not a good solution for cross compiling. I haven't looked at FreePascal, but I'm pretty sure there's an option in there somewhere
Koenraad Lelong <k.lelong@ace-electronics.be> [27 Jan 2005 14:34 +0100]:
What's it for actually ?
The very first link google turns up for LD_LIBRARY_PATH will explain you what it's used for.
AFAIK standard linux-tools (assembler, linker,...) are used. Any suggestions ?
The compiler must have a way to pass the path to the (static) linker. For the C compiler this is the -L command line switch. Philipp
participants (3)
-
Anders Johansson
-
Koenraad Lelong
-
Philipp Thomas