[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patches] -march glibc upstream patch from Roland McGrath
- To: patches@xxxxxxxxxx
- Subject: [patches] -march glibc upstream patch from Roland McGrath
- From: "Andreas Krebbel" <krebbel@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 18 Aug 2008 15:21:22 +0200
Hello,
Roland applied a different patch for enabling use of -march during
libc build.
I've extracted the patch from the upstream CVS and tested it in
combination with my other patches.
Please apply to eglibc and DFP branch and regenerate the configure
file.
Bye,
-Andreas-
2008-08-18 Roland McGrath <roland@xxxxxxxxxx>
* configure.in (--with-cpu): Check compiler support for -march/-mcpu.
* config.make.in (cflags-cpu): New substituted variable.
(with-cpu): Variable removed.
* Makeconfig (+cflags): Use $(cflags-cpu), not $(with-cpu).
Index: configure.in
===================================================================
--- configure.in.orig 2008-08-18 12:38:38.000000000 +0200
+++ configure.in 2008-08-18 12:39:48.000000000 +0200
@@ -355,7 +355,6 @@ AC_ARG_WITH([cpu],
esac
])
-
# An add-on can set this when it wants to disable the sanity check below.
libc_config_ok=no
@@ -1996,6 +1995,22 @@ EOF
fi
fi
+if test -n "$submachine"; then
+ AC_CACHE_CHECK([for compiler option for CPU variant],
+ libc_cv_cc_submachine, [dnl
+ libc_cv_cc_submachine=no
+ for opt in "-march=$submachine" "-mcpu=$submachine"; do
+ if AC_TRY_COMMAND([${CC-cc} $opt -xc /dev/null -S -o /dev/null]); then
+ libc_cv_cc_submachine="$opt"
+ break
+ fi
+ done])
+ if test "x$libc_cv_cc_submachine" = xno; then
+ AC_MSG_ERROR([${CC-cc} does not support $submachine])
+ fi
+fi
+AC_SUBST(libc_cv_cc_submachine)
+
dnl Check whether we have the gd library available.
AC_MSG_CHECKING(for libgd)
if test "$with_gd" != "no"; then
Index: config.make.in
===================================================================
--- config.make.in.orig 2008-08-18 12:38:38.000000000 +0200
+++ config.make.in 2008-08-18 12:39:48.000000000 +0200
@@ -31,7 +31,7 @@ base-machine = @base_machine@
config-vendor = @host_vendor@
config-os = @host_os@
config-sysdirs = @sysnames@
-with-cpu = @submachine@
+cflags-cpu = @libc_cv_cc_submachine@
defines = @DEFINES@
sysincludes = @SYSINCLUDES@
Index: Makeconfig
===================================================================
--- Makeconfig.orig 2008-08-18 12:38:38.000000000 +0200
+++ Makeconfig 2008-08-18 12:39:48.000000000 +0200
@@ -651,7 +651,7 @@ ifeq "$(strip $(+cflags))" ""
+cflags := $(default_cflags)
endif # $(+cflags) == ""
-+cflags += $(addprefix -mcpu=,$(with-cpu)) $(+gccwarn) $(+merge-constants)
++cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants)
+gcc-nowarn := -w
# Don't duplicate options if we inherited variables from the parent.