Main thread in Mbed OS is statically allocated and was not available in call
stack of Keil MDK. The RTX5 kernel requires statically allocated thread
information objects that are placed into a specific section to enable RTOS
thread awareness in Keil MDK. This fix is to keep main thread in specific
section of memory.
### 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
Quite a few of the scatter files are not (yet) aligned to 8-byte
boundaries and therefore the removal of legacy alignment feature
(which is under deprecation warning, but it actually not YET
deprecated) broke quite a few builds to this error:
Error: L6244E: Exec region RW_IRAM1 address (0x200001ac) not aligned on a 8 byte boundary.
We must bring this option now back to fix the builds.
This option to ld (--legacyalign) can only be removed once all of
the scatter files have been fixed.
By default IAR generates "transfer of control bypasses initialization"
warnings for C code - it's a legal construct that frequently occurs when
doing Linux-style "goto error". Many occurrences in Nanostack.
Suppress the warning for C only, to align with GCC and ARMCC. Have to
take care not to put it in the "common" section, as this would suppress
it for C++, where it actually is illegal.
### Description
Full paths in the map file are required to have correct memap parsing.
This PR adds the option `--show_full_path` to ARMC6 in every profile.
This option only affects the map file output, so it's safe to add.
This allows minimal debugging and allows tools like
mbed-os-linker-report to work properly.
Because debugging info is kept in .elf file and not flashed to device
there is no side effects to flash sizes.
While ARMC6 does use the same linker (armlink) as ARM Compiler 5, it
is not compatible.
The reason for this incompatibility are twofold:
* armlink may invoke the C preprocessor by adding a shebang
(`#!`) to the top of their input files.
* ARMC6 and ARMC5 differ in how you invoke the preprocessor:
* ARMC5: `#! armcc -E`
* ARMC6: `#! armclang -E`
This forces the tools to rewrite the shebang if it's wrong.
This does not yet handle dependencies properly