[G1 Android Development] farmatito:
While trying to build gingerbread I've experienced some trouble:

. build/envsetup.sh
including device/htc/sapphire/vendorsetup.sh
debian:~/Desktop/android/gingerbread$ lunch

You're building on Linux

Lunch menu... pick a combo:
1. generic-eng
2. simulator
3. full_sapphire-userdebug

Which would you like? [generic-eng] 3
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)

prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.1
TARGET_PRODUCT=full_sapphire
TARGET_BUILD_VARIANT=userdebug
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)

A quick and brutal fix is to:

1) go to gingerbread/prebuilt/linux-x86/toolchain

2) rename arm-eabi-4.4.3 to arm-eabi-4.4.3.old

3) link arm-eabi-4.4.0 to arm-eabi-4.4.3

cd gingerbread/prebuilt/linux-x86/toolchain
mv arm-eabi-4.4.3 to arm-eabi-4.4.3.old
ln -s arm-eabi-4.4.0 arm-eabi-4.4.3

One more fix needed to build on x86 is to change

# This forces a 64-bit build for Java6
LOCAL_CFLAGS += -m64
LOCAL_LDFLAGS += -m64

in the Android.mk files of the gingerbread/external/clearsilver/ directory

and subdirectories to:

# This forces a 64-bit build for Java6
LOCAL_CFLAGS += -m32
LOCAL_LDFLAGS += -m32

This should be fixed in a more elegant way based on the host arch.

Started to compile now....................................Done.

Works so far.

Patch attached to fix build on 32 bit hosts.

repo diff

project build/
diff --git a/core/main.mk b/core/main.mk
index 6113e52..72e32c8 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -72,7 +72,8 @@ $(info Checking build tools versions...)

ifeq ($(BUILD_OS),linux)
build_arch := $(shell uname -m)
-ifneq (64,$(findstring 64,$(build_arch)))
+#ifneq (64,$(findstring 64,$(build_arch)))
+ifneq (i686,$(findstring i686,$(build_arch)))
$(warning ************************************************************)
$(warning You are attempting to build on a 32-bit system.)
$(warning Only 64-bit build environments are supported beyond froyo/2.2.)

project external/clearsilver/
diff --git a/cgi/Android.mk b/cgi/Android.mk
index 21c534b..2c7bf36 100644
--- a/cgi/Android.mk
+++ b/cgi/Android.mk
@@ -13,8 +13,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC

# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+#LOCAL_CFLAGS += -m64
+#LOCAL_LDFLAGS += -m64
+
+# This forces a 64-bit build for Java6
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32

LOCAL_NO_DEFAULT_COMPILER_FLAGS := true

diff --git a/cs/Android.mk b/cs/Android.mk
index 9f0e30a..4807b3f 100644
--- a/cs/Android.mk
+++ b/cs/Android.mk
@@ -9,8 +9,10 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC

# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+#LOCAL_CFLAGS += -m64
+#LOCAL_LDFLAGS += -m64
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32

LOCAL_NO_DEFAULT_COMPILER_FLAGS := true

diff --git a/java-jni/Android.mk b/java-jni/Android.mk
index 21b4fd1..cc6d3ce 100644
--- a/java-jni/Android.mk
+++ b/java-jni/Android.mk
@@ -34,8 +34,10 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS += -fPIC

# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+#LOCAL_CFLAGS += -m64
+#LOCAL_LDFLAGS += -m64
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32

LOCAL_NO_DEFAULT_COMPILER_FLAGS := true

diff --git a/util/Android.mk b/util/Android.mk
index 386f379..fc27bbf 100644
--- a/util/Android.mk
+++ b/util/Android.mk
@@ -18,8 +18,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC

# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+#LOCAL_CFLAGS += -m64
+#LOCAL_LDFLAGS += -m64
+
+# This forces a 64-bit build for Java6
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32

LOCAL_NO_DEFAULT_COMPILER_FLAGS := true