Skip to content

Fixing uvisor defines to fix build issues #3718

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
Feb 8, 2017

Conversation

bridadan
Copy link
Contributor

@bridadan bridadan commented Feb 7, 2017

Description

This issue was found when trying to integrate the GNU ARM Eclipse exporter PR here: #3561

There are a few files that build fine in ALL the other build systems (seriously, the mbed build system, make exporters, IAR, AND uVision all work just fine) but that cause issues in the new Eclipse exporter. This seems to be related to build order.

These changes just add explicit includes in files that were causing issues.

Status

READY

Migrations

If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.

NO

Related PRs

This is currently blocking #3561 from coming in.

Todos

  • morph test
  • morph export-build

Note to reviewers

@Patater and/or @AlessandroA Are there other files where we should add these explicit includes?

@bridadan
Copy link
Contributor Author

bridadan commented Feb 7, 2017

/morph test

@bridadan
Copy link
Contributor Author

bridadan commented Feb 7, 2017

/morph export-build

@mbed-bot
Copy link

mbed-bot commented Feb 7, 2017

Result: FAILURE

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

/morph test

Output

mbed Build Number: 1524

Example Prep failed!

@mbed-bot
Copy link

mbed-bot commented Feb 7, 2017

Result: FAILURE

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

/morph export-build

Output

mbed Build Number: 111

Exporter Build failed!

@Patater
Copy link
Contributor

Patater commented Feb 8, 2017

@bridadan

This doesn't seem like it should be required. I am suspicious of the files the Eclipse project is trying to include.

If you are building without FEATURE_UVISOR, all files under FEATURE_UVISOR should not be included. Likewise, no matter if FEATURE_UVISOR is used or not, any TARGET_IGNORE folder should not be included. Could you tell me whether your project is enabling FEATURE_UVISOR and if the Eclipse project is including TARGET_IGNORE and/or FEATURE_UVISOR files?

Thanks.

@bridadan
Copy link
Contributor Author

bridadan commented Feb 8, 2017

@Patater the project is enabling FEATURE_UVISOR (it's using this example: https://github.com/ARMmbed/mbed-os-example-uvisor). Also, it doesn't appear that any of the folders with TARGET_IGNORE are being included, but as far as I can tell that's not important for uVisor? This is the only file I could find in the uVisor tree that is behind a TARGET_IGNORE folder: https://github.com/ARMmbed/mbed-os/blob/master/features/FEATURE_UVISOR/importer/TARGET_IGNORE/.gitignore

It does seem to be including all FEATURE_UVISOR files though.

@bridadan
Copy link
Contributor Author

bridadan commented Feb 8, 2017

/morph test

@Patater
Copy link
Contributor

Patater commented Feb 8, 2017

@bridadan Thanks for looking into this. Excluding TARGET_IGNORE is important if the importer script is even run. Developers do this, but CI wouldn't. I see that you are building a uVisor example in your CI log, so yeah, you are building with FEATURE_UVISOR on occasion.

@@ -17,6 +17,8 @@
#ifndef __UVISOR_API_UVISOR_LIB_H__
#define __UVISOR_API_UVISOR_LIB_H__

#include "includes/uvisor-lib/uvisor-lib.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is needed, it's probably because some other file isn't including uvisor-lib/uvisor-lib.h correctly. Can you get away with not having this? What breaks? Can you include uvisor-lib/uvisor-lib.h from there instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like at least cmsis/core_cmSecureAccess.h needs to include uvisor-lib/uvisor-lib.h instead of just uvisor-lib.h.

Note that uvisor-lib/uvisor-lib.h includes api/inc/uvisor-lib.h, which is why we shouldn't include uvisor-lib/uvisor-lib.h from api/inc/uvisor-lib.h.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't just remove it, otherwise I get compilation errors. The issue here is without the include, UVISOR_PRESENT doesn't get defined, so I get redefinition errors when the compile process reaches this part of the code: https://github.com/ARMmbed/mbed-os/blob/master/features/FEATURE_UVISOR/includes/uvisor/api/inc/unsupported.h#L74

Which it definitely shouldn't be getting to since the K64F is a supported platform.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like doing your suggested change with cmsis/core_cmSecureAccess.h allows it to build, though not sure if it actually runs. But I guess we can always start from here! I'll update this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, removing will cause compilation errors. I was curious which files were having errors.

Thanks for the fix. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually when I used your cmsis/core_cmSecureAccess.h change I was able to remove the include! Though I just tried the binary and it doesn't seem to work. I'm afraid my knowledge is limited on what files need to include what, maybe this needs to be looked at more in depth?

@@ -18,6 +18,7 @@
#define __RTX_BOX_INDEX_H__

#include "cmsis_os.h"
#include "api/inc/vmpu_exports.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good change.

@mbed-bot
Copy link

mbed-bot commented Feb 8, 2017

Result: ABORTED

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

/morph test

Output

mbed Build Number: 1530

Example Build failed!

@bridadan
Copy link
Contributor Author

bridadan commented Feb 8, 2017

/morph test

Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our CI passed, so you didn't break anything with the normal build process. I'm happy with the changes here.

We can debug the exporter issues with uVisor in priority with other tasks. I motion to accept this PR and the exporter one, given that an issue is filed regarding uVisor and the exporter. Could you please file an issue?

Thanks again for the fixes.

@bridadan
Copy link
Contributor Author

bridadan commented Feb 8, 2017

/morph export-build

@AlessandroA
Copy link
Contributor

@bridadan Historically exporters have not worked with uVisor due to mismatching FPU configurations: #2320.

Since this is already communicated (it's in our release note), I agree with @Patater that from our perspective this can be merged. Thanks for the fix!

@bridadan
Copy link
Contributor Author

bridadan commented Feb 8, 2017

Thanks for the quick support @AlessandroA and @Patater!

@mbed-bot
Copy link

mbed-bot commented Feb 8, 2017

Result: SUCCESS

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

/morph test

Output

mbed Build Number: 1531

All builds and test passed!

@mbed-bot
Copy link

mbed-bot commented Feb 8, 2017

Result: FAILURE

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

/morph export-build

Output

mbed Build Number: 112

Exporter Build failed!

@bridadan
Copy link
Contributor Author

bridadan commented Feb 8, 2017

I was doing some Jenkins maintenance and ended up causing a few failures in the exporter builds 😞 restarting now.

/morph export-build

@mbed-bot
Copy link

mbed-bot commented Feb 8, 2017

Result: SUCCESS

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

/morph export-build

Output

mbed Build Number: 113

All exports and builds passed!

@bridadan bridadan removed the needs: CI label Feb 8, 2017
@bridadan
Copy link
Contributor Author

bridadan commented Feb 8, 2017

@0xc0170 @sg- Any chance we could get a quick merge on this? This should fix the last failures in #3561

@sg- sg- merged commit cd55625 into ARMmbed:master Feb 8, 2017
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