Skip to content

Commit 79af889

Browse files
committed
Update README.md and add v8-marking-state.patch to address ARM64 compilation issues
1 parent dbda93e commit 79af889

File tree

2 files changed

+57
-3
lines changed

2 files changed

+57
-3
lines changed

README.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,43 @@ git submodule update --init --recursive
6969
cd ..
7070
```
7171

72-
## Step 3: Build GN (Google's Build System) for Cross-Compilation
72+
## Step 3: Apply Required Patches
73+
74+
Before building, you need to apply a critical patch to fix compilation issues with the V8 engine on ARM64.
75+
76+
### Apply the V8 Patch
77+
78+
Apply a patch file to fix the marking state issue:
79+
80+
```bash
81+
# Navigate to the qtwebengine chromium directory
82+
cd C:\qtwebengine\src\3rdparty\chromium
83+
84+
# Create the patch file
85+
curl -LO https://raw.githubusercontent.com/fauzanelka/qtwebengine-arm64/refs/heads/main/v8-marking-state.patch
86+
87+
# Apply the patch
88+
git apply v8-marking-state.patch
89+
```
90+
91+
### Alternative: Manual File Edit
92+
93+
If the patch command fails, you can manually edit the file:
94+
95+
1. Open `C:\qtwebengine\chromium\v8\src\heap\cppgc\marking-state.h` in a text editor
96+
2. Find line ~361 that contains:
97+
```cpp
98+
return MutatorMarkingState::BasicMarkingState::MarkNoPush(header);
99+
```
100+
3. Replace it with:
101+
```cpp
102+
return BasicMarkingState::MarkNoPush(header);
103+
```
104+
4. Save the file
105+
106+
> **Important**: This patch fixes a C++ compilation error where the qualified name lookup fails on ARM64 builds. Without this patch, the build will fail with compilation errors.
107+
108+
## Step 4: Build GN (Google's Build System) for Cross-Compilation
73109

74110
GN must be built first as a native x64 binary before cross-compiling QtWebEngine.
75111

@@ -90,7 +126,7 @@ cmake --build . --parallel
90126

91127
> **Note**: The GN build often fails on the first attempt due to dependency resolution. Running the build command twice typically resolves this issue.
92128
93-
## Step 4: Cross-Compile QtWebEngine/QtPdf for ARM64
129+
## Step 5: Cross-Compile QtWebEngine/QtPdf for ARM64
94130

95131
### Open Cross-Compilation Environment
96132

@@ -138,7 +174,7 @@ C:\Qt\6.9.0\msvc2022_arm64\bin\qt-configure-module.bat ..\qtwebengine -- -DQT_HO
138174
cmake --build . --parallel
139175
```
140176

141-
## Step 5: Install QtWebEngine/QtPdf
177+
## Step 6: Install QtWebEngine/QtPdf
142178

143179
After the build is complete, you need to install the libraries. It's recommended to install to a separate directory to avoid conflicts with your native Qt installation.
144180

@@ -191,6 +227,11 @@ Compress-Archive -Path ".\*" -DestinationPath "C:\QtWebEngine-6.9.0-ARM64.zip"
191227
4. **Git Submodule Issues**
192228
- Run: `git submodule update --init --recursive --force`
193229

230+
5. **V8 Compilation Errors**
231+
- Ensure the V8 patch from Step 3 has been applied correctly
232+
- Check that the file `chromium/v8/src/heap/cppgc/marking-state.h` contains the corrected line
233+
- If you see errors related to `MutatorMarkingState::BasicMarkingState`, the patch wasn't applied
234+
194235
### Verification
195236

196237
After a successful build and installation, you should find the ARM64 libraries in:

v8-marking-state.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/chromium/v8/src/heap/cppgc/marking-state.h b/chromium/v8/src/heap/cppgc/marking-state.h
2+
index d3533274ba7..1f42edd7783 100644
3+
--- a/chromium/v8/src/heap/cppgc/marking-state.h
4+
+++ b/chromium/v8/src/heap/cppgc/marking-state.h
5+
@@ -358,7 +358,7 @@ class MutatorMarkingState final : public BasicMarkingState {
6+
~MutatorMarkingState() override = default;
7+
8+
inline bool MarkNoPush(HeapObjectHeader& header) {
9+
- return MutatorMarkingState::BasicMarkingState::MarkNoPush(header);
10+
+ return BasicMarkingState::MarkNoPush(header);
11+
}
12+
13+
inline void ReTraceMarkedWeakContainer(cppgc::Visitor&, HeapObjectHeader&);

0 commit comments

Comments
 (0)