[patchv2] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/]
Commit Message
On Wed, 17 Dec 2014 12:15:42 +0100, Pedro Alves wrote:
> Can you send a version that does an autoconf check for mkdtemp instead?
Done.
> > + error (_("mkdtemp needs to be implemented for MS-Windows hosts"));
>
> I think the error text should be a bit more generic and not mention a
> particular implementation detail, like "Command not supported on this host." or
> some such
Done.
> I think the testsuite will need to be extended to handle this error,
> presumably in skip_compile_feature_tests.
Done.
Tested it does build on Fedora 21 x86_64 mingw64 for 32-bit and 64-bit
.exe targets.
OK for check-in?
Thanks,
Jan
gdb/ChangeLog
2014-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix MinGW compilation.
* compile/compile.c (get_compile_file_tempdir): Call error if
!HAVE_MKDTEMP.
* config.in: Regenerate.
* configure: Regenerate.
* configure.ac (AC_CHECK_FUNCS): Add mkdtemp.
gdb/testsuite/ChangeLog
2014-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix MinGW compilation.
* gdb.compile/compile-ops.exp: Update untested message if
!skip_compile_feature_tests.
* gdb.compile/compile-setjmp.exp: Likewise.
* gdb.compile/compile-tls.exp: Likewise.
* gdb.compile/compile.exp: Likewise.
* lib/gdb.exp (skip_compile_feature_tests): Check also "Command not
supported on this host".
Comments
On 12/17/2014 06:17 PM, Jan Kratochvil wrote:
> OK for check-in?
OK.
Thanks,
Pedro Alves
On Wed, 17 Dec 2014 19:33:38 +0100, Pedro Alves wrote:
> On 12/17/2014 06:17 PM, Jan Kratochvil wrote:
>
> > OK for check-in?
>
> OK.
Checked in:
1bc1068a0c1a1a0fad09500c97edf88467de9be0
Thanks,
Jan
@@ -191,7 +191,11 @@ get_compile_file_tempdir (void)
strcpy (tname, TEMPLATE);
#undef TEMPLATE
+#ifdef HAVE_MKDTEMP
tempdir_name = mkdtemp (tname);
+#else
+ error (_("Command not supported on this host."));
+#endif
if (tempdir_name == NULL)
perror_with_name (_("Could not make temporary directory"));
@@ -231,6 +231,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `mkdtemp' function. */
+#undef HAVE_MKDTEMP
+
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
@@ -10496,7 +10496,7 @@ for ac_func in getrusage getuid getgid \
sigaction sigprocmask sigsetmask socketpair \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
setrlimit getrlimit posix_madvise waitpid \
- ptrace64 sigaltstack
+ ptrace64 sigaltstack mkdtemp
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -1317,7 +1317,7 @@ AC_CHECK_FUNCS([getrusage getuid getgid \
sigaction sigprocmask sigsetmask socketpair \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
setrlimit getrlimit posix_madvise waitpid \
- ptrace64 sigaltstack])
+ ptrace64 sigaltstack mkdtemp])
AM_LANGINFO_CODESET
GDB_AC_COMMON
@@ -411,7 +411,7 @@ if ![runto func] {
}
if {[skip_compile_feature_tests]} {
- untested "could not find libcc1 shared library"
+ untested "compile command not supported (could not find libcc1 shared library?)"
return -1
}
@@ -24,7 +24,7 @@ if ![runto_main] {
}
if {[skip_compile_feature_tests]} {
- untested "could not find libcc1 shared library"
+ untested "compile command not supported (could not find libcc1 shared library?)"
return -1
}
@@ -27,7 +27,7 @@ if ![runto_main] then {
}
if {[skip_compile_feature_tests]} {
- untested "could not find libcc1 shared library"
+ untested "compile command not supported (could not find libcc1 shared library?)"
return -1
}
@@ -57,7 +57,7 @@ if ![runto_main] {
}
if {[skip_compile_feature_tests]} {
- untested "could not find libcc1 shared library"
+ untested "compile command not supported (could not find libcc1 shared library?)"
return -1
}
@@ -2538,6 +2538,9 @@ proc skip_compile_feature_tests {} {
"Could not load libcc1.*\r\n$gdb_prompt $" {
set result 1
}
+ -re "Command not supported on this host\\..*\r\n$gdb_prompt $" {
+ set result 1
+ }
-re "\r\n$gdb_prompt $" {
}
}