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]

[patch] to gcc: force on <sys/wait.h> on 4.3BSD


Hi there,

The patch below is based on an earlier discussion of 4.3BSD <sys/wait.h>
problems. To recap, 4.3BSD's <sys/wait.h> is not POSIX-compliant in that the
WIFEXITED and WIFSIGNALED macros it defines expect a union wait argument and
apply the dot operator to it, and thus won't work with an int argument with an
ISO C or even a strict K&R C compiler. PCC, however, is not standards-compliant
and allows applying the dot operator to an int, and as a result masks the non-
POSIX-compliance of 4.3BSD's <sys/wait.h>. This causes trouble when
bootstrapping.

One of the solutions proposed in that discussion was to force no <sys/wait.h>
on 4.3BSD in the host macro file. This is the solution implemented by this
patch. Other solutions have also been proposed, including rerunning configure
on each stage of the bootstrap and making autoconf much cleverer and able to
detect the oddity that occurs on 4.3BSD with PCC, but those are much more major
changes, and given the scope and nature of this problem, I believe that this
simple patch is the best solution.

--
Michael Sokolov
Public Service Agent
International Engineering and Science Task Force

1351 VINE AVE APT 27		Phone: +1-714-738-5409
FULLERTON CA 92833-4291 USA	(home office)

E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP)

2001-01-03  Michael Sokolov  <msokolov@ivan.Harhan.ORG>

	* config/vax/xm-bsd.h: New file.
	* config.gcc (vax-*-bsd*): Use it.

*** /dev/null	Wed Jan  3 10:43:30 2001
--- config/vax/xm-bsd.h	Sun Dec 31 21:55:33 2000
***************
*** 0 ****
--- 1,26 ----
+ /* Additional VAX host macros specifically for Berkeley UNIX
+    Copyright (C) 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.  */
+ 
+ /* 4.3BSD's <sys/wait.h> is not POSIX-compliant (uses union wait instead of
+    int), but PCC hides this fact by allowing the dot operator on an int.  This
+    causes trouble for GCC during bootstrap as GCC definitely won't mirror this
+    bit of PCC's behavior, and in general we shouldn't be using native system
+    "features" that we dislike.  So, force no <sys/wait.h> on 4.3BSD.  */
+ #undef HAVE_SYS_WAIT_H
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config.gcc,v
retrieving revision 1.17
diff -p -r1.17 config.gcc
*** config.gcc	2001/01/02 02:53:47	1.17
--- config.gcc	2001/01/03 20:19:52
*************** v850-*-*)
*** 3280,3285 ****
--- 3280,3286 ----
  	cxx_target_objs="v850-c.o"
  	;;
  vax-*-bsd*)			# vaxen running BSD
+ 	xm_file="${xm_file} vax/xm-bsd.h"
  	use_collect2=yes
  	float_format=vax
  	;;

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