Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIO builder on espressif8266 platform (xtensa gcc) fails if CPLUS_INCLUDE_PATH env variable is set #309

Open
MikeCer opened this issue Nov 30, 2023 · 0 comments

Comments

@MikeCer
Copy link

MikeCer commented Nov 30, 2023

Configuration

Operating system:

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.11

Description of problem

If the system has the CPLUS_INCLUDE_PATH (https://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html) variable set, building via xtensa gcc fails due to dependencies issues.

Steps to Reproduce

  1. create new project
  2. add espressif8266 platform (in my case I have d1_mini_pro board and arduino framework)
  3. using bash or zsh set the env variable export CPLUS_INCLUDE_PATH=/usr/include/c++/11:/usr/include/x86_64-linux-gnu/c++/11
  4. clean all platform pio run -e d1_mini_pro -t cleanall
  5. build the project pio run -e d1_mini_pro -v

Actual Results

Processing d1_mini_pro (platform: espressif8266; board: d1_mini_pro; framework: arduino; lib_ldf_mode: chain+; monitor_speed: 115200)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_pro.html
PLATFORM: Espressif 8266 (4.2.0) > WeMos D1 mini Pro
HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 @ 3.30102.0 (3.1.2) 
 - tool-esptool @ 1.413.0 (4.13) 
 - tool-esptoolpy @ 1.30000.201119 (3.0.0) 
 - toolchain-xtensa @ 2.100300.220621 (10.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain+, Compatibility ~ soft
Found 37 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
xtensa-lx106-elf-g++ -o .pio/build/d1_mini_pro/src/main.cpp.o -c -fno-rtti -std=gnu++17 -fno-exceptions -Os -mlongcalls -mtext-section-literals -falign-functions=4 -U__STRICT_ANSI__ -ffunction-sections -fdata-sections -Wall -Werror=return-type -free -fipa-pta -DPLATFORMIO=60111 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_WEMOS_D1MINIPRO -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -D_GNU_SOURCE -DARDUINO=10805 -DARDUINO_BOARD=\"PLATFORMIO_D1_MINI_PRO\" -DARDUINO_BOARD_ID=\"d1_mini_pro\" -DFLASHMODE_DIO -DLWIP_OPEN_SRC -DNONOSDK22x_190703=1 -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DVTABLES_IN_FLASH -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -Iinclude -Isrc -I/home/mcerreto/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/home/mcerreto/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/home/mcerreto/.platformio/packages/toolchain-xtensa/include -I/home/mcerreto/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip2/include -I/home/mcerreto/.platformio/packages/framework-arduinoespressif8266/variants/d1_mini src/main.cpp
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/cstdlib:41,
xtensa-lx106-elf-gcc -CC -E -P -DVTABLES_IN_FLASH -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 /home/mcerreto/.platformio/packages/framework-arduinoespressif8266/tools/sdk/ld/eagle.app.v6.common.ld.h -o .pio/build/d1_mini_pro/ld/local.eagle.app.v6.common.ld
                 from /usr/include/c++/11/stdlib.h:36,
                 from /home/mcerreto/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h:27,
                 from src/main.cpp:1:
/usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39:10: fatal error: features.h: No such file or directory

******************************************************************
* Looking for features.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:features.h"
* Web  > https://registry.platformio.org/search?q=header:features.h
*
******************************************************************

   39 | #include <features.h>
      |          ^~~~~~~~~~~~
compilation terminated.

Expected Results

pio build command completes successfully compiling platform code, project sources using xtensa gcc and generates .bin file.

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:d1_mini_pro]
platform = espressif8266
board = d1_mini_pro
framework = arduino
monitor_speed = 115200

Additional info

simply remove the env variable unset CPLUS_INCLUDE_PATH to be able to compile correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant