How to fix problem of incompatibility between GCC 4.6 and Android 2.3 (Gingerbread)

27 05 2011

Hello everybody. Let’s see how we can fix one problem that can happen when you try to compile the Android 2.3 after you already have installed GCC 4.6.

During Android compilation you can receive the following error message:

host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
host SharedLib: libneo_cs (out/host/linux-x86/obj/lib/libneo_cs.so)
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: *** Waiting for unfinished jobs....

To fix that, open a terminal and run (assuming you are in the folder android):

gedit frameworks/base/libs/utils/Android.mk

Change the line:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)

To:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive

After that, save the file and recompile the Android again.

That’s it. See you next time.

Advertisement

Actions

Information

9 responses

13 09 2011
kureikain

This is excellent!!!
Thank and thank a lot.
You are the man.!

20 10 2011
Chris

Was really surprised when I got this error after updating to 2.3.7r1. Appreciate you referencing it on your site for the rest of us. Thanks again!

3 11 2011
lwing

Thanks a lot! You’re a life saver :)

13 11 2011
recluze

Thanks a lot for the quick tip. Had the same problem (with a different error message) on 2.3.7_r1 make. This fixed it.

18 11 2011
Bahar Ali Khan

Thanks a lot, it really works.

21 11 2011
kanupatar

Great man.Now it started building correctly.I am trying to build the android gingerbread source in my latest ubuntu 11.10 machine.

/rg

1 12 2011
Aubino

Hello Boys. please escuse myself for posting my problem here! it is a friend of my who recommended it to me.

i ‘m trying to install Android Hardware Development Environment (HDE)
into a fresh copy of Ubuntu Linux 10.04.
I hav sun-java5-jdke already install the sun-java5-jdk and I have extract the HDE project tarball to my desktop by entering the command:
$ tar -x -f android-hde-ambrosia-2.1_r1.tar.gz -C ~/Desktop

Now for the next step, I want to build the OS framework and install the ARM 3D graphics SDK.
So I enter:

$ cd ~/Desktop/android-hde-ambrosia-2.1_r1.tar
$ make TARGET_PRODUCT=beagleboard TARGET_VARIANT=tests

And I obtain this:

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1-update1
TARGET_PRODUCT=beagleboard
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ECLAIR
============================================
/bin/bash: prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc: No such file or directory
/bin/bash: line 0: cd: sdk/layoutopt/app/src/resources: No such file or directory
build/core/Makefile:17: warning: overriding commands for target `out/target/product/beagleboard/system/usr/keylayout/qwerty.kl’
sdk/emulator/keymaps/Android.mk:13: warning: ignoring old commands for target `out/target/product/beagleboard/system/usr/keylayout/qwerty.kl’
host C: acp <= build/tools/acp/acp.c
In file included from /usr/include/features.h:378,
from /usr/include/stdlib.h:25,
from build/tools/acp/acp.c:11:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1

I am a beginner .
please, could someone help me to solve this?

Thanks!!

Aubino

5 12 2011
Klas

Thank you!

8 02 2012
shubham

hi,

thanks for your support,

but I stl getting following error log.
pls let me know where I am doing mistake or missing something.

“Fake: out/target/product/blaze/obj/FAKE/validate_framework_keymaps_intermediates/validate_framework_keymaps-timestamp
rm -f out/target/product/blaze/obj/STATIC_LIBRARIES/libedify_intermediates/parser.hpp
Generated: (out/target/product/blaze/android-info.txt)
Notice file: external/bzip2/NOTICE — out/host/linux-x86/obj/NOTICE_FILES/src//lib/libbz.a.txt
host Java: guavalib (out/host/common/obj/JAVA_LIBRARIES/guavalib_intermediates/classes)
host C: acp <= build/tools/acp/acp.c
cc: error: -include: No such file or directory
make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1
make: *** Waiting for unfinished jobs….
host C++: libhost <= build/libs/host/pseudolocalize.cpp
g++: error: -include: No such file or directory
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o] Error 1
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details."

thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

Join 37 other followers