This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch lto-plugin]: Don't use sys/wait.h for mingw targets
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 30 Nov 2010 12:29:48 +0100
- Subject: Re: [patch lto-plugin]: Don't use sys/wait.h for mingw targets
- References: <AANLkTinO4Yw0DBBYyouNSMPkN3UsVUQ=+QTaOJUVh3wN@mail.gmail.com>
On Tue, Nov 30, 2010 at 8:05 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Hello,
>
> in lto-plugin.c there is the header sys/wait.h used, which isn't
> present for mingw targets. This patch adds check for this header and
> make its use conditionally. Rest of the patch is the result of a
> 'autoreconf -I ../conf'.
>
> 2010-11-30 ?Kai Tietz
>
> ? ? ? ?* config.h.in: Regenerated.
> ? ? ? ?* configure: Regenerated.
> ? ? ? ?* Makefile.in: Regenerated.
> ? ? ? ?* configure.ac (AC_CHECK_HEADERS): Check for sys/wait.h.
> ? ? ? ?* lto-plugin.c: ?Include sys/wait.h conditionally.
> ? ? ? ?* aclocal.m4: Regenerated.
>
> Tested for x86_64-w64-mingw32, i686-pc-mingw32, and i686-pc-cygwin. Ok
> for apply?
>
> Regards,
> Kai
>
> --
> |? (\_/) This is Bunny. Copy and paste
> | (='.'=) Bunny into your signature to help
> | (")_(") him gain world domination
>
> Index: configure.ac
> ===================================================================
> --- configure.ac ? ? ? ?(revision 167289)
> +++ configure.ac ? ? ? ?(working copy)
> @@ -22,6 +22,7 @@
> ?esac
> ?AC_TYPE_INT64_T
> ?AC_TYPE_UINT64_T
> +AC_CHECK_HEADERS(sys/wait.h)
> ?AC_CONFIG_FILES(Makefile)
> ?AC_CONFIG_HEADERS(config.h)
Just append sys/wait.h to config.h here.
Ok with that change.
Thanks,
Richard.
> ?AC_OUTPUT
> Index: lto-plugin.c
> ===================================================================
> --- lto-plugin.c ? ? ? ?(revision 167289)
> +++ lto-plugin.c ? ? ? ?(working copy)
> @@ -47,7 +47,9 @@
> ?#include <unistd.h>
> ?#include <fcntl.h>
> ?#include <sys/types.h>
> +#ifdef HAVE_SYS_WAIT_H
> ?#include <sys/wait.h>
> +#endif
> ?#include <libiberty.h>
> ?#include <hashtab.h>
> ?#include "../gcc/lto/common.h"
>