From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12421 invoked by alias); 25 Mar 2013 00:53:38 -0000 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 Received: (qmail 12409 invoked by uid 89); 25 Mar 2013 00:53:29 -0000 X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from mail-da0-f42.google.com (HELO mail-da0-f42.google.com) (209.85.210.42) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 25 Mar 2013 00:53:26 +0000 Received: by mail-da0-f42.google.com with SMTP id n15so2971207dad.15 for ; Sun, 24 Mar 2013 17:53:25 -0700 (PDT) X-Received: by 10.66.162.229 with SMTP id yd5mr7226413pab.4.1364172805195; Sun, 24 Mar 2013 17:53:25 -0700 (PDT) Received: from [192.168.1.128] ([122.234.213.104]) by mx.google.com with ESMTPS id hu2sm11170875pbc.38.2013.03.24.17.53.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 Mar 2013 17:53:24 -0700 (PDT) Message-ID: <514FA117.9030604@gmail.com> Date: Mon, 25 Mar 2013 04:08:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0a1 MIME-Version: 1.0 To: Tom Tromey CC: Eli Zaretskii , Yao Qi , gdb-patches@sourceware.org Subject: [MinGW-w64]Build gdb/ctf.c failed References: <83ip4s4ixc.fsf@gnu.org> <1363407692-18959-1-git-send-email-yao@codesourcery.com> <1363407692-18959-4-git-send-email-yao@codesourcery.com> <51492077.30307@codesourcery.com> <83sj3qyogk.fsf@gnu.org> <87vc8m7z1d.fsf@fleche.redhat.com> In-Reply-To: <87vc8m7z1d.fsf@fleche.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-03/txt/msg00904.txt.bz2 On 2013-3-21 1:37, Tom Tromey wrote: >>>>>> "Eli" == Eli Zaretskii writes: > >>> Date: Wed, 20 Mar 2013 10:35:35 +0800 >>> From: Yao Qi >>> CC: gdb-patches , Eli Zaretskii >>> >>> Also define a macro 'mkdir' in this patch, as Eli suggested before. Is >>> it OK? > > Eli> The macro is OK, but please make sure unistd.h is included by this > Eli> file, because that's where MinGW defines the prototype of _mkdir. > > defs.h includes unistd.h. > > Tom > Hi, all. I'm using the GCC suite with MinGW-w64 SDKs. There is a little different from the MinGW SDKs. I get the build error: mingw32-gcc -O0 -g -D__USE_MINGW_ACCESS -I. -I../../gdb/gdb -I../../gdb/gdb/common -I../../gdb/gdb/config -DLOCALEDIR="\"/mingw/share/locale\"" -DHAVE_CONFIG_H -I../../gdb/gdb/../include/opcode -I../../gdb/gdb/../opcodes/.. -I../../gdb/gdb/../readline/.. -I../bfd -I../../gdb/gdb/../bfd -I../../gdb/gdb/../include -I../libdecnumber -I../../gdb/gdb/../libdecnumber -I../../gdb/gdb/gnulib/import -Ibuild-gnulib/import -IE:/code/python273/include -IE:/code/python273/include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wno-format -Werror -c -o ctf.o -MT ctf.o -MMD -MP -MF .deps/ctf.Tpo ../../gdb/gdb/ctf.c ../../gdb/gdb/ctf.c: In function 'ctf_start': ../../gdb/gdb/ctf.c:304:3: error: implicit declaration of function '_mkdir' [-Werror=implicit-function-declaration] cc1.exe: all warnings being treated as errors make[2]: *** [ctf.o] Error 1 I found that _mkdir was declared in the file: direct.h in MinGW-w64 SDKs: _CRTIMP int __cdecl _mkdir(const char *_Path); And it looks like no other header files include direct.h, so #include is needed here. For MinGW SDKs, as Tom said, it was indirectly included in defs.h, this there is no such issue. Yuanhui Zhang BTW: Do we need to add a check like below(We don't have such check in GDB, but I found such a check in other place): /* Define to 1 if you have the header file. */ #define HAVE_DIRECT_H 1