Commit Graph

6 Commits

Author SHA1 Message Date
Jo-Philipp Wich
72d751cba9 build: rework library bundling
Rework the bundle-libraries.sh implementation to use a more robust approach
for executing host binaries through the shipped ELF loader and libraries.

The previous approach relied on symlinks pointing to a wrapper script which
caused various issues, especially with multicall binaries as the original
argv[0] name was not preserved through the ld.so invocation. Another down-
side was the fact that the actual binaries got moved into another directory
which caused executables to fail looking up resources with paths relative
to the executable location.

The new library wrapper implements the following improvements:

 - Instead of symlinks pointing to a common wrapper, each ELF executable
   is now replaced by a unqiue shell script which retains the original
   program name getting called

 - Instead of letting ld.so invoke the ELF executable directly, launch
   the final ELF binary through a helper program which fixes up the argv[0]
   argument for the target program

 - Support sharing a common location for the bundled libraries instead of
   having one copy in each directory containing wrapped binaries

Finally modify the SDK build to wrap the staging_dir and toolchain binaries
which allows to use the SDK on systems with a different glibc version.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-01-10 12:27:28 +01:00
Jo-Philipp Wich
24a7ccb056 treewide: replace jow@openwrt.org with jo@mein.io
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-06-07 11:42:52 +02:00
Felix Fietkau
aab9ffeacc scripts/bundle-libraries: fall back to only copying binaries if ldd is unavailable (e.g. non-linux system)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40967
2014-06-02 13:27:23 +00:00
Jo-Philipp Wich
509f39a10a scripts: bundle-libraries.sh: support mixing 32bit and 64bit binaries
SVN-Revision: 35349
2013-01-28 15:54:27 +00:00
Jo-Philipp Wich
c70e919ae8 fix library bundling when host libraries reside in /lib/tls/ or similar
SVN-Revision: 33353
2012-09-09 22:37:32 +00:00
Jo-Philipp Wich
183f625a48 add a helper script to bundle required libraries for host utilities
SVN-Revision: 33195
2012-08-15 13:28:23 +00:00