3 # FIXME: do we need a license (or whatever else) header here?
5 # This script merges libsanitizer sources from upstream.
11 git clone https
://github.com
/llvm
/llvm-project.git upstream
20 (cd $1; ls *.
{cc
,cpp
,h
,inc
,S
} 2> /dev
/null
)
24 change_comment_headers
() {
25 for f
in $
(list_files
$1); do
26 sed -n 3p
$1/$f |
grep -q 'The LLVM Compiler Infrastructure' ||
continue
27 changed
=$
(awk 'NR != 2 && NR != 3' < $1/$f)
28 echo "$changed" > $1/$f
32 # ARGUMENTS: upstream_path local_path
33 # This function merges changes from the directory upstream_path to
34 # the directory local_path.
36 upstream_path
=upstream
/$1
38 change_comment_headers
$upstream_path
39 echo MERGE
: $upstream_path
40 all
=$
( (list_files
$upstream_path; list_files
$local_path) |
sort |
uniq)
43 if [ -f $upstream_path/$f -a -f $local_path/$f ]; then
44 echo "FOUND IN BOTH :" $f
45 # diff -u $local_path/$f $upstream_path/$f
46 cp -v $upstream_path/$f $local_path
47 elif [ -f $upstream_path/$f ]; then
48 echo "FOUND IN UPSTREAM :" $f
49 cp -v $upstream_path/$f $local_path
50 $VCS add
$local_path/$f
51 elif [ -f $local_path/$f ]; then
52 echo "FOUND IN LOCAL :" $f
53 $VCS rm $local_path/$f
64 pwd |
grep 'libsanitizer$' || \
65 fatal
"Run this script from libsanitizer dir"
67 CUR_REV
=$
(get_current_rev
)
68 echo Current upstream revision
: $CUR_REV
69 merge include
/sanitizer include
/sanitizer
72 merge lib
/tsan
/rtl tsan
73 merge lib
/sanitizer_common sanitizer_common
74 merge lib
/interception interception
77 # Need to merge lib/builtins/assembly.h file:
79 cp -v upstream
/lib
/builtins
/assembly.h
builtins
/assembly.h
83 # Update the MERGE file.
87 The first line of this file holds the git revision number of the
88 last merge done from the master library sources.