-
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
cmake: Cleanup of linking flags and improving structure #8440
Comments
Fixes: zephyrproject-rtos#8440 This commit move the link flag ${TOOLCHAIN_LIBS} from the global list to zephyr_interface and -u_ConfigAbsSyms to the zephyr library in order to give a better structure as described in zephyrproject-rtos#8440 Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Fixes: zephyrproject-rtos#8440 This commit moves kernel from the list in <zephyr_base>/CMakeLists.txt and place it as a link dependency when linking to zephyr_interface. It also links kernel to offsets to ensure correct link dependencies. Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Fixes: zephyrproject-rtos#8440 This commit moves the link flag -u_OffsetAbsSyms which is required when linking to offset static library. The library offset thus propagates the flags correctly during linking. It also ensures knowledge about link flags is present where it correctly belongs. Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Fixes: zephyrproject-rtos#8440 This commit move the link flag ${TOOLCHAIN_LIBS} from the global list to zephyr_interface and -u_ConfigAbsSyms to the zephyr library in order to give a better structure as described in zephyrproject-rtos#8440 Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Fixes: zephyrproject-rtos#8440 This commit moves kernel from the list in <zephyr_base>/CMakeLists.txt and place it as a link dependency when linking to zephyr_interface. It also links kernel to offsets to ensure correct link dependencies. Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Fixes: zephyrproject-rtos#8440 This commit moves the link flag -u_OffsetAbsSyms which is required when linking to offset static library. The library offset thus propagates the flags correctly during linking. It also ensures knowledge about link flags is present where it correctly belongs. Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
Hi @tejlmand, This issue, marked as an Enhancement, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person. Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason. @tejlmand you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you. Thanks! |
I have noticed that several link flags are handled by populating:
set(zephyr_lnk
${LINKERFLAGPREFIX},-Map=${PROJECT_BINARY_DIR}/${KERNEL_MAP_NAME}
-u_OffsetAbsSyms
-u_ConfigAbsSyms
${E_KERNEL_ENTRY}
${LINKERFLAGPREFIX},--start-group
${LINKERFLAGPREFIX},--whole-archive
${ZEPHYR_LIBS_PROPERTY}
${LINKERFLAGPREFIX},--no-whole-archive
kernel
${OFFSETS_O_PATH}
${LINKERFLAGPREFIX},--end-group
${LIB_INCLUDE_DIR}
-L${PROJECT_BINARY_DIR}
${TOOLCHAIN_LIBS}
)
Instead it is possible to add those flags to the module,e.g. offset / kernel and then the target which links to offset / kernel will obtain those flags through CMake dependencies.
Thus, it is not needed to maintain a separate list.
As example:
-u_OffsetAbsSyms and -u_ConfigAbsSyms are required by the offset library.
${E_KERNEL_ENTRY} ${TOOLCHAIN_LIBS} on the kernel library
The text was updated successfully, but these errors were encountered: