mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
Avoid early pipefail exits due to grep failures in stage comparisons.
If objects or executables did not contain any RPATH, grep would return nonzero, and the whole stage comparison loop would unexpectedly exit. Fix this by checking the grep result explicitly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242722 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
186b3e7e9e
commit
85e9772512
@ -359,10 +359,12 @@ 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
|
||||
if rpath=`objdump -x $Candidate | grep 'RPATH'` ; then
|
||||
rpath=`echo $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
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user