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

New ztest API: build failure on qemu_cortex_m3 when CONFIG_CMAKE_LINKER_GENERATOR=y #47126

Closed
LixinGuoX opened this issue Jul 1, 2022 · 2 comments · Fixed by #47436
Closed
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@LixinGuoX
Copy link
Collaborator

LixinGuoX commented Jul 1, 2022

Describe the bug
I am migrating tests/kernel/xip,tests/kernel/context,tests/kernel/early_sleep to new ztest API, see #47124, #47231, #47229.
Those tests all use CONFIG_CMAKE_LINKER_GENERATOR on qemu_cortex_m3.
Then I got a CI build failure.

To Reproduce
Steps to reproduce the behavior:

  1. try build tests/kernel/xip on qemu_cortex_m3 with new ztest API

Expected behavior
Tests should pass.

Impact
CI blocked.

Logs and console output

[134/145] Building C object zephyr/kernel/CMakeFiles/kernel.dir/sched.c.obj
[135/145] Linking C static library zephyr/kernel/libkernel.a
[136/145] Linking C executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map 
: && ccache /opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc   zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  -fuse-ld=bfd  -Wl,-T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/__w/zephyr/zephyr/twister-out/qemu_cortex_m3/tests/kernel/xip/arch.common.xip.linker_generator/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/lib/posix/liblib__posix.a  zephyr/soc/arm/ti_lm3s6965/libsoc__arm__ti_lm3s6965.a  zephyr/subsys/testsuite/ztest/libsubsys__testsuite__ztest.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -L"/opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/thumb/v7-m/nofp"  -L/__w/zephyr/zephyr/twister-out/qemu_cortex_m3/tests/kernel/xip/arch.common.xip.linker_generator/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  -no-pie  -mcpu=cortex-m3  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -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  -Wl,--fatal-warnings && cd /__w/zephyr/zephyr/twister-out/qemu_cortex_m3/tests/kernel/xip/arch.common.xip.linker_generator/zephyr && /usr/local/bin/cmake -E echo
/opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/testsuite/ztest/libsubsys__testsuite__ztest.a(ztest_new.c.obj): in function `run_test_rules':
/__w/zephyr/zephyr/subsys/testsuite/ztest/src/ztest_new.c:196: undefined reference to `_ztest_test_rule_list_start'
/opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /__w/zephyr/zephyr/subsys/testsuite/ztest/src/ztest_new.c:196: undefined reference to `_ztest_test_rule_list_end'
/opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/testsuite/ztest/libsubsys__testsuite__ztest.a(ztest_new.c.obj): in function `z_ztest_get_next_test':
/__w/zephyr/zephyr/subsys/testsuite/ztest/src/ztest_new.c:469: undefined reference to `_ztest_unit_test_list_end'
/opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /__w/zephyr/zephyr/subsys/testsuite/ztest/src/ztest_new.c:469: undefined reference to `_ztest_unit_test_list_start'
/opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/testsuite/ztest/libsubsys__testsuite__ztest.a(ztest_new.c.obj): in function `z_ztest_run_test_suite_ptr':
/__w/zephyr/zephyr/subsys/testsuite/ztest/src/ztest_new.c:556: undefined reference to `_ztest_test_rule_list_start'
/opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /__w/zephyr/zephyr/subsys/testsuite/ztest/src/ztest_new.c:556: undefined reference to `_ztest_test_rule_list_end'
/opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/subsys/testsuite/ztest/libsubsys__testsuite__ztest.a(ztest_new.c.obj): in function `ztest_verify_all_test_suites_ran':
/__w/zephyr/zephyr/subsys/testsuite/ztest/src/ztest_new.c:639: undefined reference to `_ztest_unit_test_list_start'
/opt/toolchains/zephyr-sdk-0.14.2/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /__w/zephyr/zephyr/subsys/testsuite/ztest/src/ztest_new.c:639: undefined reference to `_ztest_unit_test_list_end'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
@LixinGuoX LixinGuoX added the bug The issue is a bug, or the PR is fixing a bug label Jul 1, 2022
@LixinGuoX LixinGuoX changed the title tests: kernel: xip: build failure on qemu_cortex_m3 when migrating to new ztest API New ztest API: build failure on qemu_cortex_m3 when CONFIG_CMAKE_LINKER_GENERATOR=y Jul 4, 2022
@LixinGuoX
Copy link
Collaborator Author

Anyone help to look at this issue?

@carlescufi
Copy link
Member

@tejlmand FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants