Gingerbread build on Arch Linux x86_64 with gcc 4.6.0 / small patch

Hello everyone,

Building from the sources with the following steps does not work
directly with gcc 4.6.0

1.  repo init -u git://android.git.kernel.org/platform/manifest.git -b
gingerbread && repo sync
2. .build/envsetup.sh
3. lunch (choice 1)
4. make

You get the following error:
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]

gcc seems to be less permissive than before (http://gcc.gnu.org/
gcc-4.6/changes.html, need some further investigations)

The patch below seems to fix the problem (builds correctly):

 % repo diff frameworks/base/libs/utils/Android.mk

project frameworks/base/
diff --git a/libs/utils/Android.mk b/libs/utils/Android.mk
index eb75ed8..c333143 100644
--- a/libs/utils/Android.mk
+++ b/libs/utils/Android.mk
@@ -57,7 +57,7 @@ LOCAL_SRC_FILES:= $(commonSources)

 LOCAL_MODULE:= libutils

-LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
+LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
 LOCAL_C_INCLUDES += external/zlib

 ifeq ($(HOST_OS),windows)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值