0

Bit of background: I have some C code I need to crosscompile onto a mips64-linux target from an i686-linux host, I only have a shared object library on the target (cross compiling the libraries on the host proved a challenge).

Is it possible and how would one go about linking the shared object when compiling on the host so that it would successfully use the shared object library on the target when executed?

Many thanks!

Pk boss
  • 274
  • 1
  • 13
toocou
  • 11
  • 2
  • "I only have a shared object library on the target". What does this mean? Can you copy it between host and target? – n. m. could be an AI Sep 15 '14 at 10:16
  • I can copy it, but surely this will run into trouble when executing on the target as it will be looking for the shared library on the host? – toocou Sep 15 '14 at 10:21
  • Wouldn't it use target libs to compile in the host? Why would look for target libs in the host when executing? – KiaMorot Sep 15 '14 at 10:28
  • It would use whatever I point it to I suppose, so if I copy over the shared library from the target to the host, compile and then execute on the target it should be fine? – toocou Sep 15 '14 at 10:45
  • I would expect so at least. – KiaMorot Sep 15 '14 at 11:14
  • You only need a shared library compiled for the target. You use the same library both on the host at link-time, and on the target at run-time. An executable cannot look for a shared library on the host, it has no idea what this host thing is, and does not remember paths where libraries were located at link time. – n. m. could be an AI Sep 15 '14 at 15:30

0 Answers0