diff mbox

S390: Support -mtune=native and -march=native.

Message ID 20150709064409.GA7485@linux.vnet.ibm.com
State New
Headers show

Commit Message

Dominik Vogt July 9, 2015, 6:44 a.m. UTC
On Wed, Jul 08, 2015 at 04:18:47PM -0400, DJ Delorie wrote:
> 
> > Version 2 of the patch to enable the configure options
> > --with-arch=native and --with-tune=native.
> 
> This patch broke cross-compiling with --target=s390-*
> 
> s390_host_detect_local_cpu is only defined if the --host is s390-*
> 
> but EXTRA_SPEC_FUNCTIONS refers to it when --target is s390-*

Sorry about that.  Does the attached Patch fix the problem?

gcc/ChangeLog:
--------------
2015-07-09  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* config/s390/s390.h: S390: Do not define EXTRA_SPEC_FUNCTIONS when
	cross compiling.

Ciao

Dominik ^_^  ^_^

Comments

DJ Delorie July 9, 2015, 7:23 a.m. UTC | #1
> Sorry about that.  Does the attached Patch fix the problem?

Yup.  Thanks!
Jan-Benedict Glaw July 17, 2015, 2:16 p.m. UTC | #2
On Thu, 2015-07-09 07:44:09 +0100, Dominik Vogt <vogt@linux.vnet.ibm.com> wrote:
> On Wed, Jul 08, 2015 at 04:18:47PM -0400, DJ Delorie wrote:
> > 
> > > Version 2 of the patch to enable the configure options
> > > --with-arch=native and --with-tune=native.
> > 
> > This patch broke cross-compiling with --target=s390-*
> > 
> > s390_host_detect_local_cpu is only defined if the --host is s390-*
> > 
> > but EXTRA_SPEC_FUNCTIONS refers to it when --target is s390-*
> 
> Sorry about that.  Does the attached Patch fix the problem?

I haven't checked the patch, but others reported it to fix
cross-building. It seems to be not yet committed and my Build
Robot still complains about the initial issue:

http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=455156

  It would be nice if you'd commit it.

Thanks,
  Jan-Benedict
diff mbox

Patch

From 86e02035d8011fa158125a541cde5cc55a21c1ea Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Thu, 9 Jul 2015 07:31:42 +0100
Subject: [PATCH] S390: Do not define EXTRA_SPEC_FUNCTIONS when cross
 compiling.

---
 gcc/config/s390/s390.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 85a0d1a..362e3d4 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -126,26 +126,30 @@  enum processor_flags
   { "arch", "%{!march=*:-march=%(VALUE)}" },			\
   { "tune", "%{!mtune=*:-mtune=%(VALUE)}" }
 
+#ifdef __s390__
 extern const char *s390_host_detect_local_cpu (int argc, const char **argv);
 # define EXTRA_SPEC_FUNCTIONS \
   { "local_cpu_detect", s390_host_detect_local_cpu },
 
 # define MARCH_MTUNE_NATIVE_SPECS				\
-  " %{march=native:%<march=native %:local_cpu_detect(arch)}"	\
+  , " %{march=native:%<march=native %:local_cpu_detect(arch)}"	\
   " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
+#else
+# define MARCH_MTUNE_NATIVE_SPECS
+#endif
 
 /* Defaulting rules.  */
 #ifdef DEFAULT_TARGET_64BIT
 #define DRIVER_SELF_SPECS					\
   "%{!m31:%{!m64:-m64}}",					\
   "%{!mesa:%{!mzarch:%{m31:-mesa}%{m64:-mzarch}}}",		\
-  "%{!march=*:%{mesa:-march=g5}%{mzarch:-march=z900}}",		\
+  "%{!march=*:%{mesa:-march=g5}%{mzarch:-march=z900}}"		\
   MARCH_MTUNE_NATIVE_SPECS
 #else
 #define DRIVER_SELF_SPECS					\
   "%{!m31:%{!m64:-m31}}",					\
   "%{!mesa:%{!mzarch:%{m31:-mesa}%{m64:-mzarch}}}",		\
-  "%{!march=*:%{mesa:-march=g5}%{mzarch:-march=z900}}",		\
+  "%{!march=*:%{mesa:-march=g5}%{mzarch:-march=z900}}"		\
   MARCH_MTUNE_NATIVE_SPECS
 #endif
 
-- 
2.3.0