[Python-checkins] r87629 - in python/branches/py3k-cdecimal/Lib/test/mpdecimal: config.h.in configure configure.in

stefan.krah python-checkins at python.org
Sun Jan 2 17:33:08 CET 2011


Author: stefan.krah
Date: Sun Jan 2 17:33:08 2011
New Revision: 87629
Log:
Automatic workarounds for the following toolchain bugs:
 1) gcc-4.5 miscompiles inline asm:
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
 http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
 2) gcc-4.6/glibc: _FORTIFY_SOURCE wrappers for memmove and bcopy
 are incorrect:
 http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
Modified:
 python/branches/py3k-cdecimal/Lib/test/mpdecimal/config.h.in
 python/branches/py3k-cdecimal/Lib/test/mpdecimal/configure
 python/branches/py3k-cdecimal/Lib/test/mpdecimal/configure.in
Modified: python/branches/py3k-cdecimal/Lib/test/mpdecimal/config.h.in
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/mpdecimal/config.h.in	(original)
+++ python/branches/py3k-cdecimal/Lib/test/mpdecimal/config.h.in	Sun Jan 2 17:33:08 2011
@@ -1,11 +1,18 @@
 /* config.h.in. Generated from configure.in by autoheader. */
 
-/* Define if we can use x64 gcc inline assembler */
+/* Define if the gcc version is 4.5.x. */
+#undef HAVE_GCC_4_5
+
+/* Define if we can use x64 gcc inline assembler. */
 #undef HAVE_GCC_ASM_FOR_X64
 
-/* Define if we can use x87 gcc inline assembler */
+/* Define if we can use x87 gcc inline assembler. */
 #undef HAVE_GCC_ASM_FOR_X87
 
+/* Define if glibc has incorrect _FORTIFY_SOURCE wrappers for memmove and
+ bcopy. */
+#undef HAVE_GLIBC_MEMMOVE_BUG
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
@@ -30,7 +37,7 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
-/* Define if your compiler provides __uint128_t */
+/* Define if your compiler provides __uint128_t. */
 #undef HAVE_UINT128_T
 
 /* Define to 1 if you have the <unistd.h> header file. */
Modified: python/branches/py3k-cdecimal/Lib/test/mpdecimal/configure
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/mpdecimal/configure	(original)
+++ python/branches/py3k-cdecimal/Lib/test/mpdecimal/configure	Sun Jan 2 17:33:08 2011
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for mpdecimal 2.0.
+# Generated by GNU Autoconf 2.67 for mpdecimal @RELEASE_VERSION at .
 #
 # Report bugs to <mpdecimal-bugs at bytereef.org>.
 #
@@ -551,11 +551,11 @@
 
 # Identity of this package.
 PACKAGE_NAME='mpdecimal'
-PACKAGE_TARNAME='mpdecimal-2.0.tar.gz'
-PACKAGE_VERSION='2.0'
-PACKAGE_STRING='mpdecimal 2.0'
+PACKAGE_TARNAME='mpdecimal'
+PACKAGE_VERSION='@RELEASE_VERSION@'
+PACKAGE_STRING='mpdecimal @RELEASE_VERSION@'
 PACKAGE_BUGREPORT='mpdecimal-bugs at bytereef.org'
-PACKAGE_URL='http://www.bytereef.org/libmpdec.html'
+PACKAGE_URL='http://www.bytereef.org/mpdecimal/index.html'
 
 # Factoring default headers for most tests.
 ac_includes_default="\
@@ -1216,7 +1216,7 @@
 # Omit some internal or obsolete options to make the list less imposing.
 # This message is too long to be a string in the A/UX 3.1 sh.
 cat <<_ACEOF
-\`configure' configures mpdecimal 2.0 to adapt to many kinds of systems.
+\`configure' configures mpdecimal @RELEASE_VERSION@ to adapt to many kinds of systems.
 
 Usage: 0ドル [OPTION]... [VAR=VALUE]...
 
@@ -1264,8 +1264,7 @@
 --infodir=DIR info documentation [DATAROOTDIR/info]
 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
 --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root
- [DATAROOTDIR/doc/mpdecimal-2.0.tar.gz]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/mpdecimal]
 --htmldir=DIR html documentation [DOCDIR]
 --dvidir=DIR dvi documentation [DOCDIR]
 --pdfdir=DIR pdf documentation [DOCDIR]
@@ -1278,13 +1277,13 @@
 
 if test -n "$ac_init_help"; then
 case $ac_init_help in
- short | recursive ) echo "Configuration of mpdecimal 2.0:";;
+ short | recursive ) echo "Configuration of mpdecimal @RELEASE_VERSION@:";;
 esac
 cat <<\_ACEOF
 
 Some influential environment variables:
 MACHINE force configuration: x64, uint128, ansi64, ppro, ansi32,
- ansi-legacy, universal
+ ansi-legacy
 CC C compiler command
 CFLAGS C compiler flags
 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
@@ -1298,7 +1297,7 @@
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <mpdecimal-bugs at bytereef.org>.
-mpdecimal home page: <http://www.bytereef.org/libmpdec.html>.
+mpdecimal home page: <http://www.bytereef.org/mpdecimal/index.html>.
 _ACEOF
 ac_status=$?
 fi
@@ -1361,7 +1360,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
 cat <<\_ACEOF
-mpdecimal configure 2.0
+mpdecimal configure @RELEASE_VERSION@
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2022,7 +2021,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mpdecimal $as_me 2.0, which was
+It was created by mpdecimal $as_me @RELEASE_VERSION@, which was
 generated by GNU Autoconf 2.67. Invocation command line was
 
 $ 0ドル $@
@@ -3877,11 +3876,57 @@
 
 
 
+# _FORTIFY_SOURCE wrappers for memmove and bcopy are incorrect:
+# http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc _FORTIFY_SOURCE/memmove bug" >&5
+$as_echo_n "checking for glibc _FORTIFY_SOURCE/memmove bug... " >&6; }
+saved_cflags="$CFLAGS"
+CFLAGS="-O2 -D_FORTIFY_SOURCE=2"
+if test "$cross_compiling" = yes; then :
+ have_glibc_memmove_bug=undefined
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+void foo(void *p, void *q) { memmove(p, q, 19); }
+int main() {
+ char a[32] = "123456789000000000";
+ foo(&a[9], a);
+ if (strcmp(a, "123456789123456789000000000") != 0)
+ return 1;
+ foo(a, &a[9]);
+ if (strcmp(a, "123456789000000000") != 0)
+ return 1;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ have_glibc_memmove_bug=no
+else
+ have_glibc_memmove_bug=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+CFLAGS="$saved_cflags"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_glibc_memmove_bug" >&5
+$as_echo "$have_glibc_memmove_bug" >&6; }
+if test "$have_glibc_memmove_bug" = yes; then
+
+$as_echo "#define HAVE_GLIBC_MEMMOVE_BUG 1" >>confdefs.h
+
+fi
+
 # suncc is dectected as cc:
 case $ac_sys_system in
 sun*|Sun*)
 case $CC in
- cc|suncc)
+ cc)
 CC=suncc
 ;;
 esac
@@ -3896,34 +3941,36 @@
 MPD_CCOV=
 MPD_LDCOV=
 case $CC in
- gcc)
+ *gcc*)
 MPD_WARN="-Wall -W -Wno-unknown-pragmas"
 MPD_OPT="-O2 -fpic -s"
 MPD_PGEN="-fprofile-generate -fprofile-values"
 MPD_PUSE="-fprofile-use -freorder-blocks"
-	MPD_CCOV="-DTEST_COVERAGE -O0 -g -fno-inline -fprofile-arcs -ftest-coverage -fpic"
-	MPD_LDCOV="-fprofile-arcs"
+ MPD_CCOV="-DTEST_COVERAGE -O0 -g -fno-inline -fprofile-arcs -ftest-coverage -fpic"
+ MPD_LDCOV="-fprofile-arcs"
 ;;
- icc)
+ *icc*)
 AR=xiar
 MPD_WARN="-Wall -Wno-unknown-pragmas"
 MPD_OPT="-O2 -fpic -s"
 MPD_PGEN="-wd11505 -prof-gen"
 MPD_PUSE="-wd11505 -prof-use"
 ;;
- clang)
+ *clang*)
 MPD_WARN="-Wall -W -Wno-unknown-pragmas"
 MPD_OPT="-O2 -fpic"
 ;;
- suncc)
+ *suncc*)
 MPD_WARN=
 MPD_OPT="-O2 -fpic -s"
 ;;
 esac
 
 # Auto-detect machine dependent settings:
+M64=
 M32=
 if test -n "$MACHINE"; then
+ M64="-m64 "
 M32="-m32 "
 case "$MACHINE" in
 x64|uint128|ansi64|full_coverage|ppro|ansi32|ansi-legacy|universal)
@@ -3944,9 +3991,9 @@
 MACHINE="ansi32"
 if test $have_gcc_asm_for_x87 = yes; then
 case $CC in
- gcc|clang) # icc >= 11.0 works as well
+ *gcc*|*clang*) # icc >= 11.0 works as well
 case $ac_sys_system in
- darwin|Darwin)
+ darwin*|Darwin*)
 ;;
 *)
 MACHINE="ppro"
@@ -3963,27 +4010,53 @@
 CONFIGURE_LDFLAGS=
 case "$MACHINE" in
 x64)
- MPD_CONFIG="-DCONFIG_64 -DASM"
+ MPD_CONFIG=$M64"-DCONFIG_64 -DASM"
+ CONFIGURE_LDFLAGS=$M64
 MPD_PREC=19
 MPD_DPREC=38
 ;;
 uint128)
- MPD_CONFIG="-DCONFIG_64 -DANSI -DHAVE_UINT128_T"
+ MPD_CONFIG=$M64"-DCONFIG_64 -DANSI -DHAVE_UINT128_T"
+ CONFIGURE_LDFLAGS=$M64
 MPD_PREC=19
 MPD_DPREC=38
 ;;
 ansi64)
- MPD_CONFIG="-DCONFIG_64 -DANSI"
+ MPD_CONFIG=$M64"-DCONFIG_64 -DANSI"
+ CONFIGURE_LDFLAGS=$M64
 MPD_PREC=19
 MPD_DPREC=38
 ;;
 full_coverage)
 # Formerly ansi64c32, for testing only!
- MPD_CONFIG="-DCONFIG_32 -DANSI"
+ MPD_CONFIG=$M64"-DCONFIG_32 -DANSI"
+ CONFIGURE_LDFLAGS=$M64
 ;;
 ppro)
 MPD_CONFIG=$M32"-DCONFIG_32 -DPPRO -DASM"
 CONFIGURE_LDFLAGS=$M32
+ # gcc-4.5 miscompiles inline asm:
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
+ # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
+ case $CC in
+ *gcc*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc-4.5" >&5
+$as_echo_n "checking for gcc-4.5... " >&6; }
+ gcc_version=`$CC -dumpversion`
+ have_gcc_4_5=no
+ case $gcc_version in
+ 4.5*)
+ have_gcc_4_5=yes
+ MPD_CONFIG="$MPD_CONFIG -fno-ipa-pure-const"
+
+$as_echo "#define HAVE_GCC_4_5 1" >>confdefs.h
+
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_4_5" >&5
+$as_echo "$have_gcc_4_5" >&6; }
+ ;;
+ esac
 ;;
 ansi32)
 MPD_CONFIG=$M32"-DCONFIG_32 -DANSI"
@@ -4015,7 +4088,10 @@
 if test -z "$CFLAGS"; then
 CONFIGURE_CFLAGS="$MPD_WARN $MPD_CONFIG $MPD_OPT"
 else
- CONFIGURE_CFLAGS="$CFLAGS"
+ CONFIGURE_CFLAGS="$MPD_CONFIG -fpic $CFLAGS"
+fi
+if test "$have_glibc_memmove_bug" = yes; then
+ CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -U_FORTIFY_SOURCE"
 fi
 
 if test -n "$LDFLAGS"; then
@@ -4531,7 +4607,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mpdecimal $as_me 2.0, which was
+This file was extended by mpdecimal $as_me @RELEASE_VERSION@, which was
 generated by GNU Autoconf 2.67. Invocation command line was
 
 CONFIG_FILES = $CONFIG_FILES
@@ -4588,13 +4664,13 @@
 $config_headers
 
 Report bugs to <mpdecimal-bugs at bytereef.org>.
-mpdecimal home page: <http://www.bytereef.org/libmpdec.html>."
+mpdecimal home page: <http://www.bytereef.org/mpdecimal/index.html>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-mpdecimal config.status 2.0
+mpdecimal config.status @RELEASE_VERSION@
 configured by 0,ドル generated by GNU Autoconf 2.67,
 with options \\"\$ac_cs_config\\"
 
@@ -5297,5 +5373,25 @@
 fi
 
 
+GLIBC_MEMMOVE_BUG_WARN="
+***************************** WARNING *********************************
+
+Detected glibc _FORTIFY_SOURCE/memmove bug. See:
+
+ http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
 
+Enabling -U_FORTIFY_SOURCE workaround. If -D_FORTIFY_SOURCE is also
+present in the command line, make sure that the order of the two
+options is:
+
+ ... -D_FORTIFY_SOURCE=2 ... -U_FORTIFY_SOURCE ...
+
+A better solution is to upgrade glibc or to report the bug to your
+OS vendor.
+
+***************************** WARNING *********************************
+"
+if test "$have_glibc_memmove_bug" = yes; then
+ echo "$GLIBC_MEMMOVE_BUG_WARN"
+fi
 
Modified: python/branches/py3k-cdecimal/Lib/test/mpdecimal/configure.in
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/mpdecimal/configure.in	(original)
+++ python/branches/py3k-cdecimal/Lib/test/mpdecimal/configure.in	Sun Jan 2 17:33:08 2011
@@ -1,17 +1,10 @@
 dnl Some parts taken from Python's configure.in.
 
-dnl Only use correct autoconf version:
-m4_define([version_required],
-[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]), [1ドル]), 0,
- [],
- [m4_fatal([Autoconf version 1ドル is required for mpdecimal], 63)])
-])
-version_required(2.67)
-
-AC_INIT(mpdecimal, 2.0, mpdecimal-bugs at bytereef.org, mpdecimal-2.0.tar.gz, http://www.bytereef.org/libmpdec.html)
+AC_PREREQ([2.67])
+AC_INIT(mpdecimal, @RELEASE_VERSION@, mpdecimal-bugs at bytereef.org, mpdecimal, http://www.bytereef.org/mpdecimal/index.html)
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_FILES([Makefile tests/Makefile])
-AC_ARG_VAR(MACHINE, [force configuration: x64, uint128, ansi64, ppro, ansi32, ansi-legacy, universal])
+AC_ARG_VAR(MACHINE, [force configuration: x64, uint128, ansi64, ppro, ansi32, ansi-legacy])
 
 LIBSHARED=libmpdec.so.$PACKAGE_VERSION
 AC_SUBST(LIBSHARED)
@@ -42,7 +35,7 @@
 AC_TYPE_UINT32_T
 AC_TYPE_UINT64_T
 AC_CHECK_TYPE(__uint128_t, AC_DEFINE(HAVE_UINT128_T, 1,
- [Define if your compiler provides __uint128_t]),,)
+ [Define if your compiler provides __uint128_t.]),,)
 
 # Sizes of various types:
 AC_CHECK_SIZEOF(size_t, 4)
@@ -56,7 +49,7 @@
 AC_MSG_RESULT($have_gcc_asm_for_x64)
 if test "$have_gcc_asm_for_x64" = yes; then
 AC_DEFINE(HAVE_GCC_ASM_FOR_X64, 1,
- [Define if we can use x64 gcc inline assembler])
+ [Define if we can use x64 gcc inline assembler.])
 fi
 
 # x87 with gcc asm:
@@ -69,7 +62,7 @@
 AC_MSG_RESULT($have_gcc_asm_for_x87)
 if test "$have_gcc_asm_for_x87" = yes; then
 AC_DEFINE(HAVE_GCC_ASM_FOR_X87, 1,
- [Define if we can use x87 gcc inline assembler])
+ [Define if we can use x87 gcc inline assembler.])
 fi
 
 # gmp for extended tests:
@@ -108,11 +101,43 @@
 AC_SUBST(GMPDEPS)
 AC_SUBST(GMPPATH)
 
+# _FORTIFY_SOURCE wrappers for memmove and bcopy are incorrect:
+# http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
+AC_MSG_CHECKING(for glibc _FORTIFY_SOURCE/memmove bug)
+saved_cflags="$CFLAGS"
+CFLAGS="-O2 -D_FORTIFY_SOURCE=2"
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+void foo(void *p, void *q) { memmove(p, q, 19); }
+int main() {
+ char a[32] = "123456789000000000";
+ foo(&a[9], a);
+ if (strcmp(a, "123456789123456789000000000") != 0)
+ return 1;
+ foo(a, &a[9]);
+ if (strcmp(a, "123456789000000000") != 0)
+ return 1;
+ return 0;
+}
+]])],
+[have_glibc_memmove_bug=no],
+[have_glibc_memmove_bug=yes],
+[have_glibc_memmove_bug=undefined])
+CFLAGS="$saved_cflags"
+AC_MSG_RESULT($have_glibc_memmove_bug)
+if test "$have_glibc_memmove_bug" = yes; then
+ AC_DEFINE(HAVE_GLIBC_MEMMOVE_BUG, 1,
+ [Define if glibc has incorrect _FORTIFY_SOURCE wrappers
+ for memmove and bcopy.])
+fi
+
 # suncc is dectected as cc:
 case $ac_sys_system in
 sun*|Sun*)
 case $CC in
- cc|suncc)
+ cc)
 CC=suncc
 ;;
 esac
@@ -127,34 +152,36 @@
 MPD_CCOV=
 MPD_LDCOV=
 case $CC in
- gcc)
+ *gcc*)
 MPD_WARN="-Wall -W -Wno-unknown-pragmas"
 MPD_OPT="-O2 -fpic -s"
 MPD_PGEN="-fprofile-generate -fprofile-values"
 MPD_PUSE="-fprofile-use -freorder-blocks"
-	MPD_CCOV="-DTEST_COVERAGE -O0 -g -fno-inline -fprofile-arcs -ftest-coverage -fpic"
-	MPD_LDCOV="-fprofile-arcs"
+ MPD_CCOV="-DTEST_COVERAGE -O0 -g -fno-inline -fprofile-arcs -ftest-coverage -fpic"
+ MPD_LDCOV="-fprofile-arcs"
 ;;
- icc)
+ *icc*)
 AR=xiar
 MPD_WARN="-Wall -Wno-unknown-pragmas"
 MPD_OPT="-O2 -fpic -s"
 MPD_PGEN="-wd11505 -prof-gen"
 MPD_PUSE="-wd11505 -prof-use"
 ;;
- clang)
+ *clang*)
 MPD_WARN="-Wall -W -Wno-unknown-pragmas"
 MPD_OPT="-O2 -fpic"
 ;;
- suncc)
+ *suncc*)
 MPD_WARN=
 MPD_OPT="-O2 -fpic -s"
 ;;
 esac
 
 # Auto-detect machine dependent settings:
+M64=
 M32=
 if test -n "$MACHINE"; then
+ M64="-m64 "
 M32="-m32 "
 case "$MACHINE" in
 x64|uint128|ansi64|full_coverage|ppro|ansi32|ansi-legacy|universal)
@@ -175,9 +202,9 @@
 MACHINE="ansi32"
 if test $have_gcc_asm_for_x87 = yes; then
 case $CC in
- gcc|clang) # icc >= 11.0 works as well
+ *gcc*|*clang*) # icc >= 11.0 works as well
 case $ac_sys_system in
- darwin|Darwin)
+ darwin*|Darwin*)
 ;;
 *)
 MACHINE="ppro"
@@ -194,27 +221,50 @@
 CONFIGURE_LDFLAGS=
 case "$MACHINE" in
 x64)
- MPD_CONFIG="-DCONFIG_64 -DASM"
+ MPD_CONFIG=$M64"-DCONFIG_64 -DASM"
+ CONFIGURE_LDFLAGS=$M64
 MPD_PREC=19
 MPD_DPREC=38
 ;;
 uint128)
- MPD_CONFIG="-DCONFIG_64 -DANSI -DHAVE_UINT128_T"
+ MPD_CONFIG=$M64"-DCONFIG_64 -DANSI -DHAVE_UINT128_T"
+ CONFIGURE_LDFLAGS=$M64
 MPD_PREC=19
 MPD_DPREC=38
 ;;
 ansi64)
- MPD_CONFIG="-DCONFIG_64 -DANSI"
+ MPD_CONFIG=$M64"-DCONFIG_64 -DANSI"
+ CONFIGURE_LDFLAGS=$M64
 MPD_PREC=19
 MPD_DPREC=38
 ;;
 full_coverage)
 # Formerly ansi64c32, for testing only!
- MPD_CONFIG="-DCONFIG_32 -DANSI"
+ MPD_CONFIG=$M64"-DCONFIG_32 -DANSI"
+ CONFIGURE_LDFLAGS=$M64
 ;;
 ppro)
 MPD_CONFIG=$M32"-DCONFIG_32 -DPPRO -DASM"
 CONFIGURE_LDFLAGS=$M32
+ # gcc-4.5 miscompiles inline asm:
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
+ # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
+ case $CC in
+ *gcc*)
+ AC_MSG_CHECKING(for gcc-4.5)
+ gcc_version=`$CC -dumpversion`
+ have_gcc_4_5=no
+ case $gcc_version in
+ 4.5*)
+ have_gcc_4_5=yes
+ MPD_CONFIG="$MPD_CONFIG -fno-ipa-pure-const"
+ AC_DEFINE(HAVE_GCC_4_5, 1,
+ [Define if the gcc version is 4.5.x.])
+ ;;
+ esac
+ AC_MSG_RESULT($have_gcc_4_5)
+ ;;
+ esac
 ;;
 ansi32)
 MPD_CONFIG=$M32"-DCONFIG_32 -DANSI"
@@ -246,7 +296,10 @@
 if test -z "$CFLAGS"; then
 CONFIGURE_CFLAGS="$MPD_WARN $MPD_CONFIG $MPD_OPT"
 else
- CONFIGURE_CFLAGS="$CFLAGS"
+ CONFIGURE_CFLAGS="$MPD_CONFIG -fpic $CFLAGS"
+fi
+if test "$have_glibc_memmove_bug" = yes; then
+ CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -U_FORTIFY_SOURCE"
 fi
 
 if test -n "$LDFLAGS"; then
@@ -258,5 +311,25 @@
 
 AC_OUTPUT
 
+GLIBC_MEMMOVE_BUG_WARN="
+***************************** WARNING *********************************
+
+Detected glibc _FORTIFY_SOURCE/memmove bug. See:
+
+ http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html
 
+Enabling -U_FORTIFY_SOURCE workaround. If -D_FORTIFY_SOURCE is also
+present in the command line, make sure that the order of the two
+options is:
+
+ ... -D_FORTIFY_SOURCE=2 ... -U_FORTIFY_SOURCE ...
+
+A better solution is to upgrade glibc or to report the bug to your
+OS vendor.
+
+***************************** WARNING *********************************
+"
+if test "$have_glibc_memmove_bug" = yes; then
+ echo "$GLIBC_MEMMOVE_BUG_WARN"
+fi
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /