llvm.org GIT mirror llvm / ea8e144
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 Arnaud A. de Grandmaison 7 years ago
1 changed file(s) with 32 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
179179 fi
180180 fi
181181
182 # Make sure that a required program is available
183 function check_program_exists() {
184 local program="$1"
185 if ! type -P $program > /dev/null 2>&1 ; then
186 echo "program '$1' not found !"
187 exit 1
188 fi
189 }
190
191 check_program_exists 'chrpath'
192 check_program_exists 'file'
193 check_program_exists 'objdump'
182194
183195 # Make sure that the URLs are valid.
184196 function check_valid_urls() {
327339 cd $BuildDir
328340 }
329341
342 # Clean RPATH. Libtool adds the build directory to the search path, which is
343 # not necessary --- and even harmful --- for the binary packages we release.
344 function clean_RPATH() {
345 local InstallPath="$1"
346 for Candidate in `find $InstallPath/{bin,lib} -type f`; do
347 if file $Candidate | grep ELF | egrep 'executable|shared object' > /dev/null 2>&1 ; then
348 rpath=`objdump -x $Candidate | grep 'RPATH' | sed -e's/^ *RPATH *//'`
349 if [ -n "$rpath" ]; then
350 newrpath=`echo $rpath | sed -e's/.*\(\$ORIGIN[^:]*\).*/\1/'`
351 chrpath -r $newrpath $Candidate 2>&1 > /dev/null 2>&1
352 fi
353 fi
354 done
355 }
356
330357 set -e # Exit if any command fails
331358
332359 if [ "$do_checkout" = "yes" ]; then
414441 $llvmCore_phase1_objdir $llvmCore_phase1_installdir
415442 build_llvmCore 1 $Flavor \
416443 $llvmCore_phase1_objdir
444 clean_RPATH $llvmCore_phase1_installdir
417445
418446 # Test clang
419447 if [ "$do_clang" = "yes" ]; then
426454 $llvmCore_phase2_objdir $llvmCore_phase2_installdir
427455 build_llvmCore 2 $Flavor \
428456 $llvmCore_phase2_objdir
457 clean_RPATH $llvmCore_phase2_installdir
429458
430459 ########################################################################
431460 # Phase 3: Build llvmCore with newly built clang from phase 2.
436465 $llvmCore_phase3_objdir $llvmCore_phase3_installdir
437466 build_llvmCore 3 $Flavor \
438467 $llvmCore_phase3_objdir
468 clean_RPATH $llvmCore_phase3_installdir
439469
440470 ########################################################################
441471 # Testing: Test phase 3
477507 build_llvmCore 2 $Flavor \
478508 $llvmCore_de_phase2_objdir
479509 build_dragonegg 2 $Flavor $llvmCore_de_phase2_installdir $dragonegg_phase2_objdir
510 clean_RPATH $llvmCore_de_phase2_installdir
480511
481512 ########################################################################
482513 # Phase 3: Build llvmCore with newly built dragonegg from phase 2.
488519 build_llvmCore 3 $Flavor \
489520 $llvmCore_de_phase3_objdir
490521 build_dragonegg 3 $Flavor $llvmCore_de_phase3_installdir $dragonegg_phase3_objdir
522 clean_RPATH $llvmCore_de_phase3_installdir
491523
492524 ########################################################################
493525 # Testing: Test phase 3