Patch to remove re-assert warnings on powerpc-*-linux-*

Daniel Jacobowitz drow@false.org
Wed Mar 31 18:59:00 GMT 1999


On Mon, Mar 29, 1999 at 01:03:05PM -0500, Zack Weinberg wrote:
> On Mon, 29 Mar 1999 00:11:34 -0700, Jeffrey A Law wrote:
> >  > > >On Sat, Mar 27, 1999 at 11:03:50AM -0500, Zack Weinberg wrote:
> >  > > >> I think you can safely delete all references to CPP_OS_LINUX_SPEC.
> >  > > >> CPP_PREDEFINES is a much better place to do this sort of thing, if
> >  > > >> only because it gets the test for defining bare `unix' right.
> >I don't think this is correct.
> >
> >Look at how CPP_OS_LINUX_SPEC is used in CPP_SPEC.  
> >
> >Specifically, it supposed to be used to provide linux defines and assertions
> >when the -mcall-linux flag is given to the compiler.
> >
> >If you remove stuff from CPP_OS_LINUX_SPEC you will break that functionality.
> >This goes for both -D arguments and assertions.
> 
> I'm somewhat surprised that -mcall-linux implies -Dlinux (I thought
> -mcall-* only affected function calling conventions) but OK.

Seems somewhat nonintuitive, but:

`-mcall-linux'
     On System V.4 and embedded PowerPC systems compile code for the
     Linux-based GNU system.


> Dan, two things about your patch: Can't we get rid of the redefinition
> of CPP_PREDEFINES in rs6k/linux.h now?  And as long as you're there,

No, we really can't.  If we did, it would pick up the definition from
rs6000/svr4.h, giving us:
  "-DPPC -Dunix -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(powerpc)"

We don't want -D__svr4__ or -Asystem(svr4) as far as I can tell.  At
least based on what x86 has.

> you should go through and fix the conditional for defining bare macros
> in all the CPP_OS_*_SPEC defines.

Sure, might as well.  Patch the third attached.  The only other one
that needed to be fixed was Solaris.

Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|     CMU, CS class of 2002      |
|   Debian GNU/Linux Developer    __   Part-Time Systems Programmer  |
|         dan@debian.org         |  |        drow@cs.cmu.edu         |
\--------------------------------/  \--------------------------------/

Mon Mar 29 13:24:44 1999  Daniel Jacobowitz <dan@debian.org>

	* config/rs6000/sysv4.h (CPP_OS_LINUX_SPEC): Fix conditions
	for -Dunix and -Dlinux, and remove duplicate definition.
	(CPP_OS_SOLARIS_SPEC): Likewise for -Dunix and friends.

	* config/rs6000/linux.h (CPP_PREDEFINES): Remove -Dunix,
	-Dlinux, -Asystem(linux), and -Asystem(unix).  Add
	-Asystem(posix).


Index: sysv4.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/rs6000/sysv4.h,v
retrieving revision 1.17
diff -u -r1.17 sysv4.h
--- sysv4.h	1999/01/22 09:30:07	1.17
+++ sysv4.h	1999/03/29 18:18:43
@@ -1330,14 +1330,10 @@
 
 #ifndef CPP_OS_LINUX_SPEC
 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \
-%{!ansi: -Dunix -Dlinux } \
+%{!undef:%{!ansi:%{!std=*:-Dunix -Dlinux}%{std=gnu*:-Dunix -Dlinux}}}
 -Asystem(unix) -Asystem(linux)"
 #endif
 
-#ifndef CPP_OS_LINUX_SPEC
-#define CPP_OS_LINUX_SPEC ""
-#endif
-
 /* 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
@@ -1389,7 +1385,8 @@
 
 #ifndef CPP_OS_SOLARIS_SPEC
 #define CPP_OS_SOLARIS_SPEC "-D__ppc -D__sun__=1 -D__unix__ -D__svr4__  -D__SVR4__ \
-%{!ansi: -Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__ } \
+%{!undef:%{!ansi:%{!std=*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__} \
+               %{std=gnu*:-Dsun=1 -Dunix -DSVR4 -D__EXTENSIONS__}}} \
 -Amachine(prep)"
 #endif
 
Index: linux.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/rs6000/linux.h,v
retrieving revision 1.14
diff -u -r1.14 linux.h
--- linux.h	1999/02/02 19:10:15	1.14
+++ linux.h	1999/03/29 18:18:43
@@ -24,7 +24,7 @@
 
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES \
- "-DPPC -D__ELF__ -Dunix -Dlinux -Dpowerpc -Asystem(unix) -Asystem(linux) -Acpu(powerpc) -Amachine(powerpc)"
+ "-DPPC -D__ELF__ -Dpowerpc -Asystem(posix) -Acpu(powerpc) -Amachine(powerpc)"
 
 #undef	CPP_OS_DEFAULT_SPEC
 #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"



More information about the Gcc-patches mailing list