summaryrefslogtreecommitdiff
path: root/gcc/config/rs6000
diff options
context:
space:
mode:
authorcagney <cagney@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-01 19:25:18 +0000
committercagney <cagney@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-01 19:25:18 +0000
commit93006578d2031216f781196b79b51e3a91b48717 (patch)
treec68b354c893c42ae0677cea5323bc79727e4e2b6 /gcc/config/rs6000
parent8e7f75ad4cf9ecfa1b96d1459edfefd73fb006c5 (diff)
downloadgcc-93006578d2031216f781196b79b51e3a91b48717.tar.gz
* config.gcc: Recognize powerpc-*-netbsd*.
* doc/install.texi (Host/target specific installation notes for GCC): Mention powerpc-*-netbsd*. * config/rs6000/netbsd.h: New file. (STANDARD_STARTFILE_PREFIX, LINK_SHLIB_SPEC): Redefine. (LIB_DEFAULT_SPEC, STARTFILE_DEFAULT_SPEC): Redefine. (ENDFILE_DEFAULT_SPEC, LINK_START_DEFAULT_SPEC): Redefine. (LINK_OS_DEFAULT_SPEC, CPP_OS_DEFAULT_SPEC): Redefine. (TARGET_VERSION): Redefine. * config/rs6000/t-ppccomm (MULTILIB_MATCHES_SYSV): Recognize mcall-netbsd as a match for mcall-sysv. (EXTRA_MULTILIB_PARTS): Add ncrti$(objext) and ncrtn$(objext). (ncrti.S, ncrtn.S): New targets. ($(T)ncrti$(objext), $(T)ncrtn$(objext)): New targets. * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Recognize "netbsd' as a V4 ABI. (ASM_SPEC): Check for -mcall-netbsd. (CC1_SPEC, CC1_SPEC, LINK_START_SPEC, LINK_OS_SPEC): Ditto. (CPP_ENDIAN_SPEC, CPP_SPEC, STARTFILE_SPEC): Ditto. (LIB_SPEC, ENDFILE_SPEC): Ditto. (LIB_NETBSD_SPEC, STARTFILE_NETBSD_SPEC): Define. (ENDFILE_NETBSD_SPEC, LINK_START_NETBSD_SPEC): Define. (LINK_OS_NETBSD_SPEC, CPP_OS_NETBSD_SPEC): Define. (SUBTARGET_EXTRA_SPECS): Add NetBSD specs. * doc/invoke.texi (Option Summary): Add -mcall-netbsd. (RS/6000 and PowerPC Options): Mention -mcall-netbsd. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44552 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r--gcc/config/rs6000/netbsd.h61
-rw-r--r--gcc/config/rs6000/sysv4.h63
-rw-r--r--gcc/config/rs6000/t-ppccomm25
3 files changed, 134 insertions, 15 deletions
diff --git a/gcc/config/rs6000/netbsd.h b/gcc/config/rs6000/netbsd.h
new file mode 100644
index 00000000000..9978db50231
--- /dev/null
+++ b/gcc/config/rs6000/netbsd.h
@@ -0,0 +1,61 @@
+/* Definitions of target machine for GNU compiler,
+ for PowerPC NetBSD systems.
+ Copyright 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. */
+
+/* Under NetBSD, the normal location of the various *crt*.o files is
+ the /usr/lib directory [from config/netbsd.h]. */
+
+#undef STANDARD_STARTFILE_PREFIX
+#define STANDARD_STARTFILE_PREFIX "/usr/lib/"
+
+/* FIXME: Should this macro be treated the same as for the other
+ spec's? */
+/* NOTE: -dc and -dp are equivalent yet NetBSD's CC passes both both!
+ NetBSD's CC also passes -O1 but we can skip that. NetBSD explictly
+ sets ``-e _start'', since LD knows this, skip it. */
+
+#undef LINK_SHLIB_SPEC
+#define LINK_SHLIB_SPEC "\
+%{shared:-shared} \
+%{!shared: %{static:-dc -dp -static}} \
+%{!shared: %{!static:-dc -dp}} \
+"
+
+/* Override the defaults. */
+#undef LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC "%(lib_netbsd)"
+
+#undef STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC "%(startfile_netbsd)"
+
+#undef ENDFILE_DEFAULT_SPEC
+#define ENDFILE_DEFAULT_SPEC "%(endfile_netbsd)"
+
+#undef LINK_START_DEFAULT_SPEC
+#define LINK_START_DEFAULT_SPEC "%(link_start_netbsd)"
+
+#undef LINK_OS_DEFAULT_SPEC
+#define LINK_OS_DEFAULT_SPEC "%(link_os_netbsd)"
+
+#undef CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "%(cpp_os_netbsd)"
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (PowerPC NetBSD/ELF)");
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index c8930c7e103..9871d20c1f6 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -275,6 +275,8 @@ do { \
rs6000_current_abi = ABI_AIX; \
else if (!strcmp (rs6000_abi_name, "linux")) \
rs6000_current_abi = ABI_V4; \
+ else if (!strcmp (rs6000_abi_name, "netbsd")) \
+ rs6000_current_abi = ABI_V4; \
else if (!strcmp (rs6000_abi_name, "solaris")) \
rs6000_current_abi = ABI_SOLARIS; \
else if (!strcmp (rs6000_abi_name, "i960-old")) \
@@ -1113,7 +1115,8 @@ do { \
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
%{mcall-solaris: -mlittle -msolaris} \
%{mcall-i960-old: -mlittle} \
- %{mcall-linux: -mbig} }}}}"
+ %{mcall-linux: -mbig} \
+ %{mcall-netbsd: -mbig} }}}}"
#define CC1_ENDIAN_BIG_SPEC ""
@@ -1135,9 +1138,10 @@ do { \
%{mcall-solaris: -mlittle %(cc1_endian_little) } \
%{mcall-i960-old: -mlittle %(cc1_endian_little) } \
%{mcall-linux: -mbig %(cc1_endian_big) } \
- %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-i960-old: %{!mcall-linux: \
+ %{mcall-netbsd: -mbig %(cc1_endian_big) } \
+ %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-netbsd: \
%(cc1_endian_default) \
- }}}} \
+ }}}}} \
}}}} \
%{mcall-solaris: -mregnames } \
%{mno-sdata: -msdata=none } \
@@ -1146,7 +1150,8 @@ do { \
%{mrelocatable: -meabi } \
%{mcall-solaris: -mno-eabi } \
%{mcall-i960-old: -meabi } \
- %{mcall-linux: -mno-eabi }}} \
+ %{mcall-linux: -mno-eabi } \
+ %{mcall-netbsd: -mno-eabi }}} \
%{msdata: -msdata=default} \
%{mno-sdata: -msdata=none} \
%{profile: -p}"
@@ -1175,8 +1180,9 @@ do { \
%{mmvme: %(link_start_mvme) } \
%{msim: %(link_start_sim) } \
%{mcall-linux: %(link_start_linux) } \
+%{mcall-netbsd: %(link_start_netbsd) } \
%{mcall-solaris: %(link_start_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_start_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_start_default) }}}}}}}"
#define LINK_START_DEFAULT_SPEC ""
@@ -1230,8 +1236,9 @@ do { \
%{mmvme: %(link_os_mvme) } \
%{msim: %(link_os_sim) } \
%{mcall-linux: %(link_os_linux) } \
+%{mcall-netbsd: %(link_os_netbsd) } \
%{mcall-solaris: %(link_os_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(link_os_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_os_default) }}}}}}}"
#define LINK_OS_DEFAULT_SPEC ""
@@ -1278,9 +1285,10 @@ do { \
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
%{mcall-solaris: %(cpp_endian_solaris) } \
%{mcall-linux: %(cpp_endian_big) } \
+ %{mcall-netbsd: %(cpp_endian_big) } \
%{mcall-i960-old: %(cpp_endian_little) } \
%{mcall-aixdesc: %(cpp_endian_big) } \
- %{!mcall-solaris: %{!mcall-linux: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}"
+ %{!mcall-solaris: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}"
#define CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
@@ -1292,8 +1300,9 @@ do { \
%{mmvme: %(cpp_os_mvme) } \
%{msim: %(cpp_os_sim) } \
%{mcall-linux: %(cpp_os_linux) } \
+%{mcall-netbsd: %(cpp_os_netbsd) } \
%{mcall-solaris: %(cpp_os_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(cpp_os_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(cpp_os_default) }}}}}}}"
#define CPP_OS_DEFAULT_SPEC ""
@@ -1305,8 +1314,9 @@ do { \
%{mmvme: %(startfile_mvme) } \
%{msim: %(startfile_sim) } \
%{mcall-linux: %(startfile_linux) } \
+%{mcall-netbsd: %(startfile_netbsd) } \
%{mcall-solaris: %(startfile_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(startfile_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(startfile_default) }}}}}}}"
#define STARTFILE_DEFAULT_SPEC ""
@@ -1318,8 +1328,9 @@ do { \
%{mmvme: %(lib_mvme) } \
%{msim: %(lib_sim) } \
%{mcall-linux: %(lib_linux) } \
+%{mcall-netbsd: %(lib_netbsd) } \
%{mcall-solaris: %(lib_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %(lib_default) }}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(lib_default) }}}}}}}"
#define LIB_DEFAULT_SPEC ""
@@ -1331,9 +1342,10 @@ do { \
%{mmvme: %(endfile_mvme)} \
%{msim: %(endfile_sim)} \
%{mcall-linux: %(endfile_linux) } \
+%{mcall-netbsd: %(endfile_netbsd) } \
%{mcall-solaris: %(endfile_solaris)} \
%{mvxworks: %(endfile_vxworks) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}}"
#define ENDFILE_DEFAULT_SPEC ""
@@ -1429,6 +1441,29 @@ do { \
-Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
#endif
+/* NetBSD support. */
+#define LIB_NETBSD_SPEC "\
+%{profile:-lgmon -lc_p} %{!profile:-lc}"
+
+#define STARTFILE_NETBSD_SPEC "\
+ncrti.o%s crt0.o%s \
+%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+#define ENDFILE_NETBSD_SPEC "\
+%{!shared:crtend.o%s} %{shared:crtendS.o%s} \
+ncrtn.o%s"
+
+#define LINK_START_NETBSD_SPEC "\
+"
+
+#define LINK_OS_NETBSD_SPEC "\
+%{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}}}"
+
+#define CPP_OS_NETBSD_SPEC "\
+-D__powerpc__ -D__NetBSD__ -D__ELF__ -D__KPRINTF_ATTRIBUTE__"
+
/* Solaris support. */
/* For Solaris, Gcc automatically adds in one of the files
/usr/ccs/lib/values-Xc.o, /usr/ccs/lib/values-Xa.o, or
@@ -1524,6 +1559,7 @@ do { \
{ "lib_mvme", LIB_MVME_SPEC }, \
{ "lib_sim", LIB_SIM_SPEC }, \
{ "lib_linux", LIB_LINUX_SPEC }, \
+ { "lib_netbsd", LIB_NETBSD_SPEC }, \
{ "lib_solaris", LIB_SOLARIS_SPEC }, \
{ "lib_vxworks", LIB_VXWORKS_SPEC }, \
{ "lib_default", LIB_DEFAULT_SPEC }, \
@@ -1532,6 +1568,7 @@ do { \
{ "startfile_mvme", STARTFILE_MVME_SPEC }, \
{ "startfile_sim", STARTFILE_SIM_SPEC }, \
{ "startfile_linux", STARTFILE_LINUX_SPEC }, \
+ { "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \
{ "startfile_solaris", STARTFILE_SOLARIS_SPEC }, \
{ "startfile_vxworks", STARTFILE_VXWORKS_SPEC }, \
{ "startfile_default", STARTFILE_DEFAULT_SPEC }, \
@@ -1540,6 +1577,7 @@ do { \
{ "endfile_mvme", ENDFILE_MVME_SPEC }, \
{ "endfile_sim", ENDFILE_SIM_SPEC }, \
{ "endfile_linux", ENDFILE_LINUX_SPEC }, \
+ { "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \
{ "endfile_solaris", ENDFILE_SOLARIS_SPEC }, \
{ "endfile_vxworks", ENDFILE_VXWORKS_SPEC }, \
{ "endfile_default", ENDFILE_DEFAULT_SPEC }, \
@@ -1552,6 +1590,7 @@ do { \
{ "link_start_mvme", LINK_START_MVME_SPEC }, \
{ "link_start_sim", LINK_START_SIM_SPEC }, \
{ "link_start_linux", LINK_START_LINUX_SPEC }, \
+ { "link_start_netbsd", LINK_START_NETBSD_SPEC }, \
{ "link_start_solaris", LINK_START_SOLARIS_SPEC }, \
{ "link_start_vxworks", LINK_START_VXWORKS_SPEC }, \
{ "link_start_default", LINK_START_DEFAULT_SPEC }, \
@@ -1561,6 +1600,7 @@ do { \
{ "link_os_mvme", LINK_OS_MVME_SPEC }, \
{ "link_os_sim", LINK_OS_SIM_SPEC }, \
{ "link_os_linux", LINK_OS_LINUX_SPEC }, \
+ { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
{ "link_os_solaris", LINK_OS_SOLARIS_SPEC }, \
{ "link_os_vxworks", LINK_OS_VXWORKS_SPEC }, \
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
@@ -1577,6 +1617,7 @@ do { \
{ "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
{ "cpp_os_sim", CPP_OS_SIM_SPEC }, \
{ "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
+ { "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \
{ "cpp_os_solaris", CPP_OS_SOLARIS_SPEC }, \
{ "cpp_os_vxworks", CPP_OS_VXWORKS_SPEC }, \
{ "cpp_os_default", CPP_OS_DEFAULT_SPEC },
diff --git a/gcc/config/rs6000/t-ppccomm b/gcc/config/rs6000/t-ppccomm
index 73e0ff7e081..8b5e8cba142 100644
--- a/gcc/config/rs6000/t-ppccomm
+++ b/gcc/config/rs6000/t-ppccomm
@@ -33,16 +33,19 @@ MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \
msoft-float=mcpu?823 \
msoft-float=mcpu?860
MULTILIB_MATCHES_ENDIAN = mlittle=mlittle-endian mbig=mbig-endian
-MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux
+MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux mcall-sysv=mcall-netbsd
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
crtbeginS$(objext) crtendS$(objext) \
- ecrti$(objext) ecrtn$(objext) scrt0$(objext) scrti$(objext) scrtn$(objext)
+ ecrti$(objext) ecrtn$(objext) \
+ scrt0$(objext) scrti$(objext) scrtn$(objext) \
+ ncrti$(objext) ncrtn$(objext)
-# We build {e,s}crti.o, {e,s}crtn.o, and scrt0.o which serve to add begin and
-# end labels to all of the special sections used when we link using gcc.
+# We build {e,s}crti.o, {e,s}crtn.o, and {s,n}crt0.o which serve to
+# add begin and end labels to all of the special sections used when we
+# link using gcc.
# Assemble startup files.
ecrti.S: $(srcdir)/config/rs6000/eabi-ci.asm
@@ -51,6 +54,14 @@ ecrti.S: $(srcdir)/config/rs6000/eabi-ci.asm
ecrtn.S: $(srcdir)/config/rs6000/eabi-cn.asm
cat $(srcdir)/config/rs6000/eabi-cn.asm >ecrtn.S
+ncrti.S: $(srcdir)/config/rs6000/sol-ci.asm
+ sed -e 's/__init/_init/' -e 's/__fini/_fini/' \
+ $(srcdir)/config/rs6000/sol-ci.asm >ncrti.S
+
+ncrtn.S: $(srcdir)/config/rs6000/sol-cn.asm
+ sed -e 's/__init/_init/' -e 's/__fini/_fini/' \
+ $(srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
+
scrti.S: $(srcdir)/config/rs6000/sol-ci.asm
cat $(srcdir)/config/rs6000/sol-ci.asm >scrti.S
@@ -67,6 +78,12 @@ $(T)ecrti$(objext): ecrti.S
$(T)ecrtn$(objext): ecrtn.S
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ecrtn.S -o $(T)ecrtn$(objext)
+$(T)ncrti$(objext): ncrti.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrti.S -o $(T)ncrti$(objext)
+
+$(T)ncrtn$(objext): ncrtn.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrtn.S -o $(T)ncrtn$(objext)
+
$(T)scrti$(objext): scrti.S
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c scrti.S -o $(T)scrti$(objext)