-
Notifications
You must be signed in to change notification settings - Fork 7k
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
building samples/cpp/hello_world reports "undefined reference to `_impure_ptr'" error #78263
Comments
This is reproducible in CI under both I am raising the priority of this to high. |
FYI, this issue is currently being tracked in zephyrproject-rtos/sdk-ng#760. |
I am marking this as a release blocker since it prevents using C++ in Zephyr applications using the Zephyr SDK on two supported development platforms. |
This issue has been fixed on the SDK side by zephyrproject-rtos/sdk-ng#797, which will be available as part of the upcoming Zephyr SDK 0.16.9 release. This can be closed once the main CI is updated to use the SDK 0.16.9 release. |
I take it we need to backport the usage of the new SDK version to v3.7-branch, which is also using v0.16.8? How about v3.6-branch, which is using v0.16.5? Is that also affected? |
SDK v0.16.9 will be compatible with Zephyr v3.7 and v3.6 without any changes on the Zephyr side; so, there should be nothing to "backport." |
Well, the |
We have never done something like this in the past; but, given the criticality of this bug and that SDK v0.16.9 is compatible with v0.16.8 and v0.16.5, I suppose we can consider doing this. |
This issue can be closed after #80192 is merged. |
Describe the bug
We are starting to develop cpp applications based on Zephyr. But building the samples/cpp/hello_world reports "undefined reference to `_impure_ptr'" error.
To Reproduce
west build -b apollo4p_evb .\samples\cpp\hello_world\ -p
Expected behavior
No compiling error reports.
Impact
We cannot continue the development until the compiling error getting resolved.
Logs and console output
[1/125] Generating include/generated/zephyr/version.h
-- Zephyr version: 3.7.99 (C:/ambiqcodes/ambiqzephyr/zephyr), build: v3.7.0-2509-g6654c2a2f629
[120/125] Linking CXX executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/ambiqcodes/ambiqzephyr/zephyr/build/zephyr/zephyr_pre0.map
cmd.exe /C "cd . && C:\ambiqcodes\radio_sw\zephyr-sdk-0.16.8\arm-zephyr-eabi\bin\arm-zephyr-eabi-g++.exe -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -fuse-ld=bfd -T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=C:/ambiqcodes/ambiqzephyr/zephyr/build/zephyr/zephyr_pre0.map -Wl,--whole-archive app/libapp.a zephyr/libzephyr.a
zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/libarch__arm__core.a zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_zephyr/arch/common/libarch__common.a zephyr/arch/arch/arm/core/libarch__arm__core.a zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a zephyr/lib/libc/picolibc/liblib__libc__picolibc.a zephyr/lib/libc/common/liblib__libc__common.a zephyr/drivers/console/libdrivers__console.a
zephyr/drivers/pinctrl/libdrivers__pinctrl.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/timer/libdrivers__timer.a modules/hal_ambiq/mcu/apollo4p/lib..__modules__hal__ambiq__mcu__apollo4p.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a -L"c:/ambiqcodes/radio_sw/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp" -LC:/ambiqcodes/ambiqzephyr/zephyr/build/zephyr -lgcc zephyr/arch/common/libisr_tables.a -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -Wl,-X -Wl,-N -Wl,--orphan-handling=warn -lstdc++ -Wl,-no-pie -DPICOLIBC_LONG_LONG_PRINTF_SCANF --specs=picolibc.specs -lc -lgcc && cmd.exe /C "cd /D C:\ambiqcodes\ambiqzephyr\zephyr\build\zephyr && C:\Tools\cmake-3.22.3-windows-x86_64\bin\cmake.exe -E true""
c:/ambiqcodes/radio_sw/zephyr-sdk-0.16.8/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: c:\ambiqcodes\radio_sw\zephyr-sdk-0.16.8\arm-zephyr-eabi\bin../lib/gcc/../../picolibc/arm-zephyr-eabi/lib/thumb/v7e-m/nofp\libstdc++.a(ios_init.o): in function
std::ios_base::Init::Init()': ios_init.cc:(.text._ZNSt8ios_base4InitC2Ev+0x120): undefined reference to
_impure_ptr'collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'C:\Tools\cmake-3.22.3-windows-x86_64\bin\cmake.EXE' --build 'C:\ambiqcodes\ambiqzephyr\zephyr\build'
Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: