Index: utils/release/test-release.sh
===================================================================
--- utils/release/test-release.sh	(revision 242570)
+++ utils/release/test-release.sh	(working copy)
@@ -12,7 +12,8 @@
 #
 #===------------------------------------------------------------------------===#
 
-if [ `uname -s` = "FreeBSD" ]; then
+System=`uname -s`
+if [ $System = "FreeBSD" ]; then
     MAKE=gmake
 else
     MAKE=make
@@ -54,8 +55,9 @@ function usage() {
     echo " -use-autoconf        Use autoconf instead of cmake"
 }
 
-if [ `uname -s` = "Darwin" ]; then
+if [ $System = "Darwin" -o $System = "FreeBSD" ]; then
   # compiler-rt doesn't yet build with CMake on Darwin.
+  # libcxxabi doesn't yet build with CMake on FreeBSD.
   use_autoconf="yes"
 fi
 
@@ -176,7 +178,7 @@ function check_program_exists() {
   fi
 }
 
-if [ `uname -s` != "Darwin" ]; then
+if [ $System != "Darwin" ]; then
   check_program_exists 'chrpath'
   check_program_exists 'file'
   check_program_exists 'objdump'
@@ -337,13 +339,13 @@ function test_llvmCore() {
 # 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() {
-  if [ `uname -s` = "Darwin" ]; then
+  if [ $System = "Darwin" ]; then
     return
   fi
   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 *//'`
+      rpath=`objdump -x $Candidate | sed -ne'/RPATH/{s/^ *RPATH *//;p;}'`
       if [ -n "$rpath" ]; then
         newrpath=`echo $rpath | sed -e's/.*\(\$ORIGIN[^:]*\).*/\1/'`
         chrpath -r $newrpath $Candidate 2>&1 > /dev/null 2>&1
@@ -470,8 +472,8 @@ for Flavor in $Flavors ; do
             # Substitute 'Phase2' for 'Phase3' in the Phase 2 object file in
             # case there are build paths in the debug info. On some systems,
             # sed adds a newline to the output, so pass $p3 through sed too.
-            if ! cmp --ignore-initial=16 <(sed -e 's,Phase2,Phase3,g' $p2) \
-                    <(sed -e '' $p3) > /dev/null 2>&1 ; then
+            if ! cmp -s <(sed -e 's,Phase2,Phase3,g' $p2) <(sed -e '' $p3) \
+                    16 16 ; then
                 echo "file `basename $p2` differs between phase 2 and phase 3"
             fi
         done
