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