-
Notifications
You must be signed in to change notification settings - Fork 3k
Disable Arm Compiler 5 and Use Arm Compiler 6 by default #5406
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
Disable Arm Compiler 5 and Use Arm Compiler 6 by default #5406
Conversation
/morph build |
Build : FAILUREBuild number : 393 |
@theotherjimmy ARMC6 is no more supported which was used to test ARMC6 ? Should be just use the default ARM now with this PR and moving forward ?
|
Build : FAILUREBuild number : 398 |
Well crud. It still does not fit. |
4aba329
to
3bf7863
Compare
I removed the last commit, as it introduced incompatibility with the STD library. We are just going to have to live with wchar and enum size differences. |
/morph build |
I removed the only offending test from most targets (it tests the toolchains) |
Build : FAILUREBuild number : 403 |
1d8715f
to
3bf7863
Compare
I look at the C++ standard library size issue. The main offender is the vector class which pulls many things from the library: iostream, some exception support, and so on. On the other hand standard algorithms are fine and don't pull unrelated dependencies. Looking at libc++ source code and our compilation options vector shouldn't pull all these dependencies. After some digging, I found out that the those symbols are pulled in when the vector base class To avoid import of implicitly instantiated symbols, I've explicitly instantiated the class; templates instantiated implicitly generate weak symbols while template instantiated explicitly generates strong symbols therefore symbols resulting of an explicit instantiation will be picked up at link time. The results are dramatically different:
As surprising as it is, the code generated for Maybe there is something wrong with our link parameters which keep contents from For the record, the problem can be reproduced with the following code: #include <vector>
#define EXPLICIT_INSTANTIATION
/**
* @brief provide access to a private class member function or member data
* @details It is possible to explicitly instantiate a template class with a
* private pointer to member. When such instantiation occur, a friend function
* getMember is instantiated. This function will return the pointer to member
* used at the instantiation.
*
* @tparam MemberAccessor Act as a key to resolve the correct overload of getMember
* @tparam MemberType The type of the pointer to member that will be hijacked
* @tparam Member The pointer to member hijacked
*/
template<typename MemberAccessor, typename MemberType, MemberType Member>
struct hijacked_member_accessor {
friend MemberType getMember(MemberAccessor) {
return Member;
}
};
/**
* @brief Provide an accessors to a pointer to member, even if this one is private
*
* @param ACCESSOR name of the accessor to create
* @param MEMBER_TYPE type of the pointer to member
* @param MEMBER the pointer to member hijacked
*/
#define HIJACK_MEMBER(ACCESSOR, MEMBER_TYPE, MEMBER) \
struct ACCESSOR##_CLASS__ { \
ACCESSOR##_CLASS__() { } \
friend MEMBER_TYPE getMember(ACCESSOR##_CLASS__);\
};\
template struct hijacked_member_accessor<ACCESSOR##_CLASS__, MEMBER_TYPE, MEMBER>; \
static MEMBER_TYPE const volatile ACCESSOR = getMember(ACCESSOR##_CLASS__())
typedef std::__1::__vector_base_common<1> vector_base_common;
typedef __attribute__((noreturn)) void (vector_base_common::*throw_length_error_type)() const;
// set to 1 to explicitly instante std::__1::__vector_base_common<1>
#ifdef EXPLICIT_INSTANTIATION
template class std::__1::__vector_base_common<1>;
#endif
// create an accessor to the member function pointer vector_base_common::__throw_length_error
// named throw_length_error_accessor
HIJACK_MEMBER(
throw_length_error_accessor,
throw_length_error_type,
&vector_base_common::__throw_length_error
);
int main() {
return 0;
} The binary sizes are:
|
1997b70
to
0154f7d
Compare
/morph build |
Those two commits should get us testing in Austin CI |
now to get Travis working. |
Build : FAILUREBuild number : 449 |
I don't know what commit that was testing.... |
Ah, looking at my reflog, it tested the pre-amend version of |
/morph build |
@pan- I added the Explicit instantiation of the vector thingy to the stl_features test. Do you foresee any issues with that? |
Build : FAILUREBuild number : 450 |
Build : FAILUREBuild number : 451 |
656f596
to
6448d67
Compare
I just made the explicit instantination exclusive to armc6 |
/morph test |
Test : FAILUREBuild number : 293 |
I'm going to explain why these tests are superfluous because I don't like removing tests. The asserts were all asserting something that does not need to be true: that the toolchain's `name` attribute matched it's key in the `TOOLCHIAN_CLASSES` dictionary. With that out of the way, the `test_instantiation` test did not assert anything, and is therefore not a test.
4896e26
to
2c653ad
Compare
/morph build |
Rebased to get commits from #5405 |
Arm compiler 6 optimized way too well, and adding 2 more nops did the trick
/morph build |
Build : SUCCESSBuild number : 480 Triggering tests/morph test |
Build : SUCCESSBuild number : 481 Triggering tests/morph test |
Test : FAILUREBuild number : 300 |
Test : FAILUREBuild number : 301 |
@theotherjimmy there is one failure http://mbed-ci-master-2.austin.arm.com:8081/job/test_matrix_raas/301/target=NUCLEO_F746ZG,toolchain=ARM/ , i had to abort this combination. |
Thanks. That's a persnickety one, and I'm having trouble reproducing it (My device is not operating well as a serial port). |
Alright, I debugged it, and it looks like the FPU is off, leading to a usage fault. I turned the FPU on in a debugger, and was able to get the platform to pass an arbitrary test. |
/morph build |
Build : SUCCESSBuild number : 495 Triggering tests/morph test |
Exporter Build : FAILUREBuild number : 116 |
Test : SUCCESSBuild number : 313 |
No description provided.