-
Notifications
You must be signed in to change notification settings - Fork 3k
microlib support: Fix build with Arm Compiler 6 and MicroLib #10704
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
microlib support: Fix build with Arm Compiler 6 and MicroLib #10704
Conversation
Building binaries with MicroLib and Arm compiler 6 has been failing because of a bug in Arm compiler 6. The compiler introduces a symbol, `__scanf_mbtowc`, which is not present in MicroLib C library. The present commit adds a weak reference to the symbol to allow a successful linkage. This is a temporary fix until the bug in the compiler is fixed. It should be removed after the compiler bug is fixed.
@hugueskamba, thank you for your changes. |
// for the missing symbol | ||
#include <stdio.h> | ||
typedef int ScanfReadRec; | ||
MBED_WEAK long int _scanf_mbtowc( |
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.
Do we know what this function does? Basically what will fail for this setup.
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 converts multibyte charaters to wide characters. This function is not used in MicroLib which does not support wide characters or multibyte strings. The compiler inadvertently adds this symbol even if it is not used. There is an internal ticket being looked at by the compiler team which has acknowledged the bug.
The present commit essentially provides a stud for an unused functionality to satisfy the linker.
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.
Can we add here what version is affected (to know when we can remove it) , something along the lines <6.x.x is affected.
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.
Can we add here what version is affected (to know when we can remove it) , something along the lines <6.x.x is affected.
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 info about the compiler versions affected has been last in the last commit.
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.
*lost, correct, I cant find the comment "Arm Compiler 6 version 6.12 and earlier versions are affected." here.
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 info about the compiler versions affected has been last in the last commit.
It has now been restored. Thanks.
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.
How was this discovered - any tests failing, or we have missed the coverage?
It was discovered by attempting to build an application using the |
Started CI meanwhile |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Finalizing reviews, this is ready for integration |
6855093
to
e12889d
Compare
@0xc0170 please re-review latest changes |
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.
latest forced pushed resulted in missing the requested version
// for the missing symbol | ||
#include <stdio.h> | ||
typedef int ScanfReadRec; | ||
MBED_WEAK long int _scanf_mbtowc( |
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.
*lost, correct, I cant find the comment "Arm Compiler 6 version 6.12 and earlier versions are affected." here.
Regarding this. A request was made (via Jira) for the test team in Finland to add the test for uARM as they are responsible for adding it. |
e12889d
to
df16c78
Compare
Ci restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
df16c78
to
e12889d
Compare
@hugueskamba if you force push, leave a comment - let everyone know what has changed and why it was updated . This needs now CI again. |
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@evedon All good with this PR? |
I am not sure what that force push was as I was not even working on this branch. I need to figure out what is happening. I think when I force push on one branch it somehow push stuff on other branches too. I am investigating this at the moment. |
All good. |
Description
Building binaries with MicroLib and Arm compiler 6 has been failing
because of a bug in Arm compiler 6. The compiler introduces a
symbol,
__scanf_mbtowc
, which is not present in MicroLib C library.The present commit adds a weak reference to the symbol to allow a
successful linkage. This is a temporary fix until the bug in the
compiler is fixed. It should be removed after the compiler bug is fixed.
Pull request type