Move the fpu settings across all cores so they are aligned.
Some cores did not have fpu set for ARMClang. I matched here both toolchains to set up
the fpu the same (Only exception is soft vs hard - that is separate issue I would not like to touch
in this series).
Set DOMAIN_NS=1 only for _NS cores. We had it otherway around.
I verified one non NS target that was failing to build, plus also checked the old tools
that had this definitions:
```
91: "Cortex-M23-NS": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "DOMAIN_NS=1",
92 "__CMSIS_RTOS", "__MBED_CMSIS_RTOS_CM"],
93 "Cortex-M23": ["__CORTEX_M23", "ARM_MATH_ARMV8MBL", "__CMSIS_RTOS",
94 "__MBED_CMSIS_RTOS_CM"],
```
Some armasm flags are passed to the ASM whilst we actually use armclang to invoke it. This causes build failures as armclang is not compatible with armasm flags.
This commit passes the same flags to all tools in the chain.
Due to the recent release of Mbed CLI 2, the command line options
have been renamed to ensure good usability and harmonize with the old
tools.
These are the following changes done:
* Minimum Cmake - 3.19.0 is required
* Minimum Mbed-tools - 4.0.0 is required
* mbed-tools cmd `init` to `new`
* mbed-tools cmd `build` to `compile`
* Removed whitespaces
Fixes https://github.com/ARMmbed/mbed-os/issues/13983
Move linker script to the function mbed_set_mbed_target_linker_script.
I also moved memmap as it is needed for an app. The location might not be the best fit,
we will address this in separate pull request.
Promote MBED_TOOLCHAIN_FILE_USED to cache variable so
its previous state can be recalled when re-building. This
is because CMAKE_TOOLCHAIN_FILE is also a cache variable and its
value is set on first run when it has not been set.
The compile defintions should always be added depending on the
selected toolchain.
mbed_set_toolchain_options() should only be called if a third-party
toolchain file has not been used as it has compile options that can
cause conflicts.
The new function (mbed_set_cpu_core_definitions()) should always be
called as it has defintions needed by Mbed OS to work with that
particular MCU core.
mbed_set_cpu_core_options() should only be called if a third-party
toolchain file has not been used as it has compile options that can
cause conflicts.
As the assembler does not seem to recognise the request to the
linker to use microlib, remove that instruction.
Microlib is still used as the linker selects microlib as a result
of being explicitly asked to do so.
Rename the CMake variable expected from applications from MBED_ROOT to
MBED_PATH to be consistent with the naming used for the configuration file
(MBED_CONFIG_PATH) also expected from applications.
Issue https://gitlab.kitware.com/cmake/cmake/-/issues/21093
Until this is fixed, we should disable response files for ARMClang + ninja on Windows.
Other toolchains and host systems should benefit from response files thus not disabling them
completely.
This fixes the issue with not finding includes. It's not trivial to find the root cause, it took me a while to figure out why ARMClang can't find the paths.
I moved the check to Mbed OS main cmake. It should not be in the toolchain file as it is not
related to the toolchain but to generator. We need toolchain properly set up first.
Note, I had to protect setting CMAKE_NINJA_FORCE_RESPONSE_FILE. If I set it to 0, ninja
would still use rsp files so I rather protected it and define that variable only when
required, not always.
Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com>
mbed-os consists of mbed-core and mbed-rtos
mbed-baremetal consists of mbed-core
The main change is for mbed-core. Changing from object library to be interface. This way it allows us to do the above to have 2 main targets for users to use.
This should be backward compatible change as mbed-os target we used contains the same files/options as previously set.
These settings like enable_language should be done in the application and just once.
We hit the issue when you expose sources to an app (interface or public), CMake errors as some of the internal settings have not been configured.
A linker script needs symbols (stack size, app size, etc). They are basic values or defines. Not any array like or string like macros. We should filter these, as they are not valid anyway.
The other option to fix this would be to fix all the macros but I dont think it is needed as these config values won't be used in the linker script anyway.
Not allowed in ld files macros with spaces, like MACRO={0, 2, 3} or MACRO=(4 * 2000).
Directories that start with special prefixes (TARGET_, FEATURE_, COMPONENT_) are added to the build based on Mbed target configuration from targets.json instead of calling utility function mbed_add_cmake_directory_if_labels().
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.
Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
- Add linker option to generate map file for GCC_ARM and ARM toolchain
- Add mbed_generate_map_file function to call memap.py (parse the map
file).
- Add mbed_generate_executable function to generate executable artifacts with a memory map table