* Compiling GDB on Windows using mingw64 toolchain
@ 2018-03-04 17:19 Jan Vrany
2018-03-05 11:53 ` Yao Qi
2018-03-05 12:23 ` Pedro Alves
0 siblings, 2 replies; 9+ messages in thread
From: Jan Vrany @ 2018-03-04 17:19 UTC (permalink / raw)
To: gdb
Hi there,
I'm trying to compile recent (git master or 8.x) GDB in Windows using
mingw64 toolchain,
but so far I failed. git master as well as gdb-8.1-branch and gdb-8.0-
branch fail to
compile with following error:
---
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 -
I../../gdb/gnulib/import -Ibuild-gnulib/import
-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 gdb.o
-MT gdb.o -MMD -MP -MF ./.deps/gdb.Tpo ../../gdb/gdb.c
In file included from C:/msys64/mingw64/include/c++/6.3.0/cwchar:44:0,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/postypes.h:40,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/char_traits.h:40,
from C:/msys64/mingw64/include/c++/6.3.0/string:40,
from ../../gdb/common/common-utils.h:23,
from ../../gdb/common/common-defs.h:78,
from ../../gdb/defs.h:28,
from ../../gdb/gdb.c:19:
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected
unqualified-id before 'int'
using ::wint_t;
---
The first commit that seems to fail with this error - according to my
tests - is
da804164742b83965b487bbff5b6334f2e63fe91 (Introduce gdb::unique_ptr).
However, the older commist than this one don't compile either (other
errors in `windows-nat.c`, see below).
The GCC I'm using to compile GDB is MSYS2-built GCC 6.3. I tried to
compile master on Linux
with GCC 6.4 and, as expected, it compiles just fine).
You may find more details (such as params to configure, GCC version and
and compilation output below.
I'd appreciate any help, I'm not a C++ guy (and not much of a Windows
guy, too) so I'm bit lost.
Does anyone here tried to compile GDB under mingw64? If so, could you
please
share the details how you managed so I can try following the same
steps?
Thanks a lot!
Jan
* Parameters to `configure`:
MINGW_CHOST=x86_64-w64-mingw32
MINGW_PREFIX=/c/msys64/mingw64
./configure \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--prefix=${MINGW_PREFIX} \
--enable-targets="i686-w64-mingw32,x86_64-w64-mingw32" \
--enable-64-bit-bfd \
--disable-werror \
--disable-win32-registry \
--disable-rpath \
--with-system-gdbinit=${MINGW_PREFIX}/etc/gdbinit \
--with-python=${MINGW_PREFIX}/bin/python-config-u.sh \
--with-expat \
--with-libiconv-prefix=${MINGW_PREFIX} \
--with-zlib \
--with-lzma \
--with-system-readline \
--enable-tui
* GCC version:
> x86_64-w64-mingw32-g++ --version
x86_64-w64-mingw32-g++ (Rev3, Built by MSYS2 project) 6.3.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
* Master: commit b9671caf8fe1abd737846edf7dcd627870f986cc
(handle_general_set: Remove useless xstrdup)
---
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../../g
db/../bfd -I../../gdb/../include -I../libdecnumber
-I../../gdb/../libdecnumber -I../../gdb/gnulib/import -Ibuild-
gnulib/import
-DTUI=1 -I/c/msys64/mingw64/include -DMS_WIN64 -
I/mingw64/include/python2.7 -Wall -Wpointer-arith -Wno-unused -Wunused-
val
ue -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body
-Wunused-but-set-parameter -Wunused-but-set-variable -Wno-si
gn-compare -Wno-narrowing -Wno-error=maybe-uninitialized -Wno-format -
c -o arch/i386.o -MT arch/i386.o -MMD -MP -MF arch/.deps
/i386.Tpo
../../gdb/arch/i386.c
In file included from
C:/msys64/mingw64/include/c++/6.3.0/cwchar:44:0,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/postypes.h:40,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/char_traits.h:40,
from
C:/msys64/mingw64/include/c++/6.3.0/string:40,
from ../../gdb/common/common-
utils.h:23,
from ../../gdb/common/common-
defs.h:78,
from
../../gdb/arch/i386.c:18:
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected
unqualified-id before 'int'
using
::wint_t;
^
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected ';'
before 'int'
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: declaration
does not declare anything [-fpermissive]
In file included from
../../gdb/common/gdb_unique_ptr.h:23:0,
from ../../gdb/common/common-
defs.h:92,
from
../../gdb/arch/i386.c:18:
C:/msys64/mingw64/include/c++/6.3.0/memory: In function 'void*
std::align(std::size_t, std::size_t, void*&, std::size_t&)':
C:/msys64/mingw64/include/c++/6.3.0/memory:117:58: error: cast from
'void*' to 'gl_uintptr_t {aka long unsigned int}' loses pre
cision [-
fpermissive]
const auto __intptr =
reinterpret_cast<uintptr_t>(__ptr);
^
make[2]: *** [Makefile:1600: arch/i386.o] Error
1
make[2]: *** Waiting for unfinished
jobs....
In file included from
C:/msys64/mingw64/include/c++/6.3.0/cwchar:44:0,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/postypes.h:40,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/char_traits.h:40,
from
C:/msys64/mingw64/include/c++/6.3.0/string:40,
from ../../gdb/common/common-
utils.h:23,
from ../../gdb/common/common-
defs.h:78,
from
../../gdb/defs.h:28,
from
../../gdb/gdb.c:19:
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected
unqualified-id before 'int'
using
::wint_t;
^
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected ';'
before 'int'
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: declaration
does not declare anything [-fpermissive]
In file included from
../../gdb/common/gdb_unique_ptr.h:23:0,
from ../../gdb/common/common-
defs.h:92,
from
../../gdb/defs.h:28,
from
../../gdb/gdb.c:19:
C:/msys64/mingw64/include/c++/6.3.0/memory: In function 'void*
std::align(std::size_t, std::size_t, void*&, std::size_t&)':
C:/msys64/mingw64/include/c++/6.3.0/memory:117:58: error: cast from
'void*' to 'gl_uintptr_t {aka long unsigned int}' loses pre
cision [-
fpermissive]
const auto __intptr =
reinterpret_cast<uintptr_t>(__ptr);
^
make[2]: *** [Makefile:1600: gdb.o] Error
1
In file included from
C:/msys64/mingw64/include/c++/6.3.0/cwchar:44:0,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/postypes.h:40,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/char_traits.h:40,
from
C:/msys64/mingw64/include/c++/6.3.0/string:40,
from ../../gdb/common/common-
utils.h:23,
from ../../gdb/common/common-
defs.h:78,
from
../../gdb/defs.h:28,
from ../../gdb/i386-
tdep.c:20:
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected
unqualified-id before 'int'
using
::wint_t;
^
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected ';'
before 'int'
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: declaration
does not declare anything [-fpermissive]
In file included from
../../gdb/common/gdb_unique_ptr.h:23:0,
from ../../gdb/common/common-
defs.h:92,
from
../../gdb/defs.h:28,
from ../../gdb/i386-
tdep.c:20:
C:/msys64/mingw64/include/c++/6.3.0/memory: In function 'void*
std::align(std::size_t, std::size_t, void*&, std::size_t&)':
C:/msys64/mingw64/include/c++/6.3.0/memory:117:58: error: cast from
'void*' to 'gl_uintptr_t {aka long unsigned int}' loses pre
cision [-
fpermissive]
const auto __intptr =
reinterpret_cast<uintptr_t>(__ptr);
^
make[2]: *** [Makefile:1600: i386-tdep.o] Error
1
make[2]: Leaving directory '/h/Projects/gdb/sources_win/build-x86_64-
w64-mingw32/gdb'
make[1]: *** [Makefile:10428: all-gdb] Error
2
make[1]: Leaving directory '/h/Projects/gdb/sources_win/build-x86_64-
w64-mingw32'
make: *** [Makefile:857: all] Error
2
jv@WIN7
H:\Projects\gdb
---
* First bad revision: commit da804164742b83965b487bbff5b6334f2e63fe91
(Introduce gdb::unique_ptr)
---
x86_64-w64-mingw32-g++ -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 -I../../gdb/gnulib/import -Ibuild-
gnulib/import -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-write-strings -Wno-narrowing -Wno-format -c -o amd64-windows-
tdep.o -MT amd64-windows-tdep.o -MMD -MP -MF .deps/amd64-windows-
tdep.Tpo ../../gdb/amd64-windows-tdep.c
In file included from C:/msys64/mingw64/include/c++/6.3.0/cwchar:44:0,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/postypes.h:40,
from C:/msys64/mingw64/include/c++/6.3.0/iosfwd:40,
from C:/msys64/mingw64/include/c++/6.3.0/memory:72,
from ../../gdb/common/gdb_unique_ptr.h:77,
from ../../gdb/common/common-defs.h:86,
from ../../gdb/defs.h:28,
from ../../gdb/gdb.c:19:
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected
unqualified-id before 'int'
using ::wint_t;
^
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected ';'
before 'int'
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: declaration
does not declare anything [-fpermissive]
In file included from ../../gdb/common/gdb_unique_ptr.h:77:0,
from ../../gdb/common/common-defs.h:86,
from ../../gdb/defs.h:28,
from ../../gdb/gdb.c:19:
C:/msys64/mingw64/include/c++/6.3.0/memory: In function 'void*
std::align(std::size_t, std::size_t, void*&, std::size_t&)':
C:/msys64/mingw64/include/c++/6.3.0/memory:117:58: error: cast from
'void*' to 'gl_uintptr_t {aka long unsigned int}' loses precision [-
fpermissive]
const auto __intptr = reinterpret_cast<uintptr_t>(__ptr);
^
make[2]: *** [Makefile:1124: gdb.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from C:/msys64/mingw64/include/c++/6.3.0/cwchar:44:0,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/postypes.h:40,
from C:/msys64/mingw64/include/c++/6.3.0/iosfwd:40,
from C:/msys64/mingw64/include/c++/6.3.0/memory:72,
from ../../gdb/common/gdb_unique_ptr.h:77,
from ../../gdb/common/common-defs.h:86,
from ../../gdb/defs.h:28,
from ../../gdb/amd64-windows-tdep.c:18:
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected
unqualified-id before 'int'
using ::wint_t;
^
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected ';'
before 'int'
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: declaration
does not declare anything [-fpermissive]
In file included from ../../gdb/common/gdb_unique_ptr.h:77:0,
from ../../gdb/common/common-defs.h:86,
from ../../gdb/defs.h:28,
from ../../gdb/amd64-windows-tdep.c:18:
C:/msys64/mingw64/include/c++/6.3.0/memory: In function 'void*
std::align(std::size_t, std::size_t, void*&, std::size_t&)':
C:/msys64/mingw64/include/c++/6.3.0/memory:117:58: error: cast from
'void*' to 'gl_uintptr_t {aka long unsigned int}' loses precision [-
fpermissive]
const auto __intptr = reinterpret_cast<uintptr_t>(__ptr);
^
make[2]: *** [Makefile:1124: amd64-windows-tdep.o] Error 1
In file included from C:/msys64/mingw64/include/c++/6.3.0/cwchar:44:0,
from
C:/msys64/mingw64/include/c++/6.3.0/bits/postypes.h:40,
from C:/msys64/mingw64/include/c++/6.3.0/iosfwd:40,
from C:/msys64/mingw64/include/c++/6.3.0/memory:72,
from ../../gdb/common/gdb_unique_ptr.h:77,
from ../../gdb/common/common-defs.h:86,
from ../../gdb/defs.h:28,
from ../../gdb/amd64-tdep.c:22:
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected
unqualified-id before 'int'
using ::wint_t;
^
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected ';'
before 'int'
C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: declaration
does not declare anything [-fpermissive]
In file included from ../../gdb/common/gdb_unique_ptr.h:77:0,
from ../../gdb/common/common-defs.h:86,
from ../../gdb/defs.h:28,
from ../../gdb/amd64-tdep.c:22:
C:/msys64/mingw64/include/c++/6.3.0/memory: In function 'void*
std::align(std::size_t, std::size_t, void*&, std::size_t&)':
C:/msys64/mingw64/include/c++/6.3.0/memory:117:58: error: cast from
'void*' to 'gl_uintptr_t {aka long unsigned int}' loses precision [-
fpermissive]
const auto __intptr = reinterpret_cast<uintptr_t>(__ptr);
^
make[2]: *** [Makefile:1124: amd64-tdep.o] Error 1
make[2]: Leaving directory '/h/Projects/gdb/sources_win/build-x86_64-
w64-mingw32/gdb'
make[1]: *** [Makefile:10463: all-gdb] Error 2
make[1]: Leaving directory '/h/Projects/gdb/sources_win/build-x86_64-
w64-mingw32'
make: *** [Makefile:858: all] Error 2
jv@WIN7 H:\Projects\gdb
---
* Last good revision: commit b928b56ea67da30216b79abd6a87ffda99fc911d
(HEAD, refs/bisect/good-b928b56ea67da30216b79abd6a87ffda99fc911d)
Fails to compie:
---
x86_64-w64-mingw32-g++ -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 -I../../gdb/gnulib/import -Ibuild-
gnulib/import -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-write-strings -Wno-narrowing -Wno-format -c -o x86-dregs.o -MT
x86-dregs.o -MMD -MP -MF .deps/x86-dregs.Tpo ../../gdb/nat/x86-dregs.c
x86_64-w64-mingw32-g++ -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 -I../../gdb/gnulib/import -Ibuild-
gnulib/import -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-write-strings -Wno-narrowing -Wno-format -c -o windows-nat.o -MT
windows-nat.o -MMD -MP -MF .deps/windows-nat.Tpo ../../gdb/windows-
nat.c
../../gdb/ser-mingw.c: In function 'int ser_windows_open(serial*, const
char*)':
../../gdb/ser-mingw.c:67:41: error: cast from 'HANDLE {aka void*}' to
'gl_intptr_t {aka long int}' loses precision [-fpermissive]
scb->fd = _open_osfhandle ((intptr_t) h, O_RDWR);
^
../../gdb/ser-mingw.c: In function 'int
ser_windows_drain_output(serial*)':
../../gdb/ser-mingw.c:109:46: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int
ser_windows_flush_output(serial*)':
../../gdb/ser-mingw.c:117:46: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int
ser_windows_flush_input(serial*)':
../../gdb/ser-mingw.c:125:46: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int
ser_windows_send_break(serial*)':
../../gdb/ser-mingw.c:133:46: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'void ser_windows_raw(serial*)':
../../gdb/ser-mingw.c:150:46: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int
ser_windows_setstopbits(serial*, int)':
../../gdb/ser-mingw.c:175:46: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int ser_windows_setparity(serial*,
int)':
../../gdb/ser-mingw.c:204:46: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int
ser_windows_setbaudrate(serial*, int)':
../../gdb/ser-mingw.c:236:46: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'void ser_windows_close(serial*)':
../../gdb/ser-mingw.c:257:47: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
CancelIo ((HANDLE) _get_osfhandle (scb->fd));
^
../../gdb/ser-mingw.c: In function 'void
ser_windows_wait_handle(serial*, void**, void**)':
../../gdb/ser-mingw.c:277:46: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int ser_windows_read_prim(serial*,
size_t)':
../../gdb/ser-mingw.c:342:39: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int ser_windows_write_prim(serial*,
const void*, size_t)':
../../gdb/ser-mingw.c:365:39: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'DWORD
console_select_thread(void*)':
../../gdb/ser-mingw.c:542:39: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int fd_is_pipe(int)':
../../gdb/ser-mingw.c:621:49: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
if (PeekNamedPipe ((HANDLE) _get_osfhandle (fd), NULL, 0, NULL,
NULL, NULL))
^
../../gdb/ser-mingw.c: In function 'int fd_is_file(int)':
../../gdb/ser-mingw.c:630:47: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
if (GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_DISK)
^
../../gdb/ser-mingw.c: In function 'DWORD pipe_select_thread(void*)':
../../gdb/ser-mingw.c:645:39: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'DWORD file_select_thread(void*)':
../../gdb/ser-mingw.c:688:39: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
h = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int pipe_windows_read(serial*,
size_t)':
../../gdb/ser-mingw.c:974:57: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE pipeline_out = (HANDLE) _get_osfhandle (scb->fd);
^
../../gdb/ser-mingw.c: In function 'int pipe_windows_write(serial*,
const void*, size_t)':
../../gdb/ser-mingw.c:1005:56: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
pipeline_in = (HANDLE) _get_osfhandle (pipeline_in_fd);
^
../../gdb/ser-mingw.c: In function 'int pipe_avail(serial*, int)':
../../gdb/ser-mingw.c:1052:41: warning: cast to pointer from integer of
different size [-Wint-to-pointer-cast]
HANDLE h = (HANDLE) _get_osfhandle (fd);
^
make[2]: *** [Makefile:1124: ser-mingw.o] Error 1
make[2]: *** Waiting for unfinished jobs....
../../gdb/windows-nat.c: In function 'windows_thread_info*
windows_add_thread(ptid_t, HANDLE, void*)':
../../gdb/windows-nat.c:390:51: error: cast from 'void*' to
'gl_uintptr_t {aka long unsigned int}' loses precision [-fpermissive]
th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb;
^~~
../../gdb/windows-nat.c: In function 'void signal_event_command(char*,
int)':
../../gdb/windows-nat.c:855:17: warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]
((HANDLE) event_id == INVALID_HANDLE_VALUE))
^~~~~~~~
../../gdb/windows-nat.c:858:22: warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]
SetEvent ((HANDLE) event_id);
^~~~~~~~
../../gdb/windows-nat.c:859:25: warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]
CloseHandle ((HANDLE) event_id);
^~~~~~~~
../../gdb/windows-nat.c: In function 'int
handle_output_debug_string(target_waitstatus*)':
../../gdb/windows-nat.c:872:55: error: cast from 'LPSTR {aka char*}' to
'gl_uintptr_t {aka long unsigned int}' loses precision [-fpermissive]
((CORE_ADDR) (uintptr_t)
current_event.u.DebugString.lpDebugStringData,
^~~~~~~~~~~~~~~~
~
../../gdb/windows-nat.c: In function 'target_xfer_status
windows_xfer_memory(gdb_byte*, const gdb_byte*, ULONGEST, ULONGEST,
ULONGEST*)':
../../gdb/windows-nat.c:2428:30: warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]
(LPVOID) (uintptr_t) memaddr, writebuf,
^~~~~~~
../../gdb/windows-nat.c:2433:31: warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]
(LPCVOID) (uintptr_t) memaddr, len);
^~~~~~~
../../gdb/windows-nat.c:2440:30: warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]
(LPCVOID) (uintptr_t) memaddr, readbuf,
^~~~~~~
../../gdb/windows-nat.c: In function 'target_xfer_status
windows_xfer_shared_libraries(target_ops*, target_object, const char*,
gdb_byte*, const gdb_byte*, ULONGEST, ULONGEST, ULONGEST*)':
../../gdb/windows-nat.c:2512:31: error: cast from 'LPVOID {aka void*}'
to 'gl_uintptr_t {aka long unsigned int}' loses precision [-
fpermissive]
(uintptr_t) so->lm_info->load_addr,
^~~~~~~~~
make[2]: *** [Makefile:1124: windows-nat.o] Error 1
make[2]: Leaving directory '/h/Projects/gdb/sources_win/build-x86_64-
w64-mingw32/gdb'
make[1]: *** [Makefile:10463: all-gdb] Error 2
make[1]: Leaving directory '/h/Projects/gdb/sources_win/build-x86_64-
w64-mingw32'
make: *** [Makefile:858: all] Error 2
jv@WIN7 H:\Projects\gdb
---
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Compiling GDB on Windows using mingw64 toolchain
2018-03-04 17:19 Compiling GDB on Windows using mingw64 toolchain Jan Vrany
@ 2018-03-05 11:53 ` Yao Qi
2018-03-06 10:43 ` Jan Vrany
2018-03-05 12:23 ` Pedro Alves
1 sibling, 1 reply; 9+ messages in thread
From: Yao Qi @ 2018-03-05 11:53 UTC (permalink / raw)
To: Jan Vrany; +Cc: gdb
Jan Vrany <jan.vrany@fit.cvut.cz> writes:
> You may find more details (such as params to configure, GCC version and
> and compilation output below.
>
The configure looks right to me.
> I'd appreciate any help, I'm not a C++ guy (and not much of a Windows
> guy, too) so I'm bit lost.
> Does anyone here tried to compile GDB under mingw64? If so, could you
> please
> share the details how you managed so I can try following the same
> steps?
Yes, we use mingw64 gcc to build GDB from time to time. My
x86_64-w64-mingw32-g++ is 4.8.2 and 5.3.1, shipped in Ubuntu. I have no
troubles building GDB.
I can't tell what is wrong from the error messages you posted.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling GDB on Windows using mingw64 toolchain
2018-03-05 11:53 ` Yao Qi
@ 2018-03-06 10:43 ` Jan Vrany
0 siblings, 0 replies; 9+ messages in thread
From: Jan Vrany @ 2018-03-06 10:43 UTC (permalink / raw)
To: gdb
Hi,
On Mon, 2018-03-05 at 11:53 +0000, Yao Qi wrote:
>
> Yes, we use mingw64 gcc to build GDB from time to time. My
> x86_64-w64-mingw32-g++ is 4.8.2 and 5.3.1, shipped in Ubuntu. I have
> no
> troubles building GDB.
Thanks! I managed to cross-compile GDB using Debian's mingw64
(7.2-win32 20180123), What I was trying is to (native) compile
it on Windows.
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling GDB on Windows using mingw64 toolchain
2018-03-04 17:19 Compiling GDB on Windows using mingw64 toolchain Jan Vrany
2018-03-05 11:53 ` Yao Qi
@ 2018-03-05 12:23 ` Pedro Alves
2018-03-06 11:04 ` Jan Vrany
1 sibling, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2018-03-05 12:23 UTC (permalink / raw)
To: Jan Vrany, gdb
On 03/04/2018 05:19 PM, Jan Vrany wrote:
> C:/msys64/mingw64/include/c++/6.3.0/cwchar:139:11: error: expected
> unqualified-id before 'int'
> using ::wint_t;
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;
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling GDB on Windows using mingw64 toolchain
2018-03-05 12:23 ` Pedro Alves
@ 2018-03-06 11:04 ` Jan Vrany
2018-03-06 15:58 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Jan Vrany @ 2018-03-06 11:04 UTC (permalink / raw)
To: gdb
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
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Compiling GDB on Windows using mingw64 toolchain
2018-03-06 11:04 ` Jan Vrany
@ 2018-03-06 15:58 ` Eli Zaretskii
2018-03-06 16:15 ` Jan Vrany
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2018-03-06 15:58 UTC (permalink / raw)
To: Jan Vrany; +Cc: gdb
> From: Jan Vrany <jan.vrany@fit.cvut.cz>
> Date: Tue, 06 Mar 2018 11:04:28 +0000
>
> 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).
Doesn't MinGW64 have the wint_t type? Because if it does, that part
of wchar.in.h should have been bypassed in your build.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Compiling GDB on Windows using mingw64 toolchain
2018-03-06 15:58 ` Eli Zaretskii
@ 2018-03-06 16:15 ` Jan Vrany
2018-03-06 17:44 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Jan Vrany @ 2018-03-06 16:15 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
On Tue, 2018-03-06 at 17:57 +0200, Eli Zaretskii wrote:
> >
>
> Doesn't MinGW64 have the wint_t type? Because if it does, that part
> of wchar.in.h should have been bypassed in your build.
I believe it does have it. Following compile just fine:
--
#include <cwchar>
int main(int argc, char **argv) {
::wint_t a;
wint_t b;
return 0;
}
--
C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++ -o wchar.exe wchar.cpp
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Compiling GDB on Windows using mingw64 toolchain
2018-03-06 16:15 ` Jan Vrany
@ 2018-03-06 17:44 ` Eli Zaretskii
2018-03-08 9:15 ` Jan Vrany
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2018-03-06 17:44 UTC (permalink / raw)
To: Jan Vrany; +Cc: gdb
> From: Jan Vrany <jan.vrany@fit.cvut.cz>
> Cc: gdb@sourceware.org
> Date: Tue, 06 Mar 2018 16:14:47 +0000
>
> On Tue, 2018-03-06 at 17:57 +0200, Eli Zaretskii wrote:
> > >
> >
> > Doesn't MinGW64 have the wint_t type? Because if it does, that part
> > of wchar.in.h should have been bypassed in your build.
>
> I believe it does have it. Following compile just fine:
> --
> #include <cwchar>
> int main(int argc, char **argv) {
> ::wint_t a;
> wint_t b;
> return 0;
> }
Then I guess you need to look in the config.log to understand why the
configure-time test for it failed.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Compiling GDB on Windows using mingw64 toolchain
2018-03-06 17:44 ` Eli Zaretskii
@ 2018-03-08 9:15 ` Jan Vrany
0 siblings, 0 replies; 9+ messages in thread
From: Jan Vrany @ 2018-03-08 9:15 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb
Hi,
On Tue, 2018-03-06 at 19:44 +0200, Eli Zaretskii wrote:
> >
> Then I guess you need to look in the config.log to understand why the
> configure-time test for it failed.
Thanks! I finally found the problem and it's embarrassing.
I found out that it did not detect wint_t because there was
a syntax error in generated conftest.c so it did not compile thus
the check failed (there was a garbage at the end of the .c file).
I run my Windows in VirtualBox and realized that my build directory
is on vbox "shared folder". When I tried to build on virtualized disk,
it worked just fine. Oh my... Interestingly, I build other programs
this way for years and never encountered this.
I'm sorry for the noise! And I'm really grateful for all hints you
all gave me - helped me a lot!
Thanks again,
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-03-08 9:15 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-04 17:19 Compiling GDB on Windows using mingw64 toolchain 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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox