4
votes

I am facing a problem when trying to build android 2.3 on ubuntu 11.10

First error -

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....

I solved this by modifying,

frameworks/base/libs/utils/Android.mk LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive

But after doing the above modification, new error came up,

host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so)

host C++: libutils <= frameworks/base/libs/utils/Asset.cpp

host C++: libutils <= frameworks/base/libs/utils/AssetDir.cpp

host C++: libutils <= frameworks/base/libs/utils/AssetManager.cpp

g++: error: unrecognized option ‘--fpermissive’

make: * [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/Asset.o] Error 1 make: * Waiting for unfinished jobs....

g++: error: unrecognized option ‘--fpermissive’ g++: error: unrecognized option ‘--fpermissive’

make: * [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetDir.o] Error 1

make: * [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetManager.o]

Build Configuration: Ubuntu 11.10 Tried with both gcc versions, 4.4 and 4.6 but nothing is working out, please help me out struggling from the past one day

Command options used to built,

$. build/envsetup.sh

$lunch 1

$make -j4

GCC - version

gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

---------------------------------------------------------------- EDIT 2-

I think its a problem with the gcc version, not its moving at a better pace, but now i am getting this error- cmd - make CC=gcc-4.4 CXX=g++-4.4

error - host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so) /usr/bin/ld: cannot find -lz collect2: ld returned 1 exit status make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1

1
could you please precise how did you build?quux
modifed the question, kindly look into pleaseVamsi

1 Answers

2
votes

I have tried this solution and it solved the problem you mention: How to fix problem of incompatibility between GCC 4.6 and Android 2.3 (Gingerbread).

However, I cannot link after all is compiled. I am compiling 2.2 with gcc-4.6 on linux mint.

Anyway it should help you.