This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to get the NeXTSTEP platforms to compile (m68k/i386)
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to get the NeXTSTEP platforms to compile (m68k/i386)
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Tue, 13 Nov 2001 10:20:59 -0500 (EST)
This patch was necessary to get the various nextstep platforms to
cross-compile cc1. There were three problems.
1. Couldn't compile {cpu}.o (i.e. m68k.o/i386.o) because when setting
the targetm to TARGET_INITIALIZER, not all of the function
pointers were declared. Fixed by creating a nextstep-protos.h, as
in how the darwin port handles the same problem.
2. Couldn't compile cppdefaults.o because LOCAL_INCLUDE_DIR and
STANDARD_INCLUDE_DIR were part of INCLUDE_DEFAULTS but weren't
defined anywhere. Fixed by deleting them from INCLUDE_DEFAULTS.
3. Couldn't compile nextstep.o because of bitrot. Fixed by adding
some include files to get the necessary declarations.
Tested by cross-compiling cc1 from sparc-sun-solaris2.7 to
m68k-next-nextstep2, m68k-next-nextstep3 and i386-next-nextstep.
Ok to install?
Thanks,
--Kaveh
2001-11-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* nextstep-protos.h: New file.
* nextstep.c: Include "rtl.h", "output.h" & "tm_p.h".
* nextstep.h (INCLUDE_DEFAULTS): Delete LOCAL_INCLUDE_DIR and
STANDARD_INCLUDE_DIR from the CROSS_COMPILE clause.
(nextstep_asm_out_constructor, nextstep_asm_out_destructor,
handle_pragma): Move prototypes to nextstep-protos.h.
* config.gcc (i[34567]86-next-*, m68k-next-nextstep2*,
m68k-next-nextstep[34]*): Append nextstep-protos.h to tm_p_file.
diff -rup orig/egcs-CVS20011111/gcc/config/nextstep-protos.h egcs-CVS20011111/gcc/config/nextstep-protos.h
--- orig/egcs-CVS20011111/gcc/config/nextstep-protos.h Tue Nov 13 00:02:29 2001
+++ egcs-CVS20011111/gcc/config/nextstep-protos.h Tue Nov 13 00:01:21 2001
@@ -0,0 +1,28 @@
+/* Operating system specific defines to be used when targeting GCC
+ for NeXTSTEP.
+ Copyright (C) 2001 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. */
+
+extern void nextstep_asm_out_constructor PARAMS ((struct rtx_def *, int));
+extern void nextstep_asm_out_destructor PARAMS ((struct rtx_def *, int));
+extern int handle_pragma PARAMS ((int(*)(void), void (*)(int), const char *));
+extern void constructor_section PARAMS ((void));
+extern void destructor_section PARAMS ((void));
+extern void nextstep_exception_section PARAMS ((void));
+extern void nextstep_eh_frame_section PARAMS ((void));
diff -rup orig/egcs-CVS20011111/gcc/config/nextstep.c egcs-CVS20011111/gcc/config/nextstep.c
--- orig/egcs-CVS20011111/gcc/config/nextstep.c Sat Aug 18 07:30:24 2001
+++ egcs-CVS20011111/gcc/config/nextstep.c Mon Nov 12 23:59:48 2001
@@ -23,7 +23,10 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include "flags.h"
#include "tree.h"
+#include "rtl.h"
#include "toplev.h"
+#include "output.h"
+#include "tm_p.h"
/* Make everything that used to go in the text section really go there. */
diff -rup orig/egcs-CVS20011111/gcc/config/nextstep.h egcs-CVS20011111/gcc/config/nextstep.h
--- orig/egcs-CVS20011111/gcc/config/nextstep.h Fri Nov 9 07:30:42 2001
+++ egcs-CVS20011111/gcc/config/nextstep.h Tue Nov 13 00:11:25 2001
@@ -55,14 +55,12 @@ Boston, MA 02111-1307, USA. */
{ \
{ GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \
{ GPLUSPLUS_INCLUDE_DIR, 0, 1, 1 }, \
- { LOCAL_INCLUDE_DIR, 0, 0, 1 }, \
{ GCC_INCLUDE_DIR, "GCC", 0, 0 }, \
{ GCC_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
{ GCC_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
{ TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, \
{ TOOL_INCLUDE_DIR "/ansi", 0, 0, 0 }, \
{ TOOL_INCLUDE_DIR "/bsd", 0, 0, 0 }, \
- { STANDARD_INCLUDE_DIR, 0, 0, 0 }, \
{ "/usr/include/bsd", 0, 0, 0 }, \
{ 0, 0, 0, 0 } \
}
@@ -214,8 +212,6 @@ Boston, MA 02111-1307, USA. */
#define TARGET_ASM_CONSTRUCTOR nextstep_asm_out_constructor
#define TARGET_ASM_DESTRUCTOR nextstep_asm_out_destructor
-extern void nextstep_asm_out_constructor PARAMS ((struct rtx_def *, int));
-extern void nextstep_asm_out_destructor PARAMS ((struct rtx_def *, int));
#define TARGET_ASM_EXCEPTION_SECTION nextstep_exception_section
@@ -241,7 +237,6 @@ extern void nextstep_asm_out_destructor
#undef HANDLE_PRAGMA
#define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME)
-extern int handle_pragma PARAMS ((int(*)(void), void (*)(int), const char *));
/* Give methods pretty symbol names on NeXT. */
diff -rup orig/egcs-CVS20011111/gcc/config.gcc egcs-CVS20011111/gcc/config.gcc
--- orig/egcs-CVS20011111/gcc/config.gcc Sun Nov 11 00:36:50 2001
+++ egcs-CVS20011111/gcc/config.gcc Tue Nov 13 00:23:58 2001
@@ -1014,6 +1014,7 @@ i[34567]86-ncr-sysv4*) # NCR 3000 - ix8
tmake_file=i386/t-crtpic
;;
i[34567]86-next-*)
+ tm_p_file="${tm_p_file} nextstep-protos.h"
tm_file=i386/next.h
tmake_file=i386/t-next
extra_objs=nextstep.o
@@ -1841,6 +1842,7 @@ m68k-sony-bsd* | m68k-sony-newsos*)
float_format=m68k
;;
m68k-next-nextstep2*)
+ tm_p_file="${tm_p_file} nextstep-protos.h"
tm_file=m68k/next21.h
tmake_file=m68k/t-next
xmake_file=m68k/x-next
@@ -1850,6 +1852,7 @@ m68k-next-nextstep2*)
float_format=m68k
;;
m68k-next-nextstep[34]*)
+ tm_p_file="${tm_p_file} nextstep-protos.h"
tm_file=m68k/next.h
tmake_file=m68k/t-next
xmake_file=m68k/x-next