espressif / newlib-esp32

Version of newlib used in ESP32 ROM and ESP-IDF
GNU General Public License v2.0
31 stars 18 forks source link

dirent.h:10:2: error: #error "<dirent.h> not supported" #13

Closed SB211 closed 1 month ago

SB211 commented 6 months ago

While building for a port on FreeBSD CURRENT using esp-4.3.0_20240322, I run into a sticky error:

[...] [ALL ] In file included from /usr/ports/devel/xtensa-esp32-elf/work-idf52/crosstool-NG-esp-13.2.0_20240305/.build/xtensa-esp32-elf/src/newlib/newlib/libc/include/dirent.h:39, [ALL ] from /usr/ports/devel/xtensa-esp32-elf/work-idf52/crosstool-NG-esp-13.2.0_20240305/.build/xtensa-esp32-elf/src/newlib/libgloss/libnosys/dir.c:13: [ERROR] /usr/ports/devel/xtensa-esp32-elf/work-idf52/crosstool-NG-esp-13.2.0_20240305/.build/xtensa-esp32-elf/src/newlib/newlib/libc/include/sys/dirent.h:10:2: error: #error " not supported" [ALL ] 10 | #error " not supported" [ALL ] | ^~~~~ [ERROR] /usr/ports/devel/xtensa-esp32-elf/work-idf52/crosstool-NG-esp-13.2.0_20240305/.build/xtensa-esp32-elf/src/newlib/newlib/libc/include/dirent.h:48:16: error: unknown type name 'DIR' [ALL ] 48 | int dirfd(DIR *);

Lapshin commented 6 months ago

@SB211 , please give more information on how you do this. Using crosstool-ng? (what configuration are you using and where I can see source code of crosstool-ng you are using)?

If it is not crosstool-ng, please provide a command line that was executed to configure newlib.

I suspect you building xtensa-esp32-elf toolchain that was outdated since version esp-13.2.0_20230928. At this moment only unified "[xtensa/riscv32]-esp-elf" toolchain builds are maintained that support all xtensa/riscv32 chips.

SB211 commented 1 month ago

Sorry for the late response.

Using trombik/xtensa-esp32-elf toolchain for FreeBSD with FLAVOR idf52 works as expected.