diff options
author | Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> | 2013-11-18 10:34:59 +0000 |
---|---|---|
committer | Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> | 2013-11-18 10:34:59 +0000 |
commit | ea8e1447d1f563f743b6b73739f4ff0912595752 (patch) | |
tree | 57489ec2b05135a3faf63f5e4dad4ab0c77f533e /utils | |
parent | 38ea7b55ece37f189726ff5bc60e0b5c2754bee4 (diff) | |
download | external_llvm-ea8e1447d1f563f743b6b73739f4ff0912595752.zip external_llvm-ea8e1447d1f563f743b6b73739f4ff0912595752.tar.gz external_llvm-ea8e1447d1f563f743b6b73739f4ff0912595752.tar.bz2 |
test-release.sh: tweak RPATH for the binary packages.
libtool sets RPATH to "$ORIGIN/../lib:/the/directory/where/it/was/built/lib" so that a developper can use the built or the installed version seamlessly. Our binary packages should not have this developer friendly tweak, as the users of the binaries will not have the build tree.
Beside, in case the development tree is a possibly on an automounted share, this can create very bad user experience : they will incur an automount timeout penalty and will get a very bad feeling of llvm/clang's speed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/release/test-release.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/utils/release/test-release.sh b/utils/release/test-release.sh index 6c17b46..c4cf521 100755 --- a/utils/release/test-release.sh +++ b/utils/release/test-release.sh @@ -180,6 +180,18 @@ if [ "$do_dragonegg" = "yes" ]; then fi fi +# Make sure that a required program is available +function check_program_exists() { + local program="$1" + if ! type -P $program > /dev/null 2>&1 ; then + echo "program '$1' not found !" + exit 1 + fi +} + +check_program_exists 'chrpath' +check_program_exists 'file' +check_program_exists 'objdump' # Make sure that the URLs are valid. function check_valid_urls() { @@ -328,6 +340,21 @@ function test_llvmCore() { cd $BuildDir } +# Clean RPATH. Libtool adds the build directory to the search path, which is +# not necessary --- and even harmful --- for the binary packages we release. +function clean_RPATH() { + local InstallPath="$1" + for Candidate in `find $InstallPath/{bin,lib} -type f`; do + if file $Candidate | grep ELF | egrep 'executable|shared object' > /dev/null 2>&1 ; then + rpath=`objdump -x $Candidate | grep 'RPATH' | sed -e's/^ *RPATH *//'` + if [ -n "$rpath" ]; then + newrpath=`echo $rpath | sed -e's/.*\(\$ORIGIN[^:]*\).*/\1/'` + chrpath -r $newrpath $Candidate 2>&1 > /dev/null 2>&1 + fi + fi + done +} + set -e # Exit if any command fails if [ "$do_checkout" = "yes" ]; then @@ -415,6 +442,7 @@ for Flavor in $Flavors ; do $llvmCore_phase1_objdir $llvmCore_phase1_installdir build_llvmCore 1 $Flavor \ $llvmCore_phase1_objdir + clean_RPATH $llvmCore_phase1_installdir # Test clang if [ "$do_clang" = "yes" ]; then @@ -427,6 +455,7 @@ for Flavor in $Flavors ; do $llvmCore_phase2_objdir $llvmCore_phase2_installdir build_llvmCore 2 $Flavor \ $llvmCore_phase2_objdir + clean_RPATH $llvmCore_phase2_installdir ######################################################################## # Phase 3: Build llvmCore with newly built clang from phase 2. @@ -437,6 +466,7 @@ for Flavor in $Flavors ; do $llvmCore_phase3_objdir $llvmCore_phase3_installdir build_llvmCore 3 $Flavor \ $llvmCore_phase3_objdir + clean_RPATH $llvmCore_phase3_installdir ######################################################################## # Testing: Test phase 3 @@ -478,6 +508,7 @@ for Flavor in $Flavors ; do build_llvmCore 2 $Flavor \ $llvmCore_de_phase2_objdir build_dragonegg 2 $Flavor $llvmCore_de_phase2_installdir $dragonegg_phase2_objdir + clean_RPATH $llvmCore_de_phase2_installdir ######################################################################## # Phase 3: Build llvmCore with newly built dragonegg from phase 2. @@ -489,6 +520,7 @@ for Flavor in $Flavors ; do build_llvmCore 3 $Flavor \ $llvmCore_de_phase3_objdir build_dragonegg 3 $Flavor $llvmCore_de_phase3_installdir $dragonegg_phase3_objdir + clean_RPATH $llvmCore_de_phase3_installdir ######################################################################## # Testing: Test phase 3 |