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

Fix CMake Deprecation Warnings #389

Merged
merged 1 commit into from
May 16, 2022
Merged

Conversation

edmooring
Copy link
Contributor

Building OpenAMP for standalone ARM R5, the following warning occurs:

CMake Deprecation Warning at
/usr/share/cmake-3.16/Modules/CMakeForceCompiler.cmake:75 (message):
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
cmake/platforms/cross_generic_gcc.cmake:5 (CMAKE_FORCE_C_COMPILER)
/home/mooring/build-oa/toolchain.r5-oa.sa:18 (include)
/usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:93 (include)
CMakeLists.txt:19 (project)

Follow the suggestions in the above error message, and add
CMAKE_TRY_COMPILE_TARGET_TYPE = STATIC LIBRARY, which makes try_compile()
not try to link the cross-compiled binary. This is necessary because the
arm-none-eabi toolchain libgcc doesn't have an implementation of _exit(),
leaving that to the BSP. This results in a CMake error because it can't
build the test executable.

Signed-off-by: Ed Mooring [email protected]

Building OpenAMP for standalone ARM R5, the following warning occurs:

CMake Deprecation Warning at
/usr/share/cmake-3.16/Modules/CMakeForceCompiler.cmake:75 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  cmake/platforms/cross_generic_gcc.cmake:5 (CMAKE_FORCE_C_COMPILER)
  /home/mooring/build-oa/toolchain.r5-oa.sa:18 (include)
  /usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:93 (include)
  CMakeLists.txt:19 (project)

Follow the suggestions in the above error message, and add
CMAKE_TRY_COMPILE_TARGET_TYPE = STATIC LIBRARY, which makes try_compile()
not try to link the cross-compiled binary. This is necessary because the
arm-none-eabi toolchain libgcc doesn't have an implementation of _exit(),
leaving that to the BSP. This results in a CMake error because it can't
build the test executable.

Signed-off-by: Ed Mooring <[email protected]>
@arnopo arnopo self-requested a review May 12, 2022 10:02
Copy link
Collaborator

@arnopo arnopo left a comment

Choose a reason for hiding this comment

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

LGTM
Do you plan to also provide same fix for the libmetal?

@arnopo arnopo added this to the Release V2022.10 milestone May 13, 2022
@edmooring
Copy link
Contributor Author

edmooring commented May 15, 2022 via email

@arnopo arnopo merged commit e5988ab into OpenAMP:main May 16, 2022
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.

2 participants