Dear Jim, After changing TARGET_TOOLS_PREFIX in build/core/combo/TARGET_linux-arm.mk to android-toolchain-eabi-4.5-2011.05, then source build/envsetup.sh. go to dalvik/vm dir by: cd dalvik/vm compile dalvik in this dir: mm -B we will find many compiling error like: "break strict-aliasing rules", "used uninitialized in this function" and so on. all those actually are warnings which become errors due to -Werror option. A patch like the below can make compiling pass, but we feel strange why old toolchain has no this issue. Index: Dvm.mk =================================================================== --- Dvm.mk (revision 4149) +++ Dvm.mk (working copy) @@ -26,7 +26,8 @@ # LOCAL_CFLAGS += -fstrict-aliasing -Wstrict-aliasing=2 -fno-align-jumps #LOCAL_CFLAGS += -DUSE_INDIRECT_REF -LOCAL_CFLAGS += -Wall -Wextra -Wno-unused-parameter +#LOCAL_CFLAGS += -Wall -Wextra -Wno-unused-parameter +LOCAL_CFLAGS += -Wextra -Wno-unused-parameter LOCAL_CFLAGS += -DARCH_VARIANT="$(dvm_arch_variant)"
# @@ -264,7 +265,7 @@ ifeq ($(dvm_arch),arm) #dvm_arch_variant := armv7-a #LOCAL_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfp - LOCAL_CFLAGS += -Werror +# LOCAL_CFLAGS += -Werror MTERP_ARCH_KNOWN := true # Select architecture-specific sources (armv4t, armv5te etc.) LOCAL_SRC_FILES += \
Any configuration error from us? Thanks Barry
On 06/10/2011 09:17 AM, Barry Song wrote:
we will find many compiling error like: "break strict-aliasing rules", "used uninitialized in this function" and so on. all those actually are warnings which become errors due to -Werror option. A patch like the below can make compiling pass, but we feel strange why old toolchain has no this issue.
Hi Barry,
I also encountered that the Android code violates the C aliasing rules. As GCC evolves it gets more strict about those errors. The fact that a GCC 4.4 based toolchain didn't complain doesn't necessarily mean that there were no bugs. :) As a workaround you may add -fno-strict-aliasing to the CFLAGS (and remove -fstrict-aliasing). There is a branch called 'dev_toolchain_preview_1105' that employs these changes. On my system it builds with the gcc-linaro-4.5-2011.05-0. However, there are at least two knows issues: 1) The boot animation runs forever. This seems to be related to prelinking and libgui.so. A workaround is to disable prelinking for that module as posted at: http://lists.linaro.org/pipermail/linaro-dev/2011-June/004993.html 2) The libaudioflinger.so segfaults. A workaround seems to build this module with -O1. Both issues are under investigation by the Linaro Android and Toolchain teams.
Regards Ken