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]

Re: VAX Ultrix bootstrap failure with gcc-2.96


This shouldn't have been installed.  I thought the patch was dead after
Bruce pointed out that the configure test is done on the build system whereas
the fix has to be on the target.  Thus, this appoach won't work for a
cross.  That's why Bruce didn't install it.

My original patch using an #ifdef bsd4_2 in sys-protos.h does get propagated
through to unistd.h.  However, this also won't work for a cross.  Thus,
I was going to work up an inclhack to fix the problem before fix-header
does its work.  However, since the problem is more general than ultrix,
maybe there is a better approach?

There is one other #ifdef in sys-protos.h.  This may suffer the same
problems for cross builds.

Dave

> 
>  > From: Jeffrey A Law <law@cygnus.com>
>  > 
>  >   In message <200006051926.PAA00793@hiauly1.hia.nrc.ca>you write:
>  >   > > There is an autoconf test for this misfeature.
>  >   > > With that test added to configure, you can simply:
>  >   > > 
>  >   > > > +extern int                    getgroups(int, GETGROUPS_T *);
>  >   > > 
>  >   > 
>  >   > I believe that the following patch tests for the misfeature as per
>  >   > your suggestion.  I have checked that auto-hosts.h contains the
>  >   > GETGROUPS_T define.  However, I haven't tested yet whether this
>  >   > define gets propagated to the fixed sys/unistd.h under Ultrix.
>  >   > Hopefully, it will.
>  >   > 
>  >   > Dave
>  >   > -- 
>  >   > J. David Anglin                                  dave.anglin@nrc.ca
>  >   > National Research Council of Canada              (613) 990-0752 (FAX: 952-6
>  >   > 605)
>  >   > 
>  >   > 2000-06-05  J. David Anglin  <dave@hiauly1.hia.nrc.ca>
>  >   > 
>  >   > 	* configure.in: Add AC_TYPE_GETGROUPS test.
>  >   > 	* sys-protos.h: Use GETGROUPS_T * for second arg of getgroups.
>  >   > 	* configure: Rebuilt.
>  > 
>  > Thanks.  Installed.
>  > jeff
> 
> 
> Jeff, two problems:
> 
> 1.  You didn't regen config.in.
> 
> 2.  Even with config.in regenerated, this patch doesn't work.
> 
> The definition of GETGROUPS_T does not get propagated to unistd.h on
> sunos4.  I'd be surprised if it did on Ultrix.  Dave broke our testing
> rule and flat out said so, thus IMHO it should not have been checked in.
> 
> Okay, spilled milk.  Nuff said. :-)
> 
> 
> The problem lies in how xsys-protos.h is created and then used.  The
> creation step is:
> 
>  > cat deduced.h ../../egcs-CVS20000613/gcc/sys-protos.h > tmp-fixtmp.c
>  > mv tmp-fixtmp.c fixtmp.c
>  > ./xgcc -B/usr/local/sparc-sun-sunos4.1.4/bin/ -B./ -isystem
>  >        /usr/local/sparc-sun-sunos4.1.4/include fixtmp.c -w
>  >        -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E | sed -e
>  >        's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' |
>  >        ./gen-protos >xsys-protos.hT
>  > gen-protos: 1347 entries 340 collisions
> 
> The temporary fixtmp.c file created from deduced.h & sys-protos.h
> never sees auto-host.h here so there's no opportunity to do the
> GETGROUPS_T substitution.  IMO we rightfully don't include auto-host.h
> in this step because of all the other gobbledygook auto-host.h does.
> (E.g. think about the empty autoconf definition of "const" on K&R
> hosts and how it will screw up all the prototypes.)  Thus I don't
> recommend we simply cat auto-host.h in front of deduced.h.
> 
> Once xsys-protos.h is created, we're too late because its entry for
> getgroups looks like this:
> 
>  >   {"getgroups", "int", "int, GETGROUPS_T *", 0},
> 
> Notice that GETGROUPS_T is inside a double quoted string, so cpp macro
> substitution won't occur even though the use of xsys-protos.h in
> fix-header.c does include auto-host.h.
> 
> 
> Solution options:
> 
> 1.  Handle GETGROUPS_T like e.g. __SIZE_TYPE__ and teach gcc about it
> with a default of gid_t and an autoconf substitution in gcc source via
> auto-host.h when necessary.  Then we can leave GETGROUPS_T in unistd.h
> and we don't care cause it'll be substituted by gcc when compiling
> user code just like __SIZE_TYPE__ is.
> 
> Probably overkill IMO.
> 
> 2.  Somehow do the substituion in the xsys-protos.h creation pipeline.
> 
> E.g. a quick hack might be to change the first line of the creation
> step to:
> 
> (grep GETGROUPS_T auto-host.h ; cat deduced.h ../../egcs-CVS20000613/gcc/sys-protos.h) > tmp-fixtmp.c
> 
> This would stick "#define GETGROUPS_T int" at the top of fixtmp.c and
> it will DTRT when passed through gen-protos.  Maybe a cleaner more
> elegant variation of this approach can be created.
> 
> 3.  Something else?
> 
> 		--Kaveh
> 
> PS: Dave would be please confirm whether the currently installed
> GETGROUPS hackery works/fails for you on ultrix?  Remember to regen
> config.in before testing.  Thanks.
> 
> --
> Kaveh R. Ghazi			Engagement Manager / Project Services
> ghazi@caip.rutgers.edu		Qwest Internet Solutions
> 


-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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