buildrootschalter/support
Yann E. MORIN 514d7cab61 infra: do not append an empty LD_LIBRARY_PATH
When we set LD_LIBRARY_PATH when building our host tools, we append any
pre-existing value to our custom path:
        LD_LIBRARY_PATH="$(HOST_DIR)/usr/lib:$(LD_LIBRARY_PATH)"

But then if LD_LIBRARY_PATH was previously empty, we end up with an
LD_LIBRARY_PATH that ends with a colon.

Also, when we check that an existing LD_LIBRARY_PATH does not contain
CWD, we previously did not look for a zero-length prefix.

Since 'man ld.so' says of LD_LIBRARY_PATH:
    A colon-separated list of directories in which to search for ELF
    libraries at execution-time. Similar to the PATH environment
    variable.

And POSIX states about PATH:
    A zero-length prefix is a legacy feature that indicates the current
    working directory.

And bash also recognises a zero-length prefix to search in CWD:
    A zero-length (null) directory name in the value of PATH indicates
    the current directory.

We may thus end up on a system where a zero-length prefix in
LD_LIBRARY_PATH is interpreted as CWD.

Do not append the previous LD_LIBRARY_PATH if it was empty, and check
for a zero-length prefix when checking dependencies.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-11-30 23:56:14 +01:00
..
dependencies infra: do not append an empty LD_LIBRARY_PATH 2014-11-30 23:56:14 +01:00
download Change /bin/bash shebangs into /usr/bin/env bash 2014-10-25 01:55:37 +02:00
dummy-external core: allow external Config.in/makefile code to be integrated 2013-12-08 22:39:42 +01:00
gnuconfig Update config.guess and config.sub scripts to latest versions. 2013-10-27 15:29:38 +01:00
kconfig infra: replace BUILDROOT_CONFIG with BR2_CONFIG 2014-02-09 17:00:13 +01:00
legal-info legal-info: infrastructure to collect legally-relevant material 2012-07-17 19:05:49 +02:00
libtool support/libtool: improve version 1.5 static patching 2014-07-31 16:35:49 +02:00
misc toolchainfile.cmake.in: do not force the CMAKE_{C, CXX}_FLAGS to the cache 2014-09-28 20:57:26 +02:00
scripts Change /bin/bash shebangs into /usr/bin/env bash 2014-10-25 01:55:37 +02:00