From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27800 invoked by alias); 16 Dec 2014 09:06:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27790 invoked by uid 89); 16 Dec 2014 09:06:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx6-phx2.redhat.com Received: from mx6-phx2.redhat.com (HELO mx6-phx2.redhat.com) (209.132.183.39) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 16 Dec 2014 09:06:14 +0000 Received: from zmail14.collab.prod.int.phx2.redhat.com (zmail14.collab.prod.int.phx2.redhat.com [10.5.83.16]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBG968M7020210; Tue, 16 Dec 2014 04:06:08 -0500 Date: Tue, 16 Dec 2014 09:06:00 -0000 From: Kai Tietz To: Eli Zaretskii Cc: Jan Kratochvil , brobecker@adacore.com, yao@codesourcery.com, gdb-patches@sourceware.org Message-ID: <655183031.28919631.1418720767970.JavaMail.zimbra@redhat.com> In-Reply-To: <83vblcw9hw.fsf@gnu.org> References: <87egs2vcfu.fsf@codesourcery.com> <20141215181449.GA5457@adacore.com> <20141215182057.GA22226@host2.jankratochvil.net> <20141215183554.GB5457@adacore.com> <20141215184014.GA22610@host2.jankratochvil.net> <83y4q8wxk7.fsf@gnu.org> <20141215222801.GA28138@host2.jankratochvil.net> <83vblcw9hw.fsf@gnu.org> Subject: Re: [patch] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-12/txt/msg00441.txt.bz2 ----- Urspr=C3=BCngliche Mail ----- > > Date: Mon, 15 Dec 2014 23:28:01 +0100 > > From: Jan Kratochvil > > Cc: brobecker@adacore.com, yao@codesourcery.com, > > gdb-patches@sourceware.org, > > ktietz@redhat.com > >=20 > > Even if it managed to load libcc1.so (it needs host-dependent name > > libcc1.dll) > > then it would soon end up at least on: > >=20 > > default_infcall_mmap: > > error (_("This target does not support inferior memory allocation by > > mmap.")); > >=20 > > As currently there is only: > >=20 > > linux-tdep.c: > > set_gdbarch_infcall_mmap (gdbarch, linux_infcall_mmap); >=20 > Why is mmap needed here? >=20 > > OK for check-in? > >=20 > >=20 > > Thanks, > > Jan > > gdb/ChangeLog > > 2014-12-15 Jan Kratochvil > >=20 > > Fix MinGW compilation. > > * compile/compile.c (get_compile_file_tempdir): Call error on _WIN32. > >=20 > > --- ./gdb/compile/compile.c 2014-12-14 02:48:38.000000000 +0100 > > +++ ./gdb/compile/compile.c 2014-12-15 23:21:28.788716340 +0100 > > @@ -191,7 +191,11 @@ get_compile_file_tempdir (void) > >=20=20 > > strcpy (tname, TEMPLATE); > > #undef TEMPLATE > > +#ifdef _WIN32 > > + error (_("mkdtemp needs to be implemented for MS-Windows hosts")); > > +#else > > tempdir_name =3D mkdtemp (tname); > > +#endif > > if (tempdir_name =3D=3D NULL) > > perror_with_name (_("Could not make temporary directory")); >=20 > I think _WIN32 will catch Cygwin as well, which is not what you want. >=20 > Why not just check HAVE_MKDTEMP? >=20 Well, _WIN32 isn't set necessarily for Cygwin. For Cygwin this define is j= ust set if the windows.h header got included AFAIK. Anyway, there are bett= er ways to check, and indeed HAVE_MKDTEMP seems to be the most correct chec= k, isn't it? Kai