-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract *.a to *.bc conversion into separate script.
Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D30013 llvm-svn: 295272
- Loading branch information
1 parent
a1a8646
commit e4465db
Showing
2 changed files
with
53 additions
and
17 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
compiler-rt/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
function usage() { | ||
echo "Usage: $0 INPUT... OUTPUT" | ||
exit 1 | ||
} | ||
|
||
if [ "$#" -le 1 ]; then | ||
usage | ||
fi | ||
|
||
AR=$(readlink -f $AR) | ||
LINK=$(readlink -f $LINK) | ||
|
||
INPUTS= | ||
OUTPUT= | ||
for ARG in $@; do | ||
INPUTS="$INPUTS $OUTPUT" | ||
OUTPUT=$(readlink -f $ARG) | ||
done | ||
|
||
echo Inputs: $INPUTS | ||
echo Output: $OUTPUT | ||
|
||
SCRATCH_DIR=$(mktemp -d) | ||
ln -s $INPUTS $SCRATCH_DIR/ | ||
|
||
pushd $SCRATCH_DIR | ||
|
||
for INPUT in *; do | ||
for OBJ in $($AR t $INPUT); do | ||
$AR x $INPUT $OBJ | ||
mv -f $OBJ $(basename $INPUT).$OBJ | ||
done | ||
done | ||
|
||
$LINK *.o -o $OUTPUT | ||
|
||
rm -rf $SCRATCH_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters