diff --git a/scripts/release/images/ubuntu/Dockerfile b/scripts/release/images/ubuntu/Dockerfile index 2d4f537..e6f054d 100644 --- a/scripts/release/images/ubuntu/Dockerfile +++ b/scripts/release/images/ubuntu/Dockerfile @@ -1,3 +1,3 @@ FROM ubuntu:24.04 -ADD prepare.sh / +ADD prepare.sh clang_version.patch / RUN /prepare.sh diff --git a/scripts/release/images/ubuntu/clang_version.patch b/scripts/release/images/ubuntu/clang_version.patch new file mode 100644 index 0000000..2c667c5 --- /dev/null +++ b/scripts/release/images/ubuntu/clang_version.patch @@ -0,0 +1,15 @@ +diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp +index cce839295..b87fe998e 100644 +--- a/clang/lib/Frontend/InitPreprocessor.cpp ++++ b/clang/lib/Frontend/InitPreprocessor.cpp +@@ -873,9 +873,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI, + Builder.defineMacro("__clang_patchlevel__", TOSTR(CLANG_VERSION_PATCHLEVEL)); + #undef TOSTR + #undef TOSTR2 +- Builder.defineMacro("__clang_version__", +- "\"" CLANG_VERSION_STRING " " +- + getClangFullRepositoryVersion() + "\""); ++ Builder.defineMacro("__clang_version__", "\"" CLANG_VERSION_STRING "\""); + + if (LangOpts.GNUCVersion != 0) { + // Major, minor, patch, are given two decimal places each, so 4.2.1 becomes diff --git a/scripts/release/images/ubuntu/prepare.sh b/scripts/release/images/ubuntu/prepare.sh index f148a59..754a80c 100755 --- a/scripts/release/images/ubuntu/prepare.sh +++ b/scripts/release/images/ubuntu/prepare.sh @@ -145,6 +145,9 @@ cd /root git clone --depth 1 --branch llvmorg-$CLANG_VERSION https://github.com/llvm/llvm-project.git cd llvm-project +mv /clang_version.patch . +git apply --verbose --ignore-whitespace clang_version.patch + mkdir build && cd build cmake -G Ninja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLLVM_ENABLE_PROJECTS="clang;lld;libc" -DCMAKE_BUILD_TYPE=Release -DLLVM_VERSION_SUFFIX="_p2pool" -DLIBC_WNO_ERROR=ON -DLLVM_APPEND_VC_REV=OFF ../llvm ninja