diff --git a/ChangeLog b/ChangeLog index e9ff75251..c5068ea0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +Thu Oct 9 12:17:45 EEST 2008 (edwin) +------------------------------------- + * ChangeLog, clamav-config.h.in, configure, configure.in, + freshclam/manager.c, libclamav/readdb.c, libclamav/version.c, + shared/misc.c, unit_tests/check_clamav.c: when --disable-gcc-vcheck + is set, set CFLAGS to O0 and append -broken-compiler to the VERSION + (bb #684) introduce VERSION_SUFFIX for easier handling, and convert + -exp to use it + +Thu Oct 9 12:07:03 EEST 2008 (edwin) +------------------------------------- + + * clamav-config.h.in, configure, configure.in, freshclam/manager.c, + libclamav/readdb.c, libclamav/version.c, shared/misc.c, + unit_tests/check_clamav.c: when --disable-gcc-vcheck is set, set + CFLAGS to O0 and append -broken-compiler to the VERSION (bb #684) + introduce VERSION_SUFFIX for easier handling, and convert -exp to + use it + Wed Oct 8 11:16:34 CEST 2008 (acab) ------------------------------------ * doc/signatures.*: make a note about using regexes in [zr]md's diff --git a/clamav-config.h.in b/clamav-config.h.in index 2b9bde76c..101e584e6 100644 --- a/clamav-config.h.in +++ b/clamav-config.h.in @@ -383,6 +383,9 @@ /* Version number of package */ #undef VERSION +/* Version suffix for package */ +#undef VERSION_SUFFIX + /* tcpwrappers support */ #undef WITH_TCPWRAP diff --git a/configure b/configure index afeec7cc5..0d1520542 100755 --- a/configure +++ b/configure @@ -12178,7 +12178,7 @@ fi msg_gcc_check="use --disable-gcc-vcheck to disable this check. Before reporting any bugs check with a supported version of gcc" - +VERSION_SUFFIX= if test "$gcc_check" = "yes"; then if test "x$ac_compiler_gnu" = "xyes"; then { echo "$as_me:$LINENO: checking for a supported version of gcc" >&5 @@ -12198,9 +12198,13 @@ echo "${ECHO_T}ok (${gcc_version})" >&6; } ;; esac fi +else + CFLAGS="$CFLAGS -O0" + VERSION_SUFFIX="$VERSION_SUFFIX-broken-compiler" fi + { echo "$as_me:$LINENO: checking for gcc bug PR27603" >&5 echo $ECHO_N "checking for gcc bug PR27603... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then @@ -13249,6 +13253,7 @@ cat >>confdefs.h <<\_ACEOF #define CL_EXPERIMENTAL 1 _ACEOF + VERSION_SUFFIX="$VERSION_SUFFIX-exp" fi { echo "$as_me:$LINENO: checking for bind in -lsocket" >&5 @@ -20986,6 +20991,12 @@ echo "${ECHO_T}disabled" >&6; } fi + +cat >>confdefs.h <<_ACEOF +#define VERSION_SUFFIX "$VERSION_SUFFIX" +_ACEOF + + ac_config_files="$ac_config_files libclamunrar/Makefile libclamunrar_iface/Makefile libclamav/Makefile libclamav/lzma/Makefile clamscan/Makefile database/Makefile docs/Makefile clamd/Makefile clamdscan/Makefile clamav-milter/Makefile freshclam/Makefile sigtool/Makefile clamconf/Makefile etc/Makefile test/Makefile unit_tests/Makefile Makefile clamav-config libclamav.pc docs/man/clamav-milter.8 docs/man/clamconf.1 docs/man/clamd.8 docs/man/clamd.conf.5 docs/man/clamdscan.1 docs/man/clamscan.1 docs/man/freshclam.1 docs/man/freshclam.conf.5 docs/man/sigtool.1" cat >confcache <<\_ACEOF @@ -23392,7 +23403,23 @@ if test "$no_create" != yes; then fi -if test "x$cross_compiling" != "xno" || test "x$gcc_check" = "xno" || test "x$zlib_check" = "xno" ; then +# Yep, downgrading the compiler avoids the bug too: +# 4.0.x, and 4.1.0 are the known buggy versions +# 3.4 doesn't have the bug +if test "x$gcc_check" != "xyes"; then + { echo "$as_me:$LINENO: WARNING: +****** Optimizations disabled to avoid compiler bugs +****** The resulting binaries will be slow! +****** It is recommended to either upgrade or downgrade your compiler +" >&5 +echo "$as_me: WARNING: +****** Optimizations disabled to avoid compiler bugs +****** The resulting binaries will be slow! +****** It is recommended to either upgrade or downgrade your compiler +" >&2;} +fi + +if test "x$cross_compiling" != "xno" || test "x$gcc_check" != "xyes" || test "x$zlib_check" = "xno" ; then { echo "$as_me:$LINENO: WARNING: ****** WARNING: ****** You are either cross compiling to a different host or diff --git a/configure.in b/configure.in index fa8655b09..5e40fde67 100644 --- a/configure.in +++ b/configure.in @@ -80,7 +80,7 @@ AC_ARG_ENABLE([gcc-vcheck], gcc_check=$enableval, gcc_check="yes") msg_gcc_check="use --disable-gcc-vcheck to disable this check. Before reporting any bugs check with a supported version of gcc" - +VERSION_SUFFIX= dnl Check for gcc-4.1.0 if test "$gcc_check" = "yes"; then if test "x$ac_compiler_gnu" = "xyes"; then @@ -96,8 +96,12 @@ if test "$gcc_check" = "yes"; then ;; esac fi +else + CFLAGS="$CFLAGS -O0" + VERSION_SUFFIX="$VERSION_SUFFIX-broken-compiler" fi + dnl Checks if compiler produces valid code, regardless of compiler dnl we do these checks here to avoid receiving endless bugreports about dnl breakages due to compiler bugs. @@ -308,6 +312,7 @@ enable_experimental=$enableval, enable_experimental="no") if test "$enable_experimental" = "yes"; then AC_DEFINE([CL_EXPERIMENTAL],1,[enable experimental code]) + VERSION_SUFFIX="$VERSION_SUFFIX-exp" fi AC_CHECK_LIB([socket], [bind], [LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"]) @@ -1493,6 +1498,8 @@ AC_MSG_RESULT([$have_signed_rightshift_extended]); AC_C_FDPASSING +AC_DEFINE_UNQUOTED([VERSION_SUFFIX],"$VERSION_SUFFIX",[Version suffix for package]) + AC_OUTPUT([ libclamunrar/Makefile libclamunrar_iface/Makefile @@ -1524,7 +1531,18 @@ docs/man/freshclam.conf.5 docs/man/sigtool.1 ]) -if test "x$cross_compiling" != "xno" || test "x$gcc_check" = "xno" || test "x$zlib_check" = "xno" ; then +# Yep, downgrading the compiler avoids the bug too: +# 4.0.x, and 4.1.0 are the known buggy versions +# 3.4 doesn't have the bug +if test "x$gcc_check" != "xyes"; then + AC_MSG_WARN([ +****** Optimizations disabled to avoid compiler bugs +****** The resulting binaries will be slow! +****** It is recommended to either upgrade or downgrade your compiler +]) +fi + +if test "x$cross_compiling" != "xno" || test "x$gcc_check" != "xyes" || test "x$zlib_check" = "xno" ; then AC_MSG_WARN([ ****** WARNING: ****** You are either cross compiling to a different host or diff --git a/freshclam/manager.c b/freshclam/manager.c index 4659e1a38..c4b639604 100644 --- a/freshclam/manager.c +++ b/freshclam/manager.c @@ -1430,7 +1430,7 @@ int downloadmanager(const struct cfgstruct *copt, const struct optstruct *opt, c logg("*Software version from DNS: %s\n", newver); strncpy(vstr, get_version(), 32); vstr[31] = 0; - if((pt = strstr(vstr, "-exp"))) + if((pt = strstr(vstr, "-exp")) || (pt = strstr(vstr,"-broken"))) *pt = 0; if(vwarning && !strstr(vstr, "devel") && !strstr(vstr, "rc")) { diff --git a/libclamav/readdb.c b/libclamav/readdb.c index 7e73ea34d..da026d539 100644 --- a/libclamav/readdb.c +++ b/libclamav/readdb.c @@ -329,11 +329,7 @@ int cli_initengine(struct cl_engine **engine, unsigned int options) if(!*engine) { -#ifdef CL_EXPERIMENTAL - cli_dbgmsg("Initializing the engine (%s-exp)\n", cl_retver()); -#else cli_dbgmsg("Initializing the engine (%s)\n", cl_retver()); -#endif *engine = (struct cl_engine *) cli_calloc(1, sizeof(struct cl_engine)); if(!*engine) { diff --git a/libclamav/version.c b/libclamav/version.c index 2b9e488bb..dd28fadd7 100644 --- a/libclamav/version.c +++ b/libclamav/version.c @@ -11,5 +11,5 @@ /* libclamav's version is always the SVN revision (if available) */ const char *cl_retver(void) { - return REPO_VERSION; + return REPO_VERSION""VERSION_SUFFIX; } diff --git a/shared/misc.c b/shared/misc.c index b459c9aa4..419d278ac 100644 --- a/shared/misc.c +++ b/shared/misc.c @@ -54,19 +54,13 @@ #define REPO_VERSION "exported" #endif -#ifdef CL_EXPERIMENTAL -#define EXP_VER "-exp" -#else -#define EXP_VER -#endif - const char *get_version(void) { if(!strncmp("devel-",VERSION,6) && strcmp("exported",REPO_VERSION)) { - return REPO_VERSION""EXP_VER; + return REPO_VERSION""VERSION_SUFFIX; } /* it is a release, or we have nothing better */ - return VERSION""EXP_VER; + return VERSION""VERSION_SUFFIX; } /* CL_NOLIBCLAMAV means to omit functions that depends on libclamav */ #ifndef CL_NOLIBCLAMAV diff --git a/unit_tests/check_clamav.c b/unit_tests/check_clamav.c index 7bb8ae08d..6223e7b0d 100644 --- a/unit_tests/check_clamav.c +++ b/unit_tests/check_clamav.c @@ -71,7 +71,7 @@ END_TEST START_TEST (test_cl_retver) { const char *ver = cl_retver(); - fail_unless(!strcmp(REPO_VERSION, ver),"cl_retver"); + fail_unless(!strcmp(REPO_VERSION""VERSION_SUFFIX, ver),"cl_retver"); fail_unless(strcspn(ver,"012345789") < strlen(ver), "cl_retver must have a number"); }