1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

16 Commits

Author SHA1 Message Date
Marian Buschsieweke
59f1b4346c
makefiles/toolchain/llvm.inc.mk: disable annoying C++ warning
Designated initializers make the code much more readable and are part
of the C standard since C99. C++ with C++20 finally caught up.
Until we switch to that C++ version, let's disable the annoying
warning rather than reducing the code quality for the sake of
strict C++ compatibility of our headers.
2023-07-18 12:24:07 +02:00
Marian Buschsieweke
33442fdb71
makefiles/toolchain/llvm.inc.mk: fix include headers
With GCC, the C++ compiler knows all builtin C include paths *and*
all builtin C++ include paths, but the C compiler only knows the
C include paths. Hence, let's use the C++ compiler to collect
the include paths.
2023-07-18 12:24:07 +02:00
Marian Buschsieweke
e8bb46ece6
makefiles/toolchain/llvm.inc.mk: provide LLVM_VERSION
We already have GCC_VERSION, so let's also have LLVM_VERSION.
2023-07-18 12:24:04 +02:00
Marian Buschsieweke
6dcd3bb8ff
build system: support wrong target triples with LLVM
clang/LLVM is a bit more finicky with what target triples it accepts compared
to GCC. However, the GCC target triple is needed to properly locate the C
libraries. In case a locally installed GCC toolchain uses a technically not
fully correct target triple, it might be impossible to build with LLVM.

The solution here is to allow specifying a TARGET_ARCH_LLVM target triple
(which defaults to TARGET_ARCH), which is passed to clang. For locating the
C lib, still TARGET_ARCH is used.
2021-02-11 17:19:15 +01:00
080d5caa17
makefiles/toolchain: don't export all variables
There are already exported globally in vars.inc.mk
2020-06-24 11:00:54 +02:00
Leandro Lanzieri
fdff969695 makefiles/llvm.inc.mk: Use simple expansion for OBJCOPY and OBJDUMP 2020-02-04 15:22:07 +01:00
Marian Buschsieweke
716fc76f13
makefiles: Disable -Watomic-alignment on LLVM
`-Watomic-alignment` warns when C11 atomics have to be implemented via a to one
of the functions in `core/atomic_c11.c`. Unlike to the context of Desktop or
Server class machines, the performance penalty of this calls is insignificant
(and not existing with LTO). So this is not an issue in our context.

On the other hand: Keeping `-Watomic-alignment` prevents building applications
using C11 atomics on all platforms the atomic operations are not implemented
without calls to `core/atomic_c11.c` (due to `-Werror`), reducing portability.

So not only does the warning is not useful in our context, it actually prevents
portable use of C11 atomics. It is the most sensible thing to just disable it.
2019-10-18 09:18:37 +02:00
Gaëtan Harter
043534daf9
llvm: blacklist incompatible CFLAGS
Blacklist incompatible CFLAGS that are currently "optionally" included
in 'cflags.inc.mk'.

This prepares for the migration to 'OPTIONAL_CFLAGS'.
2019-08-29 17:43:54 +02:00
Gaëtan Harter
f47b09faa4
makefiles/toolchain: fallback to 'objdump'
When '$(PREFIX)objdump' is not present fallback to native '(g)objdump'.
'objdump' is used when flashing for some boards but the toolchain may
not be installed when building in docker.

This will allow using 'objdump' in 'cpu/kinetis/dist/check-fcfield.sh'.
2019-05-28 14:04:31 +02:00
Gaëtan Harter
566c990eba
makefiles/toolchain: fix command -v multiple commands
`command -v first second third` only works in `bash` and not in `sh`.
So replace with multiple calls to `command`.

This fixes using `objcopy` when the toolchain `objcopy` is not available.
2019-01-28 13:48:20 +01:00
cladmi
1802e775ad
llvm.inc.mk: completely replace detection of GCC includes
This completely removes the hardcoded/os specific path setting for includes.
It directly queries gcc include directories.

It takes what was already done by `makefiles/libc/llvm.inc.mk`.

I replaced the `GCC_MULTI_DIR` handling by givining `CFLAGS_CPU` when
searching for include directories.
`CFLAGS` cannot be used as it will crash when `-target $(CPU_ARCH)` is
added.
It currently requires using deferred variables as `CFLAGS_CPU` can be
overwritten later in the build process.
2018-10-16 12:50:01 +02:00
Sören Tempel
55b026b349 Makefile.include: Introduce LINKXX variable
This variable can be used to specify the linker which should be used to
link C++ object files. This is needed in order to use g++ for linking
with TOOLCHAIN=llvm.
2018-02-21 12:26:20 +01:00
Sören Tempel
18f99ef708 makefiles: always link with gcc even if TOOLCHAIN is set to LLVM
Fixes #8356
2018-02-21 12:26:20 +01:00
Joakim Nohlgård
0ad0a39a40 makefiles: Split GDB settings from toolchain 2017-10-18 14:34:20 +02:00
Joakim Nohlgård
7713bede99 openocd: Refactor openocd.sh script
- Merge flash and flash-elf commands since they were identical except
  for the file name of the image
- Split GDB command from DBG environment variable to allow more easily
  configure front-ends for GDB via environment variables.
- Remove verbose tests of empty variables and replace by `: ${VAR:=default}`
- Remove passed command line arguments to sub-functions, they were
  unused in the functions anyway.
- Remove TUI variable, use `export DBG_EXTRA_FLAGS=-tui` to get the same
  result.
2017-10-18 14:34:20 +02:00
Joakim Nohlgård
339a4da9dc Makefiles: move to new directory /makefiles 2017-04-04 15:11:54 +02:00