[Raspberry Pi Development] cmoatoto:
Use Raspberry Pi to build Android Project (AOSP)

Hi all !

My current project is to use my Raspberry Pi as a Build Machine to build all Android sources (AOSP). In fact, I'll not build AOSP but the CyanogenMod (wich is mainly a fork from AOSP).

I know this may sound crazy, dumb or useless (according to Google, a 64-bit environment is required, and a lot (>> 4GB) of RAM if you're in a hurry), especially to use an ARM processor to build while all the Makefiles has been written to be used on x86...

But what I'm thinking about is a really cheap, silent, but working build machine, to sync the repo and build nightlies everyday. The first build will take some days but then, only the changes will be build so I think that only some hours per day will be required.

If I success, I'll create a big tutorial to explain what changes was required.

First of all, I had to add the Linux-armv61 arch as Host OS/ARCH :

pi@raspberrypi ~/buildspace/android/system/build $ git diff
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 862b7f0..34eb31a 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -77,6 +77,10 @@ ifneq (,$(findstring Power,$(UNAME)))
HOST_ARCH := ppc
endif

[COLOR="SeaGreen"]+ifneq (,$(findstring arm,$(UNAME)))
+ HOST_ARCH := armv61
+endif
+[/COLOR]
BUILD_ARCH := $(HOST_ARCH)

ifeq ($(HOST_ARCH),)

then, I did this (because the raspbian ld doesn't support --icf) :

-->

pi@raspberrypi ~/buildspace/android/system/build $ git diff
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index b36111f..24e0d99 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -146,7 +146,6 @@ TARGET_GLOBAL_LDFLAGS += \
-Wl,-z,relro \
-Wl,-z,now \
-Wl,--warn-shared-textrel \
[COLOR="Red"]- -Wl,--icf=safe \[/COLOR]
$(arch_variant_ldflags)

# We only need thumb interworking in cases where thumb support

but now I am stuck with this error :

make -C kernel/samsung/smdk4210 O=/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=" /media/totoext4part/cyanogenmod/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-" headers_install
make[1]: Entering directory `/media/totoext4part/cyanogenmod/system/kernel/samsung/smdk4210'
/media/totoext4part/cyanogenmod/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: 1: /media/totoext4part/cyanogenmod/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: Syntax error: "(" unexpected
CHK include/linux/version.h
make[1]: Leaving directory `/media/totoext4part/cyanogenmod/system/kernel/samsung/smdk4210'
/bin/bash: r: command not found
make: [/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/lib/crtbegin_static.o] Error 127 (ignored)
[COLOR="SeaGreen"]target SharedLib[/COLOR]: libdl (/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/LINKED/libdl.so)
/usr/bin/ld: error: /media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/LINKED/libdl.so uses VFP register arguments, /media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o does not
/usr/bin/ld: failed to merge target specific data of file /media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o
/usr/bin/ld: warning: creating a DT_TEXTREL in a shared object.
collect2: ld returned 1 exit status
make: *** [/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/LINKED/libdl.so] Error 1

I don't really know what I have to do and if it is because the HOST is an arm arch...

It have been a long time since I didn't put my hands in this kind of things and I need help to solve this problems... Thanks in advance !