From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19944 invoked by alias); 15 Mar 2013 11:06:18 -0000 Received: (qmail 19936 invoked by uid 22791); 15 Mar 2013 11:06:17 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Mar 2013 11:06:12 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UGSSg-00001A-AJ from Yao_Qi@mentor.com ; Fri, 15 Mar 2013 04:06:10 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 15 Mar 2013 04:06:10 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Fri, 15 Mar 2013 04:06:09 -0700 Message-ID: <51430063.2060007@codesourcery.com> Date: Fri, 15 Mar 2013 11:06:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Pierre Muller CC: Subject: Re: Compilation failure for mingw64 target (was New ARI warning Fri Mar 15 02:02:12 UTC 2013 in -D 2013-03-15-gmt) References: <20130315020212.GA23545@sourceware.org> <5142E409.5090109@codesourcery.com> <002901ce2162$414d7530$c3e85f90$@muller@ics-cnrs.unistra.fr> In-Reply-To: <002901ce2162$414d7530$c3e85f90$@muller@ics-cnrs.unistra.fr> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 X-SW-Source: 2013-03/txt/msg00663.txt.bz2 Sorry for breaking the build for mingw target. On 03/15/2013 05:48 PM, Pierre Muller wrote: > ../../src/gdb/ctf.c: In function 'ctf_save_metadata_header': > ../../src/gdb/ctf.c:223:7: erreur: 'BYTE_ORDER' undeclared (first use in this fu > nction) > ../../src/gdb/ctf.c:223:7: note: each undeclared identifier is reported only onc > e for each function it appears in > ../../src/gdb/ctf.c:223:21: erreur: 'LITTLE_ENDIAN' undeclared (first use in thi > s function) This problem is addressed by using "native" endianness in CTF metadata, so BYTE_ORDER and LITTLE_ENDIAN can be avoided. > ../../src/gdb/ctf.c: In function 'ctf_start': > ../../src/gdb/ctf.c:279:33: erreur: 'S_IRGRP' undeclared (first use in this func > tion) > ../../src/gdb/ctf.c:279:43: erreur: 'S_IXGRP' undeclared (first use in this func > tion) > ../../src/gdb/ctf.c:279:53: erreur: 'S_IROTH' undeclared (first use in this func > tion) > ../../src/gdb/ctf.c:279:63: erreur: 'S_IXOTH' undeclared (first use in this func > tion) These modes are not necessary. Removed. > ../../src/gdb/ctf.c:279:3: erreur: too many arguments to function 'mkdir' Fixed. The patch below fix these errors for i686-pc-mingw32 target. It should also fix your errors for mingw64 target (I don't have mingw64 toolchain on hand). -- Yao (齐尧) gdb: 2013-03-15 Yao Qi * ctf.c (ctf_save_metadata_header): Save CTF in native endianness. (ctf_start) [USE_WIN32API]: Call mkdir with DIRNAME only. [!USE_WIN32API]: Call mkdir with DIRNAME and mode parameter. --- gdb/ctf.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gdb/ctf.c b/gdb/ctf.c index 44c4e9e..05022b7 100644 --- a/gdb/ctf.c +++ b/gdb/ctf.c @@ -194,7 +194,7 @@ ctf_save_metadata_header (struct trace_write_handler *handler) "\ntrace {\n" " major = %u;\n" " minor = %u;\n" - " byte_order = %s;\n" /* be or le */ + " byte_order = native;\n" " packet.header := struct {\n" " uint32_t magic;\n" " };\n" @@ -243,8 +243,7 @@ ctf_save_metadata_header (struct trace_write_handler *handler) ctf_save_write_metadata (handler, "\n"); ctf_save_write_metadata (handler, metadata_fmt, - CTF_SAVE_MAJOR, CTF_SAVE_MINOR, - BYTE_ORDER == LITTLE_ENDIAN ? "le" : "be"); + CTF_SAVE_MAJOR, CTF_SAVE_MINOR); ctf_save_write_metadata (handler, "\n"); } @@ -298,10 +297,16 @@ ctf_start (struct trace_file_writer *self, const char *dirname) struct ctf_trace_file_writer *writer = (struct ctf_trace_file_writer *) self; int i; + int ret = 0; /* Create DIRNAME. */ - if (mkdir (dirname, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) - && errno != EEXIST) +#ifdef USE_WIN32API + ret = mkdir (dirname); +#else + ret = mkdir (dirname, S_IRUSR | S_IWUSR | S_IXUSR); +#endif + + if (ret && errno != EEXIST) error (_("Unable to open directory '%s' for saving trace data (%s)"), dirname, safe_strerror (errno)); -- 1.7.7.6