]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix MinGW compilation
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 17 Dec 2014 19:09:02 +0000 (20:09 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 17 Dec 2014 19:09:02 +0000 (20:09 +0100)
On Sun, 14 Dec 2014 07:00:28 +0100, Yao Qi wrote:
The build on mingw host is broken because mingw has no mkdtemp.

../../../git/gdb/compile/compile.c: In function 'get_compile_file_tempdir':
../../../git/gdb/compile/compile.c:194:3: error: implicit declaration of function 'mkdtemp' [-Werror=implicit-function-declaration]
   tempdir_name = mkdtemp (tname);
   ^
../../../git/gdb/compile/compile.c:194:16: error: assignment makes pointer from integer without a cast [-Werror]
   tempdir_name = mkdtemp (tname);
                ^
cc1: all warnings being treated as errors

In the end I have managed to test it by Wine myself:

$ wine build_win32/gdb/gdb.exe -q build_win32/gdb/gdb.exe -ex start -ex 'compile code 1' -ex 'set confirm no' -ex quit
[...]
Temporary breakpoint 1, main (argc=1, argv=0x241418) at ../../gdb/gdb.c:29
29        args.argc = argc;
Could not load libcc1.so: Module not found.

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);

While one could debug Linux targets from MS-Windows host I find it somehow
overcomplicated now when we are trying to get it running at least on native
Linux x86*.

The 'compile' project needs a larger port effort to run on MS-Windows.

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".

gdb/ChangeLog
gdb/compile/compile.c
gdb/config.in
gdb/configure
gdb/configure.ac
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.compile/compile-ops.exp
gdb/testsuite/gdb.compile/compile-setjmp.exp
gdb/testsuite/gdb.compile/compile-tls.exp
gdb/testsuite/gdb.compile/compile.exp
gdb/testsuite/lib/gdb.exp

index b672dc3eec52a4b2298f18e1d8675f4d7aafed26..42ace6de1f69b768bf4978e795a1d76682f45d88 100644 (file)
@@ -1,3 +1,12 @@
+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.
+
 2014-12-17  Doug Evans  <xdje42@gmail.com>
 
        * valops.c (value_maybe_namespace_elt): Remove redundant call to
index 6d3d16ebdfaa45b67cba60ba8fe9f5c27c6cc194..414fc35f6c306eca2ea4353b0189f69a3a4908c4 100644 (file)
@@ -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"));
 
index fb3c315571ceb11aafb2c34b563dc25454ec52ea..9d3f32d6b6733cd7b03afc94c2d0eea372a9d255 100644 (file)
 /* 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
 
index 89852304d52b640a98f90674d8c8921418300f3c..7ff74badbf7ceaeec6320a3739c25d9e86cb0eb9 100755 (executable)
@@ -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"
index c933e3fd53192d3a7bae006a95b878f499ee011d..e972ac2ab110ee97e4e177b087297471f6b4abd4 100644 (file)
@@ -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
 
index 9e69efc13106f72ec74da3f3a38618f64c805b88..f749d2e313658c7922caaf152b2a97c9bc62b2c7 100644 (file)
@@ -1,3 +1,14 @@
+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".
+
 2014-12-16  Doug Evans  <xdje42@gmail.com>
 
        * boards/stabs.exp: New file.
index c295836450e2f6d02cec75a66f61ee2dc0ca3af0..4fc950f32a8f8b0f89bc2635b8b7efdd07ab0f05 100644 (file)
@@ -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
 }
 
index 557c1f0c4db8f631830e7701d24709ceca6b7271..8f876e20b310d3148c7a7af5bfdc0c911d9cf189 100644 (file)
@@ -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
 }
 
index e9613f539822096cf930e85c9ad884526cc3ed74..d95a3511aca80f07ca8d92998e7a0c3dc1109441 100644 (file)
@@ -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
 }
 
index d0dd7913e6a4c3a7c8a3a3cbcac8528a31733cfc..040b7278998894a7c15534cc2e0bc394b15ac06d 100644 (file)
@@ -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
 }
 
index 3a3a3964f89c97c915763bac55e3c64fbbebb01e..08087f242f6c496472b83040aac11769e7680d3a 100644 (file)
@@ -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 $" {
        }
     }