home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 48
/
Amiga_Dream_48.iso
/
LinuxPpc
/
users
/
harry
/
gcc-2.7.2.2_patch
< prev
next >
Wrap
Text File
|
1998-01-19
|
8KB
|
230 lines
Harry,
Enclosed is the patch I've been using.
FILES IN THE PATCH
As can be seen, gcc-2.7.2.2 almost compiles for Linux/PPC "out-of-the-box".
gcc-2.7.2.2/config/rs6000/linux.h
gcc-2.7.2.2/config/rs6000/xm-linux.h
I started with the these files from the "gcc-2.7.2.1-1.ppc.src.rpm" and
changed some macros around.
gcc-2.7.2.2/ginclude/va-ppc.h
This is the same as the one from the "gcc-2.7.2.1-1.ppc.src.rpm". Just
a wrapper around the va_list structure.
gcc-2.7.2.2/configure
gcc-2.7.2.2/README.LINUXPPC
These are both mine.
INSTRUCTIONS FOR USING THE PATCH
Get the gcc-2.7.2.2 distribution from
<ftp://prep.ai.mit.edu/pub/gnu/gcc-2.7.2.2> or a mirror site.
Save everything between the "==== CUT HERE ====" lines below into a file
called gcc.patch.
Untar the gcc distribution.
From the parent directory of gcc-2.7.2.2 issue a "patch <gcc.patch"
command.
Now go into the gcc-2.7.2.2 directory and read the file "README.LINUXPPC".
Good luck,
--
Anthony C. Ard <aard@best.com>
Finger me for PGP key. "Wouldn't you rather be involved in a series of
colorful time-wasting trends?" -- Frank Zappa
==== CUT HERE =============================================================
diff -u gcc-2.7.2.2/config/rs6000/linux.h.orig gcc-2.7.2.2/config/rs6000/linux.h
--- gcc-2.7.2.2/config/rs6000/linux.h.orig Wed Apr 2 02:08:44 1997
+++ gcc-2.7.2.2/config/rs6000/linux.h Thu Apr 3 22:43:23 1997
@@ -0,0 +1,46 @@
+/*
+ * Configuration for Linux/PowerPC
+ */
+
+#include "rs6000/sysv4.h"
+
+/* Define this as 1 if `char' should by default be signed; else as 0. */
+#undef DEFAULT_SIGNED_CHAR
+#define DEFAULT_SIGNED_CHAR 1
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (PowerPC Linux/Sys V.4 ABI)");
+
+#undef DWARF_DEBUGGING_INFO
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES \
+ "-DELF -DPPC -Dunix -Dlinux -Dpowerpc -Asystem(unix) -Asystem(linux) -Acpu(powerpc) -Amachine(powerpc)"
+
+/* Set the default to my machine, a PowerMacintosh 8500/180 with a 604e. */
+#undef PROCESSOR_DEFAULT
+#define PROCESSOR_DEFAULT PROCESSOR_PPC604
+
+/* Leave out some SYSV linking stuff */
+#undef LINK_SPEC
+
+/* Provide a STARTFILE_SPEC appropriate for Linux. Here we add
+ the Linux magical crtbegin.o file (see crtstuff.c) which
+ provides part of the support for getting C++ file-scope static
+ object constructed before entering `main'. */
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+/* Provide a ENDFILE_SPEC appropriate for Linux. Here we tack on
+ the Linux magical crtend.o file (see crtstuff.c) which
+ provides part of the support for getting C++ file-scope static
+ object constructed before entering `main', followed by a normal
+ Linux "finalizer" file, `crtn.o'. */
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
diff -u gcc-2.7.2.2/config/rs6000/xm-linux.h.orig gcc-2.7.2.2/config/rs6000/xm-linux.h
--- gcc-2.7.2.2/config/rs6000/xm-linux.h.orig Wed Apr 2 02:08:50 1997
+++ gcc-2.7.2.2/config/rs6000/xm-linux.h Wed Apr 2 02:08:34 1997
@@ -0,0 +1,5 @@
+/*
+ * Configuration for Linux/PowerPC
+ */
+
+#include "rs6000/xm-sysv4.h"
diff -u gcc-2.7.2.2/ginclude/va-ppc.h.orig gcc-2.7.2.2/ginclude/va-ppc.h
--- gcc-2.7.2.2/ginclude/va-ppc.h.orig Mon Oct 9 09:35:19 1995
+++ gcc-2.7.2.2/ginclude/va-ppc.h Wed Apr 2 03:14:21 1997
@@ -25,10 +25,13 @@
#if defined (_STDARG_H) || defined (_VARARGS_H)
/* Register save area located below the frame pointer */
+#ifndef __GNUC__va_regsave_t
+#define __GNUC__va_regsave_t
typedef struct {
long __gp_save[8]; /* save area for GP registers */
double __fp_save[8]; /* save area for FP registers */
} __va_regsave_t;
+#endif
/* Macros to access the register save area */
/* We cast to void * and then to TYPE * because this avoids
diff -u gcc-2.7.2.2/configure.orig gcc-2.7.2.2/configure
--- gcc-2.7.2.2/configure.orig Thu Jan 30 14:20:15 1997
+++ gcc-2.7.2.2/configure Thu Apr 3 22:37:58 1997
@@ -2204,6 +2204,27 @@
fi
fixincludes=Makefile.in
;;
+ powerpc-*-linux*) # PowerPC running Linux
+ cpu_type=rs6000 # with ELF format
+ xm_file=rs6000/xm-linux.h
+ xmake_file=x-linux
+ tm_file=rs6000/linux.h
+ #broken_install=yes
+ # GNU always uses ELF.
+ elf=yes
+ # GNU tools are the only tools.
+ gnu_ld=yes
+ gas=yes
+ # On Linux, the headers are already okay.
+ fixincludes=Makefile.in
+ # Don't build libgcc1.c, because there is no non-GNU
+ # compiler to build it with. The GNU system C library will
+ # include assembly versions of any needed functions.
+ tmake_file=t-libc-ok
+ # Linux/PPC still uses the Linux C Library based on glibc v1.
+ # The start files come from that package.
+ #extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+ ;;
rs6000-ibm-aix3.[01]*)
tm_file=rs6000/aix31.h
tmake_file=rs6000/t-rs6000
diff -u gcc-2.7.2.2/README.LINUXPPC.orig gcc-2.7.2.2/README.LINUXPPC
--- gcc-2.7.2.2/README.LINUXPPC.orig Thu Apr 3 22:52:48 1997
+++ gcc-2.7.2.2/README.LINUXPPC Thu Apr 3 23:57:31 1997
@@ -0,0 +1,72 @@
+README for Linux/PPC (ppc-unknown-linux) -*-indented-text-*-
+===========================================================================
+03-Apr-97
+
+This file was written by Anthony C. Ard <mailto:aard@best.com>. It is not
+part of the standard gcc-2.7.2.2 distribution from the Free Software
+Foundation <ftp://prep.ai.mit.edu/pub/gnu>.
+
+First of all, why did I do this? For absolutely no reason other than that
+I like to receive software in source form and compile it myself. I'm a
+geek, so sue me.
+
+
+WARNING
+
+ Enter at your own risk. I don't guarantee that anything will work.
+ Obviously, my intention is that everything does work, but I'm not
+ necessarily the smartest guy in the world... You are totally on your
+ own. If you find something I've done stupidly, or have missed, I'd
+ love to hear about it.
+
+INFORMATION
+
+ This is not setup to use shared libraries in any way shape or form.
+ Shared libraries work for a lot of people, but they don't seem to like
+ me.
+
+ I hope this works on:
+
+ Linux: PCI Power Macintosh, PPCP, BeBox.
+ MkLinux: Power Macintosh
+
+ But I've only tested the build with the following (which is the only
+ machine I've got other than an old Quadra 700):
+
+ Power Macintosh 8500/180, 180MHz 604e, 512K L2 cache, 64mb RAM.
+ Linux-pmac (Linux kernel 2.1.24 from Paul Mackerras, dated 970325).
+ No shared libraries support.
+
+ The default setup for gcc is to use signed chars and perform PPC604
+ instruction scheduling. You can change this very easily by modifying
+ the file "gcc-2.7.2.2/config/rs6000/linux.h". Change the definitions
+ of DEFAULT_SIGNED_CHAR and TARGET_VERSION. Look around in the files
+ that linux.h includes to determine the supported definitions for those
+ macros.
+
+
+INSTALLATION
+
+ 1. Get the file "gcc-2.7.2.2.tar.gz" from prep.ai.mit.edu and untar
+ the sources.
+
+ 2. Configure the package.
+
+ $ cd gcc-2.7.2.2
+ $ ./configure --prefix=/usr ppc-unknown-linux
+
+ 3. Follow the instuctions in the file "INSTALL".
+
+ 4. Cleanup.
+
+ If your previous version of gcc was installed from a Redhat Package
+ Manager file, then you might want to get rid of it with:
+
+ # rpm -e gcc.
+
+ You'll probably notice that the above command just deleted the files
+ you installed! Whoops! But don't worry. As long as you haven't
+ touched any files in the source tree just reinstall and you're set.
+
+
+-- END
==== CUT HERE =============================================================