This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: VAX Ultrix bootstrap failure with gcc-2.96
- To: dave at hiauly1 dot hia dot nrc dot ca (John David Anglin)
- Subject: Re: VAX Ultrix bootstrap failure with gcc-2.96
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Tue, 20 Jun 2000 12:54:50 -0400 (EDT)
- Cc: ghazi at caip dot rutgers dot edu, bkorb at sco dot COM, gcc-patches at gcc dot gnu dot org
I have run a complete bootstrap cycle with this patch under hpux 10.20.
Please review for installation.
Dave
>
> > Yes, I understand the namespace pollution issue. I think the solution
> > that Dave is working on will not leave GETGROUPS_T in unistd.h, but I
> > have yet to actually see it. :-)
>
> Here is the patch for review.
>
> --
> J. David Anglin dave.anglin@nrc.ca
> National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
>
> 2000-06-16 J. David Anglin <dave@hiauly1.hia.nrc.ca>
>
> * Makefile.in (TARGET_GETGROUPS_T): New configuration variable.
> * configure.in (TARGET_GETGROUPS_T): Evaluate.
> * sys-protos.h (getgroups): Use TARGET_GETGROUPS_T for array type
> of second argument of getgroups.
> * configure, config.in: Rebuilt.
>
> --- Makefile.in.orig Thu Jun 15 19:15:07 2000
> +++ Makefile.in Thu Jun 15 19:26:43 2000
> @@ -130,6 +130,9 @@
> [ -f $(RANLIB) ] \
> || [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
>
> +# Substitution type for target's getgroups 2nd arg.
> +TARGET_GETGROUPS_T = @TARGET_GETGROUPS_T@
> +
> # Compiler to use for compiling libgcc1.a.
> # OLDCC should not be the GNU C compiler,
> # since that would compile typical libgcc1.a functions such as mulsi3
> @@ -1839,7 +1842,8 @@
> SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
> stmp-int-hdrs
> -rm -f SYSCALLS.c tmp-SYSCALLS.s
> - cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
> + sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
> + $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
> $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
> -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
> -rm -f SYSCALLS.c tmp-SYSCALLS.s
> @@ -1996,7 +2000,8 @@
> $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c
>
> xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile
> - cat deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
> + sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
> + deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
> mv tmp-fixtmp.c fixtmp.c
> $(GCC_FOR_TARGET) 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/( )/()/' \
> --- configure.in.orig Thu Jun 15 18:24:15 2000
> +++ configure.in Thu Jun 15 21:06:05 2000
> @@ -480,6 +480,26 @@
>
> AC_CHECK_TYPE(ssize_t, int)
>
> +# Try to determine the array type of the second argument of getgroups
> +# for the target system (int or gid_t).
> +AC_TYPE_GETGROUPS
> +if test "${target}" = "${build}"; then
> + TARGET_GETGROUPS_T=$ac_cv_type_getgroups
> +else
> + case "${target}" in
> + # This condition may need some tweaking. It should include all
> + # targets where the array type of the second argument of getgroups
> + # is int and the type of gid_t is not equivalent to int.
> + *-*-sunos* | *-*-ultrix*)
> + TARGET_GETGROUPS_T=int
> + ;;
> + *)
> + TARGET_GETGROUPS_T=gid_t
> + ;;
> + esac
> +fi
> +AC_SUBST(TARGET_GETGROUPS_T)
> +
> gcc_AC_FUNC_VFPRINTF_DOPRNT
> gcc_AC_FUNC_PRINTF_PTR
>
> --- sys-protos.h.orig Thu Jun 15 00:01:55 2000
> +++ sys-protos.h Thu Jun 15 19:43:49 2000
> @@ -445,7 +445,7 @@
> extern struct group * getgrent(void);
> extern struct group * getgrgid(gid_t);
> extern struct group * getgrnam(const char *);
> -extern int getgroups(int, gid_t *);
> +extern int getgroups(int, TARGET_GETGROUPS_T []);
> extern struct hostent * gethostbyaddr(/* ??? */);
> extern struct hostent * gethostbyname(/* ??? */);
> extern struct hostent * gethostent(/* ??? */);
>
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)