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

102 Commits

Author SHA1 Message Date
Marian Buschsieweke
b86366e34e
makefiles/toolchain: Fix incorrect assumptions on address space layout
GCC 12 gives out of bounds warnings when the resulting address is out
of bounds of what GCC assumes to be the valid address space. It seems
that by default the address 0x0 is not considered valid (which would
be a NULL pointer and typically not mapped in a userspace behind an MMU
scenario), but in fact is valid on bare metal hardware. At least on
AVR and MSP430 this needs to be set. On many Cortex M MCUs 0x0 is also
a valid address (e.g. often the flash is mapped there), but seemingly
for them `--param=min-pagesize=0` is already the default. In any case,
it won't hurt to set it explicit for them as well.
2023-05-08 15:42:40 +02:00
Marian Buschsieweke
b123f1071a
cpu/msp430_common: Fix linking with binutils 2.40
An `INSERT AFTER` directive no longer can refer to a different linker
script included with `-T path/to/script.ld`. Instead, this adds wrapper
linker scripts that just `INCLUDE` the three individual linker scripts.
This way, the xfa.ld can safely refer back to sections defined in
the vendor linker script.

For some reason, this approach cause the exact issue it fixes for
binutils 2.40 with the binutils in the CI. We stick with the old
linker flags with binutils prior 2.40 to be compatible with both
conflicting behaviors.

The best approach would be to come up with something that works across
different versions of binutils; but no such solution materialized.
2023-05-08 15:40:26 +02:00
Marian Buschsieweke
7e8a0ae2d4
build system: use -std=gnu11 for avr8
This allows using the __flash qualifier to store data into flash.
2023-02-27 12:06:29 +01:00
Benjamin Valentin
b30efeeb65 makefiles/gnu.inc.mk: set flags based on compiler version 2022-11-19 23:14:54 +01:00
Benjamin Valentin
71b1689407 makefiles/cflags.inc.mk: don't include absolute path in __FILE__ macro 2022-11-15 15:28:54 +01:00
Marian Buschsieweke
8448aa33ae
makefiles/arch/cortexm.inc.mk: fix ASMFLAGS
Drop `CFLAGS_DBG` from `ASFLAGS` to fix

    make RIOT_CI_BUILD=1 CC_NOCOLOR=1 --no-print-directory -C /home/maribu/Repos/software/RIOT/tests/pkg_qdsa clean all
    rm -rf /home/maribu/Repos/software/RIOT/tests/pkg_qdsa/bin/samr21-xpro/pkg-build/qdsa
    Building application "tests_pkg_qdsa" for "samr21-xpro" with MCU "samd21".

    Assembler messages:
    Fatal error: unknown option `-ggdb'
    make[3]: *** [/home/maribu/Repos/software/RIOT/Makefile.base:176: /home/maribu/Repos/software/RIOT/tests/pkg_qdsa/bin/samr21-xpro/qdsa_asm/bigint_red.o] Error 1
    make[2]: *** [/home/maribu/Repos/software/RIOT/Makefile.base:31: ALL--/home/maribu/Repos/software/RIOT/build/pkg/qdsa/arm/asm] Error 2
    make[1]: *** [Makefile:11: all] Error 2
    make: *** [/home/maribu/Repos/software/RIOT/tests/pkg_qdsa/../../Makefile.include:803: pkg-build] Error 2

    Return value: 2
2022-11-11 23:11:07 +01:00
Benjamin Valentin
9eb3741dee makefiles/arch/avr8.inc.mk: fix detection of GCC 12 2022-10-13 12:48:44 +02:00
3ee3d1b9ac
Merge pull request #18562 from MrKevinWeiss/pr/removemips
cpu/mips: Remove all mips
2022-09-30 10:47:09 +02:00
MrKevinWeiss
6cad5d2477
cpu/mips: Remove all mips 2022-09-27 13:42:37 +02:00
Marian Buschsieweke
e0a81fe945
makefiles/arch/riscv.inc.mk: Fix with BUILD_IN_DOCKER
With RISC-V being a relatively young toolchain, a lot of inconsistencies
between different toolchains are to be found that differ in the target
triple and the flags supported. This build system performs run-time
tests to detect the toolchain and supported flags.

With `BUILD_IN_DOCKER=1` issues arise, as this checks are performed
outside of the docker container. However, the host may have no RISC-V
toolchain installed or a different toolchain, so there is little reason
in performing this detection then. Instead, a hard coded target triple
and supported flags are provided when using `BUILD_IN_DOCKER=1`.
2022-09-27 10:43:39 +02:00
Marian Buschsieweke
7bd23069dc
makefiles/arch/avr8.inc.mk: Fix compilation with GCC 12.2.0
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 for details
2022-08-30 14:26:40 +02:00
chrysn
7ee66ad219 makefiles/cargo: Drop duplicate workaround remnants 2022-07-09 20:45:51 +02:00
Marian Buschsieweke
8c369a8d29
buildsystem: Improve RISC-V compilation handling with newer toolchain
Use -misa-spec=2.2 on newer toolchains, which allows passing the same
-march value to both the linker and the compiler even when binutils and
GCC support difference ISA specs.
2022-05-13 10:54:30 +02:00
6f52b90e58
cpu/cortexm_common: enable FPU on cortexm33 2022-05-05 21:16:10 +02:00
Marian Buschsieweke
8eb3692b9d
makefiles/arch/riscv.inc.mk: improve error message
When no toolchain could be detected, provide a friendly message
instead.
2022-04-19 15:51:31 +02:00
Marian Buschsieweke
c89331f93b
build system: Detect more RISC-V target triples
Omitting the middle part of `riscv32-none-elf` is apparently legal and
done by Arch Linux.
2022-04-14 19:25:36 +02:00
Marian Buschsieweke
10f65f1631
build system: Fix compilation for RISC-V with newer GCC
A backward incompatible change in the RISC-V resulting in instructions
previously included by rv32imac to only be available with
rv32imac_zicsr. All RISC-V CPUs supported by RIOT are hence either
considered as rv32imac (from the old ISA spec point of view) or as
rv32imac_zicsr (from the new ISA spec point of view). This adds a
simple test if GCC understands rv32imac_zicsr and uses it then as march,
but uses rv32imac as march if not.
2022-04-14 16:52:48 +02:00
Keith Packard
b21e624280 cpu/arm7, arch/cortexm: Remove -fno-builtin flag
This flag disables all builtin functions provided by the compiler as
well as disabling all optimizations and error checking related to
standard C library functions. If you're using a C library which
conforms to the ANSI C standard, you want to leave these compiler
features enabled.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-04-02 16:58:09 -07:00
chrysn
a2e1b92e1d makefiles: Define RUST_TARGET for use with Cargo / Rust
For RISC-V and Cortex-M-not-3, triples are known and have worked in some
configuration, but do not work at the moment and stay disabled until the
reference platforms (native, M3) have been established well.
2021-12-14 12:55:13 +01:00
chrysn
69dadf61e9
Merge pull request #17152 from maribu/sys/posix/sockets
sys/posix/socket: align struct sockaddr{,_storage}
2021-11-16 13:55:27 +01:00
Marian Buschsieweke
4b02d0fbc1
makefiles/arch: use -std=gnu11 also for MIPS
This brings MIPS back in line with the other archs.
2021-11-11 09:55:24 +01:00
Benjamin Valentin
b4dc8a5366 makefiles: RISC-V: prefer target triple from riotdocker 2021-11-04 10:02:04 +01:00
Francisco
7f3344870d
Merge pull request #16972 from Ollrogge/flashpage_pr
periph/flashpage: extend API
2021-10-26 12:51:05 +02:00
Ollrogge
741943f021 cpu/msp430_common: extend flashpage API 2021-10-25 15:03:50 +02:00
Marian Buschsieweke
62d6a560b1
cpu/avr8_common: Fix link with binutils > 2.35.2
The xfa.ld script is incompatible with binutils > 2.35.2 and results
in firmwares that wont boot. Sadly, I couldn't figure out an elegant
way to fix the issue. Instead, I modified the linker script provided
by binutils to also include XFA.
2021-10-13 16:37:19 +02:00
Martine Lenders
13cc189a8a
Revert "Remove which from shell invocations" 2021-09-03 11:27:03 +02:00
chrysn
6b50033766 makefiles: Replace which with command -v
As the POSIX documentation[1] of `command -v` guarantees that on error
there will be no output (and there will be output in the other cases),
the tests in Makefiles were simplified to test for output equality to
the empty string.

Redirects swallowing error outputs were removed, as the command produces
no error output there (as recommended at [2]).

Existing uses of `command` are simplified as well.

[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html
[2]: https://salsa.debian.org/debian/debianutils/-/blob/master/debian/NEWS
2021-09-02 16:30:46 +02:00
Gerson Fernando Budke
307e8c7a17 cpu/atxmega: Add external bus interface
Introduce XMEGA EBI driver.  This enable EBI for use with all memory
supported by the device and peripherals. It include support to  SRAM,
SDRAM, LCDs or any other external bus access.

Note: This feature only works for A1/A1U series, which are, the series
with EBI hardware.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-24 08:35:41 -03:00
Marian Buschsieweke
5cc62437da
cpu/avr8_common: move ldscripts from atmega_common
The ldscripts are already used for both ATmega and ATxmega, so it
makes sense to have them in the common folder.
2021-03-30 10:50:09 +02:00
Gerson Fernando Budke
4b2bcd560b makefiles/arch/avr8: Add xmega linker conditions
The current script doesn't allow change script path and name.
Add LDSCRIPT_COMPAT_PATH and LDSCRIPT_COMPAT_NAME default
values to allow a unique path inside atxmega folder.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-03-15 20:16:10 -03:00
Gerson Fernando Budke
699248c65f makefiles/arch/atmega.inc.mk: Rename to avr8.inc.mk
Atmel AVR-8 CPU was reworked to accomodate variants like ATxmega.
This rename to atmega.inc.mk to avr8.inc.mk to be compliant with
new directory structure.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-03-15 20:16:10 -03:00
56165d22a4
arch/riscv: use natural malign-data type 2021-02-25 12:50:52 +01:00
6711388afe cpu/mips_pic32_common: fix XFA support 2021-02-18 10:46:08 +01:00
f411fd4814 cpu/msp430_common: add XFA support 2021-02-18 10:46:08 +01:00
Joakim Nohlgård
6adeec09e9 atmega_common: add arch specific XFA ldscript to properly place .roxfa 2021-02-16 14:55:26 +01:00
Sören Tempel
125e4b54c1 fe310: Support the LLVM toolchain (i.e. compilation with clang)
This requires -nostartfiles to be only passed to the linker, not the
compiler, as it is a linker flag and passing it to the compiler causes a
clang warning to be emitted.

Additionally, clang does not seem to support `-mcmodel=medlow` and
`-msmall-data-limit=8` but these options do not seem strictly necessary
to me anyhow thus they are deactivated conditionally when using clang.
2020-10-07 07:37:52 +00:00
2692957c0e
riscv_common: Refactor common fe310 code to riscv_common 2021-02-05 09:32:19 +01:00
Benjamin Valentin
236c4db83e cpu/atmega*: drop ldscripts_compat
Those were only needed with very old toolchains.
These days they cause more confusion than benefit, so drop them.
2021-01-22 19:05:20 +01:00
Marian Buschsieweke
720ea90372
Merge pull request #15668 from leandrolanzieri/pr/makefiles/arch/riscv_redirect_which_error
makefiles/arch/riscv: redirect 'which' error message to /dev/null
2020-12-19 21:43:16 +01:00
Marian Buschsieweke
902aa29b62
sys/malloc_thread_safe: split out of cpu/atmega_common
Split out Gunar Schorcht's clever approach to provide thread safe malloc for
AVR into a system module and make AVR depend on this. This allows other
platforms to also use this.
2020-12-17 15:39:05 +01:00
Leandro Lanzieri
aaf4a738f9
makefiles/arch/riscv: redirect error message to /dev/null 2020-12-17 15:23:21 +01:00
Marian Buschsieweke
feee507bf9
makefiles/arch/riscv.inc.mk: Detect target triple
This improves the target triple detection logic to include all possible target
triples of compilers that might be able to generate our binaries.
2020-11-06 20:53:28 +01:00
benpicco
ee189fa428
Merge pull request #15187 from bergzand/pr/info/add_json
info.inc.mk: Add info-build-json as JSON-formatted build info
2020-10-15 21:27:26 +02:00
2dac4db343
make: Use common comma variable definition 2020-10-09 12:02:28 +02:00
Bas Stottelaar
0f8cecb50b cpu/cortexm_common: add support for Cortex-M33 2020-10-06 17:11:26 +02:00
chrysn
2eeda9a1ca makefiles: Pass explicit float mode to clang
The assumption that clang defaults to hard-float on ARM architectures
does not hold on Debian systems where [set-correct-float-abi].
As setting the flags that are implied on most systems does no harm, the
flags for the selected hard- or soft float behavior are now set
independently of the toolchain.

[set-correct-float-abi]: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/10/debian/patches/26-set-correct-float-abi.diff

Closes: https://github.com/RIOT-OS/RIOT/issues/15026
2020-09-25 11:02:29 +02:00
Marian Buschsieweke
d9e495fe83
build system: use riscv-none-elf as triplet
Use riscv-none-elf instead of legacy riscv-none-embed as target triplet for
RISC-V development. However, if ricsv-none-elf is not present, try
riscv64-unknown-elf and riscv-none-embed instead. If the legacy riscv-none-embed
is used, a warning is printed.
2020-09-15 11:18:33 +02:00
Cenk Gündoğan
0d0bc91553
Merge pull request #14754 from leandrolanzieri/pr/no_archives
build system: link object files
2020-09-10 09:36:29 +02:00
Marian Buschsieweke
7c1949341e
build system: Overwrite TARGET_ARCH per arch
Add `TARGET_ARCH_<ARCH>` for each architecture (e.g. `TARGET_ARCH_CORTEX` for
Cortex M) to allow users to overwrite the target triple for a specific arch
from ~/.profile or ~/.bashrc (or the like) without overwriting it for all others
as well.
2020-09-08 22:28:41 +02:00
Leandro Lanzieri
81cb769cad
makefiles: avoid building archives when compiling 2020-09-04 15:01:10 +02:00