Friday, June 15, 2012

[Solved]error: "_FORTIFY_SOURCE" redefined [-Werror]


<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
 <built-in>:0:0: note: this is the location of the previous definition
 cc1plus: all warnings being treated as errors
make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1
此处编译错误是由于ubuntu 11.10采用了GCC4.6.1导致的。
解决方法:
修改源码目录下/build/core/combo/HOST_linux-x86.mk文件:
将以下语句
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
修改为
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

3 comments: