Commit b6c9286a by Michael Meissner

update PowerPC support

From-SVN: r10648
parent 1bad666c
......@@ -45,6 +45,7 @@ Boston, MA 02111-1307, USA. */
%{mcpu=403: -mppc} \
%{mcpu=601: -m601} \
%{mcpu=603: -mppc} \
%{mcpu=603e: -mppc} \
%{mcpu=604: -mppc}"
/* Define the options for the binder: Start text at 512, align all segments
......@@ -65,10 +66,17 @@ Boston, MA 02111-1307, USA. */
as per README.RS6000. */
#undef LINK_SPEC
#ifndef CROSS_COMPILE
#define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\
%{static:-bnso -bI:/lib/syscalls.exp} \
%{mcpu=common: milli.exp%s} \
%{!shared:%{g*:-bexport:/usr/lib/libg.exp}} %{shared:-bM:SRE}"
#else
#define LINK_SPEC "-T512 -H512 %{!r:-btextro} -bhalt:4 -bnodelcsect\
%{static:-bnso} \
%{mcpu=common: milli.exp%s} \
%{shared:-bM:SRE}"
#endif
/* These are not necessary when we pass -u to the assembler, and undefining
them saves a great deal of space in object files. */
......
......@@ -43,6 +43,7 @@ Boston, MA 02111-1307, USA. */
%{mcpu=403: -mppc} \
%{mcpu=601: -m601} \
%{mcpu=603: -mppc} \
%{mcpu=603e: -mppc} \
%{mcpu=604: -mppc}"
/* These are not necessary when we pass -u to the assembler, and undefining
......@@ -65,6 +66,13 @@ Boston, MA 02111-1307, USA. */
}
#undef LINK_SPEC
#ifndef CROSS_COMPILE
#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
%{static:-bnso -bI:/lib/syscalls.exp} %{g*:-bexport:/usr/lib/libg.exp}\
%{shared:-bM:SRE}"
#else
#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
%{static:-bnso} \
%{shared:-bM:SRE}"
#endif
......@@ -60,7 +60,6 @@ Boston, MA 02111-1307, USA. */
/* Invoke an initializer function to set up the GOT */
#define NAME__MAIN "__eabi"
#define INVOKE__main 1
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC Embedded)");
......@@ -69,57 +68,19 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES \
"-DPPC -D__embedded__ -Asystem(embedded) -Acpu(powerpc) -Amachine(powerpc)"
/* Don't use startfiles or libraries except for libgcc.a */
/* Use the simulator crt0 or mvme and libgloss/newlib libraries if desired */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC ""
#define STARTFILE_SPEC "\
%{mmvme: mvme-crt0.o%s} \
%{msim: sim-crt0.o%s}"
#undef LIB_SPEC
#define LIB_SPEC ""
#define LIB_SPEC "\
%{mmvme: -lmvme -lc -lmvme} \
%{msim: -lsim -lc -lsim}"
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "libgcc.a%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC ""
/* This is how to output an assembler line defining an `int' constant.
For -mrelocatable, we mark all addresses that need to be fixed up
in the .fixup section. */
#undef ASM_OUTPUT_INT
#define ASM_OUTPUT_INT(FILE,VALUE) \
do { \
static int recurse = 0; \
if (TARGET_RELOCATABLE \
&& in_section != in_toc \
&& in_section != in_text \
&& in_section != in_ctors \
&& in_section != in_dtors \
&& !recurse \
&& GET_CODE (VALUE) != CONST_INT \
&& GET_CODE (VALUE) != CONST_DOUBLE \
&& CONSTANT_P (VALUE)) \
{ \
static int labelno = 0; \
char buf[256], *p; \
\
recurse = 1; \
ASM_GENERATE_INTERNAL_LABEL (buf, "LCP", labelno++); \
STRIP_NAME_ENCODING (p, buf); \
fprintf (FILE, "%s:\n", p); \
fprintf (FILE, "\t.long ("); \
output_addr_const (FILE, (VALUE)); \
fprintf (FILE, ")@fixup\n"); \
fprintf (FILE, "\t.section\t\".fixup\",\"aw\"\n"); \
ASM_OUTPUT_ALIGN (FILE, 2); \
fprintf (FILE, "\t.long\t%s\n", p); \
fprintf (FILE, "\t.previous\n"); \
recurse = 0; \
} \
else \
{ \
fprintf (FILE, "\t.long "); \
output_addr_const (FILE, (VALUE)); \
fprintf (FILE, "\n"); \
} \
} while (0)
......@@ -28,7 +28,9 @@ Boston, MA 02111-1307, USA. */
#define CPP_SPEC "\
%{posix: -D_POSIX_SOURCE} \
%{mrelocatable: -D_RELOCATABLE} \
%{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_AIX}} \
%{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
%{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: -D_CALL_AIX}}}} \
%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \
%{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
%{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
......@@ -49,5 +51,20 @@ Boston, MA 02111-1307, USA. */
%{mcpu=rsc1: -D_ARCH_PWR} \
%{mcpu=403: -D_ARCH_PPC} \
%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
%{mcpu=602: -D_ARCH_PPC} \
%{mcpu=603: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC}"
%{mcpu=603e: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC} \
%{mcpu=620: -D_ARCH_PPC}"
/* Define this macro as a C expression for the initializer of an
array of string to tell the driver program which options are
defaults for this target and thus do not need to be handled
specially when using `MULTILIB_OPTIONS'.
Do not define this macro if `MULTILIB_OPTIONS' is not defined in
the target makefile fragment or if none of the options listed in
`MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "mbig", "mbig-endian", "mcall-aix" }
......@@ -29,7 +29,9 @@ Boston, MA 02111-1307, USA. */
#define CPP_SPEC "\
%{posix: -D_POSIX_SOURCE} \
%{mrelocatable: -D_RELOCATABLE} \
%{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}} \
%{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
%{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: -D_CALL_SYSV}}}} \
%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \
%{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
%{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \
......@@ -50,5 +52,20 @@ Boston, MA 02111-1307, USA. */
%{mcpu=rsc1: -D_ARCH_PWR} \
%{mcpu=403: -D_ARCH_PPC} \
%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
%{mcpu=602: -D_ARCH_PPC} \
%{mcpu=603: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC}"
%{mcpu=603e: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC} \
%{mcpu=620: -D_ARCH_PPC}"
/* Define this macro as a C expression for the initializer of an
array of string to tell the driver program which options are
defaults for this target and thus do not need to be handled
specially when using `MULTILIB_OPTIONS'.
Do not define this macro if `MULTILIB_OPTIONS' is not defined in
the target makefile fragment or if none of the options listed in
`MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "mlittle", "mlittle-endian", "mcall-sysv" }
......@@ -22,11 +22,6 @@ Boston, MA 02111-1307, USA. */
#include "rs6000/eabile.h"
/* Right now, the simulator doesn't handle floating point, so disable it
by default. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_LITTLE_ENDIAN | MASK_SOFT_FLOAT)
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC Simulated)");
......@@ -34,40 +29,16 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES \
"-DPPC -D__embedded__ -D__simulator__ -Asystem(embedded) -Asystem(simulator) -Acpu(powerpc) -Amachine(powerpc)"
#undef CPP_SPEC
#define CPP_SPEC "\
%{posix: -D_POSIX_SOURCE} \
%{mrelocatable: -D_RELOCATABLE} \
%{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}} \
%{!mhard-float: -D_SOFT_FLOAT} \
%{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
%{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
%{!mlittle: %{!mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)}} \
%{!mcpu*: \
%{mpower: %{!mpower2: -D_ARCH_PWR}} \
%{mpower2: -D_ARCH_PWR2} \
%{mpowerpc*: -D_ARCH_PPC} \
%{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \
%{!mno-powerpc: -D_ARCH_PPC}} \
%{mcpu=common: -D_ARCH_COM} \
%{mcpu=power: -D_ARCH_PWR} \
%{mcpu=powerpc: -D_ARCH_PPC} \
%{mcpu=rios: -D_ARCH_PWR} \
%{mcpu=rios1: -D_ARCH_PWR} \
%{mcpu=rios2: -D_ARCH_PWR2} \
%{mcpu=rsc: -D_ARCH_PWR} \
%{mcpu=rsc1: -D_ARCH_PWR} \
%{mcpu=403: -D_ARCH_PPC} \
%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
%{mcpu=603: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC}"
/* Use the simulator crt0 and libgloss/newlib libraries */
/* Use the simulator crt0 or mvme and libgloss/newlib libraries if desired */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "sim-crt0.o%s"
#define STARTFILE_SPEC "\
%{mmvme: mvme-crt0.o%s} \
%{!mmvme: sim-crt0.o%s}"
#undef LIB_SPEC
#define LIB_SPEC "-lsim -lc -lsim"
#define LIB_SPEC "\
%{mmvme: -lmvme -lc -lmvme} \
%{!mmvme: -lsim -lc -lsim}"
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "libgcc.a%s"
......
......@@ -22,11 +22,6 @@ Boston, MA 02111-1307, USA. */
#include "rs6000/eabi.h"
/* Right now, the simulator doesn't handle floating point, so disable it
by default. */
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_SOFT_FLOAT)
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC Simulated)");
......@@ -34,40 +29,16 @@ Boston, MA 02111-1307, USA. */
#define CPP_PREDEFINES \
"-DPPC -D__embedded__ -D__simulator__ -Asystem(embedded) -Asystem(simulator) -Acpu(powerpc) -Amachine(powerpc)"
#undef CPP_SPEC
#define CPP_SPEC "\
%{posix: -D_POSIX_SOURCE} \
%{mrelocatable: -D_RELOCATABLE} \
%{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}} \
%{!mhard-float: -D_SOFT_FLOAT} \
%{mlittle: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
%{mlittle-endian: -D_LITTLE_ENDIAN -Amachine(littleendian)} \
%{!mlittle: %{!mlittle-endian: -D_BIG_ENDIAN -Amachine(bigendian)}} \
%{!mcpu*: \
%{mpower: %{!mpower2: -D_ARCH_PWR}} \
%{mpower2: -D_ARCH_PWR2} \
%{mpowerpc*: -D_ARCH_PPC} \
%{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \
%{!mno-powerpc: -D_ARCH_PPC}} \
%{mcpu=common: -D_ARCH_COM} \
%{mcpu=power: -D_ARCH_PWR} \
%{mcpu=powerpc: -D_ARCH_PPC} \
%{mcpu=rios: -D_ARCH_PWR} \
%{mcpu=rios1: -D_ARCH_PWR} \
%{mcpu=rios2: -D_ARCH_PWR2} \
%{mcpu=rsc: -D_ARCH_PWR} \
%{mcpu=rsc1: -D_ARCH_PWR} \
%{mcpu=403: -D_ARCH_PPC} \
%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
%{mcpu=603: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC}"
/* Use the simulator crt0 and libgloss/newlib libraries */
/* Use the simulator crt0 or mvme and libgloss/newlib libraries if desired */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "sim-crt0.o%s"
#define STARTFILE_SPEC "\
%{mmvme: mvme-crt0.o%s} \
%{!mmvme: sim-crt0.o%s}"
#undef LIB_SPEC
#define LIB_SPEC "-lsim -lc -lsim"
#define LIB_SPEC "\
%{mmvme: -lmvme -lc -lmvme} \
%{!mmvme: -lsim -lc -lsim}"
#undef LIBGCC_SPEC
#define LIBGCC_SPEC "libgcc.a%s"
......
......@@ -20,6 +20,7 @@ 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. */
#define TARGET_AIX 0
#include "rs6000/rs6000.h"
......
......@@ -19,6 +19,8 @@ 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define TARGET_AIX 0
#include "rs6000/powerpc.h"
/* Don't generate XCOFF debugging information. */
......@@ -32,8 +34,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* The XCOFF support uses weird symbol suffixes, which we don't want
for ELF. */
#undef RS6000_OUTPUT_BASENAME
#define RS6000_OUTPUT_BASENAME(FILE, NAME) assemble_name (FILE, NAME)
#undef STRIP_NAME_ENCODING
/* Don't bother to output .extern pseudo-ops. They are not needed by
ELF assemblers. */
......
......@@ -43,6 +43,7 @@ Boston, MA 02111-1307, USA. */
%{mcpu=403: -mppc} \
%{mcpu=601: -m601} \
%{mcpu=603: -mppc} \
%{mcpu=603e: -mppc} \
%{mcpu=604: -mppc}"
#undef CPP_PREDEFINES
......@@ -68,8 +69,11 @@ Boston, MA 02111-1307, USA. */
%{mcpu=rsc1: -D_ARCH_PWR} \
%{mcpu=403: -D_ARCH_PPC} \
%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
%{mcpu=602: -D_ARCH_PPC} \
%{mcpu=603: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC}"
%{mcpu=603e: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC} \
%{mcpu=620: -D_ARCH_PPC}"
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
......
......@@ -29,7 +29,9 @@ Boston, MA 02111-1307, USA. */
#define CPP_SPEC "\
%{posix: -D_POSIX_SOURCE} \
%{mrelocatable: -D_RELOCATABLE} \
%{mcall-sysv: -D_CALL_SYSV} %{mcall-aix: -D_CALL_AIX} %{!mcall-sysv: %{!mcall-aix: -D_CALL_SYSV}} \
%{mcall-sysv: -D_CALL_SYSV} %{mcall-nt: -D_CALL_NT} \
%{mcall-aix: -D_CALL_AIX} %{mcall-aixdesc: -D_CALL_AIX -D_CALL_AIXDESC} \
%{!mcall-sysv: %{!mcall-aix: %{!mcall-aixdesc: %{!mcall-nt: -D_CALL_SYSV}}}} \
%{msoft-float: -D_SOFT_FLOAT} %{mcpu=403: -D_SOFT_FLOAT} \
%{mbig: -D_BIG_ENDIAN -Amachine(bigendian)} \
%{mbig-endian: -D_BIG_ENDIAN -Amachine(bigendian)} \
......@@ -50,5 +52,20 @@ Boston, MA 02111-1307, USA. */
%{mcpu=rsc1: -D_ARCH_PWR} \
%{mcpu=403: -D_ARCH_PPC} \
%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
%{mcpu=602: -D_ARCH_PPC} \
%{mcpu=603: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC}"
%{mcpu=603e: -D_ARCH_PPC} \
%{mcpu=604: -D_ARCH_PPC} \
%{mcpu=620: -D_ARCH_PPC}"
/* Define this macro as a C expression for the initializer of an
array of string to tell the driver program which options are
defaults for this target and thus do not need to be handled
specially when using `MULTILIB_OPTIONS'.
Do not define this macro if `MULTILIB_OPTIONS' is not defined in
the target makefile fragment or if none of the options listed in
`MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "mlittle", "mlittle-endian", "mcall-sysv" }
......@@ -2,6 +2,8 @@
LIBGCC1 =
CROSS_LIBGCC1 =
EXTRA_HEADERS = $(srcdir)/ginclude/ppc-asm.h
# These are really part of libgcc1, but this will cause them to be
# built correctly, so... [taken from t-sparclite]
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
......
......@@ -2,6 +2,8 @@
LIBGCC1 =
CROSS_LIBGCC1 =
EXTRA_HEADERS = $(srcdir)/ginclude/ppc-asm.h
# These are really part of libgcc1, but this will cause them to be
# built correctly, so... [taken from t-sparclite]
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
......@@ -16,15 +18,18 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
# Build libgcc.a with different options.
MULTILIB_OPTIONS = msoft-float \
mlittle
mlittle/mbig \
mcall-sysv/mcall-aix/mcall-aixdesc
MULTILIB_DIRNAMES = soft-float \
little-endian
little big \
sysv aix aixdesc
MULTILIB_MATCHES = mlittle=mlittle-endian \
msoft-float=mcpu?403 \
msoft-float=mcpu?mpc403 \
msoft-float=mcpu?ppc403
mbig=mbig-endian \
msoft-float=mcpu?403
MULTILIB_EXCEPTIONS = *mlittle/*mcall-aixdesc*
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment