This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[MinGW-w64]Build gdb/ctf.c failed
- From: asmwarrior <asmwarrior at gmail dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, Yao Qi <yao at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Mon, 25 Mar 2013 08:57:59 +0800
- Subject: [MinGW-w64]Build gdb/ctf.c failed
- References: <83ip4s4ixc dot fsf at gnu dot org> <1363407692-18959-1-git-send-email-yao at codesourcery dot com> <1363407692-18959-4-git-send-email-yao at codesourcery dot com> <CADPb22RwSq0iv_gQu5PSGezQoUy0ve16M2hmL51HvM19v0M5Ow at mail dot gmail dot com> <51492077 dot 30307 at codesourcery dot com> <83sj3qyogk dot fsf at gnu dot org> <87vc8m7z1d dot fsf at fleche dot redhat dot com>
On 2013-3-21 1:37, Tom Tromey wrote:
>>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
>
>>> Date: Wed, 20 Mar 2013 10:35:35 +0800
>>> From: Yao Qi <yao@codesourcery.com>
>>> CC: gdb-patches <gdb-patches@sourceware.org>, Eli Zaretskii <eliz@gnu.org>
>>>
>>> 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 <direct.h> 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 <direct.h> header file. */
#define HAVE_DIRECT_H 1