Skip to content

callback - Add workaround for IAR issue with type information #2898

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
Oct 4, 2016

Conversation

geky
Copy link
Contributor

@geky geky commented Oct 3, 2016

In the IAR ide, implicitly generated structures based on function templates end up with missing type information. This has no effect on using the IAR compiler standalone, but when used through the ide the missing type information causes the ide to error.

As a workaround, moved the function attributes generated for the Callback and Event classes into the class scope. This avoids the syntax that confuses IAR.

cc @pan-, @bridadan, @sarahmarshy

In the IAR ide, implicitly generated structures based on function
templates end up with missing type information. This has no effect
on using the IAR compiler standalone, but when used through the ide
the missing type information causes the ide to error.

As a workaround, moved the function attributes generated for the
Callback and Event classes into the class scope. This avoids the
syntax that confuses IAR.
@geky
Copy link
Contributor Author

geky commented Oct 3, 2016

/morph export-build

@mbed-bot
Copy link

mbed-bot commented Oct 3, 2016

Result: ABORTED

Your command has finished executing! Here's what you wrote!

/morph export-build

@bridadan
Copy link
Contributor

bridadan commented Oct 3, 2016

/morph export-build

@bridadan
Copy link
Contributor

bridadan commented Oct 3, 2016

/morph test-nightly

@mbed-bot
Copy link

mbed-bot commented Oct 3, 2016

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph export-build

@geky
Copy link
Contributor Author

geky commented Oct 4, 2016

/morph export-build

@mbed-bot
Copy link

mbed-bot commented Oct 4, 2016

Result: ABORTED

Your command has finished executing! Here's what you wrote!

/morph export-build

@bridadan
Copy link
Contributor

bridadan commented Oct 4, 2016

uVision was hanging, had to kill the exporter test. Restarting now!

/morph export-build

@mbed-bot
Copy link

mbed-bot commented Oct 4, 2016

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1043

Test failed!

@mbed-bot
Copy link

mbed-bot commented Oct 4, 2016

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph export-build

@bridadan
Copy link
Contributor

bridadan commented Oct 4, 2016

Nightly test results look ok, same failures we're currently seeing on master.

And export-build looks a lot better on IAR! Some targets are actually passing now 😄 Still some broken ones.

Getting a lot of these errors though:

00:52:24 C:\Jenkins\workspace\exporter_build_test\ide\iar\targets\cmsis\core_cm7.h(2230) : Error[Ta097]: Cannot call intrinsic function "__nounwind __DSB" from Thumb mode in this architecture

00:52:24 C:\Jenkins\workspace\exporter_build_test\ide\iar\targets\cmsis\core_cm7.h(2238) : Error[Ta097]: Cannot call intrinsic function "__nounwind __DSB" from Thumb mode in this architecture

00:52:24 C:\Jenkins\workspace\exporter_build_test\ide\iar\targets\cmsis\core_cm7.h(2239) : Error[Ta097]: Cannot call intrinsic function "__nounwind __ISB" from Thumb mode in this architecture

00:52:24 C:\Jenkins\workspace\exporter_build_test\ide\iar\targets\cmsis\core_cm7.h(2257) : Error[Ta097]: Cannot call intrinsic function "__nounwind __DSB" from Thumb mode in this architecture

00:52:24 C:\Jenkins\workspace\exporter_build_test\ide\iar\targets\cmsis\core_cm7.h(2265) : Error[Ta097]: Cannot call intrinsic function "__nounwind __DSB" from Thumb mode in this architecture

00:52:24 C:\Jenkins\workspace\exporter_build_test\ide\iar\targets\cmsis\core_cm7.h(2266) : Error[Ta097]: Cannot call intrinsic function "__nounwind __ISB" from Thumb mode in this architecture

00:52:24 C:\Jenkins\workspace\exporter_build_test\ide\iar\platform\CThunk.h(235) : Error[Ta097]: Cannot call intrinsic function "__nounwind __ISB" from Thumb mode in this architecture

00:52:24 C:\Jenkins\workspace\exporter_build_test\ide\iar\platform\CThunk.h(236) : Error[Ta097]: Cannot call intrinsic function "__nounwind __DSB" from Thumb mode in this architecture

@geky Let me know if you need help parsing through all of the log output from the CI.

uVision is all good though!

@pan-
Copy link
Member

pan- commented Oct 4, 2016

This has no effect on using the IAR compiler standalone, but when used through the ide the missing type information causes the ide to error.

Then why trying to fix the code ? Something has to be wrong with the exporters and some flags must not be propagated correctly. At the end, the IDE use the same compiler!

@sarahmarshy
Copy link
Contributor

@bridadan I have seen those errors with unsupported targets, because they are set to none. Can you check the regressions from previous runs? Sorry, I would but I am typing this on my phone.

@bridadan
Copy link
Contributor

bridadan commented Oct 4, 2016

@pan- It's not a compile error, the error is an internal error of IAR:

Internal Error: [CoreUtil/General]: OgElfTypeHandler: Missing type entry for local in B35 mbed::Callback<void (int)>::generate<>(void (*const &)(int))(f); s: this, ops, <Var 1715>; t: local [C:\Jenkins\workspace\exporter_build_test\ide\iar\hal\api\Callback.h\1413:5-1437:5]

If you have any ideas on this we're definitely open to suggestions 😄

@geky
Copy link
Contributor Author

geky commented Oct 4, 2016

My guess is that it is not a flags issue, but rather an interworkings issue with the ide and compiler. I suspect IAR has additional hooks to provide type-information from the compiler to the ide, and this relatively uncommon bit of C++ syntax causes the extra ligature to break.

@bridadan
Copy link
Contributor

bridadan commented Oct 4, 2016

@sarahmarshy Good call, this PR gets the exporter build test back to the state it was in when this PR was merged: #2754. Any idea how we could just "skip" the targets if we know they will fail in IAR? (Note: that can be a separate PR)

@pan-
Copy link
Member

pan- commented Oct 4, 2016

@bridadan Thanks for the clarification, did anyone contact IAR about this ? Are they mbed partners ?

@bridadan
Copy link
Contributor

bridadan commented Oct 4, 2016

I don't think we've reached out to IAR, thought that'd be a good thing to do. Though I personally don't know how to start that process. I think either @theotherjimmy or @sarahmarshy might know? Either way we can always revert this change if we find the IAR issue.

@sarahmarshy It looks like the only export build test that has ever had all IAR passing was from your open PR here: #2708 (specifically this CI run: http://10.118.12.43:8081/job/exporter_build_test/67/). This PR should come in first and then we should rerun PR #2708, correct? And then hopefully we'll have uVision and IAR passing?

@sarahmarshy
Copy link
Contributor

@bridadan Skips are determined by whether or not the target has information in this repo, so it would require a change there. Though, some of the errors might also be FPU settings, which are resolved in #2708. If we merge this PR, then run the tests on #2708, we should have fully passing tests!

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.

6 participants