Skip to content

Commit 3619183

Browse files
committed
build: dual-version build tooling + broad-CPU baseline
build-version.sh builds a specific Chromium version into its own tree/out so 149 (stable) and 151 (latest) coexist without clobbering; versions.txt pins the supported versions and their stealth roles. args.gn: pin the tree to the SSE4.2 (x86-64-v2) baseline (-mno-avx/avx2/bmi/ lzcnt/fma...). Chromium 151's clang auto-vectorizes some baseline paths with post-Haswell instructions that trip a PA_CHECK at static init on pre-2013 CPUs (issue #20); stock Chrome runs there, so we match it.
1 parent db50d13 commit 3619183

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

build/args.gn

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,16 @@ enable_widevine = false
3131
target_cpu = "x64"
3232
target_os = "linux"
3333

34+
# Broad-CPU compatibility (issue #20). Chromium 151's bundled clang auto-vectorizes
35+
# some baseline paths (e.g. PartitionAlloc's bucket-index lookup) with post-Haswell
36+
# instructions — LZCNT/TZCNT (BMI/ABM), AVX2, FMA. On pre-2013 CPUs that lack them
37+
# (e.g. Intel Sandy Bridge / Xeon E5-2600 v1) LZCNT/TZCNT silently decode as BSR/BSF
38+
# with different zero-input semantics, corrupting a bucket index and tripping a
39+
# PA_CHECK at static-init -> SIGTRAP before main() (no runtime flag can intervene).
40+
# Stock Chrome runs on these CPUs, so we pin the whole tree back to the SSE4.2 (x86-64-v2)
41+
# baseline. Keeps SSE4.2/POPCNT; drops AVX/AVX2/BMI/FMA. Costs ~nothing in practice and
42+
# restores compatibility down to ~Nehalem-era hardware.
43+
extra_cflags = "-mno-avx -mno-avx2 -mno-bmi -mno-bmi2 -mno-lzcnt -mno-fma -mno-f16c -mno-movbe"
44+
extra_cxxflags = "-mno-avx -mno-avx2 -mno-bmi -mno-bmi2 -mno-lzcnt -mno-fma -mno-f16c -mno-movbe"
45+
3446
# ThinLTO is on by default for official builds; left implicit.

build/build-version.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
# Build a specific Chromium version of Fortress into its OWN tree/out/bundle, so multiple
3+
# versions (e.g. 149 stable + 151 latest) coexist without clobbering each other.
4+
#
5+
# Usage: build/build-version.sh <chromium-version> [platform]
6+
# e.g. build/build-version.sh 149.0.7827.200 linux-x64
7+
# build/build-version.sh 151.0.7908.0 linux-x64
8+
#
9+
# Each version gets its own workdir .fortress-build-<major>/ (each needs ~100GB + hours).
10+
# The patch series is 3-way applied; if a patch fails on an older/newer tree, re-anchor it
11+
# (see DUAL_VERSION_BUILD.md) and re-run.
12+
set -euo pipefail
13+
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
14+
VER="${1:?usage: build-version.sh <chromium-version> [platform]}"
15+
PLATFORM="${2:-linux-x64}"
16+
MAJOR="${VER%%.*}"
17+
WORK="$REPO/.fortress-build-$MAJOR"
18+
19+
echo "==> Fortress $MAJOR | Chromium $VER | workdir $WORK"
20+
21+
# Build the versioned tree (build.sh reads CHROMIUM_VERSION from the env).
22+
CHROMIUM_VERSION="$VER" "$REPO/build/build.sh" "$WORK"
23+
24+
# Bundle with a VERSION-TAGGED asset name so both majors can ship in one release:
25+
# tilion-fortress-<major>-<platform>.tar.gz
26+
DEST="$WORK/dist"
27+
"$REPO/packaging/build-bundle.sh" "$WORK/chromium/src/out/Fortress" "$REPO/fonts" "$DEST" "$MAJOR-$PLATFORM"
28+
29+
echo "==> built: $WORK/chromium/src/out/Fortress/chrome"
30+
echo "==> bundle: $DEST/tilion-fortress-$MAJOR-$PLATFORM.tar.gz"
31+
echo "==> verify: python3 $REPO/tools/gauntlet.py --bundle $DEST/tilion-fortress"

build/versions.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Fortress supported Chromium versions (build with build/build-version.sh <version>).
2+
# Pin the EXACT current stable patch from https://chromiumdash.appspot.com/releases before a build.
3+
#
4+
# major version channel role
5+
149 149.0.7827.200 stable RECOMMENDED default — matches the mass of real users (stealth)
6+
151 151.0.7908.0 ahead newest features; note: ahead-of-stable trips some UA checks
7+
#
8+
# Notes:
9+
# - 149 is current/near-stable and where most real Chrome users sit (staged rollout + enterprise
10+
# lag), so it is the better stealth default per the version-realism research.
11+
# - 151 stays available for anyone who wants the newest engine, but reports a version ahead of
12+
# stable (a soft tell on rebrowser). Ship both; default installers/SDK to 149.

0 commit comments

Comments
 (0)