Repository navigation
Upgrade LLVM toolchain from 19.1.7 to 21.1.8 #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| name: Build WebKit (Reusable) | ||
|
|
||
| env: | ||
| LLVM_VERSION: 19 | ||
| LLVM_VERSION: 21 | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
@@ -98,20 +98,20 @@ jobs: | |
| HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
| HOMEBREW_NO_ANALYTICS_THIS_RUN: 1 | ||
| run: | | ||
| echo "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin" >> $GITHUB_PATH | ||
| brew install llvm@${{env.LLVM_VERSION}} python icu4c ninja -f --overwrite | ||
| brew link llvm@${{env.LLVM_VERSION}} -f --overwrite | ||
| echo "${{matrix.brew_prefix}}/llvm@21/bin" >> $GITHUB_PATH | ||
| brew install llvm@21 python icu4c ninja -f --overwrite | ||
| brew link llvm@21 -f --overwrite | ||
| - name: Run | ||
| env: | ||
| ICU_INCLUDE_DIRS: ${{matrix.brew_prefix}}/icu4c/include | ||
| ICU_ROOT: ${{matrix.brew_prefix}}/icu4c | ||
| LDFLAGS: "${{env.LDFLAGS}} " | ||
| CC: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/clang" | ||
| CXX: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/clang++" | ||
| RANLIB: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/llvm-ranlib" | ||
| AR: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/llvm-ar" | ||
| CMAKE_C_COMPILER: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/clang" | ||
| CMAKE_CXX_COMPILER: "${{matrix.brew_prefix}}/llvm@${{env.LLVM_VERSION}}/bin/clang++" | ||
| CC: "${{matrix.brew_prefix}}/llvm@21/bin/clang" | ||
| CXX: "${{matrix.brew_prefix}}/llvm@21/bin/clang++" | ||
| RANLIB: "${{matrix.brew_prefix}}/llvm@21/bin/llvm-ranlib" | ||
| AR: "${{matrix.brew_prefix}}/llvm@21/bin/llvm-ar" | ||
| CMAKE_C_COMPILER: "${{matrix.brew_prefix}}/llvm@21/bin/clang" | ||
| CMAKE_CXX_COMPILER: "${{matrix.brew_prefix}}/llvm@21/bin/clang++" | ||
|
Comment on lines
+101
to
+114
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/build-reusable.yml | head -150Repository: oven-sh/WebKit Length of output: 6715 🏁 Script executed: rg "llvm@" .github/workflows/build-reusable.ymlRepository: oven-sh/WebKit Length of output: 671 🏁 Script executed: rg -B5 -A5 "llvm@21.1.8" .github/workflows/build-reusable.ymlRepository: oven-sh/WebKit Length of output: 598 Use The workflow accepts 🔧 Proposed fix- echo "${{matrix.brew_prefix}}/llvm@21/bin" >> $GITHUB_PATH
- brew install llvm@21 python icu4c ninja -f --overwrite
- brew link llvm@21 -f --overwrite
+ echo "${{matrix.brew_prefix}}/llvm@${{ env.LLVM_VERSION }}/bin" >> $GITHUB_PATH
+ brew install llvm@${{ env.LLVM_VERSION }} python icu4c ninja -f --overwrite
+ brew link llvm@${{ env.LLVM_VERSION }} -f --overwrite- CC: "${{matrix.brew_prefix}}/llvm@21/bin/clang"
- CXX: "${{matrix.brew_prefix}}/llvm@21/bin/clang++"
- RANLIB: "${{matrix.brew_prefix}}/llvm@21/bin/llvm-ranlib"
- AR: "${{matrix.brew_prefix}}/llvm@21/bin/llvm-ar"
- CMAKE_C_COMPILER: "${{matrix.brew_prefix}}/llvm@21/bin/clang"
- CMAKE_CXX_COMPILER: "${{matrix.brew_prefix}}/llvm@21/bin/clang++"
+ CC: "${{matrix.brew_prefix}}/llvm@${{ env.LLVM_VERSION }}/bin/clang"
+ CXX: "${{matrix.brew_prefix}}/llvm@${{ env.LLVM_VERSION }}/bin/clang++"
+ RANLIB: "${{matrix.brew_prefix}}/llvm@${{ env.LLVM_VERSION }}/bin/llvm-ranlib"
+ AR: "${{matrix.brew_prefix}}/llvm@${{ env.LLVM_VERSION }}/bin/llvm-ar"
+ CMAKE_C_COMPILER: "${{matrix.brew_prefix}}/llvm@${{ env.LLVM_VERSION }}/bin/clang"
+ CMAKE_CXX_COMPILER: "${{matrix.brew_prefix}}/llvm@${{ env.LLVM_VERSION }}/bin/clang++"🤖 Prompt for AI Agents |
||
| CMAKE_C_FLAGS: " -fno-exceptions ${{matrix.cpp_flags}} -fvisibility=hidden -fvisibility-inlines-hidden -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -faddrsig " | ||
| CMAKE_CXX_FLAGS: " -fno-exceptions ${{matrix.cpp_flags}} -fvisibility=hidden -fvisibility-inlines-hidden -O3 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -faddrsig -fno-c++-static-destructors " | ||
| CMAKE_OSX_DEPLOYMENT_TARGET: "13.0" | ||
|
|
@@ -273,7 +273,7 @@ jobs: | |
| run: | | ||
| "C:\Program Files\7-Zip" >> $Env:GITHUB_PATH | ||
| scoop config use_external_7zip true | ||
| scoop install ninja llvm@19.1.7 | ||
| scoop install ninja llvm@21.1.8 | ||
| Join-Path (Resolve-Path ~).Path "scoop\apps\llvm\current\bin" >> $Env:GITHUB_PATH | ||
| - name: Install LLVM and Ninja (ARM64) | ||
| if: matrix.platform == 'ARM64' | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,7 +3,7 @@ ARG WEBKIT_RELEASE_TYPE=Release | |||||||||||||||||||||||
| ARG CPU=native | ||||||||||||||||||||||||
| ARG LTO_FLAG="-flto=full -fwhole-program-vtables -fforce-emit-vtables " | ||||||||||||||||||||||||
| ARG RELEASE_FLAGS="-O3 -DNDEBUG=1" | ||||||||||||||||||||||||
| ARG LLVM_VERSION="19" | ||||||||||||||||||||||||
| ARG LLVM_VERSION="21" | ||||||||||||||||||||||||
| ARG DEFAULT_CFLAGS="-mno-omit-leaf-frame-pointer -g -fno-omit-frame-pointer -ffunction-sections -fdata-sections -faddrsig -fno-unwind-tables -fno-asynchronous-unwind-tables -DU_STATIC_IMPLEMENTATION=1 " | ||||||||||||||||||||||||
| ARG ENABLE_SANITIZERS="" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -71,10 +71,10 @@ RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130 \ | |||||||||||||||||||||||
| --slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-13 \ | ||||||||||||||||||||||||
| --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-13 | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # Install LLVM 19 | ||||||||||||||||||||||||
| # Install LLVM 21 | ||||||||||||||||||||||||
| RUN wget https://apt.llvm.org/llvm.sh \ | ||||||||||||||||||||||||
| && chmod +x llvm.sh \ | ||||||||||||||||||||||||
| && ./llvm.sh 19 all \ | ||||||||||||||||||||||||
| && ./llvm.sh 21 all \ | ||||||||||||||||||||||||
| && rm llvm.sh \ | ||||||||||||||||||||||||
|
Comment on lines
+74
to
78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat DockerfileRepository: oven-sh/WebKit Length of output: 9782 Use the LLVM_VERSION ARG when invoking llvm.sh. Hardcoding 🔧 Proposed fix-# Install LLVM 21
+# Install LLVM ${LLVM_VERSION}
RUN wget https://apt.llvm.org/llvm.sh \
&& chmod +x llvm.sh \
- && ./llvm.sh 21 all \
+ && ./llvm.sh ${LLVM_VERSION} all \
&& rm llvm.sh \📝 Committable suggestion
Suggested change
🧰 Tools🪛 Hadolint (2.14.0)[info] 75-75: Avoid use of wget without progress bar. Use (DL3047) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| && rm -rf /var/lib/apt/lists/* | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,10 +2,10 @@ ARG MARCH_FLAG="" | |||||||||||||||||||||
| ARG WEBKIT_RELEASE_TYPE=Release | ||||||||||||||||||||||
| ARG CPU=native | ||||||||||||||||||||||
| ARG LTO_FLAG="-flto=full -fwhole-program-vtables -fforce-emit-vtables " | ||||||||||||||||||||||
| ARG LLVM_VERSION="19" | ||||||||||||||||||||||
| ARG LLVM_VERSION="21" | ||||||||||||||||||||||
| ARG DEFAULT_CFLAGS="-mno-omit-leaf-frame-pointer -g -fno-omit-frame-pointer -ffunction-sections -fdata-sections -faddrsig -fno-unwind-tables -fno-asynchronous-unwind-tables -DU_STATIC_IMPLEMENTATION=1 " | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| FROM alpine:3.21 as base | ||||||||||||||||||||||
| FROM alpine:3.23 as base | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ARG MARCH_FLAG | ||||||||||||||||||||||
| ARG WEBKIT_RELEASE_TYPE | ||||||||||||||||||||||
|
|
@@ -15,13 +15,13 @@ ARG LLVM_VERSION | |||||||||||||||||||||
| ARG DEFAULT_CFLAGS | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| RUN apk update | ||||||||||||||||||||||
| RUN apk add --no-cache cmake make clang19 clang19-static clang19-dev llvm19-dev llvm19-static musl-dev git lld libgcc gcc g++ libstdc++ build-base lld-dev llvm19-libs libc-dev xz zlib zlib-dev libxml2 libxml2-dev | ||||||||||||||||||||||
| RUN apk add --no-cache cmake make clang21 clang21-static clang21-dev llvm21-dev llvm21-static musl-dev git lld libgcc gcc g++ libstdc++ build-base lld-dev llvm21-libs libc-dev xz zlib zlib-dev libxml2 libxml2-dev | ||||||||||||||||||||||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ENV CXX=clang++-19 | ||||||||||||||||||||||
| ENV CC=clang-19 | ||||||||||||||||||||||
| ENV LDFLAGS='-L/usr/include -L/usr/include/llvm19' | ||||||||||||||||||||||
| ENV CXXFLAGS="-I/usr/include -I/usr/include/llvm19" | ||||||||||||||||||||||
| ENV PATH="/usr/bin:/usr/local/bin:/zig/bin:/usr/lib/llvm19/bin:$PATH" | ||||||||||||||||||||||
| ENV CXX=clang++-21 | ||||||||||||||||||||||
| ENV CC=clang-21 | ||||||||||||||||||||||
| ENV LDFLAGS='-L/usr/include -L/usr/include/llvm21' | ||||||||||||||||||||||
| ENV CXXFLAGS="-I/usr/include -I/usr/include/llvm21" | ||||||||||||||||||||||
| ENV PATH="/usr/bin:/usr/local/bin:/zig/bin:/usr/lib/llvm21/bin:$PATH" | ||||||||||||||||||||||
|
Comment on lines
+20
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Parameterize toolchain env vars with LLVM_VERSION. This avoids drift if the LLVM version is bumped again. ♻️ Proposed refactor-ENV CXX=clang++-21
-ENV CC=clang-21
-ENV LDFLAGS='-L/usr/include -L/usr/include/llvm21'
-ENV CXXFLAGS="-I/usr/include -I/usr/include/llvm21"
-ENV PATH="/usr/bin:/usr/local/bin:/zig/bin:/usr/lib/llvm21/bin:$PATH"
+ENV CXX=clang++-${LLVM_VERSION}
+ENV CC=clang-${LLVM_VERSION}
+ENV LDFLAGS="-L/usr/include -L/usr/include/llvm${LLVM_VERSION}"
+ENV CXXFLAGS="-I/usr/include -I/usr/include/llvm${LLVM_VERSION}"
+ENV PATH="/usr/bin:/usr/local/bin:/zig/bin:/usr/lib/llvm${LLVM_VERSION}/bin:$PATH"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| ENV CPU=${CPU} | ||||||||||||||||||||||
| ENV MARCH_FLAG=${MARCH_FLAG} | ||||||||||||||||||||||
| ENV WEBKIT_OUT_DIR=/webkitbuild | ||||||||||||||||||||||
|
|
@@ -66,7 +66,7 @@ ARG LTO_FLAG | |||||||||||||||||||||
| ARG LLVM_VERSION | ||||||||||||||||||||||
| ARG DEFAULT_CFLAGS | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| RUN apk add --no-cache cpio curl file gnupg ninja ruby unzip rsync perl python3 openssl-dev openssl linux-headers | ||||||||||||||||||||||
| RUN apk add --no-cache cpio curl file gnupg ninja ruby ruby-getoptlong unzip rsync perl python3 openssl-dev openssl linux-headers | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ENV WEBKIT_OUT_DIR=/webkitbuild | ||||||||||||||||||||||
| # These are unnecessary on musl | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * LLVM 21's libc++ moved std::__hash_memory from an inline function to an | ||
| * external symbol exported from libc++.dylib (llvm/llvm-project#127040). | ||
| * On macOS, the system /usr/lib/libc++.1.dylib doesn't have this symbol, | ||
| * causing link failures and runtime crashes. | ||
| * | ||
| * This shim provides the missing symbol using libc++'s own cityhash | ||
| * implementation (which is still available in the headers). | ||
| * | ||
| * See: https://github.com/llvm/llvm-project/issues/77653 | ||
| * TODO: Remove this when the system libc++ on our minimum macOS version | ||
| * includes __hash_memory, or when LLVM fixes the driver (issue #77653). | ||
| */ | ||
|
|
||
| #if defined(__APPLE__) | ||
|
|
||
| #include <__config> | ||
| #include <__functional/hash.h> | ||
| #include <cstddef> | ||
|
|
||
| #if _LIBCPP_VERSION >= 220000 | ||
| #error "LLVM 22+ detected. Check if __hash_memory is still missing from the system libc++.dylib. " \ | ||
| "If the symbol is now available (or LLVM fixed issue #77653), remove this shim." | ||
| #endif | ||
|
|
||
| #if _LIBCPP_AVAILABILITY_HAS_HASH_MEMORY | ||
|
|
||
| _LIBCPP_BEGIN_NAMESPACE_STD | ||
|
|
||
| [[__gnu__::__pure__]] | ||
| _LIBCPP_EXPORTED_FROM_ABI | ||
| size_t __hash_memory(_LIBCPP_NOESCAPE const void* __ptr, size_t __size) _NOEXCEPT { | ||
| return __murmur2_or_cityhash<size_t>()(__ptr, __size); | ||
| } | ||
|
|
||
| _LIBCPP_END_NAMESPACE_STD | ||
|
|
||
| #endif // _LIBCPP_AVAILABILITY_HAS_HASH_MEMORY | ||
|
|
||
| #endif // __APPLE__ |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,7 +9,7 @@ set -euxo pipefail | |||||||||
| THIS_DIR=$(pwd) | ||||||||||
|
|
||||||||||
| # Set default values for environment variables that are not set. | ||||||||||
| CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-clang-19} | ||||||||||
| CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-clang-21} | ||||||||||
| CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER:-clang++} | ||||||||||
|
Comment on lines
+12
to
13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent compiler version specification between C and C++ compilers.
Proposed fix CMAKE_C_COMPILER=${CMAKE_C_COMPILER:-clang-21}
-CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER:-clang++}
+CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER:-clang++-21}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| CMAKE_C_FLAGS=${CMAKE_C_FLAGS:-} | ||||||||||
| CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS:-} | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.