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

CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND missing implementation for __atomic_test_and_set, breaks stdatomic (IDFGH-14597) #15353

Closed
3 tasks done
nebkat opened this issue Feb 7, 2025 · 2 comments
Assignees
Labels
Status: Opened Issue is new Type: Bug bugs in IDF

Comments

@nebkat
Copy link
Contributor

nebkat commented Feb 7, 2025

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.4

Operating System used.

Windows

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

PowerShell

What is the expected behavior?

std::atomic_flag / stdatomic.h should work with CONFIG_SPIRAM=y.

What is the actual behavior?

Linker error: undefined reference to '__atomic_test_and_set'.

Steps to reproduce.

  1. Clone https://github.com/nebkat/esp-idf-stdatomic-bug
  2. idf.py @profile/spiram build

Build or installation Logs.

FAILED: hello_world.elf
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Espressif\tools\xtensa-esp-elf\esp-14.2.0_20241119\xtensa-esp-elf\bin\xtensa-esp32s3-elf-g++.exe -mlongcalls  -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -Wl,--cref -Wl,--defsym=IDF_TARGET_ESP32S3=0 -Wl,--Map=C:/Espressif/frameworks/esp-idf-v5.4/examples/get-started/hello_world/build/spiram/hello_world.map -Wl,--no-warn-rwx-segments -Wl,--orphan-handling=warn -fno-rtti -fno-lto -Wl,--gc-sections -Wl,--warn-common -T esp32s3.peripherals.ld -T esp32s3.rom.ld -T esp32s3.rom.api.ld -T esp32s3.rom.bt_funcs.ld -T esp32s3.rom.libgcc.ld -T esp32s3.rom.wdt.ld -T esp32s3.rom.version.ld -T esp32s3.rom.newlib.ld -T memory.ld -T sections.ld @CMakeFiles\hello_world.elf.rsp -o hello_world.elf && cd ."
C:/Espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(hello_world_main.c.obj):(.literal.app_main+0x0): undefined reference to `__atomic_test_and_set'
C:/Espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(hello_world_main.c.obj): in function `app_main':
C:/Espressif/frameworks/esp-idf-v5.4/examples/get-started/hello_world/main/hello_world_main.c:12:(.text.app_main+0xc): undefined reference to `__atomic_test_and_set'
collect2.exe: error: ld returned 1 exit status

More Information.

See also:

Appears to be introduced by 4f09fba, no linker error when reverted.

@nebkat nebkat added the Type: Bug bugs in IDF label Feb 7, 2025
@github-actions github-actions bot changed the title CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND missing implementation for __atomic_test_and_set, breaks stdatomic CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND missing implementation for __atomic_test_and_set, breaks stdatomic (IDFGH-14597) Feb 7, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 7, 2025
@Lapshin
Copy link
Collaborator

Lapshin commented Feb 7, 2025

@nebkat , thank you for the report. The issue #15167 has already been fixed in the master branch and backport is on its way to v5.4.
You may cherry-pick the commit 793e394 until the backport is not in place.

@nebkat
Copy link
Contributor Author

nebkat commented Feb 7, 2025

Damn I must have never jumped to the closed issues tab to see that issue 😢 Thanks @Lapshin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants