在Ubuntu 11.10 编译android的改动
2012-02-21 11:16
176 查看
1.host Prebuilt: monkeyrunner (out/host/linux-x86/obj/EXECUTABLES/monkeyrunner_intermediates/monkeyrunner)
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
<命令行>:0:0: 错误: “_FORTIFY_SOURCE”重定义 [-Werror]
<built-in>:0:0: 附注: 这是先前定义的位置
cc1plus:所有的警告都被当作是错误
note:
build/core/combo/HOST_linux-x86.mk line 61:
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
2.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)
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
<命令行>:0:0: 错误: “_FORTIFY_SOURCE”重定义 [-Werror]
<built-in>:0:0: 附注: 这是先前定义的位置
cc1plus:所有的警告都被当作是错误
note:
build/core/combo/HOST_linux-x86.mk line 61:
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
2.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)
相关文章推荐
- 【转】ubuntu11.10 64bit 环境android编译错误
- ubuntu 11.10(32位)下android2.2 源码编译
- ubuntu 11.10下载和编译Android源码
- ubuntu 11.10(32位)下android2.2 源码编译
- ubuntu 11.10 编译android 4.0问题
- ubuntu 11.10 64bit下编译android4.0.3
- 在32位ubuntu-11.10上搭建android 4.x编译环境
- ubuntu11.10 编译android4.1.1源码
- ubuntu11.10 64bit 系统编译android 源码 错误
- Ubuntu 11.10编译Android 错误
- ubuntu 11.10 编译 android 源码问题
- Ubuntu 11.10 Android编译环境安装
- ubuntu 11.10(32位系统)下编译android源码
- ubuntu 11.10上 Amlogic android编译环境搭建
- ubuntu 11.10 编译android aosp 由于gcc版本过高引起的错误,安装 gcc 4.4
- ubuntu 11.10(32位系统)下编译android源码
- Ubuntu 11.10编译Android 错误
- 在 VMWare 7.1.2 + Ubuntu 11.10(32位)中,编译 Android 2.3.7 (gingerbread) 源码 (Anroid Open Source Project)
- ubuntu11.10 64bit 编译android 4.0
- 在32位ubuntu-11.10上搭建android 4.x编译环境