Skip to content

Commit 5aa445c

Browse files
authored
Revert "infra: bump indexer to llvm-21" (#13901)
Reverts #13848 Unfortunately, this breaks the indexer for many projects that are still building on clang 18 with errors like: ``` Step #23: fatal error: too many errors emitted, stopping now [-ferror-limit=] Step #23: | ^~~~~~~~~~~~ Step #23: 422 | return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2); Step #23: /usr/local/lib/clang/18/include/mmintrin.h:422:41: error: cannot initialize a parameter of type 'unsigned int' with an rvalue of type '__v8qi' (vector of 8 'char' values) Step #23: | ^~~~~~~~~~~~~~~~~~~~~ Step #23: 422 | return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2); Step #23: /usr/local/lib/clang/18/include/mmintrin.h:422:19: error: use of undeclared identifier '__builtin_ia32_paddsb'; did you mean '__builtin_ia32_kaddsi'? Step #23: | ^~~~~~~~~~~~~~~~~~~~ Step #23: 400 | return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2); Step #23: /usr/local/lib/clang/18/include/mmintrin.h:400:19: error: use of undeclared identifier '__builtin_ia32_paddd' Step #23: | ^~~~~~~~~~~~~~~~~~~~ Step #23: 379 | return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2); Step #23: /usr/local/lib/clang/18/include/mmintrin.h:379:19: error: use of undeclared identifier '__builtin_ia32_paddw' Step #23: | ^~~~~~~~~~~~~~~~~~~~ Step #23: 358 | return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2); Step #23: /usr/local/lib/clang/18/include/mmintrin.h:358:19: error: use of undeclared identifier '__builtin_ia32_paddb' ```
1 parent f816e66 commit 5aa445c

File tree

4 files changed

+15
-32
lines changed

4 files changed

+15
-32
lines changed

infra/base-images/all.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717

1818
docker build --pull -t gcr.io/oss-fuzz-base/base-image "$@" infra/base-images/base-image
1919
docker build -t gcr.io/oss-fuzz-base/base-clang "$@" infra/base-images/base-clang
20-
docker build -t gcr.io/oss-fuzz-base/base-clang-full --build-arg FULL_LLVM_BUILD=1 "$@" infra/base-images/base-clang
2120
docker build -t gcr.io/oss-fuzz-base/base-builder "$@" infra/base-images/base-builder
2221
docker build -t gcr.io/oss-fuzz-base/base-builder-go "$@" infra/base-images/base-builder-go
2322
docker build -t gcr.io/oss-fuzz-base/base-builder-jvm "$@" infra/base-images/base-builder-jvm
2423
docker build -t gcr.io/oss-fuzz-base/base-builder-python "$@" infra/base-images/base-builder-python
2524
docker build -t gcr.io/oss-fuzz-base/base-builder-rust "$@" infra/base-images/base-builder-rust
2625
docker build -t gcr.io/oss-fuzz-base/base-builder-ruby "$@" infra/base-images/base-builder-ruby
2726
docker build -t gcr.io/oss-fuzz-base/base-builder-swift "$@" infra/base-images/base-builder-swift
28-
docker build -t gcr.io/oss-fuzz-base/indexer "$@" infra/indexer
2927
docker build -t gcr.io/oss-fuzz-base/base-runner "$@" infra/base-images/base-runner
3028
docker build -t gcr.io/oss-fuzz-base/base-runner-debug "$@" infra/base-images/base-runner-debug

infra/base-images/base-builder/precompile_honggfuzz

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ make clean
3333
# These CFLAGs match honggfuzz's default, with the exception of -mtune to
3434
# improve portability and `-D_HF_LINUX_NO_BFD` to remove assembly instructions
3535
# from the filenames.
36-
sed -i 's/-Werror//g' Makefile
37-
CC=clang CFLAGS="-O3 -funroll-loops -D_HF_LINUX_NO_BFD -Wno-unterminated-string-initialization -Wno-error" make
36+
CC=clang CFLAGS="-O3 -funroll-loops -D_HF_LINUX_NO_BFD" make
3837

3938
# libhfuzz.a will be added by CC/CXX linker directly during linking,
4039
# but it's defined here to satisfy the build infrastructure

infra/base-images/base-clang/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ RUN apt-get update && apt-get install -y wget sudo && \
3333
SUDO_FORCE_REMOVE=yes apt-get autoremove --purge -y wget sudo && \
3434
rm -rf /usr/local/doc/cmake /usr/local/bin/cmake-gui
3535

36+
RUN apt-get update && apt-get install -y git && \
37+
git clone https://github.com/ossf/fuzz-introspector.git fuzz-introspector && \
38+
cd fuzz-introspector && \
39+
git checkout 332d674f00b8abc4c9ebf10e9c42e5b72b331c63 && \
40+
git submodule init && \
41+
git submodule update && \
42+
apt-get autoremove --purge -y git && \
43+
rm -rf .git
44+
3645
COPY checkout_build_install_llvm.sh /root/
3746
# Keep all steps in the same script to decrease the number of intermediate
3847
# layes in docker file.
@@ -65,7 +74,6 @@ ENV CFLAGS -O1 \
6574
-Wno-error=implicit-function-declaration \
6675
-Wno-error=implicit-int \
6776
-Wno-error=vla-cxx-extension \
68-
-Wno-error=unknown-warning-option \
6977
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
7078
ENV CXXFLAGS_EXTRA "-stdlib=libc++"
7179
ENV CXXFLAGS "$CFLAGS $CXXFLAGS_EXTRA"

infra/base-images/base-clang/checkout_build_install_llvm.sh

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,15 @@ apt-get update && apt-get install -y $LLVM_DEP_PACKAGES --no-install-recommends
6060
# languages, projects, ...) is needed.
6161
# Check CMAKE_VERSION infra/base-images/base-clang/Dockerfile was released
6262
# recently enough to fully support this clang version.
63-
if [[ -n "$FULL_LLVM_BUILD" ]]; then
64-
OUR_LLVM_REVISION=llvmorg-21.1.0-rc3
65-
else
66-
OUR_LLVM_REVISION=llvmorg-18.1.8
67-
fi
63+
OUR_LLVM_REVISION=llvmorg-18.1.8
6864

6965
mkdir $SRC/chromium_tools
7066
cd $SRC/chromium_tools
7167
git clone https://chromium.googlesource.com/chromium/src/tools/clang
72-
7368
cd clang
74-
if [[ -n "$FULL_LLVM_BUILD" ]]; then
75-
OUR_CLANG_REVISION=329189001bce28e8f90dfa1c96075731a7a8f7de
76-
else
77-
# Pin clang script due to https://github.com/google/oss-fuzz/issues/7617
78-
OUR_CLANG_REVISION=9eb79319239629c1b23cf7a59e5ebb2bab319a34
79-
fi
80-
git checkout $OUR_CLANG_REVISION
69+
# Pin clang script due to https://github.com/google/oss-fuzz/issues/7617
70+
git checkout 9eb79319239629c1b23cf7a59e5ebb2bab319a34
71+
8172
LLVM_SRC=$SRC/llvm-project
8273
# Checkout
8374
CHECKOUT_RETRIES=10
@@ -106,20 +97,7 @@ clone_with_retries https://github.com/llvm/llvm-project.git $LLVM_SRC
10697
git -C $LLVM_SRC checkout $OUR_LLVM_REVISION
10798
echo "Using LLVM revision: $OUR_LLVM_REVISION"
10899

109-
# Prepare fuzz introspector.
110-
echo "Installing fuzz introspector"
111-
if [[ -n "$FULL_LLVM_BUILD" ]]; then
112-
FUZZ_INTROSPECTOR_CHECKOUT=341ebbd72bc9116733bcfcfab5adfd7f9b633e07
113-
else
114-
FUZZ_INTROSPECTOR_CHECKOUT=332d674f00b8abc4c9ebf10e9c42e5b72b331c63
115-
fi
116-
117-
git clone https://github.com/ossf/fuzz-introspector.git /fuzz-introspector
118-
cd /fuzz-introspector
119-
git checkout $FUZZ_INTROSPECTOR_CHECKOUT
120-
git submodule init
121-
git submodule update
122-
100+
# For fuzz introspector.
123101
echo "Applying introspector changes"
124102
OLD_WORKING_DIR=$PWD
125103
cd $LLVM_SRC

0 commit comments

Comments
 (0)