On Tue, Apr 06, 2021 at 03:31:40PM +0200, Stepan Klymonchuk wrote: > I cloned binutils-gdb repository from here (master branch) on a linux > machine (Ubuntu) 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=/usr/x86_64-w64-mingw32 --target=arm-none-eabi > --host=x86_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 > -DWITH_DEFAULT_ALIGNMENT=STRICT_ALIGNMENT -DDEFAULT_INLINE=0 > -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../../include > -I./../../include -I../../bfd -I./../../bfd -I../../opcodes > -I./../../opcodes -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 ‘os_time’: > ./../common/callback.c:417:25: error: passing argument 1 of ‘time’ > from incompatible pointer type [-Werror=incompatible-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 ‘time_t *’ > {aka ‘long long int *’} but argument is of type ‘long int *’ > 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
So this is when compiling sim. Did you intend to compile gdb and sim, or just binutils? If you really only wanting binutils (plus gas, ld, gprof) then configure with --disable-gdb --disable-gdbserver --disable-gdbsupport --disable-libdecnumber --disable-readline --disable-sim. Bug reports about gdb and sim should be reported via http://www.gnu.org/software/gdb/bugs/ or to bug-...@gnu.org > > I think it has something to do with time_t being typedef'd as a long long > int (64 bit integer) in the host platform (Windows), however, the function > os_time from the file sim/common/callback.c:414 (path relative to project > root), takes a long (32 bit integer) as a parameter: > > static longos_time (host_callback *p, long *t){ > return wrap (p, time (t)); > } > > How can I fix this error? > > > Stepan Klymonchuk -- Alan Modra Australia Development Lab, IBM