[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] Add support for --with-arch configure option



Hello,

glibc configure currently accepts the --with-cpu=x parameter doing two
things:

1. Compile everything with -mcpu=x
2. Append x to the sysdeps paths when looking for the files to be built.

In GCC -mcpu has been replaced by -march/-mtune in order to be able
change the scheduling policy without depending on the architecture.
So there are targets (e.g. S/390) which do not support -mcpu anymore.

The attached patch adds the --with-arch configure option having the
same effect as --with-cpu regarding point 2 but passing the -march=x
option to GCC instead of -mcpu.

This is a prerequisite for supporting S/390 DFP hardware support in
eglibc.

Please apply to DFP and mainline branch if it is OK.

Bye,

-Andreas-

2008-08-15  Andreas Krebbel  <krebbel1@xxxxxxxxxx>

	* Makeconfig: Use -march instead of -mcpu depending on
	with-arch variable.
	* configure.in: New configure parameter --with-arch added.
	* config.make.in: Set with-arch.


Index: Makeconfig
===================================================================
*** Makeconfig.orig	2008-07-22 15:06:07.000000000 +0200
--- Makeconfig	2008-08-11 13:11:57.000000000 +0200
*************** ifeq	"$(strip $(+cflags))" ""
*** 651,657 ****
  +cflags	:= $(default_cflags)
  endif	# $(+cflags) == ""

! +cflags += $(addprefix -mcpu=,$(with-cpu)) $(+gccwarn) $(+merge-constants)
  +gcc-nowarn := -w

  # Don't duplicate options if we inherited variables from the parent.
--- 651,662 ----
  +cflags	:= $(default_cflags)
  endif	# $(+cflags) == ""

! ifeq	"$with-arch" ""
! +cflags += $(addprefix -mcpu=,$(with-cpu))
! else
! +cflags += $(addprefix -march=,$(with-arch))
! endif
! +cflags += $(+gccwarn) $(+merge-constants)
  +gcc-nowarn := -w

  # Don't duplicate options if we inherited variables from the parent.
Index: configure.in
===================================================================
*** configure.in.orig	2008-07-22 15:06:00.000000000 +0200
--- configure.in	2008-08-12 16:14:13.000000000 +0200
*************** AC_ARG_WITH([cpu],
*** 355,360 ****
--- 355,371 ----
    esac
  ])

+ subarch=
+ AC_ARG_WITH([arch],
+ 	    AS_HELP_STRING([--with-arch=CPU], [select code for CPU variant]),
+ 	    [dnl
+   case "$withval" in
+   yes|'') AC_MSG_ERROR([--with-arch requires an argument]) ;;
+   no) ;;
+   *) submachine="$withval"; subarch="$withval" ;;
+   esac
+ ])
+

  # An add-on can set this when it wants to disable the sanity check below.
  libc_config_ok=no
*************** if test -z "$submachine_used" && test -n
*** 683,688 ****
--- 694,700 ----
    AC_MSG_ERROR(The $submachine subspecies of $host_cpu is not supported.)
  fi
  AC_SUBST(submachine)
+ AC_SUBST(subarch)

  # We have now validated the configuration.

Index: config.make.in
===================================================================
*** config.make.in.orig	2008-07-22 15:04:47.000000000 +0200
--- config.make.in	2008-08-11 13:11:38.000000000 +0200
*************** config-vendor = @host_vendor@
*** 32,37 ****
--- 32,38 ----
  config-os = @host_os@
  config-sysdirs = @sysnames@
  with-cpu = @submachine@
+ with-arch = @subarch@

  defines = @DEFINES@
  sysincludes = @SYSINCLUDES@