From 72759e8c1e743abfa3dddfaf6d9899f78845f4dc Mon Sep 17 00:00:00 2001 From: David James Date: Mon, 23 May 2011 10:38:11 -0700 Subject: [PATCH] Update build_image to use ldd distributed with target if it's present. BUG=chromium-os:13977 TEST=Build an image with new compiler, boot image and verify new ldd is used. Build image with old compiler and verify old ldd is used. Change-Id: I8cbc5b87342245106f0a8fd0fa80ae42329eff60 Reviewed-on: http://gerrit.chromium.org/gerrit/1367 Tested-by: David James Reviewed-by: Raymes Khoury --- build_image | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build_image b/build_image index d7ce93377b..22422898f5 100755 --- a/build_image +++ b/build_image @@ -460,8 +460,12 @@ update_dev_packages() { # Leave core files for developers to inspect. sudo touch "${ROOT_FS_DIR}/root/.leave_core" - # The ldd tool is a useful shell script but lives in glibc; just copy it. - sudo cp -a "$(which ldd)" "${root_dev_dir}/usr/bin" + # This hack is only needed for devs who have old versions of glibc, which + # filtered out ldd when cross-compiling. TODO(davidjames): Remove this hack + # once everybody has upgraded to a new version of glibc. + if [[ ! -x "${ROOT_FS_DIR}/usr/bin/ldd" ]]; then + sudo cp -a "$(which ldd)" "${ROOT_FS_DIR}/usr/bin" + fi # If vim is installed, then a vi symlink would probably help. if [[ -x "${ROOT_FS_DIR}/usr/local/bin/vim" ]]; then