forked from mesonbuild/meson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ARMCLANG compiler support for C/C++ (mesonbuild#3717)
- Loading branch information
Showing
8 changed files
with
206 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file assumes that path to the arm compiler toolchain is added | ||
# to the environment(PATH) variable, so that Meson can find | ||
# the armclang, armlink and armar while building. | ||
[binaries] | ||
c = 'armclang' | ||
cpp = 'armclang' | ||
ar = 'armar' | ||
strip = 'armar' | ||
|
||
[properties] | ||
# The '--target', '-mcpu' options with the appropriate values should be mentioned | ||
# to cross compile c/c++ code with armclang. | ||
c_args = ['--target=arm-arm-none-eabi', '-mcpu=cortex-m0plus'] | ||
cpp_args = ['--target=arm-arm-none-eabi', '-mcpu=cortex-m0plus'] | ||
|
||
[host_machine] | ||
system = 'bare metal' # Update with your system name - bare metal/OS. | ||
cpu_family = 'arm' | ||
cpu = 'Cortex-M0+' | ||
endian = 'little' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## ARM compiler(version 6) for C and CPP | ||
|
||
Cross-compilation is now supported for ARM targets using ARM compiler version 6 - ARMCLANG. | ||
The required ARMCLANG compiler options for building a shareable library are not included in the | ||
current Meson implementation for ARMCLANG support, so it can not build shareable libraries. | ||
This current Meson implementation for ARMCLANG support can not build assembly files with | ||
arm syntax(we need to use armasm instead of ARMCLANG for the .s files with this syntax) | ||
and only supports gnu syntax. | ||
The default extension of the executable output is .axf. | ||
The environment path should be set properly for the ARM compiler executables. | ||
The '--target', '-mcpu' options with the appropriate values should be mentioned | ||
in the cross file as shown in the snippet below. | ||
|
||
``` | ||
[properties] | ||
c_args = ['--target=arm-arm-none-eabi', '-mcpu=cortex-m0plus'] | ||
cpp_args = ['--target=arm-arm-none-eabi', '-mcpu=cortex-m0plus'] | ||
``` | ||
|
||
Note: | ||
- The current changes are tested on Windows only. | ||
- PIC support is not enabled by default for ARM, | ||
if users want to use it, they need to add the required arguments | ||
explicitly from cross-file(c_args/c++_args) or some other way. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters