Hi,
Once I had compiled minimad for ARM using the Lart cross compiler I used the 'file' command to see some stats on the resulting executable. It tells me that the file is an ELF arm executable, dynamicly linked (uses shared libraries) and a few other things.
Now shared libraried are linked at runtime, right? So when I take the minimad executable and dowload it onto the arm evaluator board the shared libraries will be left behind and it will not work. Is this reasoning correct or am i missing something? If I am correct how do I go about telling the compiler to do static linking?
Thanks Gareth
On Wednesday, April 10, 2002, at 08:56 PM, Gareth wrote:
Once I had compiled minimad for ARM using the Lart cross compiler I used the 'file' command to see some stats on the resulting executable. It tells me that the file is an ELF arm executable, dynamicly linked (uses shared libraries) and a few other things.
Now shared libraried are linked at runtime, right? So when I take the minimad executable and dowload it onto the arm evaluator board the shared libraries will be left behind and it will not work. Is this reasoning correct or am i missing something? If I am correct how do I go about telling the compiler to do static linking?
The shared libraries in question are usually things like the C library (libc.so) and perhaps the math library (libm.so). Presumably these are already present in the runtime environment on your evaluator board, so it should work fine. (minimad doesn't really need libm, so you can eliminate this from the link if necessary.)
libmad is not compiled as a shared library unless you give --enable-shared to `configure', so you shouldn't need to worry about this being missing.
If you really need to create a statically linked executable, you can relink giving the -static flag to GCC.
-- Rob Leslie rob@mars.org