Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Vrany <jan.vrany@fit.cvut.cz>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: Compiling GDB on Windows using mingw64 toolchain
Date: Tue, 06 Mar 2018 11:04:00 -0000	[thread overview]
Message-ID: <1520334268.16358.20.camel@fit.cvut.cz> (raw)
In-Reply-To: <ceef3314-4dd7-31a6-34c3-866270257804@redhat.com>

Hi, 

> This probably means that something did "#define wint_t int" before
> we get here (or some #undef doesn't trigger), which makes the
> compiler see:
> 
>   using ::int;
> 

Yes, you're right. I dug a little deeper and tried to compile following
program: 

--
#include <cwchar>                               
#include <string>                               
                                                
int main(int argc, char **argv) {               
        return 0;                               
}                                               
--

using following:

--
 x86_64-w64-mingw32-g++ -x c++  -g -O2   -I. -I../../gdb
-I../../gdb/common -I../../gdb/config
-DLOCALEDIR="\"/c/msys64/mingw64/share/locale\"" -DHAVE_CONFIG_H
-I../../gdb/../include/opcode -I../../gdb/../opcodes/..  -
I../../gdb/../zlib -I../bfd -I../../gdb/../bfd -I../../gdb/../include
-I../libdecnumber -I../../gdb/../libdecnumber    -DTUI=1  -
I/c/msys64/mingw64/include -DMS_WIN64  -I/mingw64/include/python2.7
-Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function
-Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-
parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-narrowing
-Wno-error=maybe-uninitialized -Wno-format  -c -o wchar.o -MT wchar.o
-MMD -MP -MF ./.deps/wchar.Tpo wchar.cpp
--

The above g++ invocation is essentially the same as used to compile
(failing) i386-tdep.c, just with i386-tdep.c replaced by wchar.c.
It fails with the very same error. Of course, the wchar.c test program 
compiles just fine "normally". 

So, it must be some of the command line switches that confuses the
compiler, most likely so that it takes some incompatible "system"
header. 

When I remove the `-I../../gdb/gnulib/import -Ibuild-gnulib/import`
from the command, it compiles just fine. 
It seems to me that the problem originats in
gdb/gnulib/import/wchar.in.h., line ~111. 

How to fix that, I don't know (yet). 

Thanks, 

Jan


  reply	other threads:[~2018-03-06 11:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-04 17:19 Jan Vrany
2018-03-05 11:53 ` Yao Qi
2018-03-06 10:43   ` Jan Vrany
2018-03-05 12:23 ` Pedro Alves
2018-03-06 11:04   ` Jan Vrany [this message]
2018-03-06 15:58     ` Eli Zaretskii
2018-03-06 16:15       ` Jan Vrany
2018-03-06 17:44         ` Eli Zaretskii
2018-03-08  9:15           ` Jan Vrany

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=1520334268.16358.20.camel@fit.cvut.cz \
    --to=jan.vrany@fit.cvut.cz \
    --cc=gdb@sourceware.org \
    /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