Commit graph

22 commits

Author SHA1 Message Date
Alistair Francis
d49ab2ddde gcc.make: Add support for riscv64-elf- toolchain
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2021-05-14 15:59:18 +10:00
Kent McLeod
b6366c80ce gcc.cmake Add additional RISCV toolchains
Search for more toolchains if the first one cannot be found.

Signed-off-by: Kent McLeod <Kent.Mcleod@data61.csiro.au>
2020-04-07 18:57:35 +10:00
Kent McLeod
f16fbbf93f gcc.cmake: Don't use CACHE when setting variables
The toolchain file is invoked in many different CACHE contexts and
shouldn't assume any behavior about the cache. Variables set in the file
will also be inherited by any scope that calls project() and so it is
not necessary to write any variables into the CACHE.
2020-03-17 15:55:05 +11:00
Kent McLeod
50d9eee09a gcc.cmake: Detect if toolchain file is templated
If the toolchain file is not templated, then any template variables
won't be initialized correctly. Add a test for overwriting
CROSS_COMPILER_PREFIX only if the templated value is valid.
2020-03-11 12:58:52 +11:00
Stephen Sherratt
f27b25c977 Set CROSS_COMPILER_PREFIX in gcc.cmake template 2020-03-11 11:36:05 +11:00
Gerwin Klein
79da079239 Convert license tags to SPDX identifiers
This commit also converts our own copyright headers to directly use
SPDX, but leaves all other copyright header intact, only adding the
SPDX ident. As far as possible this commit also merges multiple
Data61 copyright statements/headers into one for consistency.
2020-03-09 13:21:49 +08:00
Matthew
0e8a2cf05c Remove unnecessary variables in toolchain files
Setting `-target` flag explicitly is unnecessary. Whenever this needs to
be explicitly passed through, the coompiler id should be checked.

Changes to the musl build system makes the explicit `C_COMPILER`
variable useless.
2020-02-12 16:08:35 +11:00
Matthew
1d8b5d4ab1 Specify the C compiler in a variable for user lvl
Having the basic compiler name in a variable lets us pass it around to
any other user level project (e.g musllibc)
2020-02-12 16:08:35 +11:00
maybe-sybr
ea4c8cb163 Fix style complaints in gcc.cmake
Unrelated to the rest of the changeset on this branch but a good
opportunity to make the code quality checks happy.
2019-12-06 09:44:57 +11:00
maybe-sybr
dc5b6b6a74 Add support for arm Xcompilers on Red Hat distros
This change introduces a `gcc` hunting helper function to `gcc.cmake` in
order to help us find an appropriately prefixed `gcc` for the target
being built for. We use this helper to find 32b ARM cross-compiling
`gcc`s for both Debian and Red Hat based distros.
2019-12-06 09:44:57 +11:00
Kent McLeod
4d21d40b1e gcc.cmake: Add option for coloured gcc output
Setting the environment variable GCC_COLORS or CMake option
FORCE_COLORED_OUTPUT will cause GCC's colour messages to be outputted.
2019-11-26 08:58:34 +11:00
Kent McLeod
ed87dc35f2 gcc.cmake: Configure ccache in toolchain file
This should be a reasonable default option.
2019-09-19 11:23:01 +10:00
Kent McLeod
7d9297326b CMake: Possibly set toolchain file automatically
If CMAKE_TOOLCHAIN_FILE is unset in seL4Config.cmake then generate one
that selects the correct toolchain based on configured kernel arch
settings.

This means that initialising a build goes from:
`cmake -DCMAKE_TOOLCHAIN_FILE=gcc.cmake -DAARCH32=ON -G Ninja -C
../configs/ARM_verified.cmake ..`
to:
`cmake -G Ninja -C ../configs/ARM_verified.cmake ..`

gcc.cmake is modified to be used as an input to configure_file.
@KernelArch@ and other @@ arguments will be replaced with the
configuration settings. The file will still work if passed directly to
cmake via -DCMAKE_TOOLCHAIN_FILE=gcc.cmake without being templated.
2019-09-13 18:42:42 +10:00
Siwei Zhuang
d52341df3c cmake: Update the RISCV build to work with GCC 8.2.0 2019-03-15 10:48:37 +11:00
Kent McLeod
5ee9dec227 CMake: Move APPLE host check into x86 branch
This is to more clearly record the OSX host + x86 target assumption
when setting CROSS_COMPILER_PREFIX to "x86_64-unknown-linux-gnu-"
2018-09-10 15:57:19 +10:00
Ilya Yanok
a5a1efeaf5 Use Linux cross-compiler if building for x86_64 on OS X
Even if we are building for x86_64, we still need a cross compiler to be able to
build ELF binaries.

OS X cross compilers can be installed via brew from here:
https://github.com/SergioBenitez/homebrew-osxct
2018-09-10 15:57:19 +10:00
Kent McLeod
42230e271f cmake: Add RISC-V default toolchains to gcc.cmake 2018-04-18 10:10:14 +10:00
Adrian Danis
caf86a4b65 cmake: Convience argument for arm hardware floating point toolchain 2018-03-23 12:29:33 +11:00
Claudia Tu
0602690f28 Rename ARM toolchain flag to aarch32 2017-12-12 14:13:22 +11:00
Claudia Tu
9b009d9759 Add toolchain flag for aarch64 2017-12-12 14:13:22 +11:00
Adrian Danis
5e273cc7bd cmake: Easier setting of ARM cross compiler
Allows for an ARM cross compiler to be specified with just -DARM=TRUE when initializing
cmake, instead of having to specify a full cross compilation prefix. This provides no
additional functionality, but provides a nicer interface for users
2017-10-27 13:55:46 +11:00
Adrian Danis
0b73072016 Add a CMake based build system
This commit adds an alternate build system using CMake that operates indepenently of
the existing Kconfig+Kbuild+make based build system
2017-08-22 13:56:26 +10:00