Skip to content

Fix ARMC6 linker error for the bare metal profile #11564

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

Merged
merged 1 commit into from
Sep 25, 2019

Conversation

hugueskamba
Copy link
Collaborator

Description

To reproduce the error, build mbed-os-example-blinky-baremetal with the following command using the master branch of Mbed OS:
mbed compile -t arm -m NUCLEO_F042K6

The ARMC6 compiler inadvertently introduces the _scanf_mbtowc symbol
to the build. The commit provides a weak definition of the symbol to
satisfy the linker whenever the symbol is included. This affects ARM
Compiler 6 version 6.12 and earlier.

The compiler error was previously observed when the MICROLIB library is
used with the uARM toolchain. However, the weak definition was put in
mbed-os/rtos which is not included when the bare metal profile is used.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@evedon @kjbracey-arm @0xc0170

Release Notes

The ARMC6 compiler inadvertently introduces the `_scanf_mbtowc` symbol
to the build. The commit provides a weak definition of the symbol to
satisfy the linker whenever the symbol is included. This affects ARM
Compiler 6 version 6.12 and earlier.

The compiler error was previously observed when the MICROLIB library is
used with the uARM toolchain. However, the weak definition was put in
`mbed-os/rtos` which is not included when the bare metal profile is used.
@ciarmcom ciarmcom requested review from 0xc0170, evedon, kjbracey and a team September 25, 2019 13:00
@ciarmcom
Copy link
Member

@hugueskamba, thank you for your changes.
@0xc0170 @kjbracey-arm @evedon @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 25, 2019

@ARMmbed/mbed-os-test baremetal build in CI to catch errors like these?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 25, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Sep 25, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit 28a0e3c into ARMmbed:master Sep 25, 2019
@hugueskamba hugueskamba deleted the hk-fix-armc6-baremetal-build branch September 26, 2019 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants