Skip to content

Commit b1b69d2

Browse files
committed
Compatibilize ArmC6 with ArmC5-built archives
### Description Arm compiler 5 builds with "short" enums and "short" wchars. This means that C/C++ enums will be packed into the smallest power of 2 number of bytes by the compiler and the `wchar_t` is 2 bytes. Arm compiler 6 defaults to packing enums into 4 bytes and `wchar_t` is 4 bytes. Further, Arm Compiler 5's `-O0` (no optimizations) bulids will actually do some amount of optimizing, similar to Arm Compiler 6's `-O1`. I have switched the debug profile to `-O1` for maximum compatibility with our prior behavior. NOTE: "Compatibilize" is a word ### Pull request type [x] Fix [ ] Refactor [ ] Target update [ ] Functionality change [ ] Docs update [ ] Test update [ ] Breaking change
1 parent 9aef9d3 commit b1b69d2

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

tools/profiles/debug.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
"-Wl,-n"]
1717
},
1818
"ARMC6": {
19-
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-g", "-O0",
19+
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-g", "-O1",
2020
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
2121
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
22-
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="],
22+
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=",
23+
"-fshort-enums", "-fshort-wchar" ],
2324
"asm": [],
2425
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
2526
"cxx": ["-fno-rtti", "-std=gnu++98"],

tools/profiles/develop.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Os",
1919
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
2020
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
21-
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="],
21+
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=",
22+
"-fshort-enums", "-fshort-wchar"],
2223
"asm": [],
2324
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
2425
"cxx": ["-fno-rtti", "-std=gnu++98"],

tools/profiles/release.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz",
1919
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
2020
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
21-
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="],
21+
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=",
22+
"-fshort-enums", "-fshort-wchar"],
2223
"asm": [],
2324
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
2425
"cxx": ["-fno-rtti", "-std=gnu++98"],

0 commit comments

Comments
 (0)