This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: OpenServer and GNU as.
- To: egcs-patches at cygnus dot com
- Subject: PATCH: OpenServer and GNU as.
- From: Robert Lipe <robertl at dgii dot com>
- Date: Tue, 30 Jun 1998 22:22:58 -0500
The following patch adds support for --with-gnu-as to OpenServer. This
disables COFF multilibbing, COFF support in general, and the flags that
we pass to the native assembler that make GAS unhappy.
This approach isn't my favorite, but switching assembler names at
runtime would have required too much work for two little gain in gcc.c.
This way constrains all the damage to the OpenServer port. I'm not
happy about creating another code path in this way, but I think this
should get the two or three people a month that have asked me about this
for two years happy once again.
* install.texi (sco3.2v5): Document new --with-gnu-as flag.
* config/i386/sco5.h (JUMP_TABLES_IN_TEXT_SECTION): Defined as
in other targets.
(USE_GAS): Conditionalize away native assembler usage.
* config/i386/sco5gas.h: New file.
* config/i386/t-sco5gas: New file.
* configure.in (ix86-sco3.2v5*): Use new files if --with-gnu-as
Index: install.texi
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/install.texi,v
retrieving revision 1.19
diff -u -p -r1.19 install.texi
--- install.texi 1998/05/05 23:17:11 1.19
+++ install.texi 1998/07/01 03:13:35
@@ -980,13 +980,22 @@ Use this configuration for SCO release 3
@item i386-*-sco3.2v5*
Use this for the SCO OpenServer Release family including 5.0.0, 5.0.2,
-5.0.4, Internet FastStart 1.0, and Internet FastStart 1.1.
+5.0.4, 5.0.5, Internet FastStart 1.0, and Internet FastStart 1.1.
GNU CC can generate either ELF or COFF binaries. ELF is the default.
To get COFF output, you must specify @samp{-mcoff}) on the command line.
For 5.0.0 and 5.0.2, you must install TLS597 from ftp.sco.com/TLS.
5.0.4 and later do not require this patch.
+
+The native SCO assembler that is provided with the OS at no charge
+is normally required. If, however, you must be able to use the GNU
+assembler (perhaps you have complex asms) you must configure this
+package @samp{--with-gnu-as}. You must use a recent version of GNU
+binutils; version 2.9.1 seems to work well. If you select this option,
+you will be unable to build COFF images. Trying to do so will result in
+non-obvious failures. In general, the "--with-gnu-as" option isn't as
+well tested as the native assembler.
@emph{NOTE:} You must follow the instructions about invoking
@samp{make bootstrap} because the native OpenServer compiler builds
Index: configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.120
diff -u -p -r1.120 configure.in
--- configure.in 1998/06/28 06:09:43 1.120
+++ configure.in 1998/07/01 03:13:38
@@ -981,8 +981,14 @@ for machine in $build $host $target; do
xmake_file=i386/x-sco5
fixincludes=fixinc.sco
install_headers_dir=install-headers-cpio
- tm_file=i386/sco5.h
- tmake_file=i386/t-sco5
+ if [[ x$gas = xyes ]]
+ then
+ tm_file=i386/sco5gas.h
+ tmake_file=i386/t-sco5gas
+ else
+ tm_file=i386/sco5.h
+ tmake_file=i386/t-sco5
+ fi
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
;;
i[[34567]]86-*-sco3.2v4*) # 80386 running SCO 3.2v4 system
Index: config/i386/sco5.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/sco5.h,v
retrieving revision 1.14
diff -u -p -r1.14 sco5.h
--- sco5.h 1998/03/06 14:44:52 1.14
+++ sco5.h 1998/07/01 03:13:45
@@ -653,7 +653,7 @@ dtors_section () \
(current_function_calls_setjmp || current_function_calls_longjmp))
#undef JUMP_TABLES_IN_TEXT_SECTION
-#define JUMP_TABLES_IN_TEXT_SECTION 1
+#define JUMP_TABLES_IN_TEXT_SECTION (TARGET_ELF && flag_pic)
#undef LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX \
@@ -777,19 +777,29 @@ dtors_section () \
SCO also allows you to compile, link and generate either ELF or COFF
binaries. With gcc, unlike the SCO compiler, the default is ELF.
- Specify -mcoff to gcc to produce elf binaries. -fpic will get the
+ Specify -mcoff to gcc to produce COFF binaries. -fpic will get the
assembler and linker to produce PIC code.
*/
/* Set up assembler flags for PIC and ELF compilations */
#undef ASM_SPEC
+
+#if USE_GAS
+ /* Leave ASM_SPEC undefined so we pick up the master copy from gcc.c
+ * Undef MD_EXEC_PREFIX becuase we don't know where GAS is, but it's not
+ * likely in /usr/ccs/bin/
+ */
+#undef MD_EXEC_PREFIX
+#else
+
#define ASM_SPEC \
- "-b %{!mcoff:elf}%{mcoff:coff \
- %{static:%e-static not valid with -mcoff} \
- %{shared:%e-shared not valid with -mcoff} \
- %{symbolic:%e-symbolic not valid with -mcoff}} \
- %{Ym,*} %{Yd,*} %{Wa,*:%*} \
- %{!mcoff:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF %{Qn:} %{!Qy:-Qn}}"
+ "-b %{!mcoff:elf}%{mcoff:coff \
+ %{static:%e-static not valid with -mcoff} \
+ %{shared:%e-shared not valid with -mcoff} \
+ %{symbolic:%e-symbolic not valid with -mcoff}} \
+ %{Ym,*} %{Yd,*} %{Wa,*:%*} \
+ %{!mcoff:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF %{Qn:} %{!Qy:-Qn}}"
+#endif
/* Use crt1.o as a startup file and crtn.o as a closing file. */
Index: config/i386/sco5gas.h
===================================================================
RCS file: sco5gas.h
diff -N sco5gas.h
--- /dev/null Mon Dec 31 20:00:00 1979
+++ sco5gas.h Tue Jun 30 20:13:45 1998
@@ -0,0 +1,25 @@
+/* Definitions for Intel x86 running SCO OpenServer, running GNU assembler
+ Copyright (C) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+/* Just set a single flag we can test for inside of sco5.h and include it. */
+
+#define USE_GAS 1
+#include "sco5.h"
Index: config/i386/t-sco5gas
===================================================================
RCS file: t-sco5gas
diff -N t-sco5gas
--- /dev/null Mon Dec 31 20:00:00 1979
+++ t-sco5gas Tue Jun 30 20:13:45 1998
@@ -0,0 +1,16 @@
+# The pushl in CTOR initialization interferes with frame pointer elimination.
+CRTSTUFF_T_CFLAGS = -fPIC -fno-omit-frame-pointer
+CRTSTUFF_T_CFLAGS_S = -mcoff -fno-omit-frame-pointer
+
+#
+# I am still a little unsure of the multilib architecture. The following
+# 4 lines are based on advice from meissner@cygnus.com.
+#
+MULTILIB_OPTIONS = fPIC
+MULTILIB_DIRNAMES = pic
+MULTILIB_EXCEPTIONS = *fPIC*
+MULTILIB_MATCHES = fPIC=fpic
+MULTILIB_EXTRA_OPTS =
+
+LIBGCC=stmp-multilib
+INSTALL_LIBGCC=install-multilib