Created attachment 943 [details] compile log Tree/Branch: Poky/Master Poky Commit: 5a9b80bbb173408de779d74936a2f7050d6a6c19 1.Use "--enable-targets=all" option in binutils-native due to compile error. (The commit 5a9b80bbb173408de779d74936a2f7050d6a6c19); if the option is not used, all thing is ok. 2.The log shows that -Werror make all warning be treated as errors. 3.And "memset" in oasys.c:911 due to the warning Log:(see attachment for detail) bitbake binutils-native ... | In file included from /usr/include/string.h:642:0, | from /home/jiahongxu/yocto/build-20121119/tmp/work/x86_64-linux/binutils-native-2.22-r17/binutils-2.22/bfd/sysdep.h:44, | from /home/jiahongxu/yocto/build-20121119/tmp/work/x86_64-linux/binutils-native-2.22-r17/binutils-2.22/bfd/oasys.c:25: | In function 'memset', | inlined from 'oasys_write_object_contents' at /home/jiahongxu/yocto/build-20121119/tmp/work/x86_64-linux/binutils-native-2.22-r17/binutils-2.22/bfd/oasys.c:911:3: | /usr/include/x86_64-linux-gnu/bits/string3.h:82:30: error: call to '__warn_memset_zero_len' declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters [-Werror] | cc1: all warnings being treated as errors | make[4]: *** [oasys.lo] Error 1 ...
*Analysis When using "--enable-targets=all", oasys.c included in "$all_backends" is compiled, and with option "-Werror", warning in oasys.c is treated as error. *Resolution 1. Modify oasys.c:911 to remove warning: -(void) memset (r.module_name + length, ' ', sizeof (r.module_name) - length); +if (sizeof (r.module_name) > length) + (void) memset (r.module_name + length, ' ', sizeof (r.module_name) - length); Or 2. Modify binutils_2.22.bb to ignore warning Append option "--disable-werror" to EXTRA_OECONF_class-native in binutils_2.22.bb could ignore warning -EXTRA_OECONF_class-native = "--enable-targets=all --enable-64-bit-bfd --enable-install-libbfd" +EXTRA_OECONF_class-native = "--enable-targets=all --enable-64-bit-bfd --enable-install-libbfd --disable-werror"
Binutils has been updated to 2.23, and this bug has already fixed since there.