Skip to content

Compile error with mingw64 / wsl (OCD-1042) #347

@ddemelier-ts

Description

@ddemelier-ts

Development Kit

esp32c6-devkitc

Module or chip used

esp32c6

Debug Adapter

ftdi

OpenOCD version

git

Operating System

Windows

Using an IDE ?

no

OpenOCD command line

no

JTAG Clock Speed

no

ESP-IDF version

no

Problem Description

Cross-compiling openocd-esp32 under wsl with x86_64-w64-mingw32 fails with the following error:

libtool: compile:  x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -D__USE_MINGW_ANSI_STDIO -DFD_SETSIZE=128 -I./src -I./src -DPKGDATADIR=\"/usr/share/openocd\" -DBINDIR=\"/usr/bin\" -I./jimtcl -I./jimtcl -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Wpointer-arith -Wundef -Werror -g -O2 -MT src/target/espressif/esp_semihosting.lo -MD -MP -MF src/target/espressif/.deps/esp_semihosting.Tpo -c src/target/espressif/esp_semihosting.c -o src/target/espressif/esp_semihosting.o
src/target/espressif/esp_semihosting.c: In function ‘esp_semihosting_common’:
src/target/espressif/esp_semihosting.c:25:36: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   25 | #define fsync(fd) FlushFileBuffers((HANDLE)fd)
      |                                    ^
src/target/espressif/esp_semihosting.c:730:26: note: in expansion of macro ‘fsync’
  730 |    semihosting->result = fsync(fd);
      |                          ^~~~~
cc1: all warnings being treated as errors

Debug Logs

No response

Expected behavior

Doesn't build.

Screenshots

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions