From patchwork Wed Dec 17 18:17:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 4308 Received: (qmail 5808 invoked by alias); 17 Dec 2014 18:17:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 5798 invoked by uid 89); 17 Dec 2014 18:17:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 17 Dec 2014 18:17:16 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBHIHA08013469 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Dec 2014 13:17:10 -0500 Received: from host2.jankratochvil.net (ovpn-116-142.ams2.redhat.com [10.36.116.142]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sBHIH5s4005854 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 17 Dec 2014 13:17:07 -0500 Date: Wed, 17 Dec 2014 19:17:04 +0100 From: Jan Kratochvil To: Pedro Alves Cc: Eli Zaretskii , brobecker@adacore.com, yao@codesourcery.com, gdb-patches@sourceware.org, ktietz@redhat.com Subject: [patchv2] compile: Fix MinGW build [Re: [mingw rfc] Add mkdtemp to gdb/gnulib/] Message-ID: <20141217181704.GA21574@host2.jankratochvil.net> References: <87a92pvc0w.fsf@codesourcery.com> <20141215124358.GU5457@adacore.com> <20141215171225.GA19674@host2.jankratochvil.net> <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> <549165DE.9040005@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <549165DE.9040005@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes 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 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 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". diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 6d3d16e..414fc35 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -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")); diff --git a/gdb/config.in b/gdb/config.in index fb3c315..9d3f32d 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -231,6 +231,9 @@ /* Define to 1 if you have the 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 diff --git a/gdb/configure b/gdb/configure index 8985230..7ff74ba 100755 --- a/gdb/configure +++ b/gdb/configure @@ -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" diff --git a/gdb/configure.ac b/gdb/configure.ac index c933e3f..e972ac2 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -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 diff --git a/gdb/testsuite/gdb.compile/compile-ops.exp b/gdb/testsuite/gdb.compile/compile-ops.exp index c295836..4fc950f 100644 --- a/gdb/testsuite/gdb.compile/compile-ops.exp +++ b/gdb/testsuite/gdb.compile/compile-ops.exp @@ -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 } diff --git a/gdb/testsuite/gdb.compile/compile-setjmp.exp b/gdb/testsuite/gdb.compile/compile-setjmp.exp index 557c1f0..8f876e2 100644 --- a/gdb/testsuite/gdb.compile/compile-setjmp.exp +++ b/gdb/testsuite/gdb.compile/compile-setjmp.exp @@ -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 } diff --git a/gdb/testsuite/gdb.compile/compile-tls.exp b/gdb/testsuite/gdb.compile/compile-tls.exp index e9613f5..d95a351 100644 --- a/gdb/testsuite/gdb.compile/compile-tls.exp +++ b/gdb/testsuite/gdb.compile/compile-tls.exp @@ -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 } diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp index d0dd791..040b727 100644 --- a/gdb/testsuite/gdb.compile/compile.exp +++ b/gdb/testsuite/gdb.compile/compile.exp @@ -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 } diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 3a3a396..08087f2 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -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 $" { } }