Skip to content

Commit 3639fd1

Browse files
vladimirolteankuba-moo
authored andcommitted
tests: build: build clang with ccache again
Commit 7ab8275 ("tests/patch/build_clang: use LLVM=1 to enable clang") seems to have unnecessarily dropped CC="ccache clang" when transitioning to LLVM=1. This increases build times. We can still use LLVM=1 to get the LLVM linker etc, but still override CC with "ccache clang" to cache the object files instead of compiling them. Signed-off-by: Vladimir Oltean <[email protected]>
1 parent c6748a0 commit 3639fd1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/patch/build_clang/build_clang.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Copyright (C) 2019 Netronome Systems, Inc.
55

6-
cc=clang
6+
cc="ccache clang"
77
output_dir=build_clang/
88
ncpu=$(grep -c processor /proc/cpuinfo)
99
build_flags="-Oline -j $ncpu W=1"
@@ -19,7 +19,7 @@ prep_config() {
1919
}
2020

2121
echo "Using $build_flags redirect to $tmpfile_o and $tmpfile_n"
22-
echo "LLVM=1 cc=$cc"
22+
echo "LLVM=1 cc=\"$cc\""
2323
$cc --version | head -n1
2424

2525
HEAD=$(git rev-parse HEAD)
@@ -35,7 +35,7 @@ else
3535
echo "Baseline building the tree"
3636

3737
prep_config
38-
make LLVM=1 O=$output_dir $build_flags
38+
make LLVM=1 O=$output_dir CC="$cc" $build_flags
3939
fi
4040

4141
# Check if new files were added, new files will cause mod re-linking
@@ -58,7 +58,7 @@ git checkout -q HEAD~
5858
echo "Building the tree before the patch"
5959

6060
prep_config
61-
make LLVM=1 O=$output_dir $build_flags 2> >(tee $tmpfile_o >&2)
61+
make LLVM=1 O=$output_dir CC="$cc" $build_flags 2> >(tee $tmpfile_o >&2)
6262
incumbent=$(grep -i -c "\(warn\|error\)" $tmpfile_o)
6363

6464
echo "Building the tree with the patch"
@@ -69,7 +69,7 @@ git checkout -q $HEAD
6969
touch $touch_relink
7070

7171
prep_config
72-
make LLVM=1 O=$output_dir $build_flags 2> >(tee $tmpfile_n >&2) || rc=1
72+
make LLVM=1 O=$output_dir CC="$cc" $build_flags 2> >(tee $tmpfile_n >&2) || rc=1
7373

7474
current=$(grep -i -c "\(warn\|error\)" $tmpfile_n)
7575

0 commit comments

Comments
 (0)