-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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] Fix 'gnuarmemb' auto-detection #45386
[cmake] Fix 'gnuarmemb' auto-detection #45386
Conversation
without 'specs=nosys.specs', GCC fails to compile a dummy C file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a valid change: see #45383 (comment)
@@ -24,6 +24,7 @@ set(BINTOOLS gnu) | |||
|
|||
set(CROSS_COMPILE_TARGET arm-none-eabi) | |||
set(SYSROOT_TARGET arm-none-eabi) | |||
set(CMAKE_EXE_LINKER_FLAGS_INIT "--specs=nosys.specs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let alone the problem that this is trying to solve does not exist when using one of the supported configurations (see #45383 (comment)), this fix is wrong because --specs=nosys.specs
is only valid when using the minimal libc. When using the newlib-nano, --specs=nano.specs
is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem occurs during the toolchain auto-detection only. The minimalc/newlib-nano choice is not done yet. CMake is checking if the toolchain found is usable by trying to compile a dummy C file (empty main()). It fails because the linker does not find the '_exit()' symbol. From what I read on ARM support forum (can't get my hands on it anymore...), it is normal as the toolchain is arm-none-eabi.
This fix should be harmless during the build stage as 'CMAKE_EXE_LINKER_FLAGS_INIT' variable is no longer used. Am I wrong?
(Note this flag is used in the same manner with the llvm/CLang toolchain)
Hello, |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
without 'specs=nosys.specs', GCC fails to compile a dummy C file
Fixes #45383