Mailing List Archive

[PATCH 1/1] Only bring in <execinfo.h> if it's available
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@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
--
1.7.10.4

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

http://www.clamav.net/contact.html#ml
Re: [PATCH 1/1] Only bring in <execinfo.h> if it's available [ In reply to ]
On Mon, Nov 3, 2014 at 1:55 PM, Bernd Kuhls <bernd.kuhls@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@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
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

http://www.clamav.net/contact.html#ml
Re: [PATCH 1/1] Only bring in <execinfo.h> if it's available [ In reply to ]
Hi,

Shawn Webb <swebb@sourcefire.com> wrote in news:CAO2uJaf5EB5O7=5P_
6TAp6bs_LOB87t_-XpFfZGuxJy4tE084g@mail.gmail.com:

> Thanks for this patch. Can you please file a bug in our bug tracker at
> https://bugzilla.clamav.net/?

https://bugzilla.clamav.net/show_bug.cgi?id=11170
Could you please make this bug report public so the buildroot maintainers can
check it while reviewing my patch?

> Also, instead of modifying configure (which
> is generated using GNU autotools), can you modify configure.ac instead?

I oriented myself at this commit

https://github.com/vrtadmin/clamav-
devel/commit/0f9ce68529b9ebf4011cb9a19ac1210eb3f7d317

where I was surprised to see a generated ./configure being part of the git
repo.

> 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.

This won´t happen because I patched m4/reorganization/headers.m4 ;)

Regards, Bernd
Re: [PATCH 1/1] Only bring in <execinfo.h> if it's available [ In reply to ]
On Mon, Nov 3, 2014 at 2:09 PM, Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> Hi,
>
> Shawn Webb <swebb@sourcefire.com> wrote in news:CAO2uJaf5EB5O7=5P_
> 6TAp6bs_LOB87t_-XpFfZGuxJy4tE084g@mail.gmail.com:
>
> > Thanks for this patch. Can you please file a bug in our bug tracker at
> > https://bugzilla.clamav.net/?
>
> https://bugzilla.clamav.net/show_bug.cgi?id=11170
> Could you please make this bug report public so the buildroot maintainers
> can
> check it while reviewing my patch?
>
> > Also, instead of modifying configure (which
> > is generated using GNU autotools), can you modify configure.ac instead?
>
> I oriented myself at this commit
>
> https://github.com/vrtadmin/clamav-
> devel/commit/0f9ce68529b9ebf4011cb9a19ac1210eb3f7d317
>
> where I was surprised to see a generated ./configure being part of the git
> repo.
>
> > 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.
>
> This won´t happen because I patched m4/reorganization/headers.m4 ;)


Gotcha. Sorry, I had missed that part of the patch. Thanks!
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

http://www.clamav.net/contact.html#ml