How To CrossCompile OpenJDK for ARMv7
This document describes the steps needed to cross-compile OpenJDK using
OpenEmbedded process, which is clearly described in the following link.
OpenEmbedded process, which is clearly described in the following link.
The same sequence of steps are copied here.
Steps for build-setup: ======================
1. First make sure the following packages have been installed on your host PC.
Steps for build-setup: ======================
1. First make sure the following packages have been installed on your host PC.
2. On Ubuntu you will need to change /bin/sh to point to bash instead of dash,
you can do this by running the following command and answer "No" if you want
to use dash in the question box that gets displayed.
you can do this by running the following command and answer "No" if you want
to use dash in the question box that gets displayed.
3. Create a directory to be used for openembedded with sufficient disk space.
4. Now you will have to create your own copy of bitbake, openembedded from
its various sources. The openembedded git tree are quite heavy about
500Mb in size, so be patient.
its various sources. The openembedded git tree are quite heavy about
500Mb in size, so be patient.
5. Create your build directory
6. Create your own local.conf.
A tested minimal build/conf/local.conf configuration can look like this.
A tested minimal build/conf/local.conf configuration can look like this.
- look in org.openembedded.dev/conf/distro
- for various preconfigured distro targets.
DISTRO = "angstrom-2010.x"
- look in org.openembedded.dev/conf/machine
- for various preconfigured machine targets.
- If you want to build packages for the same architecture
- as bitbake are running on then change this to MACHINE = "native"
MACHINE = "beagleboard"
- Comment out one of the two lines below
#DISTRO_TYPE = "debug"
DISTRO_TYPE = "release"
#This row instructs bitbake to both create jffs2 compressed filesystems for embedded
flash disks
#and tar.gz tarballs to be unpacked on removable compact flash sd cards.
IMAGE_FSTYPES = "jffs2 tar.gz "
#flash disks
#and tar.gz tarballs to be unpacked on removable compact flash sd cards.
IMAGE_FSTYPES = "jffs2 tar.gz "
- The default build uses glibc
- Uncomment the line below if you want uclibc instead of glibc
- be prepared for a lot of package breakage!
- 'uclibc' or 'glibc' or 'eglibc'
ANGSTROMLIBC = "glibc"
- If you enable glibc and encounter qemu-native build issues
- uncomment the line below.
ENABLE_BINARY_LOCALE_GENERATION=0
- specifies where BitBake should place the downloaded sources
DL_DIR = "${OETOP}/sources"
- specifies where BitBake should create its temporary files
TMPDIR = ${OETOP}/${MYBUILDDIR}/tmp
- specifies that BitBake should emit the log if a build fails
BBINCLUDELOGS = "yes"
- collection setup
BBFILES="${OEBRANCH}/recipes/*/*.bb ${USERBRANCH}/packages/*/*.bb"
BBFILE_COLLECTIONS="oe user"
BBFILE_PATTERN_oe="^${OEBRANCH}/packages"
BBFILE_PATTERN_user="^${USERBRANCH}/packages"
BBFILE_PATTERN_user="^${USERBRANCH}/packages"
BBFILE_PRIORITY_oe="5"
BBFILE_PRIORITY_user="15"
BBFILE_PRIORITY_user="15"
- Uncomment these lines to enable parallel make.
- This allows make to spawn mutliple processes to take advantage of multiple
- processors. Useful on SMP machines
PARALLEL_MAKE = "-j 4"
BB_NUMBER_THREADS = "4"
- some of the OE provided native tools are a bit buggy
- uncomment the line below if you run into build failures due to the packages listed
below - you will also need to install your distro's version of these packages on your
build machine
#ASSUME_PROVIDED += "gdk-pixbuf-csource-native imagemagick-native librsvg-native
------------------------------------------------------------------------------------
bitbake in your path Do this by creating a simple bash script like this: #
- Environment setup for oe #
export MYBUILDDIR="build"
export BB_ENV_EXTRAWHITE="MACHINE DISTRO ANGSTROM_MODE OETOP OEBRANCH USERBRANCH
MYBUILDDIR"
MYBUILDDIR"
export OETOP="~/openembedded"
export OEBRANCH="${OETOP}/org.openembedded.dev"
export USERBRANCH="${OETOP}/user.collection"
export OEBRANCH="${OETOP}/org.openembedded.dev"
export USERBRANCH="${OETOP}/user.collection"
export PATH="${OETOP}/bitbake-1.12.0/bin/:$PATH"
export BBPATH="${OETOP}/${MYBUILDDIR}:${USERBRANCH}:${OEBRANCH}"
umask 0002export BBPATH="${OETOP}/${MYBUILDDIR}:${USERBRANCH}:${OEBRANCH}"
bash #
- end oe setup #
------------------------------------------------------------------------------------
8. Now cross-compile OpenJDK using bitbake command.
simply do the following:
simply do the following:
9. Once the compilation successfull, openJDK binaries can be found at,
Issues faced during build-setup: ================================
1. Proxy settings.
During the build process, bitbake tools will try to download many required packages
from the console.
To run this behind the proxy, need to set proper proxy settings to access from the
console.
1. Proxy settings.
During the build process, bitbake tools will try to download many required packages
from the console.
To run this behind the proxy, need to set proper proxy settings to access from the
console.
wget.exe --execute
http_proxy="http://<PROXY_USER>:<PROXY_PASSWORD>
--------------------------------------
http_proxy="http://<PROXY_USER>:<PROXY_PASSWORD>
<PROXY_ADDRESS>:<PROXY_PORT>/" $--------------------------------------
2. Checksum mismatch error for a downloaded packages.
Bitbake tries to download many required packages and matches for their check sum.
It check sum doesn't match, the package may be corrupted.
In this case give a try to download manually the corrupted package and place it
to the source
directory.
~/openembedded-openjdk/sources
Bitbake tries to download many required packages and matches for their check sum.
It check sum doesn't match, the package may be corrupted.
In this case give a try to download manually the corrupted package and place it
to the source
directory.
~/openembedded-openjdk/sources
3. If the proxy password/username contains a combination of @
symbol, use its hex
value in place of @ character. hex of @ character is %40
Hi
ReplyDeleteI am getting the following error
bitbake openjdk-7-jre
ERROR: Unable to parse conf/bitbake.conf: file conf/bitbake.conf not found in ~/openembedded/build:~/openembedded/user.collection:~/openembedded/org.openembedded.dev