Reproducible builds: fixed clang version display
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
FROM ubuntu:24.04
|
FROM ubuntu:24.04
|
||||||
ADD prepare.sh /
|
ADD prepare.sh clang_version.patch /
|
||||||
RUN /prepare.sh
|
RUN /prepare.sh
|
||||||
|
|||||||
15
scripts/release/images/ubuntu/clang_version.patch
Normal file
15
scripts/release/images/ubuntu/clang_version.patch
Normal file
@@ -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
|
||||||
@@ -145,6 +145,9 @@ cd /root
|
|||||||
git clone --depth 1 --branch llvmorg-$CLANG_VERSION https://github.com/llvm/llvm-project.git
|
git clone --depth 1 --branch llvmorg-$CLANG_VERSION https://github.com/llvm/llvm-project.git
|
||||||
|
|
||||||
cd llvm-project
|
cd llvm-project
|
||||||
|
mv /clang_version.patch .
|
||||||
|
git apply --verbose --ignore-whitespace clang_version.patch
|
||||||
|
|
||||||
mkdir build && cd build
|
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
|
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
|
ninja
|
||||||
|
|||||||
Reference in New Issue
Block a user