[compiler-rt] r219333 - Remove bashisms and switch to /bin/sh

Ed Maste emaste at freebsd.org
Wed Oct 8 11:35:16 PDT 2014


Author: emaste
Date: Wed Oct  8 13:35:16 2014
New Revision: 219333

URL: http://llvm.org/viewvc/llvm-project?rev=219333&view=rev
Log:
Remove bashisms and switch to /bin/sh

On a default FreeBSD install Bash is not installed and fdescfs is not
mounted.  Use plain sh functionality instead.

Differential Revision: http://reviews.llvm.org/D5631

Modified:
    compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh

Modified: compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh?rev=219333&r1=219332&r2=219333&view=diff
==============================================================================
--- compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh (original)
+++ compiler-rt/trunk/lib/dfsan/scripts/check_custom_wrappers.sh Wed Oct  8 13:35:16 2014
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
 
 DFSAN_DIR=$(dirname "$0")/../
 DFSAN_CUSTOM_TESTS=${DFSAN_DIR}/../../test/dfsan/custom.cc
@@ -7,20 +7,22 @@ DFSAN_ABI_LIST=${DFSAN_DIR}/done_abilist
 
 DIFFOUT=$(mktemp -q /tmp/tmp.XXXXXXXXXX)
 ERRORLOG=$(mktemp -q /tmp/tmp.XXXXXXXXXX)
+DIFF_A=$(mktemp -q /tmp/tmp.XXXXXXXXXX)
+DIFF_B=$(mktemp -q /tmp/tmp.XXXXXXXXXX)
 
 on_exit() {
   rm -f ${DIFFOUT} 2> /dev/null
   rm -f ${ERRORLOG} 2> /dev/null
+  rm -f ${DIFF_A} 2> /dev/null
+  rm -f ${DIFF_B} 2> /dev/null
 }
 
 trap on_exit EXIT
-
-diff -u \
-  <(grep -E "^fun:.*=custom" ${DFSAN_ABI_LIST} | grep -v "dfsan_get_label" \
-    | sed "s/^fun:\(.*\)=custom.*/\1/" | sort ) \
-  <(grep -E "__dfsw.*\(" ${DFSAN_CUSTOM_WRAPPERS} \
-    | sed "s/.*__dfsw_\(.*\)(.*/\1/" \
-    | sort) > ${DIFFOUT}
+grep -E "^fun:.*=custom" ${DFSAN_ABI_LIST} | grep -v "dfsan_get_label" \
+  | sed "s/^fun:\(.*\)=custom.*/\1/" | sort > $DIFF_A
+grep -E "__dfsw.*\(" ${DFSAN_CUSTOM_WRAPPERS} \
+  | sed "s/.*__dfsw_\(.*\)(.*/\1/" | sort > $DIFF_B
+diff -u $DIFF_A $DIFF_B > ${DIFFOUT}
 if [ $? -ne 0 ]
 then
   echo -n "The following differences between the ABI list and ">> ${ERRORLOG}
@@ -28,13 +30,11 @@ then
   cat ${DIFFOUT} >> ${ERRORLOG}
 fi
 
-diff -u \
-  <(grep -E __dfsw_ ${DFSAN_CUSTOM_WRAPPERS} \
-    | sed "s/.*__dfsw_\([^(]*\).*/\1/" \
-    | sort) \
-  <(grep -E "^\\s*test_.*\(\);" ${DFSAN_CUSTOM_TESTS} \
-    | sed "s/.*test_\(.*\)();/\1/" \
-    | sort) > ${DIFFOUT}
+grep -E __dfsw_ ${DFSAN_CUSTOM_WRAPPERS} \
+  | sed "s/.*__dfsw_\([^(]*\).*/\1/" | sort > $DIFF_A
+grep -E "^\\s*test_.*\(\);" ${DFSAN_CUSTOM_TESTS} \
+  | sed "s/.*test_\(.*\)();/\1/" | sort > $DIFF_B
+diff -u $DIFF_A $DIFF_B > ${DIFFOUT}
 if [ $? -ne 0 ]
 then
   echo -n "The following differences between the implemented " >> ${ERRORLOG}
@@ -42,7 +42,7 @@ then
   cat ${DIFFOUT} >> ${ERRORLOG}
 fi
 
-if [[ -s ${ERRORLOG} ]]
+if [ -s ${ERRORLOG} ]
 then
   cat ${ERRORLOG}
   exit 1





More information about the llvm-commits mailing list