[yocto] [prelink-cross] error while loading shared libraries: ld-linux.so.3

Florian Boehmak florian at fnbk.cc
Tue Jun 16 00:01:33 PDT 2015


Hi,

I am having difficulties to cross-prelink a simple hello world program.
Prelinking for my x86 machine works fine (host system) but when using the
arm cross-compile toolchain I get the error:

prelink: bin_arm/hello: Could not parse `/usr/local/sbin//prelink-rtld:
error while loading shared libraries: ld-linux.so.3'

If I understand it correctly then prelink-rtld emulates ld-linux.so but why
is it parsed by rtld?

Here are my files:

# main.cpp

#include <stdio.h>
#include "world.h"
int main (int argc, char *argv[])
{
fprintf(stdout, "hello\n");
World w;
w.Str();
return 0;
}


# world.cpp

#include "world.h"
void World::Str()
{
fprintf(stdout, "world\n");
}


# prelink_arm.conf

-l arm-2012.03/arm-none-linux-gnueabi/libc/lib
-h arm-2012.03/arm-none-linux-gnueabi/libc/lib
-l arm-2012.03/arm-none-linux-gnueabi/libc/usr/lib
-h arm-2012.03/arm-none-linux-gnueabi/libc/usr/lib


# compiling

../arm-2012.03/bin/arm-none-linux-gnueabi-gcc -Wall -fPIC -shared -Iinclude
-o lib_arm/libworld.so src/world.cpp
arm-2012.03/bin/arm-none-linux-gnueabi-gcc -Wall -Iworld/include
-Lworld/lib_arm/ -lworld -o bin_arm/hello src/main.cpp


# prelink-cross

PATH=/usr/local/sbin prelink --verbose --cache-file=cache/prelink_arm.cache
--config-file=prelink_arm.conf
--ld-library-path="world/lib_arm;arm-2012.03/arm-none-linux-gnueabi/libc/lib;arm-2012.03/arm-none-linux-gnueabi/libc/usr/lib;"
-h bin_arm/hello


I am sort of stuck. Could you point me in the right direction. What am I
missing or doing wrong?
Thank you.

Cheers
Florian

Ps. I have put together the code on github this would be the
"shared-library" branch.
https://github.com/fnbk/prelink-cross-example

Ps. I posted a similar question on stackoverflow, cross-prelinking but
without shared libraries.
http://stackoverflow.com/q/30849060/5011904
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20150616/83300928/attachment.html>


More information about the yocto mailing list