This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/]
- From: Kai Tietz <ktietz at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, brobecker at adacore dot com, yao at codesourcery dot com, gdb-patches at sourceware dot org
- Date: Tue, 16 Dec 2014 04:06:07 -0500 (EST)
- Subject: Re: [patch] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/]
- Authentication-results: sourceware.org; auth=none
- References: <87egs2vcfu dot fsf at codesourcery dot com> <20141215181449 dot GA5457 at adacore dot com> <20141215182057 dot GA22226 at host2 dot jankratochvil dot net> <20141215183554 dot GB5457 at adacore dot com> <20141215184014 dot GA22610 at host2 dot jankratochvil dot net> <83y4q8wxk7 dot fsf at gnu dot org> <20141215222801 dot GA28138 at host2 dot jankratochvil dot net> <83vblcw9hw dot fsf at gnu dot org>
----- UrsprÃngliche Mail -----
> > Date: Mon, 15 Dec 2014 23:28:01 +0100
> > From: Jan Kratochvil <jan.kratochvil@redhat.com>
> > Cc: brobecker@adacore.com, yao@codesourcery.com,
> > gdb-patches@sourceware.org,
> > ktietz@redhat.com
> >
> > Even if it managed to load libcc1.so (it needs host-dependent name
> > libcc1.dll)
> > then it would soon end up at least on:
> >
> > default_infcall_mmap:
> > error (_("This target does not support inferior memory allocation by
> > mmap."));
> >
> > As currently there is only:
> >
> > linux-tdep.c:
> > set_gdbarch_infcall_mmap (gdbarch, linux_infcall_mmap);
>
> Why is mmap needed here?
>
> > OK for check-in?
> >
> >
> > Thanks,
> > Jan
> > gdb/ChangeLog
> > 2014-12-15 Jan Kratochvil <jan.kratochvil@redhat.com>
> >
> > Fix MinGW compilation.
> > * compile/compile.c (get_compile_file_tempdir): Call error on _WIN32.
> >
> > --- ./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)
> >
> > strcpy (tname, TEMPLATE);
> > #undef TEMPLATE
> > +#ifdef _WIN32
> > + error (_("mkdtemp needs to be implemented for MS-Windows hosts"));
> > +#else
> > tempdir_name = mkdtemp (tname);
> > +#endif
> > if (tempdir_name == NULL)
> > perror_with_name (_("Could not make temporary directory"));
>
> I think _WIN32 will catch Cygwin as well, which is not what you want.
>
> Why not just check HAVE_MKDTEMP?
>
Well, _WIN32 isn't set necessarily for Cygwin. For Cygwin this define is just set if the windows.h header got included AFAIK. Anyway, there are better ways to check, and indeed HAVE_MKDTEMP seems to be the most correct check, isn't it?
Kai