-
Notifications
You must be signed in to change notification settings - Fork 3k
NEW TOOLCHAIN: Add the ARMC6 Compiler #4949
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
Note this is an alternate implementation for #4905 |
tools/toolchains/arm.py
Outdated
|
||
if mem_map: | ||
args.extend(["--scatter", mem_map]) | ||
def make_real_scatter(self, scatter_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.
What about leaving the shebang in as is for ARMC5 so all the linker script stay as they are and have make_real_scatter replace the ARMC5 shebang with the ARMC6 shebang only when building for ARMC6?
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.
Sounds great! I'll do it first thing tomorrow.
tools/toolchains/__init__.py
Outdated
from tools.toolchains.gcc import GCC_ARM | ||
from tools.toolchains.iar import IAR | ||
|
||
TOOLCHAIN_CLASSES = { | ||
'ARM': ARM_STD, | ||
'uARM': ARM_MICRO, | ||
'ARMC6': ARMC6, |
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.
are we removing uARM ,because ARM_MICRO class is still defined ? Is this breaking change or what is the intention here? or I have missed something - most probably
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.
Did not mean to do that. Rebase coming anyway. I'll remove that change.
tools/profiles/release.json
Outdated
@@ -14,6 +14,13 @@ | |||
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit", | |||
"-Wl,-n"] | |||
}, | |||
"ARMC6": { | |||
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz", "-DNDEBUG", "-flto"], |
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.
isn't this duplicate flto
as it is also defined in the ld
?
Curious about choosing - Oz
for the release?
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.
No. ld flags are not taken from common.
-Oz
is for minimizing the size. That's what the release profile does. It used to be called small after all.
d3591e7
to
6a50eb2
Compare
targets/targets.json
Outdated
@@ -600,7 +600,7 @@ | |||
"K64F": { | |||
"supported_form_factors": ["ARDUINO"], | |||
"core": "Cortex-M4F", | |||
"supported_toolchains": ["ARM", "GCC_ARM", "IAR"], | |||
"supported_toolchains": ["ARM", "GCC_ARM", "IAR", "ARMC6"], |
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.
Drop this change.
tools/toolchains/__init__.py
Outdated
|
||
TOOLCHAIN_PATHS = { | ||
'ARM': ARM_PATH, | ||
'uARM': ARM_PATH, |
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.
Fix.
61818a5
to
9c779d9
Compare
I closed the other implementation, so I'm changing the title and removing the dupe label. |
@@ -122,4 +122,4 @@ LR_m_text m_interrupts_start m_text_start+m_text_size-m_interrupts_start { ; l | |||
} | |||
RW_IRAM1 ImageLimit(RW_m_data_2) { ; Heap region growing up | |||
} | |||
} | |||
} |
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.
nitpick - this file doesn't need to be modified.
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.
Yup. I'll rebase that out.
""" | ||
with open(scatter_file, "rb") as input: | ||
lines = input.readlines() | ||
if (lines[0].startswith(self.SHEBANG) or |
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 the line be normalized before using this check? That way extra spaces won't cause this comparison to fail
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 comparison failing would not be that bad: it would just emit another linker script with the correct shebang. I'm not sure I want to make that check complicated, but you're right that it can be improved to reduce the frequency of emitting linker scripts.
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.
Good point. I didn't realize there is no harm done if the comparison fails. I agree, it would be good to keep it simple like it is now.
9c779d9
to
8bd662a
Compare
8bd662a
to
cb7c509
Compare
I need to update this PR to include support for all targets. |
45c3dc8
to
b7c1072
Compare
@theotherjimmy armc6 looks good except for below 2
|
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
/morph test |
So I assume this is the outstanding Realtek error
In this file we have :
So it looks like GNUC is being defined for ARMCC 6 ? Which is a bit weird in itself. Speaking to Bartek he says it should be including cmsis_armclang.h for ARMCC 6 so I think this needs to look like -
|
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
REALTEK_RTL8195AM,toolchain ARMC6 there are long of warning : http://mbed-ci-master-2.austin.arm.com:8081/job/build_matrix/1138/target=REALTEK_RTL8195AM,toolchain=ARMC6/console Build time for REALTEK_RTL8195AM :
The temp fix to this is reduce the verbosity of logs, caveat to reduced info in case of failure. |
Yep |
@adbridge Yes, that's the correct fix. Thanks for pushing it! |
/morph test |
1 similar comment
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputExample Build failed! |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputExample Build failed! |
Run with ARM 6 build disabled since we have following issue to be resolved
/morph test |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
@studavekar Thanks for getting this through CI. |
Description
This implementation shares much more code with ARMC5 and comes with an
exporter: make_armc6. This all comes at a cost though:
I was required toI had to replace (or not) the scatter shebang dynamically, based on the toolchain being used.remove the CPP invocations from the top of all of the scatter files and
add them back dynamically,
Design Notes
This variant was designed to minimize the change set. In particular,
I removed all of theI replace the shebangs at runtime (of the tools). This does impose a requirement that the tools must always be able to do this going forward, but they#!
s from the top of Arm Compiler scatter files, andshould (and will, soon)detect if a scatter file does not contain a preprocessor invocation or contains a compatible preprocessor invocation and use it directly without modification. This may lead to linker errors, but I hope that "command armcc not found" and "command armclang not found" will be descriptive enough to users.Comparison to #4905
Advantages
Disadvantages
by forcing all scatter files to be preprocessed.that corrects armc5 invocations to armc6 invocations and armc6 invocations to armc5 invocations.TODO: