Skip to content

Protect local static object construction in ARMCC #5635

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 2 commits into from
Dec 12, 2017

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Dec 1, 2017

Implement the functions __cxa_guard_acquire, __cxa_guard_release and __cxa_guard_abort for ARMCC so local static object construction is thread safe. Also update the race test to properly detect this bug.

The test for construction of local static objects doesn't check
to see if the object returned has been fully initialized. Because
of this, an error with ARMCC was not detected.

This patch adds an assert to the race_test to ensure that the
object has been properly initialized.
@c1728p9
Copy link
Contributor Author

c1728p9 commented Dec 1, 2017

/morph build

@c1728p9
Copy link
Contributor Author

c1728p9 commented Dec 1, 2017

@theotherjimmy does anything special need to be done for ARMC6?

@theotherjimmy
Copy link
Contributor

You need to add:

#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)                                                                                

or similar for armc6 to pick up the block.

@c1728p9
Copy link
Contributor Author

c1728p9 commented Dec 1, 2017

@theotherjimmy This is already present:

#if defined (__GNUC__) || defined(__CC_ARM)

@theotherjimmy
Copy link
Contributor

@c1728p9 Yeah, I saw that. You don't have anything related to __ARMCC_VERSION though, which is required for ARMC6

Implement the functions __cxa_guard_acquire, __cxa_guard_release
and __cxa_guard_abort for ARMCC so local static object construction is
thread safe.
@c1728p9
Copy link
Contributor Author

c1728p9 commented Dec 1, 2017

My bad. I updated the PR to add it.

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 4, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Dec 4, 2017

Build : SUCCESS

Build number : 644
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5635/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Dec 4, 2017

@mbed-ci
Copy link

mbed-ci commented Dec 4, 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