Go to file
Yann E. MORIN 5c0c385226 core: check host executables have appropriate RPATH
When we build our host programs, and they depend on a host library we
also build, we want to ensure that program actually uses that library at
runtime, and not the one from the system.

We currently ensure that in two ways:
  - we add a RPATH tag that points to our host library directory,
  - we export LD_LIBRARY_PATH to point to that same directory.

With these two in place, we're pretty much confident that our host
libraries will be used by our host programs.

However, it turns our that not all the host programs we build end up
with an RPATH tag:
  - some packages do not use our $(HOST_LDFLAGS)
  - some packages' build system are oblivious to those LDFLAGS

In this case, there are two situations:
  - the program is not linked to one of our host libraries: it in fact
    does not need an RPATH tag [0]
  - the program actually uses one of our host libraries: in that case it
    should have had an RPATH tag pointing to the host directory.

For libraries, they only need an RPATH if they depend on another library
that is not installed in the standard library path. However, any system
library will already be in the standard library path, and any library we
install ourselves is in $(HOST_DIR)/usr/lib so already in RPATH.

We add a new support script that checks that all ELF executables have
a proper DT_RPATH (or DT_RUNPATH) tag when they link to our host
libraries, and reports those file that are missing an RPATH. If a file
missing an RPATH is an executable, the script aborts; if only libraries
are are missing an RPATH, the script does not abort.

[0] Except if it were to dlopen() it, of course, but the only program
I'm aware of that does that is openssl, and it has a correct RPATH tag.

[Peter: reworded as suggested by Arnout, fix HOT_DIR typo in comment]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-11-18 22:47:10 +01:00
arch arch: add tune options for powerpc e5500 and e6500 2015-11-17 00:16:39 +01:00
board configs/qemu: enable tmpfs for microblaze 2015-11-17 21:20:53 +01:00
boot uboot: fix ARCH for i386 and x86_64 2015-11-16 21:16:37 +01:00
configs configs/qemu: bump x86 to 4.3 kernel 2015-11-17 21:20:44 +01:00
docs docs/manual: fix bash export syntax in example code 2015-11-11 23:12:30 +01:00
fs fs/ext2: add options for extra space and extra inodes 2015-10-31 15:56:56 +01:00
linux linux: bump default version to 4.3 2015-11-02 20:56:43 +01:00
package core: check host executables have appropriate RPATH 2015-11-18 22:47:10 +01:00
support core: check host executables have appropriate RPATH 2015-11-18 22:47:10 +01:00
system system: Fix warning when selecting systemd and ensure merged /usr workarounds are enabled 2015-11-09 21:48:10 +01:00
toolchain toolchain/external: fix gdbserver install with Linaro 2015.08 2015-11-05 23:21:38 +01:00
.defconfig
.gitignore
CHANGES Update for 2015.11-rc1 2015-11-07 22:43:57 +01:00
Config.in
Config.in.legacy
COPYING
Makefile Update for 2015.11-rc1 2015-11-07 22:43:57 +01:00
Makefile.legacy
README

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on Freenode IRC.