QNAP [ MySySRoot ] [ 1.221106 ] add an alternative sysroot to your NAS

  • Vague de SPAM

    Suite à une vague de spam sur le forum, les inscriptions sont temporairement limitées.

    Après votre inscription, un membre de l'équipe devra valider votre compte avant qu'il ne soit activé. Nous sommes désolés pour la gêne occasionnée et vous remercions de votre patience.

QoolBox

Représentant QNAP
2 Janvier 2014
10 748
185
173
51
France
www.qnap.com
Professionnel
Oui
mysysroot.png

Source : none (self creation with cross-tool-ng)

Download : x64 intel/amd , arm64 , armv7


About :


Intend to add an alternative root
this allow to develloper to use/execute binaries built until a libc 2.36.1

it create an /opt/sysroot where new sysroot is set

readlef / patchelf are added to NAS $PATH

example :

To build an executable that will work with the new glibc, do this:

g++ main.o -o myapp … \
-Wl,–rpath=/opt/sysroot/lib \
-Wl,–dynamic-linker=/opt/sysroot/lib/ld-linux.so.2

The -rpath linker option will make the runtime loader search for libraries in /opt/sysroot/libc (so you wouldn’t have to set LD_LIBRARY_PATH before running it), and the -dynamic-linker option will “bake” path to correct ld-linux.so.2 into the application.

./patchelf –set-interpreter /opt/sysroot/lib/ld-linux.so.2 –set-rpath /opt/sysroot/lib myapp

When you try to run a binary in linux, the binary tries to load the linker, then the libraries, and they should all be in the path and/or in the right place. If your problem is with the linker and you want to find out which path your binary is looking for, you can find out with this command:

$ readelf -l myapp | grep interpreter
[Requesting program interpreter: /lib/ld-linux.so.2]

If your problem is with the libs, commands that will give you the libs being used are:
$ readelf -d myapp | grep Shared
$ ldd myapp