With the configuration of Samsung Arndale board to make a full Linaro Android build locally, it failed at:
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
out/target/product/arndale/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:10:26: error: extra tokens at end of #ifndef directive [-Werror]
#ifndef java_util_HashSet<E>_JNI
^
out/target/product/arndale/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:11:26: error: missing whitespace after the macro name [-Werror]
#define java_util_HashSet<E>_JNI
^
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
out/target/product/arndale/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:24:20: error: expected initializer before '<' token
const char kHashSet<E>ClassPath[] = "java/util/HashSet<E>";
^
out/target/product/arndale/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:26:17: error: expected initializer before '<' token
jclass g_HashSet<E>_clazz = NULL;
^
out/target/product/arndale/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected '{' before '<' token
namespace JNI_HashSet<E> {
^
out/target/product/arndale/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected unqualified-id before '<' token
external/chromium_org/content/common/android/hash_set.cc:30:1: error: expected '}' at end of input
} // namespace content
^
cp out/target/product/arndale/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/browser_plugin/browser_plugin_constants.d out/target/product/arndale/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/browser_plugin/browser_plugin_constants.P; sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$//' -e '/^$/ d' -e 's/$/ :/' < out/target/product/arndale/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/browser_plugin/browser_plugin_constants.d >> out/target/product/arndale/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/browser_plugin/browser_plugin_constants.P; rm -f out/target/product/arndale/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/browser_plugin/browser_plugin_constants.d
cc1plus: all warnings being treated as errors
make: *** [out/target/product/arndale/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/android/hash_set.o] Error 1
This failure can be reproduced in following ways:
1. On ubuntu 13.10 & 14.04 64bit host machine with Linaro gcc 4.9 2014.05 or gcc 4.8 2014.04 tool chain:
http://snapshots.linaro.org/android/~linaro-android/toolchain-4.9-2014.05/1/android-toolchain-eabi-4.9-2014.05-x86.tar.bz2
http://snapshots.linaro.org/android/~linaro-android/toolchain-4.8-2014.04/1/android-toolchain-eabi-4.8-2014.04-x86.tar.bz2
$ sudo apt-get install gnupg flex bison gperf build-essential zip curl zlib1g-dev git bzr acpitool libfwtsacpica1 libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc u-boot-tools openjdk-6-jdk openjdk-6-jre vim-common python-parted python-yaml wget uuid-dev software-properties-common
$ sudo dpkg --add-architecture i386
$ curl https://storage.googleapis.com/git-repo-downloads/repo > repo
$ chmod 755 repo
$ sudo ln -s /Absolute_Path/repo /usr/local/sbin/repo
$ which repo
$ ls -l /usr/local/sbin/repo
$ mkdir arndale
$ cd arndale
$ repo init -u git://android.git.linaro.org/platform/manifest.git -b linaro_android_4.4.2 -m default.xml -g common,arndale
$ repo sync -j2
$ cd ../
$ wget http://snapshots.linaro.org/android/~linaro-android/toolchain-4.9-2014.05/1/android-toolchain-eabi-4.9-2014.05-x86.tar.bz2
$ tar xjvf android-toolchain-eabi-4.9-2014.05-x86.tar.bz2
$ cd arndale
$ . build/envsetup.sh
$ make -j4 TARGET_PRODUCT=full_arndale TARGET_SIMULATOR=false WITH_HOST_DALVIK=false INCLUDE_PERF=0 SLEEP_OPTION=60 TOOLCHAIN_TRIPLET=arm-linux-androideabi TARGET_TOOLS_PREFIX=/Absolute_Path_To_Toolchain/bin/arm-linux-androideabi- LINARO_BUILD_SPEC=arndale-linaro boottarball systemtarball userdatatarball showcommands > build_log_YYMMDD.txt 2>&1 &
2. Using linaro_android_build_cmds.sh (gcc 4.8 toolchain will be used in this condition, host machine is ubuntu 12.04.4 64bit):
$ wget http://snapshots.linaro.org/android/~linaro-android/linux-linaro-arndale/462/pinned-manifest.xml
$ wget http://snapshots.linaro.org/android/~linaro-android/linux-linaro-arndale/462/linaro_android_build_cmds.sh
$ chmod 755 linaro_android_build_cmds.sh
Edit linaro_android_build_cmds.sh, Add WITH_HOST_DALVIK=false in "export" section, around line 140
Modify the last line - make command, to: make -j${CPUS} boottarball systemtarball userdatatarball > build_log_YYMMDD.txt 2>&1
$ wget http://snapshots.linaro.org/android/binaries/open/20131008/build-info.tar.bz2
$ mkdir full_build
$ ./linaro_android_build_cmds.sh -m pinned-manifest.xml -d /Absolute_Path_To/full_build -o /Absolute_Path_To/build-info.tar.bz2 -l botao.sun -y
I finally managed to get the Samsung Arndale Android build done locally by switching back to the Oracle JDK 1.6.0_45:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
For OpenJDK, the default one for version 6 is 1.6.0_31, which will cause the error information shows in bug description.
If using OpenJDK 7, the build just failed straight away far before that HashSet error.
So for local build, except Oracle JDK 1.6.0_45, there is no other option to do so. And since that build script linaro_ android_ build_cmds. sh basically doing the same thing as manually procedures, then it doesn't work either.