From: Aaro K. <aar...@ik...> - 2014-04-25 22:33:51
|
With GCC 4.9.0 oprofile 0.9.9 build fails on non-PPC platfroms because the "test-for-synth" configure check result is incorrect: There is a NULL pointer dereference in the test program, so the compiler seems to optimize the rest of the code away, and the test will always succeed regardless whether bfd_elf64_powerpc*_vec are present or not. Fix by allocating the referred struct statically. While at it, also include stdio.h to avoid a compiler warning. Signed-off-by: Aaro Koskinen <aar...@ik...> --- m4/binutils.m4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/m4/binutils.m4 b/m4/binutils.m4 index 25fb15a..449ce64 100644 --- a/m4/binutils.m4 +++ b/m4/binutils.m4 @@ -27,8 +27,10 @@ if test "$OS" = "Linux"; then AC_MSG_CHECKING([whether bfd_get_synthetic_symtab() exists in BFD library]) rm -f test-for-synth AC_LANG_CONFTEST( - [AC_LANG_PROGRAM([[#include <bfd.h>]], - [[asymbol * synthsyms; bfd * ibfd = 0; + [AC_LANG_PROGRAM([[#include <bfd.h>] + [#include <stdio.h>] + [static bfd _ibfd;]], + [[asymbol * synthsyms; bfd * ibfd = &_ibfd; long synth_count = bfd_get_synthetic_symtab(ibfd, 0, 0, 0, 0, &synthsyms); extern const bfd_target bfd_elf64_powerpc_vec; extern const bfd_target bfd_elf64_powerpcle_vec; -- 1.9.0 |