Skip to content

Commit

Permalink
Document how to use cross-toolchain-helper with the SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaszimmermann committed Jun 28, 2024
1 parent 124aad4 commit e44db71
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/04-Cross-compilation-inside-the-SDK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Cross-compiling inside the SDK

To cross-compile WebKit for different machines, WebKit provides a yocto based environment.
See /path/to/WebKit/Tools/yocto/README.md for details. You do not need to cross-compile from
within the SDK, but if you want to do it, here are some instructions:

```
unset LD_LIBRARY_PATH
export NUMBER_OF_PROCESSORS=12 # Adapt to your machine.
export WEBKIT_USE_SCCACHE=0
Tools/Scripts/cross-toolchain-helper --cross-target rpi3-32bits-mesa --build-image
Tools/Scripts/cross-toolchain-helper --cross-target rpi3-32bits-mesa --build-toolchain
Tools/Scripts/cross-toolchain-helper --cross-target rpi3-32bits-mesa --cross-toolchain-run-cmd CFLAGS="" CPPFLAGS="" WebKitBuild/CrossToolChains/rpi3-32bits-mesa/build/toolchain/sysroots/x86_64-pokysdk-linux/post-relocate-setup.d/meson-setup.py
Tools/Scripts/cross-toolchain-helper --cross-target rpi3-32bits-mesa --cross-toolchain-run-cmd Tools/Scripts/build-webkit --wpe --release
```

It is important to unset the `LD_LIBRARY_PATH` otherwise `cross-toolchain-helper` will partly fail,
but `build-webkit` continues, leading to an inconsistent build environment, that will fail to produce binaries.

sccache is also not supported in that mode, and will interefer with yocto - disable it.

Follow the instructions in Tools/yocto/README.md to flash the image onto your target machine.

0 comments on commit e44db71

Please sign in to comment.