ar_to_bc.sh: replace readlink -f with custom relative path resolution
llvm-ar is a crunchgen-style executable dispatching to dlltool,ranlib,lib,ar based on argv[0].
In our content-addressable storage, readlink -f resolves paths to some
digest and thus lost the original "llvm-ar" filename.
Replace it with a custom path resolution to fix the problem.
@@ -9,8 +9,8 @@ if [ "$#" -le 1 ]; then
usage
fi
-AR=$(readlink -f $AR)
-LINK=$(readlink -f $LINK)
+[[ AR == /* ]] || AR=$PWD/$AR
+[[ LINK == /* ]] || LINK=$PWD/$LINK
INPUTS=
OUTPUT=
