KaiOS: Difference between revisions

846 bytes removed ,  2 December 2020
Updated the build instructions to reflect the native b2g bootstrap and modified the default mozconfig file
(Added instructions on how to add stuff to the sysroot)
(Updated the build instructions to reflect the native b2g bootstrap and modified the default mozconfig file)
Line 10: Line 10:
<pre>hg clone https://hg.mozilla.org/projects/kaios</pre>
<pre>hg clone https://hg.mozilla.org/projects/kaios</pre>
Bootstrap your build environment via mach
Bootstrap your build environment via mach
<pre>export LOCAL_NDK_BASE_URL='ftp://ftp.kaiostech.com/ndk/android-ndk' ./mach bootstrap --application-choice='GeckoView/Firefox for Android'</pre>
<pre>export LOCAL_NDK_BASE_URL='ftp://ftp.kaiostech.com/ndk/android-ndk' ./mach bootstrap --application-choice='Boot2Gecko'</pre>
Download the b2g sysroot using <code>mach</code>:
<pre>
./mach artifact toolchain --from-build toolchain-linux64-b2g-sysroot
rm -rf ~/.mozbuild/b2g-sysroot
mv b2g-sysroot ~/.mozbuild
</pre>
Add a suitable mozconfig file, you can use the following one for the time being
Add a suitable mozconfig file, you can use the following one for the time being
<pre>
<pre>
Line 26: Line 20:
ac_add_options --with-android-version=29
ac_add_options --with-android-version=29
ac_add_options --target=x86_64-linux-android
ac_add_options --target=x86_64-linux-android
ac_add_options --with-target-arch-name=x86_64


# Compiler options
# Compiler options
CC="$HOME/.mozbuild/clang/bin/clang"
CXX="$HOME/.mozbuild/clang/bin/clang++"
ac_add_options --with-android-ndk="$HOME/.mozbuild/android-ndk-r20b-canary"
ac_add_options --with-android-ndk="$HOME/.mozbuild/android-ndk-r20b-canary"
mk_add_options "export LD_LIBRARY_PATH=$HOME/.mozbuild/clang/lib"
# Use sccache
ac_add_options --with-ccache=sccache


# B2G-specific options
# B2G-specific options
Line 44: Line 31:
ac_add_options --enable-b2g-fm
ac_add_options --enable-b2g-fm
ac_add_options --enable-forkserver
ac_add_options --enable-forkserver
# We don't use the profiler
ac_add_options --disable-profiling


# Only for x86-64
# Only for x86-64
ac_add_options --enable-wasm-simd
ac_add_options --enable-wasm-simd


# sandbox includes non existent arm64 files
# Sandbox & profiler are not supported yet
ac_add_options --disable-profiling
ac_add_options --disable-sandbox
ac_add_options --disable-sandbox


Line 59: Line 44:
ac_add_options --enable-linker=lld
ac_add_options --enable-linker=lld
ac_add_options --disable-elf-hack
ac_add_options --disable-elf-hack
export CFLAGS="-Wno-nullability-completeness"
export CPPFLAGS="-DANDROID -DTARGET_OS_GONK \
-DJE_FORCE_SYNC_COMPARE_AND_SWAP_4=1 \
-D_USING_LIBCXX \
-DGR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1 \
-isystem $ANDROID_NDK/platforms/$ANDROID_PLATFORM/$ARCH_DIR/usr/include"
export LDFLAGS="--sysroot=$HOME/.mozbuild/android-ndk-r20b-canary/platforms/android-29/arch-x86_64/"
</pre>
</pre>
Build as usual with <code>./mach build</code>
Build as usual with <code>./mach build</code>
Line 83: Line 58:
<pre>export LOCAL_NDK_BASE_URL='ftp://ftp.kaiostech.com/ndk/android-ndk'</pre>
<pre>export LOCAL_NDK_BASE_URL='ftp://ftp.kaiostech.com/ndk/android-ndk'</pre>
Install Gecko dependencies
Install Gecko dependencies
<pre>cd gecko && ./mach bootstrap --application-choice mobile</pre>
<pre>cd gecko && ./mach bootstrap --application-choice Boot2Gecko</pre>
Build by invoking the <code>build.sh</code> script in the top-level directory. Depending on your machine this step can take anywhere from 30 minutes to several hours
Build by invoking the <code>build.sh</code> script in the top-level directory. Depending on your machine this step can take anywhere from 30 minutes to several hours
<pre>./build.sh</pre>
<pre>./build.sh</pre>
Confirmed users
429

edits