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

add testcase for LTO with picolibc module #81679

Conversation

benediktibk
Copy link
Collaborator

Add a testcase which builds with LTO and the picolibc module.

@benediktibk benediktibk marked this pull request as ready for review November 20, 2024 20:43
@benediktibk
Copy link
Collaborator Author

Testcase for #81674

@benediktibk benediktibk force-pushed the add/build_test_lto_picolibc_module branch from dde4013 to 00dd0c2 Compare December 12, 2024 12:13
Add a testcase which builds with LTO and the picolibc module.

Signed-off-by: Benedikt Schmidt <[email protected]>
@benediktibk benediktibk force-pushed the add/build_test_lto_picolibc_module branch from 00dd0c2 to 7d0e08e Compare December 23, 2024 08:47
@benediktibk
Copy link
Collaborator Author

benediktibk commented Dec 23, 2024

With the fix in #83132 of @keith-packard these tests now run successfully. There is only one small caveat: We pass -flto and -fno-lto at the same time, but it looks like later flags override the previous ones: https://stackoverflow.com/questions/15909788/how-does-gcc-behave-if-passed-conflicting-compiler-flags

.../zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-DCORE_CM7
-DHSE_VALUE=8000000
-DKERNEL
-DK_HEAP_MEM_POOL_SIZE=0
-DSTM32F746xx
-DUSE_FULL_LL_DRIVER
-DUSE_HAL_DRIVER
-D__LINUX_ERRNO_EXTENSIONS__
-D__PROGRAM_START
-D__ZEPHYR__=1
-I.../build/twister/nucleo_f746zg_stm32f746xx/tests/misc/test_build/buildsystem.lto.picolibc_module/zephyr/include/generated/zephyr
-I.../zephyr/include
-I.../build/twister/nucleo_f746zg_stm32f746xx/tests/misc/test_build/buildsystem.lto.picolibc_module/zephyr/include/generated
-I.../zephyr/soc/st/stm32
-I.../zephyr/soc/st/stm32/common/.
-I.../zephyr/drivers
-I.../zephyr/soc/st/stm32/stm32f7x/.
-I.../modules/hal/cmsis/CMSIS/Core/Include
-I.../zephyr/modules/cmsis/.
-I.../modules/hal/stm32/stm32cube/stm32f7xx/soc
-I.../modules/hal/stm32/stm32cube/stm32f7xx/drivers/include
-I.../modules/hal/stm32/stm32cube/common_ll/include
-isystem
.../zephyr/lib/libc/common/include
-isystem
.../build/twister/nucleo_f746zg_stm32f746xx/tests/misc/test_build/buildsystem.lto.picolibc_module/modules/picolibc/picolibc/include
-isystem
.../zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include
-isystem
.../zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/include-fixed
-Wshadow
-fno-strict-aliasing
-Werror
-Os
-flto=auto
-imacros
.../build/twister/nucleo_f746zg_stm32f746xx/tests/misc/test_build/buildsystem.lto.picolibc_module/zephyr/include/generated/zephyr/autoconf.h
-fno-printf-return-value
-fno-common
-g
-gdwarf-4
-fdiagnostics-color=always
-mcpu=cortex-m7
-mthumb
-mabi=aapcs
-mfp16-format=ieee
-mtp=soft
--sysroot=.../zephyr-sdk-0.16.1/arm-zephyr-eabi/arm-zephyr-eabi
-imacros
.../zephyr/include/zephyr/toolchain/zephyr_stdint.h
-Wall
-Wformat
-Wformat-security
-Wno-format-zero-length
-Wdouble-promotion
-Wno-pointer-sign
-Wpointer-arith
-Wexpansion-to-defined
-Wno-unused-but-set-variable
-Werror=implicit-int
-fno-pic
-fno-pie
-fno-asynchronous-unwind-tables
-ftls-model=local-exec
-fno-reorder-functions
--param=min-pagesize=0
-fno-defer-pop
-fmacro-prefix-map=.../zephyr/tests/misc/test_build=CMAKE_SOURCE_DIR
-fmacro-prefix-map=.../zephyr=ZEPHYR_BASE
-fmacro-prefix-map=...=WEST_TOPDIR
-ffunction-sections
-fdata-sections
-std=c99
-nostdinc
-fno-lto
-MD
-MT
zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/stdio.c.obj
-MF
zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/stdio.c.obj.d
-o
zephyr/lib/libc/picolibc/CMakeFiles/lib__libc__picolibc.dir/stdio.c.obj
-c
.../zephyr/lib/libc/picolibc/stdio.c

Copy link
Member

@aescolar aescolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kartben kartben merged commit 0603637 into zephyrproject-rtos:main Dec 23, 2024
18 checks passed
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

Successfully merging this pull request may close these issues.

4 participants