This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Partial new configuration: rs6000 hooks for OpenBSD


Let me explain the situation here. In reality, OpenBSD has had very
good support for PowerPc for quite a long time now.

However, we have constantly been playing catch-up with gcc.
Specifically,
- we have a gcc 2.95.x config that works.
- we have a gcc 3.2.x port that works.
- we have a gcc 3.3.x port that mostly works (I've still to figure what
the new unwinder is doing that doesn't work for us).

An annoying problem with the rs6000 configurations is the sysv4.h file...
It changes fairly often, and each time, I must synch our internal
configuration with it.

So, here is a patch to sysv4.h that adds the OpenBSD hooks we've been
using, adapted to the flavor of the day...

I am quite aware that this is not a complete configuration... there are
a few issues to work out in HEAD gcc until we have a running configuration
on OpenBSD.   But this would remove some drudge work burden, as modifying
this file again and again is no fun.

Two requests:
- does having this set a problem for anyone ? I am not asking anyone to
maintain or fix the OpenBSD stuff at this point. Just not having most of
the patch to adapt each time would be a big help.
- can you check that this does not prevent other rs6000 targets from
bootstrapping ?


And, of course, do you agree to this approach ? If you don't suggest
another approach... please keep in mind that I don't have as much time
to work on this as I would like, but this is the most sensible course of
action I could devise...

2003-11-17  Marc Espie  <espie@openbsd.org>

	* config/rs6000/sysv4.h: OpenBSD hooks.

Index: config/rs6000/sysv4.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/sysv4.h,v
retrieving revision 1.141
diff -c -p -r1.141 sysv4.h
*** config/rs6000/sysv4.h	1 Nov 2003 11:31:24 -0000	1.141
--- config/rs6000/sysv4.h	17 Nov 2003 12:57:07 -0000
*************** do {									\
*** 199,204 ****
--- 199,206 ----
      rs6000_current_abi = ABI_V4;					\
    else if (!strcmp (rs6000_abi_name, "netbsd"))				\
      rs6000_current_abi = ABI_V4;					\
+   else if (!strcmp (rs6000_abi_name, "openbsd"))			\
+     rs6000_current_abi = ABI_V4;					\
    else if (!strcmp (rs6000_abi_name, "i960-old"))			\
      {									\
        rs6000_current_abi = ABI_V4;					\
*************** extern int fixuplabelno;
*** 808,813 ****
--- 810,816 ----
    mcall-aixdesc |		   \
    mcall-freebsd |		   \
    mcall-netbsd  |		   \
+   mcall-openbsd |		   \
    mcall-linux   |		   \
    mcall-gnu             :-mbig;    \
    mcall-i960-old        :-mlittle}"
*************** extern int fixuplabelno;
*** 830,835 ****
--- 833,839 ----
    mcall-aixdesc |					  \
    mcall-freebsd |					  \
    mcall-netbsd  |					  \
+   mcall-openbsd |					  \
    mcall-linux   |					  \
    mcall-gnu             : -mbig %(cc1_endian_big);        \
    mcall-i960-old        : -mlittle %(cc1_endian_little);  \
*************** extern int fixuplabelno;
*** 842,848 ****
      %{mcall-i960-old: -meabi } \
      %{mcall-linux: -mno-eabi } \
      %{mcall-gnu: -mno-eabi } \
!     %{mcall-netbsd: -mno-eabi }}} \
  %{msdata: -msdata=default} \
  %{mno-sdata: -msdata=none} \
  %{profile: -p}"
--- 846,853 ----
      %{mcall-i960-old: -meabi } \
      %{mcall-linux: -mno-eabi } \
      %{mcall-gnu: -mno-eabi } \
!     %{mcall-netbsd: -mno-eabi } \
!     %{mcall-openbsd: -mno-eabi }}} \
  %{msdata: -msdata=default} \
  %{mno-sdata: -msdata=none} \
  %{profile: -p}"
*************** extern int fixuplabelno;
*** 875,880 ****
--- 880,886 ----
    mcall-linux  : %(link_start_linux)       ; \
    mcall-gnu    : %(link_start_gnu)         ; \
    mcall-netbsd : %(link_start_netbsd)      ; \
+   mcall-openbsd: %(link_start_openbsd)     ; \
                 : %(link_start_default)     }"
  
  #define LINK_START_DEFAULT_SPEC ""
*************** extern int fixuplabelno;
*** 932,937 ****
--- 938,944 ----
    mcall-linux  : %(link_os_linux)       ; \
    mcall-gnu    : %(link_os_gnu)         ; \
    mcall-netbsd : %(link_os_netbsd)      ; \
+   mcall-openbsd: %(link_os_openbsd)     ; \
                 : %(link_os_default)     }"
  
  #define LINK_OS_DEFAULT_SPEC ""
*************** extern int fixuplabelno;
*** 948,953 ****
--- 955,961 ----
    mcall-linux  : %(cpp_os_linux)       ; \
    mcall-gnu    : %(cpp_os_gnu)         ; \
    mcall-netbsd : %(cpp_os_netbsd)      ; \
+   mcall-openbsd: %(cpp_os_openbsd)     ; \
                 : %(cpp_os_default)     }"
  
  #define	CPP_OS_DEFAULT_SPEC ""
*************** extern int fixuplabelno;
*** 964,969 ****
--- 972,978 ----
    mcall-linux  : %(startfile_linux)       ; \
    mcall-gnu    : %(startfile_gnu)         ; \
    mcall-netbsd : %(startfile_netbsd)      ; \
+   mcall-openbsd: %(startfile_openbsd)     ; \
                 : %(startfile_default)     }"
  
  #define	STARTFILE_DEFAULT_SPEC ""
*************** extern int fixuplabelno;
*** 980,985 ****
--- 989,995 ----
    mcall-linux  : %(lib_linux)       ; \
    mcall-gnu    : %(lib_gnu)         ; \
    mcall-netbsd : %(lib_netbsd)      ; \
+   mcall-openbsd: %(lib_openbsd)     ; \
                 : %(lib_default)     }"
  
  #define LIB_DEFAULT_SPEC ""
*************** extern int fixuplabelno;
*** 996,1001 ****
--- 1006,1012 ----
    mcall-linux  : crtsavres.o%s        %(endfile_linux)       ; \
    mcall-gnu    : crtsavres.o%s        %(endfile_gnu)         ; \
    mcall-netbsd : crtsavres.o%s        %(endfile_netbsd)      ; \
+   mcall-openbsd: crtsavres.o%s        %(endfile_openbsd)     ; \
                 : %(crtsavres_default) %(endfile_default)     }"
  
  #define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
*************** ncrtn.o%s"
*** 1163,1168 ****
--- 1174,1207 ----
  #define CPP_OS_NETBSD_SPEC "\
  -D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__"
  
+ /* OpenBSD support.  */
+ #ifndef	LIB_OPENBSD_SPEC
+ #define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
+ #endif
+ 
+ #ifndef	STARTFILE_OPENBSD_SPEC
+ #define	STARTFILE_OPENBSD_SPEC "\
+ %{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
+ %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+ #endif
+ 
+ #ifndef	ENDFILE_OPENBSD_SPEC
+ #define	ENDFILE_OPENBSD_SPEC "\
+ %{!shared:crtend.o%s} %{shared:crtendS.o%s}"
+ #endif
+ 
+ #ifndef LINK_START_OPENBSD_SPEC
+ #define LINK_START_OPENBSD_SPEC "-Ttext 0x400074"
+ #endif
+ 
+ #ifndef LINK_OS_OPENBSD_SPEC
+ #define LINK_OS_OPENBSD_SPEC ""
+ #endif
+ 
+ #ifndef CPP_OS_OPENBSD_SPEC
+ #define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
+ #endif
+ 
  /* WindISS support.  */
  
  #define LIB_WINDISS_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group"
*************** ncrtn.o%s"
*** 1195,1200 ****
--- 1234,1240 ----
    { "lib_gnu",			LIB_GNU_SPEC },				\
    { "lib_linux",		LIB_LINUX_SPEC },			\
    { "lib_netbsd",		LIB_NETBSD_SPEC },			\
+   { "lib_openbsd",		LIB_OPENBSD_SPEC },			\
    { "lib_windiss",              LIB_WINDISS_SPEC },                     \
    { "lib_default",		LIB_DEFAULT_SPEC },			\
    { "startfile_ads",		STARTFILE_ADS_SPEC },			\
*************** ncrtn.o%s"
*** 1205,1210 ****
--- 1245,1251 ----
    { "startfile_gnu",		STARTFILE_GNU_SPEC },			\
    { "startfile_linux",		STARTFILE_LINUX_SPEC },			\
    { "startfile_netbsd",		STARTFILE_NETBSD_SPEC },		\
+   { "startfile_openbsd",	STARTFILE_OPENBSD_SPEC },		\
    { "startfile_windiss",        STARTFILE_WINDISS_SPEC },               \
    { "startfile_default",	STARTFILE_DEFAULT_SPEC },		\
    { "endfile_ads",		ENDFILE_ADS_SPEC },			\
*************** ncrtn.o%s"
*** 1215,1220 ****
--- 1256,1262 ----
    { "endfile_gnu",		ENDFILE_GNU_SPEC },			\
    { "endfile_linux",		ENDFILE_LINUX_SPEC },			\
    { "endfile_netbsd",		ENDFILE_NETBSD_SPEC },			\
+   { "endfile_openbsd",		ENDFILE_OPENBSD_SPEC },			\
    { "endfile_windiss",          ENDFILE_WINDISS_SPEC },                 \
    { "endfile_default",		ENDFILE_DEFAULT_SPEC },			\
    { "link_path",		LINK_PATH_SPEC },			\
*************** ncrtn.o%s"
*** 1229,1234 ****
--- 1271,1277 ----
    { "link_start_gnu",		LINK_START_GNU_SPEC },			\
    { "link_start_linux",		LINK_START_LINUX_SPEC },		\
    { "link_start_netbsd",	LINK_START_NETBSD_SPEC },		\
+   { "link_start_openbsd",	LINK_START_OPENBSD_SPEC },		\
    { "link_start_windiss",	LINK_START_WINDISS_SPEC },		\
    { "link_start_default",	LINK_START_DEFAULT_SPEC },		\
    { "link_os",			LINK_OS_SPEC },				\
*************** ncrtn.o%s"
*** 1240,1245 ****
--- 1283,1289 ----
    { "link_os_linux",		LINK_OS_LINUX_SPEC },			\
    { "link_os_gnu",		LINK_OS_GNU_SPEC },			\
    { "link_os_netbsd",		LINK_OS_NETBSD_SPEC },			\
+   { "link_os_openbsd",		LINK_OS_OPENBSD_SPEC },			\
    { "link_os_windiss",		LINK_OS_WINDISS_SPEC },			\
    { "link_os_default",		LINK_OS_DEFAULT_SPEC },			\
    { "cc1_endian_big",		CC1_ENDIAN_BIG_SPEC },			\
*************** ncrtn.o%s"
*** 1253,1258 ****
--- 1297,1303 ----
    { "cpp_os_gnu",		CPP_OS_GNU_SPEC },			\
    { "cpp_os_linux",		CPP_OS_LINUX_SPEC },			\
    { "cpp_os_netbsd",		CPP_OS_NETBSD_SPEC },			\
+   { "cpp_os_openbsd",		CPP_OS_OPENBSD_SPEC },			\
    { "cpp_os_windiss",           CPP_OS_WINDISS_SPEC },                  \
    { "cpp_os_default",		CPP_OS_DEFAULT_SPEC },			\
    SUBSUBTARGET_EXTRA_SPECS


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]