This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Solaris7/sparc with GNU as is broken


GNU as does not accept -xarch=v9 nor =v9a, so the -m64 multilibbing
that's now enabled by default on Solaris7/sparc doesn't work out.

Here's a patch that fixes part of the problem, by using -Av9 and -Av9a
with GNU as.  I know the patch assumes string concatenation works, but
so does the original file, in many places, and I wouldn't have time to
try to clean it up right now.

It relies on configure.in defining HAVE_GNU_AS when appropriate.
While I was at it, I thought HAVE_GNU_LD would also be quite handy.

Here's the patch.  Ok to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
	
	* configure.in (HAVE_GNU_AS, HAVE_GNU_LD): Define.
	* acconfig.h: Likewise.
	* configure, config.in: Rebuilt.
	* config/sparc/sol2-sld-64.h: Use HAVE_GNU_AS to choose either
	`-xarch=' or `-A'.
	
Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/configure.in,v
retrieving revision 1.307
diff -u -r1.307 configure.in
--- gcc/configure.in	1999/11/23 07:57:06	1.307
+++ gcc/configure.in	1999/11/29 19:37:36
@@ -4388,6 +4388,14 @@
     ;;
 esac
 
+if test x$gas = xyes; then
+  AC_DEFINE(HAVE_GNU_AS)
+fi
+
+if test x$gnu_ld = xyes; then
+  AC_DEFINE(HAVE_GNU_LD)
+fi
+
 # Figure out what language subdirectories are present.
 # Look if the user specified --enable-languages="..."; if not, use
 # the environment variable $LANGUAGES if defined. $LANGUAGES might
Index: gcc/acconfig.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/acconfig.h,v
retrieving revision 1.37
diff -u -r1.37 acconfig.h
--- gcc/acconfig.h	1999/09/22 14:23:21	1.37
+++ gcc/acconfig.h	1999/11/29 19:37:36
@@ -26,6 +26,12 @@
 /* Define if your compiler understands volatile.  */
 #undef HAVE_VOLATILE
 
+/* Define if the assembler is known to be GNU as. */
+#undef HAVE_GNU_AS
+
+/* Define if the linker is known to be GNU ld. */
+#undef HAVE_GNU_LD
+
 /* Define if your assembler supports specifying the maximum number
    of bytes to skip when using the GAS .p2align command. */
 #undef HAVE_GAS_MAX_SKIP_P2ALIGN
Index: gcc/config/sparc/sol2-sld-64.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sparc/sol2-sld-64.h,v
retrieving revision 1.8
diff -u -r1.8 sol2-sld-64.h
--- gcc/config/sparc/sol2-sld-64.h	1999/08/02 22:58:01	1.8
+++ gcc/config/sparc/sol2-sld-64.h	1999/11/29 19:37:36
@@ -28,24 +28,31 @@
 #undef LONG_DOUBLE_TYPE_SIZE
 #define LONG_DOUBLE_TYPE_SIZE 128
 
+#undef ASM_XARCH_FLAG
+#if HAVE_GNU_AS
+# define ASM_XARCH_FLAG(__str) "-A" __str
+#else
+# define ASM_XARCH_FLAG(__str) "-xarch=" __str
+#endif
+
 #undef ASM_CPU32_DEFAULT_SPEC
 #define ASM_CPU32_DEFAULT_SPEC	""
 #undef ASM_CPU64_DEFAULT_SPEC
-#define ASM_CPU64_DEFAULT_SPEC	"-xarch=v9"
+#define ASM_CPU64_DEFAULT_SPEC	ASM_XARCH_FLAG("v9")
 
 #if TARGET_CPU_DEFAULT == TARGET_CPU_v9
 #undef CPP_CPU64_DEFAULT_SPEC
 #define CPP_CPU64_DEFAULT_SPEC ""
 #undef ASM_CPU32_DEFAULT_SPEC
-#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plus"
+#define ASM_CPU32_DEFAULT_SPEC ASM_XARCH_FLAG("v8plus")
 #endif
 #if TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc
 #undef CPP_CPU64_DEFAULT_SPEC
 #define CPP_CPU64_DEFAULT_SPEC ""
 #undef ASM_CPU32_DEFAULT_SPEC
-#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusa"
+#define ASM_CPU32_DEFAULT_SPEC ASM_XARCH_FLAG("v8plusa")
 #undef ASM_CPU64_DEFAULT_SPEC
-#define ASM_CPU64_DEFAULT_SPEC "-xarch=v9a"
+#define ASM_CPU64_DEFAULT_SPEC ASM_XARCH_FLAG("v9a")
 #endif
 
 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
@@ -84,9 +91,13 @@
 
 #undef ASM_CPU_SPEC
 #define ASM_CPU_SPEC "\
-%{mcpu=ultrasparc:" DEF_ARCH32_SPEC("-xarch=v8plusa") DEF_ARCH64_SPEC("-xarch=v9a") "} \
-%{mcpu=v9:" DEF_ARCH32_SPEC("-xarch=v8plus") DEF_ARCH64_SPEC("-xarch=v9") "} \
-%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC("-xarch=v8") DEF_ARCH64_SPEC("-xarch=v9") "}}} \
+%{mcpu=ultrasparc:" DEF_ARCH32_SPEC(ASM_XARCH_FLAG("v8plusa")) \
+		    DEF_ARCH64_SPEC(ASM_XARCH_FLAG("v9a")) "} \
+%{mcpu=v9:" DEF_ARCH32_SPEC(ASM_XARCH_FLAG("v8plus")) \
+	    DEF_ARCH64_SPEC(ASM_XARCH_FLAG("v9")) "} \
+%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:" DEF_ARCH32_SPEC(ASM_XARCH_FLAG("v8")) \
+					DEF_ARCH64_SPEC(ASM_XARCH_FLAG("v9")) \
+					"}}} \
 %{!mcpu*:%(asm_cpu_default)} \
 "
 


Unfortunately, this wasn't enough to get it to build: GNU as chokes on
the `.xword' emitted while compiling libgcc's _trampoline with -m64.
Is there any way to get around it, or must we disable 64bit mode when
using GNU as if it is found to choke on .xword?  It's a one-line test,
that I will submit separately if we decide to do it.

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]