Embedding/IPCLiteAPI BeagleBoardHF: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with "Cross compile Mozilla Qt for HardFP precise target Based on instructions from https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/FirefoxCrossCompile <pre> # Prepare mult...")
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Cross compile Mozilla Qt for HardFP precise target
# Basic Setup and minimal dependencies for toolkit-X-less Gecko build
Based on instructions from https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/FirefoxCrossCompile
# based on instructions from https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/FirefoxCrossCompile
 
<pre>
<pre>
# Prepare multiarch chroot
# Prepare multiarch chroot


sudo debootstrap --variant=buildd precise /home/precise
sudo debootstrap --variant=buildd precise /home/precise
sudo cp -f /etc/apt/apt.conf /home/precise/etc/apt/
sudo cp -f /etc/resolv.conf /home/precise/etc/
sudo chroot /home/precise/
sudo chroot /home/precise/
mount -t proc proc /proc
mount -t proc proc /proc
apt-get update
apt-get install vim bash-completion


#Set up the /etc/apt/sources.list inside the chroot :
#Set up the /etc/apt/sources.list inside the chroot :


echo "# use arch=amd64 if you have 32bit Linux install
echo "# use arch=amd64 if you have 32bit Linux install
deb [arch=i386] http://archive.ubuntu.com/ubuntu precise main universe
deb [arch=i386] http://archive.ubuntu.com/ubuntu precise main universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports precise main universe
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports precise main universe multiverse
#deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ precise-updates main universe multiverse
#deb [arch=armhf] http://ppa.launchpad.net/linaro-maintainers/overlay/ubuntu precise main
#deb [arch=armhf] http://ppa.launchpad.net/linaro-maintainers/staging-overlay/ubuntu precise main
deb-src http://ppa.launchpad.net/linaro-maintainers/overlay/ubuntu precise main
deb-src http://ppa.launchpad.net/linaro-maintainers/staging-overlay/ubuntu precise main
deb-src http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
deb-src http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list


Line 40: Line 42:


apt-get update
apt-get update
apt-get install g++-arm-linux-gnueabihf build-essential pkg-config unzip zip autoconf2.13 libglib2.0-dev
apt-get install vim bash-completion
 
apt-get install g++-arm-linux-gnueabihf build-essential pkg-config unzip zip autoconf2.13
# Install main Mozilla Qt port dependencies
apt-get install libqt4-dev:armhf libqt4-opengl-dev:armhf libpango1.0-dev:armhf libdbus-glib-1-dev:armhf libasound2-dev:armhf libxt-dev:armhf mesa-common-dev:armhf
 
vi /var/lib/dpkg/info/libglib2.0-0:armhf.postinst
and set exit 0 in the beginning of script
apt-get -f install


# Finally, we need to create a symlink for pkg-config:
# Finally, we need to create a symlink for pkg-config:
Line 53: Line 49:
cd /usr/bin
cd /usr/bin
ln -s /usr/share/pkg-config-crosswrapper arm-linux-gnueabihf-pkg-config
ln -s /usr/share/pkg-config-crosswrapper arm-linux-gnueabihf-pkg-config
</pre>
Prepare Mozilla source tree with Embedding IPC patches and HONK (plain linux port)
Clone mozilla repository + patch queue (for IPC Embedding), better to create some folder like /build
<pre>
mkdir /build
cd /build
hg clone http://hg.mozilla.org/mozilla-central
cd mozilla-central
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/embedipc_queue .hg/patches
hg update `cat .hg/patches/changeset`
hg qpush -a
</pre>
Mozilla toolkit-Xlib-less HONK port, b2g, for rendering into Framebuffer
<pre>
# Install main Mozilla B2G Honk port base dependencies
apt-get install libfreetype6-dev:armhf libfontconfig1-dev:armhf libasound-dev:armhf libudev-dev:armhf
# X deps (only for X build)
apt-get install libxt-dev:armhf libxext-dev:armhf libxrender-dev:armhf
# This part is basically enough to build honk (plain linux gecko port ab be able to run it on Framebuffer or SGX EGL fb context)
cd mozilla-central
MOZCONFIG=$(pwd)/.hg/patches/mozconfig.cross.precise-honk make -f client.mk build_all
To launch b2g clone and copy https://github.com/andreasgal/gaia to your local PC apache /var/www folder or put it into device /var/www folder
Copy b2g stub to device
cp -rfL obj-build-linaro-honk/dist/bin ./b2g-build
arm-linux-gnueabihf-strip ./b2g-build/*
scp -r ./b2g-build/ root@device-ip:/opt
on device:
cd /opt/b2g-build
B2G_HOMESCREEN=http://server[local-server]/gaia/homescreen.html ./b2g
</pre>
Qt build with X
<pre>
# Install main Mozilla Qt port dependencies
apt-get install libqt4-dev:armhf libqt4-opengl-dev:armhf libpango1.0-dev:armhf libdbus-glib-1-dev:armhf libasound2-dev:armhf libxt-dev:armhf mesa-common-dev:armhf
# make sure that required build libraries are still in the system
apt-get install pkg-config unzip zip autoconf2.13 libglib2.0-dev


# XXX Minor trick in order to get host version of qt moc/rcc
# XXX Minor trick in order to get host version of qt moc/rcc
# install host qt-dev version, and backup moc/rcc/uic
# install host qt-dev version, and backup moc/rcc/uic
rm /usr/share/doc/libx11-6/changelog.Debian.gz
apt-get install libqt4-dev
apt-get install libqt4-dev
cp /usr/bin/moc-qt4 /tmp/
cp /usr/bin/moc-qt4 /tmp/
Line 66: Line 108:
# install armhf version back
# install armhf version back
apt-get install libqt4-dev:armhf libqt4-opengl-dev:armhf
apt-get install libqt4-dev:armhf libqt4-opengl-dev:armhf
# make sure that required build libraries are still in the system
apt-get install pkg-config unzip zip autoconf2.13 libglib2.0-dev


# and replace arm version of moc/uic/rcc
# and replace arm version of moc/uic/rcc
Line 74: Line 113:
cp /tmp/rcc /usr/bin/rcc
cp /tmp/rcc /usr/bin/rcc
cp /tmp/uic-qt4 /usr/bin/uic-qt4
cp /tmp/uic-qt4 /usr/bin/uic-qt4
# Clone mozilla repository + patch queue (for IPC Embedding), better to create some folder like /build
mkdir /build
cd /build
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/mozilla_ipcembed
cd mozilla_ipcembed
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/embedipc_queue .hg/patches
hg update -C embedipc
hg qpush -a


# Create mozconfig
# Create mozconfig
Line 107: Line 136:
LDFLAGS="$FIX_LINK_LDFLAGS"
LDFLAGS="$FIX_LINK_LDFLAGS"


ac_add_options --build=i686-linux-gnu
ac_add_options --target=arm-linux-gnueabihf
ac_add_options --host=arm-linux-gnueabihf
ac_add_options --prefix=/usr
ac_add_options --prefix=/usr
ac_add_options --enable-application=mobile
ac_add_options --enable-application=mobile
Line 131: Line 159:
ac_add_options --enable-optimize
ac_add_options --enable-optimize
mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_OBJDIR="@TOPSRCDIR@/obj-build-linarohf"
mk_add_options MOZ_OBJDIR="@TOPSRCDIR@/obj-build-linaro"
ac_add_options --with-arm-kuser
ac_add_options --with-arm-kuser
ac_add_options --with-thumb=toolchain-default
ac_add_options --with-thumb=toolchain-default
Line 137: Line 165:
ac_add_options --with-system-zlib
ac_add_options --with-system-zlib
ac_add_options --enable-force-egl
ac_add_options --enable-force-egl
ac_add_options --with-gl-provider=EGL


#ac_add_options --enable-debug
#ac_add_options --enable-debug
#ac_add_options --enable-logging
#ac_add_options --enable-logging
#***********************************
#***********************************


MOZCONFIG=$(pwd)/mozconfig.linaro.precise make -f client.mk build_all
MOZCONFIG=$(pwd)/mozconfig.linaro make -f client.mk build_all


</pre>
</pre>

Latest revision as of 03:11, 21 April 2012

  1. Basic Setup and minimal dependencies for toolkit-X-less Gecko build
  2. based on instructions from https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/FirefoxCrossCompile
# Prepare multiarch chroot

sudo debootstrap --variant=buildd precise /home/precise
sudo cp -f /etc/apt/apt.conf /home/precise/etc/apt/
sudo cp -f /etc/resolv.conf /home/precise/etc/
sudo chroot /home/precise/
mount -t proc proc /proc

#Set up the /etc/apt/sources.list inside the chroot :

echo "# use arch=amd64 if you have 32bit Linux install
deb [arch=i386] http://archive.ubuntu.com/ubuntu precise main universe multiverse
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports precise main universe multiverse
#deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ precise-updates main universe multiverse
#deb [arch=armhf] http://ppa.launchpad.net/linaro-maintainers/overlay/ubuntu precise main
#deb [arch=armhf] http://ppa.launchpad.net/linaro-maintainers/staging-overlay/ubuntu precise main
deb-src http://ppa.launchpad.net/linaro-maintainers/overlay/ubuntu precise main
deb-src http://ppa.launchpad.net/linaro-maintainers/staging-overlay/ubuntu precise main
deb-src http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list

#We need some packages not yet in precise, so we create /etc/apt/sources.list.d/linaro-maintainers.list

echo "deb http://ppa.launchpad.net/linaro-maintainers/overlay/ubuntu precise main
deb-src http://ppa.launchpad.net/linaro-maintainers/overlay/ubuntu precise main
deb http://ppa.launchpad.net/linaro-maintainers/staging-overlay/ubuntu precise main
deb-src http://ppa.launchpad.net/linaro-maintainers/staging-overlay/ubuntu precise main
" > /etc/apt/sources.list.d/linaro-maintainers.list

#Enable multiarch for dpkg in in /etc/dpkg/dpkg.cfg.d/multiarch 

echo "foreign-architecture armhf" > /etc/dpkg/dpkg.cfg.d/multiarch
 
#In /etc/apt/apt.conf.d/10local disable installing recommends:

echo 'APT::Install-Recommends "0";
APT::Install-Suggests "0";' > /etc/apt/apt.conf.d/10local

# Install toolchain and essentials 

apt-get update
apt-get install vim bash-completion
apt-get install g++-arm-linux-gnueabihf build-essential pkg-config unzip zip autoconf2.13

# Finally, we need to create a symlink for pkg-config:

cd /usr/bin
ln -s /usr/share/pkg-config-crosswrapper arm-linux-gnueabihf-pkg-config

Prepare Mozilla source tree with Embedding IPC patches and HONK (plain linux port) Clone mozilla repository + patch queue (for IPC Embedding), better to create some folder like /build

mkdir /build
cd /build
hg clone http://hg.mozilla.org/mozilla-central
cd mozilla-central
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/embedipc_queue .hg/patches
hg update `cat .hg/patches/changeset`
hg qpush -a

Mozilla toolkit-Xlib-less HONK port, b2g, for rendering into Framebuffer

# Install main Mozilla B2G Honk port base dependencies
apt-get install libfreetype6-dev:armhf libfontconfig1-dev:armhf libasound-dev:armhf libudev-dev:armhf

# X deps (only for X build)
apt-get install libxt-dev:armhf libxext-dev:armhf libxrender-dev:armhf

# This part is basically enough to build honk (plain linux gecko port ab be able to run it on Framebuffer or SGX EGL fb context)
cd mozilla-central
MOZCONFIG=$(pwd)/.hg/patches/mozconfig.cross.precise-honk make -f client.mk build_all

To launch b2g clone and copy https://github.com/andreasgal/gaia to your local PC apache /var/www folder or put it into device /var/www folder
Copy b2g stub to device
cp -rfL obj-build-linaro-honk/dist/bin ./b2g-build
arm-linux-gnueabihf-strip ./b2g-build/*
scp -r ./b2g-build/ root@device-ip:/opt
on device:
cd /opt/b2g-build
B2G_HOMESCREEN=http://server[local-server]/gaia/homescreen.html ./b2g

Qt build with X


# Install main Mozilla Qt port dependencies
apt-get install libqt4-dev:armhf libqt4-opengl-dev:armhf libpango1.0-dev:armhf libdbus-glib-1-dev:armhf libasound2-dev:armhf libxt-dev:armhf mesa-common-dev:armhf

# make sure that required build libraries are still in the system
apt-get install pkg-config unzip zip autoconf2.13 libglib2.0-dev 

# XXX Minor trick in order to get host version of qt moc/rcc
# install host qt-dev version, and backup moc/rcc/uic
apt-get install libqt4-dev
cp /usr/bin/moc-qt4 /tmp/
cp /usr/bin/rcc /tmp/
cp /usr/bin/uic-qt4 /tmp/

# install armhf version back
apt-get install libqt4-dev:armhf libqt4-opengl-dev:armhf

# and replace arm version of moc/uic/rcc
cp /tmp/moc-qt4 /usr/bin/moc-qt4
cp /tmp/rcc /usr/bin/rcc
cp /tmp/uic-qt4 /usr/bin/uic-qt4

# Create mozconfig
vi mozconfig.cross.precise
# and copy this content
#***********************************
export PKG_CONFIG=arm-linux-gnueabihf-pkg-config
export CROSS_COMPILE=1
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export STRIP=arm-linux-gnueabihf-strip
export CPPFLAGS=-I/usr/include

export HOST_CC=gcc
export HOST_CFLAGS="-g `pkg-config --cflags glib-2.0` -L/usr/lib/i386-linux-gnu"
export HOST_CXX=g++
export HOST_CXXFLAGS=-g
export CFLAGS=-g
export CXXFLAGS=-g
export FFLAGS="-g -O2"
FIX_LINK_LDFLAGS="-L/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link=/usr/lib/arm-linux-gnueabihf -L/lib/arm-linux-gnueabihf -Wl,-rpath-link=/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf/mesa-egl -Wl,-rpath-link=/usr/lib/arm-linux-gnueabihf/mesa-egl"
export LDFLAGS="$FIX_LINK_LDFLAGS"
LDFLAGS="$FIX_LINK_LDFLAGS"

ac_add_options --target=arm-linux-gnueabihf
ac_add_options --prefix=/usr
ac_add_options --enable-application=mobile
ac_add_options --enable-update-channel=nightly
ac_add_options --enable-update-packaging
ac_add_options --enable-tests
ac_add_options --enable-default-toolkit=cairo-qt
ac_add_options --enable-mobile-optimize
ac_add_options --disable-necko-wifi
ac_add_options --with-x

mk_add_options CPPFLAGS=-I/usr/include
mk_add_options LDFLAGS="$FIX_LINK_LDFLAGS"

ac_add_options --enable-cpp-rtti

export MOZ_DEBUG_SYMBOLS=1
ac_add_options --enable-debug-symbols="-gdwarf-2"
export MOZILLA_OFFICIAL=1
mk_add_options PROFILE_GEN_SCRIPT=@TOPSRCDIR@/build/profile_pageloader.pl

ac_add_options --enable-optimize
mk_add_options MOZ_MAKE_FLAGS="-j4"
mk_add_options MOZ_OBJDIR="@TOPSRCDIR@/obj-build-linaro"
ac_add_options --with-arm-kuser
ac_add_options --with-thumb=toolchain-default
ac_add_options --with-float-abi=toolchain-default
ac_add_options --with-system-zlib
ac_add_options --enable-force-egl
ac_add_options --with-gl-provider=EGL

#ac_add_options --enable-debug
#ac_add_options --enable-logging
#***********************************

MOZCONFIG=$(pwd)/mozconfig.linaro make -f client.mk build_all