[compiler-rt] r357450 - ar_to_bc.sh: replace readlink -f with custom relative path resolution

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 21:58:30 PDT 2019


Author: maskray
Date: Mon Apr  1 21:58:29 2019
New Revision: 357450

URL: http://llvm.org/viewvc/llvm-project?rev=357450&view=rev
Log:
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.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh

Modified: compiler-rt/trunk/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh?rev=357450&r1=357449&r2=357450&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh (original)
+++ compiler-rt/trunk/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh Mon Apr  1 21:58:29 2019
@@ -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=




More information about the llvm-commits mailing list