-
Notifications
You must be signed in to change notification settings - Fork 3k
Enabling small C library option and deprecating uARM toolchain #12068
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
Conversation
@rajkan01, thank you for your changes. |
f17280e
to
8ee62e9
Compare
|
We will be doing this renaming from default_lib to c_lib in IOTCORE-1450 after this PR merged. |
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.
@ARMmbed/team-st-mcd could you have a look at changes to the linker scripts?
"*": { | ||
"K64F": { | ||
"target.default_lib": "small", | ||
"mbed-trace.fea-ipv6": false |
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.
What is that and why does it need to be set?
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.
I'll let rajkumar answer. But mbed-trace.fea-ipv6
should have been overridden for all targets.
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.
"mbed-trace.fea-ipv6": false added to disable IPV6 tracing code in mbed_trace and we need mbed_trace due to dependency with the device key. More information on PR #11875
73fdc50
to
cb9b6d5
Compare
a7b0cf1
to
1116c18
Compare
d0e09b0
to
c4b1a65
Compare
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.
Should you also remove all TOOLCHAIN_ARM_MICRO directory ?
and harmonize TOOLCHAIN_ARM_STD and TOOLCHAIN_ARMC6
"target.default_lib": "small" | ||
}, | ||
"NUCLEO_F411RE": { | ||
"target.default_lib": "small" |
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.
Why target.default_lib is not set to small for all targets,
instead of adding a line for each 1...?
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.
It has only been set for targets that have been tested so far.
@evedon please comment |
We are deprecating TOOLCHAIN_ARM_MICRO but not removing it at this stage. This will be done in a future Mbed OS release. |
@@ -51,6 +51,8 @@ static control_t test_printf_d(const size_t call_count) | |||
|
|||
/*************************************************************************/ | |||
/*************************************************************************/ | |||
#if !defined(__NEWLIB_NANO) | |||
// The format specifier %hhd is not supported by Newlib-Nano |
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.
That doesn't make sense to me. These tests are for minimal-printf not for standard printf. I'm assuming they are being run in all cases even if the minimal-printf is not present and that's the problem. The thing is this change will possibly hide issues as we won't execute tests in usecase with minimal-printf and minimal clibs. I think the correct solution is to exclude all minimal-printf tests if minimal-printf is not used, but run them with newlib-nano + minimal-printf as the newlib-nano limitation won't be hit.
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 user has the choice to swap the standard printf by minimal-printf ; mbed_printf
is a test API that is always present (it calls mbed_minimal_formatted_string
which is the minimal printf implementation).
But you are right that the limitation is a newlib-nano limitation and the test could check against a predefined value to avoid calling printf.
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.
It's also a waste of time in the CI (even if not huge one) to test the stdlib. Sure it possible to find bugs there but it's rather rare.
- By default, Mbed OS build tools use standard C library for all supported toolchains. It is possible to use smaller C libraries by overriding the "target.default_lib" option with "small". This option is only currently supported for the GCC_ARM toolchain. This override config option is now extended in the build tool for ARM toolchain. - Add configuration option to specify libraries supported for each toolchain per targets. - Move __aeabi_assert function from rtos to retarget code so it’s available for bare metal. - Use 2 memory region model for ARM toolchain scatter file for the following targets: NUCLEO_F207ZG, STM32F411xE, STM32F429xI, NUCLEO_L073RZ, STM32F303xE - Add a warning message in the build tools to deprecate uARM toolchain. - NewLib-Nano C library is not supporting floating-point and printf with %hhd,%hhu,%hhX,%lld,%llu,%llX format specifier so skipping those green tea test cases.
My comments around disabling tests weren't addressed. It's not a huge problem, but with minimal amount of work we can do things properly. So unless I'm missing something could you please make sure the minimal-printf tests are not executed when minimal-printf is not used? |
8f7171d
to
4cd6236
Compare
4cd6236
to
3697815
Compare
Minimal printf green tea test has changed to test without using std library printf and snprintf functions, please review. |
CI started |
Test run: FAILEDSummary: 2 of 4 test jobs failed Failed test jobs:
|
What are the effects if any on program memory / ram consumption? |
CI restarted |
Test run: FAILEDSummary: 1 of 12 test jobs failed Failed test jobs:
|
test restarted |
I'll review this one as well. |
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.
Once "Release Notes" are provided, LGTM
Oh, wait, reviewing the first template above (was it using older one) ? I'm checking now |
@bulislaw does a deprecation (even of a compiler) count as a breaking change ? I've marked it as such for now, pending confirmation. |
Summary of changes
more info on https://github.com/ARMmbed/mbed-os/blob/master/docs/design-documents/platform/memory-model/ram_memory_model.md,
so replaced ARM Std scatter file 1-region memory model with Microlib scatter file 2 region memory model.
Impact of changes
With these changes, uARM toolchain is being deprecated.
Migration actions required
As uARM toolchain is deprecated, the user has to redefine a supported_c_libs configuration with "small" for arm toolchain on the target in targets.json to enable Microlib support like
and change the scatter file to the 2-region memory model see more info.
Instead of -t uARM, use default_lib with "small" in mbed_app.json configuration for ARMC6 toolchain.
Documentation
ARMmbed/mbed-os-5-docs#1178
Pull request type
Test results
Reviewers
@evedon @hugueskamba @jamesbeyond @graham.hammond @mark.edgeworth @adrien.cabarbaye