[Clamav-devel] [PATCH 1/1] Only bring in <execinfo.h> if it's available

Shawn Webb swebb at sourcefire.com
Mon Nov 3 13:58:49 EST 2014


On Mon, Nov 3, 2014 at 1:55 PM, Bernd Kuhls <bernd.kuhls at t-online.de> wrote:

> Fixes uclibc build as uclibc does not include backtrace functionality.
>
> Compile error was found by an autobuild server, part of the buildroot
> project:
>
> http://autobuild.buildroot.net/results/2a6/2a68aa790b1e8d6fd4dc41f2ab724dfc03b3806d//build-end.log
>
> Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
> ---
>  clamav-config.h.in           |    3 +++
>  configure                    |    2 +-
>  libclamav/mbox.c             |    2 ++
>  m4/reorganization/headers.m4 |    2 +-
>  4 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/clamav-config.h.in b/clamav-config.h.in
> index bc13504..1db5d2e 100644
> --- a/clamav-config.h.in
> +++ b/clamav-config.h.in
> @@ -182,6 +182,9 @@
>  /* Define to 1 if the system has the type `error_t'. */
>  #undef HAVE_ERROR_T
>
> +/* Define to 1 if you have the <execinfo.h> header file. */
> +#undef HAVE_EXECINFO_H
> +
>  /* have working file descriptor passing support */
>  #undef HAVE_FD_PASSING
>
> diff --git a/configure b/configure
> index b8cd3a9..0f7158e 100755
> --- a/configure
> +++ b/configure
> @@ -14437,7 +14437,7 @@ esac
>
>
>
> -for ac_header in stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h
> sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h
> sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h
> sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h sys/queue.h
> sys/cdefs.h
> +for ac_header in stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h
> sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h
> sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h
> sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h sys/queue.h
> sys/cdefs.h execinfo.h
>  do :
>    as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
>  ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header"
> "$ac_includes_default"
> diff --git a/libclamav/mbox.c b/libclamav/mbox.c
> index b0233ae..5d4e5cb 100644
> --- a/libclamav/mbox.c
> +++ b/libclamav/mbox.c
> @@ -84,7 +84,9 @@
>  #endif
>
>  #ifdef HAVE_BACKTRACE
> +#ifdef HAVE_EXECINFO_H
>  #include <execinfo.h>
> +#endif
>  #include <syslog.h>
>
>  static void    sigsegv(int sig);
> diff --git a/m4/reorganization/headers.m4 b/m4/reorganization/headers.m4
> index 9b71f33..23016bc 100644
> --- a/m4/reorganization/headers.m4
> +++ b/m4/reorganization/headers.m4
> @@ -1,4 +1,4 @@
> -AC_CHECK_HEADERS([stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h
> sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h
> sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h
> sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h sys/queue.h
> sys/cdefs.h])
> +AC_CHECK_HEADERS([stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h
> sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h
> sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h
> sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h sys/queue.h
> sys/cdefs.h execinfo.h])
>  AC_CHECK_HEADER([syslog.h],AC_DEFINE([USE_SYSLOG],1,[use syslog]),)
>
>  have_pthreads=no


Thanks for this patch. Can you please file a bug in our bug tracker at
https://bugzilla.clamav.net/? Also, instead of modifying configure (which
is generated using GNU autotools), can you modify configure.ac instead?
That way your changes will stick whenever we run autoreconf. The way your
patch stands right now is that your changes to the configure script would
get wiped away whenever anyone runs autoreconf.

Thanks,

Shawn


More information about the clamav-devel mailing list