-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add missing --preinclude and -input on assembly files #2303
Conversation
This change: b4e8cf6. However, looks like just cmd options. @bogdanm Is that correct? @AlessandroA Please can you test? @theotherjimmy I can't figure out what the IAR change does. I assume the exporter.py adds preinclude to asm flags, and the iar change removes it ,because of the IAR limitation? Better commit message might answer it. |
@0xc0170 your assumtion is correct. The IAR assembler cannot handle the |
How did you test this? At least with GCC and make, I don't see how this can work, since the exporter template doesn't add the include paths for assembler files: https://github.com/mbedmicro/mbed/blob/master/tools/export/gcc_arm_common.tmpl#L92 |
I tested the PR and the compilation still fails. The build command should also include the config file Failure:
File structure (the file is there):
Note: To test it I cherry-picked this commit on top of |
@theotherjimmy please state always how you tested a patch (how to reproduce this prior the patch that it failed, and how it solves the problem after this patch). |
It does here: https://github.com/mbedmicro/mbed/blob/master/tools/export/gcc_arm_common.tmpl#L92 (you'd also need the |
Woops. Yes @bogdanm, you are correct I did not specify an include path for the |
That should do it. |
d1547ac
to
8e17375
Compare
Except for IAR, it does not support the --preinclude option for assembly files but all of the other exporters can. It was less code to remove it in IAR than to explicitly add it in all of the other exporters.
8e17375
to
5ef2a56
Compare
I also added the full explanation of why not IAR that I gave to @0xc0170 to the first commit message. |
.s.o: | ||
+@$(call MAKEDIR,$(dir $@)) | ||
$(CC) $(CPU) -c $(ASM_FLAGS) -o $@ $< | ||
$(CC) $(CPU) -c $(ASM_FLAGS $(INCLUDE_PATHS)) -o $@ $< |
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.
Syntax error here (parantheses opening/closing incorrectly).
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.
Doh! Just a moment. It passed my test.
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.
Thanks for being on top of code review!
5ef2a56
to
43737c1
Compare
@@ -196,6 +197,7 @@ def scan_and_copy_resources(self, prj_paths, trg_path, relative=False): | |||
self.config_header = self.toolchain.MBED_CONFIG_FILE_NAME | |||
config.get_config_data_header(join(trg_path, self.config_header)) | |||
self.config_macros = [] | |||
self.resources.inc_dirs.append(dirname(self.config_header)) |
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 don't think this does anything useful. 3 lines above (line 197) we set config_header
to the name of the config header file, not to its path. So its dirname will always be empty.
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.
True.......... So it should just append trg_path then? (I'm apparently still asleep over here :P)
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 think that'll help, yes.
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.
Actually that does some strange stuff. -I..//home/jimbri01/src/mbedmicro/mbed/.build/export/.temp
ends up in my command line.
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'm pretty sure that the mbed_config.h
file will always be in the same directory as the Makefile
.
43737c1
to
437c84b
Compare
437c84b
to
209cf9f
Compare
@@ -196,6 +197,7 @@ def scan_and_copy_resources(self, prj_paths, trg_path, relative=False): | |||
self.config_header = self.toolchain.MBED_CONFIG_FILE_NAME | |||
config.get_config_data_header(join(trg_path, self.config_header)) | |||
self.config_macros = [] | |||
self.resources.inc_dirs.append(".") |
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'm going to assume that you veridifed that . == trg_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.
Actually, the trg_path is an absolute path to the .temp directory where the project files are generated. I did verify that the Makefile
and mbed_config.h
always live in the same directory.
I tested locally with ARMmbed/mbed-os-example-uvisor#8:
Follow up on the issue: After fixing the CC_FLAGS issue, this pr should be good to go. |
@@ -76,6 +76,8 @@ def generate(self, progen_build=False): | |||
project_data['tool_specific']['iar'].setdefault("misc", {}) | |||
project_data['tool_specific']['iar'].update(tool_specific['iar']) | |||
project_data['tool_specific']['iar']['misc'].update(self.progen_flags) | |||
project_data['tool_specific']['iar']['misc']['asm_flags'].remove( | |||
self.toolchain.get_config_option(self.config_header)[0]) |
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.
Is there a way to provide configuration options to the IAR assembler in the exporters now? On the command line, it's done by switching to -D
s instead of using --preinclude
:
https://github.com/ARMmbed/mbed-os/blob/master/tools/toolchains/iar.py#L155
@theotherjimmy: any news on this? |
Updated per @geky's comment. |
Ah! Sorry @theotherjimmy, it should be CC_SYMBOLS for asm rules. |
e4de665
to
965ffc3
Compare
Looks good to me and worked locally. LGTM 👍 |
Any answer to this:
Or should we just ignore this for now? |
from iasmarm help:
That's my best guess. |
And again, as I already explained in a previous comment, that's already implemented here for command line: https://github.com/ARMmbed/mbed-os/blob/master/tools/toolchains/iar.py#L155 Question is, do we plan to do the same thing in exporters? |
I think we should. The question in my mind is: should it be part of this PR? EDIT: Yes. |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
Outputmbed Build Number: 582 All builds and test passed! |
Given the circumstances, I think we can go ahead with this and fix the IAR ASM flags issue when/if we need to. |
...so yeah, the fix for IAR ASM is already in this PR. Thanks @theotherjimmy. I'll be right back, need to find a good optician. |
Except for IAR
Resolves #2272