From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CF629389850D; Wed, 7 Apr 2021 09:58:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF629389850D From: "stepanstepan0000 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug sim/27705] New: Error cross-compiling binutils-gdb for windows Date: Wed, 07 Apr 2021 09:58:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: sim X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stepanstepan0000 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2021 09:58:39 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27705 Bug ID: 27705 Summary: Error cross-compiling binutils-gdb for windows Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: sim Assignee: unassigned at sourceware dot org Reporter: stepanstepan0000 at gmail dot com CC: vapier at gentoo dot org Target Milestone: --- I cloned binutils-gdb repository from master branch on a linux machine (Ubu= ntu) and I want to compile it for Windows (using x86_64_w64_mingw32 toolchain). First, I ran ./configure with the following options to specify the cross-compile toolchain. ./configure --prefix=3D/usr/x86_64-w64-mingw32 --target=3Darm-none-eabi --host=3Dx86_64-w64-mingw32 Then I ran make and get the following error (I omitted most of the output because it is pretty large): [...] x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H=20 -DWITH_DEFAULT_ALIGNMENT=3DSTRICT_ALIGNMENT -DDEFAULT_INLINE=3D0 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wno-format -Werror -DMODET -I. -I. -I../common -I./../common -I../../incl= ude -I./../../include -I../../bfd -I./../../bfd -I../../opcodes -I./../../opcod= es -I../../intl -g -O2 -c -o callback.o -MT callback.o -MMD -MP -MF .deps/callback.Tpo ./../common/callback.c ./../common/callback.c: In function =E2=80=98os_time=E2=80=99: ./../common/callback.c:417:25: error: passing argument 1 of =E2=80=98time= =E2=80=99 from incompatible pointer type [-Werror=3Dincompatible-pointer-types] 417 | return wrap (p, time (t)); | ^ | | | long int * In file included from ./../common/callback.c:35: /usr/share/mingw-w64/include/time.h:230:47: note: expected =E2=80=98time_t = *=E2=80=99 {aka =E2=80=98long long int *=E2=80=99} but argument is of type =E2=80=98long in= t *=E2=80=99 230 | static __inline time_t __CRTDECL time(time_t *_Time) { return _time64(_Time); } | ~~~~~~~~^~~~~ cc1: all warnings being treated as errors make[3]: *** [Makefile:513: callback.o] Error 1 make[3]: Leaving directory '/media/D/Work/FC/binutils-gdb/sim/arm' make[2]: *** [Makefile:928: all-recursive] Error 1 make[2]: Leaving directory '/media/D/Work/FC/binutils-gdb/sim' make[1]: *** [Makefile:8376: all-sim] Error 2 make[1]: Leaving directory '/media/D/Work/FC/binutils-gdb' make: *** [Makefile:915: all] Error 2 I think it has something to do with time_t being typedef'd as a long long i= nt (64 bit integer) in the host platform (Windows), however, the function os_t= ime from the file sim/common/callback.c:414 (path relative to project root), ta= kes a long (32 bit integer) as a parameter: static long os_time (host_callback *p, long *t) { return wrap (p, time (t)); } How can I fix this error? --=20 You are receiving this mail because: You are on the CC list for the bug.=