--- Makefile.am +++ Makefile.am @@ -25,6 +25,7 @@ SUBDIRS = \ +AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 # The module will not build under distcheck --- agents/jvmpi/jvmpi_oprofile.cpp +++ agents/jvmpi/jvmpi_oprofile.cpp @@ -16,6 +16,7 @@ #include #include #include +#include extern "C" { #include --- configure.in +++ configure.in @@ -140,7 +140,7 @@ AX_CHECK_DOCBOOK dnl finally restore the original libs setting LIBS="$ORIG_SAVE_LIBS" LIBERTY_LIBS="-liberty $DL_LIB $INTL_LIB" -BFD_LIBS="-lbfd -liberty $DL_LIB $INTL_LIB" +BFD_LIBS="-lbfd -liberty $Z_LIB $DL_LIB $INTL_LIB" POPT_LIBS="-lpopt" AC_SUBST(LIBERTY_LIBS) AC_SUBST(BFD_LIBS) --- libutil++/file_manip.cpp +++ libutil++/file_manip.cpp @@ -44,7 +44,7 @@ bool copy_file(string const & source, st if (!in) return false; - int fd = open(destination.c_str(), O_RDWR|O_CREAT); + int fd = open(destination.c_str(), O_RDWR|O_CREAT, 0600); if (fd < 0) return false; close(fd); --- m4/binutils.m4 +++ m4/binutils.m4 @@ -8,11 +8,12 @@ AC_CHECK_FUNCS(xcalloc) AC_CHECK_FUNCS(xmemdup) AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl"; DL_LIB="-ldl", DL_LIB="") AC_CHECK_LIB(intl, main, LIBS="$LIBS -lintl"; INTL_LIB="-lintl", INTL_LIB="") +AC_CHECK_LIB(z, zlibVersion, LIBS="$LIBS -lz"; Z_LIB=-lz, Z_LIB=) AC_CHECK_LIB(bfd, bfd_openr,, AC_MSG_ERROR([bfd library not found])) AC_LANG_PUSH(C) SAVE_LIBS=$LIBS -LIBS=" -lbfd -liberty " +LIBS=" -lbfd -liberty -lz" # Determine if bfd_get_synthetic_symtab macro is available OS="`uname`" if test "$OS" = "Linux"; then --- m4/builtinexpect.m4 +++ m4/builtinexpect.m4 @@ -5,7 +5,7 @@ AC_MSG_CHECKING([whether __builtin_expec SAVE_CFLAGS=$CFLAGS CFLAGS="-Werror $CFLAGS" AC_TRY_LINK(,[ -int i; +int i = 0; if (__builtin_expect(i, 0)) { } ], AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK", --- m4/cellspubfdsupport.m4 +++ m4/cellspubfdsupport.m4 @@ -12,7 +12,7 @@ AC_DEFUN([AX_CELL_SPU], AC_LANG_PUSH(C) SAVE_LIBS=$LIBS -LIBS=" -lbfd -liberty " +LIBS=" -lbfd -liberty -lz" AC_CHECK_LIB(bfd, bfd_openr_iovec, [bfd_openr_iovec_exists="yes"], --- m4/mallocattribute.m4 +++ m4/mallocattribute.m4 @@ -4,9 +4,9 @@ AC_DEFUN([AX_MALLOC_ATTRIBUTE], AC_MSG_CHECKING([whether malloc attribute is understood]) SAVE_CFLAGS=$CFLAGS CFLAGS="-Werror $CFLAGS" -AC_TRY_COMPILE(,[ +AC_TRY_COMPILE([ void monkey() __attribute__((malloc)); -],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no])) +],,AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no])) CFLAGS=$SAVE_CFLAGS ] ) --- utils/opcontrol +++ utils/opcontrol @@ -508,10 +508,19 @@ get_image_range() exit 1 fi + kernel_file=$FILE_IMAGE + case $(file -L $kernel_file) in + *"gzip compressed"*) + kernel_file=$(mktemp /tmp/opcXXXXXX) || exit 1 + trap "rm -f $kernel_file" EXIT + gzip -cd $FILE_IMAGE > $kernel_file + ;; + esac + # start at the start of .text, and end at _etext - range_info=`objdump -h $FILE_IMAGE 2>/dev/null | grep " .text "` + range_info=`objdump -h $kernel_file 2>/dev/null | grep " .text "` tmp1=`echo $range_info | awk '{print $4}'` - tmp2=`objdump -t $FILE_IMAGE 2>/dev/null | grep "_etext$" | awk '{ print $1 }'` + tmp2=`objdump -t $kernel_file 2>/dev/null | grep "_etext$" | awk '{ print $1 }'` if test -z "$tmp1" -o -z "$tmp2"; then echo "The specified file $FILE_IMAGE does not seem to be valid" >&2