-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
C++: Boot fails with global STL objects #75853
Labels
area: C++
bug
The issue is a bug, or the PR is fixing a bug
platform: ESP32
Espressif ESP32
priority: low
Low impact/importance bug
Comments
sylvioalves
added a commit
to sylvioalves/zephyr
that referenced
this issue
Jul 16, 2024
cplusplus-rom linker initialization was wrongly placed in RAM area when it should be in ROM area. Fixes zephyrproject-rtos#75853 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
nashif
pushed a commit
that referenced
this issue
Aug 6, 2024
cplusplus-rom linker initialization was wrongly placed in RAM area when it should be in ROM area. Fixes #75853 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
topisani
pushed a commit
to topisani/zephyr
that referenced
this issue
Aug 28, 2024
cplusplus-rom linker initialization was wrongly placed in RAM area when it should be in ROM area. Fixes zephyrproject-rtos#75853 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com> (cherry picked from commit c374d31)
Chenhongren
pushed a commit
to Chenhongren/zephyr
that referenced
this issue
Aug 29, 2024
cplusplus-rom linker initialization was wrongly placed in RAM area when it should be in ROM area. Fixes zephyrproject-rtos#75853 (cherry picked from commit c374d31) Original-Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com> GitOrigin-RevId: c374d31 Cr-Build-Id: 8740269368881080913 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8740269368881080913 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: I6570e43f0389302d902a7996f746a67d3a4f2653 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5769425 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: C++
bug
The issue is a bug, or the PR is fixing a bug
platform: ESP32
Espressif ESP32
priority: low
Low impact/importance bug
Describe the bug
For a C++ app (main.cpp), when declaring a global variable of an STL class, e.g.,
std::string
, the app fails to boot (even the boot banner is not shown on the UART console).It seems like this problem is related to static construction of STL objects.
This happens since I upgraded to Zephyr v3.7.0-rc*. I did not experience this with v3.6.0, so it looks like a regression.
Zephyr version:
v3.7.0-rc3
(commit:fd0e46506fabd4c0c91ecb336a39cb6a6aa2b270
)Zephyr SDK:
0.16.8
C++ implementation:
CONFIG_GLIBCXX_LIBCPP=y
Target:
esp32_devkitc_wroom/esp32/procpu
To Reproduce
samples/cpp/cpp_synchronization
cd samples/cpp/cpp_synchronization
west build -b "esp32_devkitc_wroom/esp32/procpu"
west flash
west espressif monitor
Expected behavior
Successful sample app boot that starts with the boot banner:
Actual behavior
The bootloader stops after setting up memory segments and does not reach the boot banner stage.
Impact
Cannot run C++ applications with global/static STL objects.
In addition, cannot declare initialized STL rvalue in functions, for example, declaring the following function would also reproduce this problem (probably since it actually creates a static const object as rvalue to return):
Logs and console output
UART console log output of
samples/cpp/cpp_synchronization
when declaring global STL object as suggested in the reproduction steps given above:(output stops after the last line quoted above - no boot banner or any other output)
Environment:
esp32_devkitc_wroom/esp32/procpu
CONFIG_GLIBCXX_LIBCPP
v3.7.0-rc3
(fd0e46506fabd4c0c91ecb336a39cb6a6aa2b270
)The text was updated successfully, but these errors were encountered: