Truly independent web browser
Meta: Rename ENABLE_CI_BASELINE_CPU to LADYBIRD_BASELINE_CPU_TARGET
Jelle Raaijmakers1340e9a983d7
diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.ymlindex e6cf12435e1..ca54685eb43 100644--- a/.github/actions/build/action.yml+++ b/.github/actions/build/action.yml@@ -60,7 +60,7 @@ runs:id: 'build-parameters'shell: bashrun: |- CMAKE_OPTIONS="-DENABLE_CI_BASELINE_CPU=ON"+ CMAKE_OPTIONS="-DLADYBIRD_BASELINE_CPU_TARGET=ON"if ${{ inputs.os == 'Linux' }} ; then# FIXME: https://github.com/WebAssembly/wabt/issues/2533# wabt doesn't have binary releases for arm64 Linux@@ -145,7 +145,7 @@ runs:VCPKG_CACHE_MODE: ${{ github.ref == 'refs/heads/master' && inputs.vcpkg_cache_sas != '' && 'write' || '' }}run: |cmake --preset ${{ inputs.build_preset }} -B Build `- -DENABLE_CI_BASELINE_CPU=ON+ -DLADYBIRD_BASELINE_CPU_TARGET=ON- name: Create Build Environment (Fuzzers)if: ${{ inputs.build_preset == 'Fuzzers' }}diff --git a/.github/workflows/js-and-wasm-artifacts.yml b/.github/workflows/js-and-wasm-artifacts.ymlindex ddab3233d1a..5e6af801527 100644--- a/.github/workflows/js-and-wasm-artifacts.yml+++ b/.github/workflows/js-and-wasm-artifacts.yml@@ -90,7 +90,7 @@ jobs:cmake --preset Distribution \-DCMAKE_C_COMPILER=clang \-DCMAKE_CXX_COMPILER=clang++ \- -DENABLE_CI_BASELINE_CPU=ON \+ -DLADYBIRD_BASELINE_CPU_TARGET=ON \-DENABLE_GUI_TARGETS=OFFif: ${{ matrix.os_name == 'Linux' }}diff --git a/.github/workflows/libjs-test262.yml b/.github/workflows/libjs-test262.ymlindex c99b3532fff..ada530ad603 100644--- a/.github/workflows/libjs-test262.yml+++ b/.github/workflows/libjs-test262.yml@@ -93,7 +93,7 @@ jobs:cmake --preset Release -B libjs-test262/Build \-DCMAKE_C_COMPILER=clang \-DCMAKE_CXX_COMPILER=clang++ \- -DENABLE_CI_BASELINE_CPU=ON \+ -DLADYBIRD_BASELINE_CPU_TARGET=ON \-DWASM_SPEC_TEST_SKIP_FORMATTING=ON \-DINCLUDE_WASM_SPEC_TESTS=ON \-DENABLE_GUI_TARGETS=OFFdiff --git a/.github/workflows/web-benchmarks.yml b/.github/workflows/web-benchmarks.ymlindex f5cf0ab8ceb..395f0a3ad12 100644--- a/.github/workflows/web-benchmarks.yml+++ b/.github/workflows/web-benchmarks.yml@@ -106,7 +106,7 @@ jobs:working-directory: ${{ github.workspace }}run: |cmake --preset Distribution -B Build \- -DENABLE_CI_BASELINE_CPU=ON \+ -DLADYBIRD_BASELINE_CPU_TARGET=ON \-DPython3_EXECUTABLE=${{ env.pythonLocation }}/bin/python \-DCMAKE_C_COMPILER=${{ steps.build-parameters.outputs.host_cc }} \-DCMAKE_CXX_COMPILER=${{ steps.build-parameters.outputs.host_cxx }}diff --git a/Documentation/AdvancedBuildInstructions.md b/Documentation/AdvancedBuildInstructions.mdindex f4a30ca70aa..770c3023990 100644--- a/Documentation/AdvancedBuildInstructions.md+++ b/Documentation/AdvancedBuildInstructions.md@@ -33,7 +33,7 @@ There are some optional features that can be enabled during compilation that are- `ENABLE_ALL_THE_DEBUG_MACROS`: used for checking whether debug code compiles on CI. This should not be set normally, as it clutters the console output and makes the system run very slowly. Instead, enable only the needed debug macros, as described below.- `ENABLE_COMPILETIME_FORMAT_CHECK`: checks for the validity of `std::format`-style format string during compilation. Enabled by default.- `ENABLE_JS_JIT`: builds the optimizing JIT for JavaScript. Enabled by default on x86-64 and AArch64 Linux and macOS and on x86-64 Windows, the platforms it generates code for. Without it, LibJS runs JavaScript in its interpreter alone, and the interpreter is built without the feedback collection and tier-up checks that only the JIT needs. See [the configuration of the JIT](../Libraries/LibJS/JIT/ARCHITECTURE.md#13-configuration).-- `ENABLE_CI_BASELINE_CPU`: builds C++ and Rust for a common CPU target instead of the build machine. Disabled by default; explicitly set `-DENABLE_CI_BASELINE_CPU=ON` when packaging binaries for older machines. On x86-64 this is x86-64-v2 (SSE4.2 and POPCNT), so distributed binaries run without AVX, AVX2, BMI or LZCNT. Both the JavaScript and WebAssembly JITs remain available; WebAssembly selects newer instructions at runtime when supported.+- `LADYBIRD_BASELINE_CPU_TARGET`: builds C++ and Rust for a common CPU target instead of the build machine. Disabled by default; explicitly set `-DLADYBIRD_BASELINE_CPU_TARGET=ON` when packaging binaries for older machines. On x86-64 this is x86-64-v2 (SSE4.2 and POPCNT), so distributed binaries run without AVX, AVX2, BMI or LZCNT. Both the JavaScript and WebAssembly JITs remain available; WebAssembly selects newer instructions at runtime when supported.- `INCLUDE_WASM_SPEC_TESTS`: downloads and includes the WebAssembly spec testsuite tests. In order to use this option, you will need to install `prettier` and `wasm-tools`.- `BUILD_BROWSER_TESTS_ONLY`: only builds the tests that run the browser's own executables, such as the LibWeb test suite and the WebDriver tests, and leaves out the test programs for individual libraries. Enabled by the `Distribution` preset.- `LADYBIRD_CACHE_DIR`: sets the location of a shared cache of downloaded files. Should not need to be set manually unless managing a distribution package.diff --git a/Libraries/LibWasm/JIT/ARCHITECTURE.md b/Libraries/LibWasm/JIT/ARCHITECTURE.mdindex e85ee10123a..fa6848c8614 100644--- a/Libraries/LibWasm/JIT/ARCHITECTURE.md+++ b/Libraries/LibWasm/JIT/ARCHITECTURE.md@@ -332,7 +332,7 @@ Without them, `asm/x86_64/sse.rs` emits legacy SSE sequences and bit scans, andshifts use CL. This selection also covers entry, exit and host stubs. The shared encoders live inlibjs_jit's `asm/x86_64/`; `codegen/x86_64/vector.rs` names the SIMD opcodes. SSE packed operationsread spilled vectors through registers, since their memory operands require sixteen-byte alignment.-Distributed C++ and Rust builds target the same v2 baseline (`ENABLE_CI_BASELINE_CPU`); native+Distributed C++ and Rust builds target the same v2 baseline (`LADYBIRD_BASELINE_CPU_TARGET`); nativebuilds still target the machine building them. After each node, a value with a slot is storedthere; a phi in a register with a slot is stored where its block starts.diff --git a/Meta/CMake/cmake_options.cmake b/Meta/CMake/cmake_options.cmakeindex 843dd241e5d..f174cf4525f 100644--- a/Meta/CMake/cmake_options.cmake+++ b/Meta/CMake/cmake_options.cmake@@ -41,7 +41,7 @@ option(LADYBIRD_GENERATE_SYMBOL_FILES "Build with debug info and write the symboif (LADYBIRD_GENERATE_SYMBOL_FILES AND MSVC)message(FATAL_ERROR "LADYBIRD_GENERATE_SYMBOL_FILES is not supported with MSVC-style toolchains")endif()-option(ENABLE_CI_BASELINE_CPU "Use a common CPU baseline for portable binaries and ccache sharing" OFF)+option(LADYBIRD_BASELINE_CPU_TARGET "Use a common CPU baseline for portable binaries and ccache sharing" OFF)set(LADYBIRD_VERSION "" CACHE STRING "Version of a release, such as 2026.46.0")set(LADYBIRD_BROWSER_VERSION "${PROJECT_VERSION}")diff --git a/Meta/CMake/compile_options.cmake b/Meta/CMake/compile_options.cmakeindex eeb5e321454..5641fcd3d00 100644--- a/Meta/CMake/compile_options.cmake+++ b/Meta/CMake/compile_options.cmake@@ -57,8 +57,8 @@ function(add_cxx_link_option_if_supported option)endfunction()# RUSTC_TARGET_CPU_FLAGS names the same CPU for rustc, so that Rust code runs on the instruction set C++ code does.-if (ENABLE_CI_BASELINE_CPU)- # In CI, we want to target a common architecture so different runners can share ccache caches effectively.+if (LADYBIRD_BASELINE_CPU_TARGET)+ # Binaries that run on other machines, and ccache caches that different runners share, need a common architecture.if (APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")add_cxx_compile_options(-mcpu=apple-m1)set(RUSTC_TARGET_CPU_FLAGS -Ctarget-cpu=apple-m1)diff --git a/Meta/CMake/flatpak/org.ladybird.Ladybird.json b/Meta/CMake/flatpak/org.ladybird.Ladybird.jsonindex 59d4b0e9179..db6f2b21eab 100644--- a/Meta/CMake/flatpak/org.ladybird.Ladybird.json+++ b/Meta/CMake/flatpak/org.ladybird.Ladybird.json@@ -812,7 +812,7 @@"-DCMAKE_BUILD_TYPE=Release","-DCMAKE_C_COMPILER=clang","-DCMAKE_CXX_COMPILER=clang++",- "-DENABLE_CI_BASELINE_CPU=ON",+ "-DLADYBIRD_BASELINE_CPU_TARGET=ON","-DENABLE_LTO_FOR_RELEASE=ON","-DLADYBIRD_GENERATE_SYMBOL_FILES=ON","-DENABLE_INSTALL_FREEDESKTOP_FILES=ON",