I just tried to cross-build latest git OpenOCD (using libftdi) under Linux. It
seems to me Win32 build with MinGW.org 32bit compiler is okay.
But then I got build error with MinGW-w64.
make[6]: Entering directory
`/home/mcuee/Desktop/build/openocd/build-win64-libftdi/src/jtag/drivers'
/bin/sh ../../../libtool --tag=CC --mode=compile
x86_64-w64-mingw32-gcc -std=gnu99 -DHAVE_CONFIG_H -I.
-I../../../../git/openocd/src/jtag/drivers -I../../..
-I../../../../git/openocd/src -I../../../src -g -O2
-D__USE_MINGW_ANSI_STDIO -Wall -Wstrict-prototypes -Wformat-security
-Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast
-Wcast-align -Wredundant-decls -MT ft2232.lo -MD -MP -MF
.deps/ft2232.Tpo -c -o ft2232.lo
../../../../git/openocd/src/jtag/drivers/ft2232.c
libtool: compile: x86_64-w64-mingw32-gcc -std=gnu99 -DHAVE_CONFIG_H
-I. -I../../../../git/openocd/src/jtag/drivers -I../../..
-I../../../../git/openocd/src -I../../../src -g -O2
-D__USE_MINGW_ANSI_STDIO -Wall -Wstrict-prototypes -Wformat-security
-Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast
-Wcast-align -Wredundant-decls -MT ft2232.lo -MD -MP -MF
.deps/ft2232.Tpo -c ../../../../git/openocd/src/jtag/drivers/ft2232.c
-o ft2232.o
../../../../git/openocd/src/jtag/drivers/ft2232.c:138:22: error:
redeclaration of enumerator 'TYPE_2232H'
/home/mcuee/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.5.2/../../../../x86_64-w64-mingw32/include/ftdi.h:25:80:
note: previous definition of 'TYPE_2232H' was here
../../../../git/openocd/src/jtag/drivers/ft2232.c:138:38: error:
redeclaration of enumerator 'TYPE_4232H'
/home/mcuee/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.5.2/../../../../x86_64-w64-mingw32/include/ftdi.h:25:94:
note: previous definition of 'TYPE_4232H' was here
../../../../git/openocd/src/jtag/drivers/ft2232.c: In function
'ft2232_device_is_highspeed':
../../../../git/openocd/src/jtag/drivers/ft2232.c:577:22: warning:
comparison between 'enum ftdi_chip_type' and 'enum <anonymous>'
../../../../git/openocd/src/jtag/drivers/ft2232.c:577:51: warning:
comparison between 'enum ftdi_chip_type' and 'enum <anonymous>'
../../../../git/openocd/src/jtag/drivers/ft2232.c: In function
'signalyzer_h_init':
../../../../git/openocd/src/jtag/drivers/ft2232.c:4125:18: warning:
comparison between 'enum ftdi_chip_type' and 'enum <anonymous>'
make[6]: *** [ft2232.lo] Error 1
The problem seems to be that the defintion has already been
included inside libftdi-0.18. And the MinGW-w64 compiler seems
to be more stringent.
ft2232.c:
#define LIBFTDI_READ_RETRY_COUNT 2000
#ifndef BUILD_FT2232_HIGHSPEED
#if BUILD_FT2232_FTD2XX == 1
enum { FT_DEVICE_2232H = 6, FT_DEVICE_4232H };
#elif BUILD_FT2232_LIBFTDI == 1
enum { TYPE_2232H = 4, TYPE_4232H = 5 };
#endif
#endif
ftdi.h from libftdi-0.18
/** FTDI chip type */
enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2, TYPE_R=3,
TYPE_2232H=4, TYPE_4232H=5 };
Commenting out the following two lines seems to solve the issues.
But I am not so sure if this is the proper fix and why these two
lines are there (an older version of libftdi?)
#elif BUILD_FT2232_LIBFTDI == 1
enum { TYPE_2232H = 4, TYPE_4232H = 5 };
--
Xiaofan
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development