From b1b69d2d600dab71330d239ca7cfbf33a7657ca4 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Mon, 19 Nov 2018 11:43:05 -0600 Subject: [PATCH] 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 --- tools/profiles/debug.json | 5 +++-- tools/profiles/develop.json | 3 ++- tools/profiles/release.json | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/profiles/debug.json b/tools/profiles/debug.json index dc0ace4e0b..b5c6dbec93 100644 --- a/tools/profiles/debug.json +++ b/tools/profiles/debug.json @@ -16,10 +16,11 @@ "-Wl,-n"] }, "ARMC6": { - "common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-g", "-O0", + "common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-g", "-O1", "-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions", "-DMULADDC_CANNOT_USE_R7", "-fdata-sections", - "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="], + "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", + "-fshort-enums", "-fshort-wchar" ], "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu99"], "cxx": ["-fno-rtti", "-std=gnu++98"], diff --git a/tools/profiles/develop.json b/tools/profiles/develop.json index 1006de70a8..c9a15a6a1e 100644 --- a/tools/profiles/develop.json +++ b/tools/profiles/develop.json @@ -18,7 +18,8 @@ "common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Os", "-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions", "-DMULADDC_CANNOT_USE_R7", "-fdata-sections", - "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="], + "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", + "-fshort-enums", "-fshort-wchar"], "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu99"], "cxx": ["-fno-rtti", "-std=gnu++98"], diff --git a/tools/profiles/release.json b/tools/profiles/release.json index e0c36c979e..f17d2de426 100644 --- a/tools/profiles/release.json +++ b/tools/profiles/release.json @@ -18,7 +18,8 @@ "common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz", "-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions", "-DMULADDC_CANNOT_USE_R7", "-fdata-sections", - "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="], + "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", + "-fshort-enums", "-fshort-wchar"], "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu99"], "cxx": ["-fno-rtti", "-std=gnu++98"],