From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: asmwarrior <asmwarrior@gmail.com>,
MinGW Users List <mingw-users@lists.sourceforge.net>,
Chris Sutcliffe <ir0nh34d@gmail.com>,
Xun Xun <xunxun1982@gmail.com>
Subject: Re: gdb (gdbserver.exe) build problem under msys
Date: Wed, 26 Oct 2011 14:49:00 -0000 [thread overview]
Message-ID: <201110261536.18038.pedro@codesourcery.com> (raw)
In-Reply-To: <4EA7FCF2.7050402@gmail.com>
On Wednesday 26 October 2011 13:28:34, asmwarrior wrote:
> Hi, when using msys + gcc 4.6.1 to build the latest version of gdb (gdb cvs head code), I found a problem.
>
> the build step looks like:
>
> mkdir build
> cd build
> CFLAGS="-O2 -fno-omit-frame-pointer -mtune=i686" \
> ../gdb/configure \
> --prefix=/mingw \
> --host=mingw32 \
> --build=mingw32 \
> --target=mingw32 \
> --with-python=/python/python \
> --with-expat \
> --disable-nls
>
> Then, I just run "make" under the build folder.
>
> I found that gdb.exe was successfully built, but the gdbserver.exe failed. the error log is below:
>
> make[3]: Entering directory `/f/build_gdb/gdb/gdbgit/build/gdb'
> make[4]: Entering directory `/f/build_gdb/gdb/gdbgit/build/gdb/doc'
> make[4]: Nothing to be done for `all'.
> make[4]: Leaving directory `/f/build_gdb/gdb/gdbgit/build/gdb/doc'
> make[4]: Entering directory `/f/build_gdb/gdb/gdbgit/build/gdb/gdbserver'
> CONFIG_FILES="" CONFIG_HEADERS=config.h:config.in /bin/sh ./config.status
> config.status: creating config.h
> config.status: config.h is unchanged
> config.status: executing default commands
> gcc -c -O2 -fno-omit-frame-pointer -mtune=i686 -D__USE_MINGW_ACCESS -I. -I../../../gdb/gdb/gdbserver -I../../../gdb/gdb/gdbserver/../common -I../../../gdb/gdb/gdbserver/../regformats -I../../../gdb/gdb/gdbserver/../../include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Werror ../../../gdb/gdb/gdbserver/inferiors.c
> gcc -c -O2 -fno-omit-frame-pointer -mtune=i686 -D__USE_MINGW_ACCESS -I. -I../../../gdb/gdb/gdbserver -I../../../gdb/gdb/gdbserver/../common -I../../../gdb/gdb/gdbserver/../regformats -I../../../gdb/gdb/gdbserver/../../include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Werror ../../../gdb/gdb/gdbserver/regcache.c
> gcc -c -O2 -fno-omit-frame-pointer -mtune=i686 -D__USE_MINGW_ACCESS -I. -I../../../gdb/gdb/gdbserver -I../../../gdb/gdb/gdbserver/../common -I../../../gdb/gdb/gdbserver/../regformats -I../../../gdb/gdb/gdbserver/../../include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Werror ../../../gdb/gdb/gdbserver/remote-utils.c
> ../../../gdb/gdb/gdbserver/remote-utils.c: In function 'handle_accept_event':
> ../../../gdb/gdb/gdbserver/remote-utils.c:150:22: error: storage size of 'sockaddr' isn't known
> ../../../gdb/gdb/gdbserver/remote-utils.c:157:3: error: implicit declaration of function 'accept' [-Werror=implicit-function-declaration]
> ....
>
>
> I just looked at the build tree, and found that the file:
>
> build/gdb/gdbserver/config.h (this file size if about 9K)
>
> there contains some code:
> /* Define if we should use the Windows API, instead of the POSIX API. On
> Windows, we use the Windows API when building for MinGW, but the POSIX API
> when building for Cygwin. */
> #undef USE_WIN32API
>
> This is wrong, because the USE_WIN32API should be defined under Windows MSYS.
>
> But when I check the file in the parent folder "build/gdb/config.h", the USE_WIN32API is correctly defined, so that's why gdb.exe can build successfully.
>
> By checking the file "build/gdb/gdbserver/config.log", it looks like all the checking works fine.
>
> So, I guess that something was wrong one the time when
> "build\gdb\gdbserver\config.status" was creating the config.h.
>
> Any one can help me to test it or find the problem?
gdbserver/configure.ac has:
if test "${srv_mingw}" = "yes"; then
AC_DEFINE(USE_WIN32API, 1,
[Define if we should use the Windows API, instead of the
POSIX API. On Windows, we use the Windows API when
building for MinGW, but the POSIX API when building
for Cygwin.])
fi
and gdbserver/configure.srv has:
case "${target}" in
...
i[34567]86-*-mingw*) srv_regobj="$srv_i386_regobj"
srv_tgtobj="i386-low.o win32-low.o win32-i386-low.o"
srv_xmlfiles="$srv_i386_xmlfiles"
srv_mingw=yes
;;
...
x86_64-*-mingw*) srv_regobj="$srv_amd64_regobj"
srv_tgtobj="i386-low.o i387-fp.o win32-low.o win32-i386-low.o"
srv_xmlfiles="$srv_i386_xmlfiles $srv_amd64_xmlfiles"
srv_mingw=yes
;;
So in order for USE_WIN32API not to be defined, ${target} didn't
match above.
Try, e.g., checking what does "grep ac_cv_target gdbserver/config.log"
and "grep ac_cv_host gdbserver/config.log" say.
--
Pedro Alves
next prev parent reply other threads:[~2011-10-26 14:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-26 14:36 asmwarrior
2011-10-26 14:49 ` Pedro Alves [this message]
2011-10-27 0:55 ` Asmwarrior
2011-10-27 2:31 ` Asmwarrior
2011-10-27 7:10 ` Asmwarrior
2011-10-27 14:48 ` asmwarrior
2011-10-26 16:37 ` Joel Brobecker
2011-10-26 19:10 ` Pedro Alves
2011-10-26 23:10 ` Petr Hluzín
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201110261536.18038.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=asmwarrior@gmail.com \
--cc=gdb@sourceware.org \
--cc=ir0nh34d@gmail.com \
--cc=mingw-users@lists.sourceforge.net \
--cc=xunxun1982@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox