1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-28 23:29:45 +01:00
Commit Graph

567 Commits

Author SHA1 Message Date
Marian Buschsieweke
f166e74696
build system: error on conflicting features
When the build system is aware of an invalid configuration - such as
multiple C libs being used or a single piece of hardware being used in
two conflicting roles - this now is treated as an error rather than
a warning.
2024-11-20 21:51:34 +01:00
Mikolai Gütschow
b96536d1ba
Makefiles: (application) support for SRC in subfolders 2024-11-01 11:53:55 +01:00
Joshua DeWeese
aee2ea64f4
Merge pull request #20689 from bmewen/cachedir-tag
Makefile.include: creation of CACHEDIR.TAG as a dependency of pkg-prepare
2024-06-18 19:54:39 +00:00
mewen.berthelot
b275e61ec7 Makefile.include: creation of CACHEDIR.TAG as a dependency of pkg-prepare 2024-06-10 10:09:30 +02:00
Karl Fessel
b58b25516c Makefile.include: place compile_commands.json by rule target 2024-05-31 13:37:43 +02:00
MrKevinWeiss
ff7f7ccd5a
*Makefile.include: Remove TEST_KCONFIG includes 2024-03-26 14:53:40 +01:00
Marian Buschsieweke
f0d29068f5
Merge pull request #20381 from maribu/build-system/no-warn-rwx
build sytem: add `--no-warn-rwx-segments` to linker
2024-03-18 12:05:45 +00:00
Daniel Lockau
9c9d739634 Makefile.{include,base},pkg/nanopb: fix target dependencies & code generation 2024-03-12 09:50:23 +01:00
chrysn
756a384442 makefiles, treewide: Remove MCU variable 2024-02-18 20:46:09 +01:00
chrysn
5b6ae6b766 makefile: Don't $(info) when the output can break info-build-json 2024-02-16 20:08:28 +01:00
Marian Buschsieweke
c9f16f1194
build sytem: add --no-warn-rwx-segments to linker
Before we disabled the warning about RWX segments only for picolibc,
but this issue is popping up on more and more toolchains (looking
at MSP430 and RISC-V). Other than on `native`/`native64`, there is no
MMU to enforce whatever permissions the segments contain anyway.
(And writing to ROM with regular store instructions will not be possible
even without the need for an MMU.)

So let's just globally disable this warning, unless building for
`native` and `native64`.
2024-02-12 20:55:58 +01:00
benpicco
4d9e8a8dde
Merge pull request #20335 from fzi-haxel/pr/native64-board
native64: Separate board for 64-bit native
2024-02-05 22:58:02 +00:00
Frederik Haxel
0c2cfe99e6 native64: Add Linux/x86_64 board
Adds a separate board for native64 instead of the `NATIVE_64BIT` workaround.
The files in `boards/native64` are more or less dummy files and just include
the `boards/native` logic (similar to `openlabs-kw41z-mini-256kib`).
The main logic for native is in `makefiles/arch/native.inc.mk`, `cpu/native`
and `boards/native`.

The remaining changes concern the build system, and change native board checks
to native CPU checks to cover both boards.
2024-02-05 22:01:40 +01:00
Benjamin Valentin
b729fe3237 sys/shell: add RIOT_VERSION_EXTRA output
This allows to define an extra string that will be output as part
of the version command.

e.g. an application may define

RIOT_VERSION_EXTRA += v1.33.7
RIOT_VERSION_EXTRA += flashed by $(shell whoami
2024-02-05 14:18:14 +01:00
Mikolai Gütschow
292393c7e7
make help: show generate-Makefile.ci
generate-Makefile.ci is the only target interesting to the user containing uppercase and a dot.
Instead of matching all such targets with sed, generate-Makefile.ci is matched explicitly, to avoid showing internal targets.
2023-12-18 09:57:11 +01:00
chrysn
f18208eb64 makefile: Don't $(info) when the output can break info-boards-supported 2023-11-25 20:47:13 +01:00
Karl Fessel
d4d9be5ce4 make: COMPILE_COMMANDS_PATH adapt for external apps 2023-08-09 13:20:05 +02:00
Gunar Schorcht
1d96feb66e Makefile.include: don't use target lstfile implicitly 2023-07-05 11:27:28 +02:00
Gerson Fernando Budke
ae61702ffe Makefile.include: Generate lst file using objdump
The MAP file does not provide all information necessary to do a full
analize of generated code. This automatically generate the LST file
with all relavant C and ASM code to help inspect code generated.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2023-06-29 17:29:33 +02:00
Fabian Hüßler
4e1ac37400 buildsystem: add target debug-client 2023-06-10 00:04:56 +02:00
Marian Buschsieweke
701f8c1be3
build system: fix make compile-commands BUILD_IN_DOCKER=1
Just run `make compile-commands` outside of docker, as the compile
commands generated in the docker container won't be helpful for tools
outside of the container anyway.

Fixes https://github.com/RIOT-OS/RIOT/issues/17507
2023-05-17 22:44:43 +02:00
Marian Buschsieweke
5457014c4a
build-system: Allow out of tree BUILD_DIR
- Replace all users of `$(RIOTBASE)/build` with the already present
  `$(BUILD_DIR)` variable
- Replace all users of `$(BUILD_DIR)/pkg` with the already present
  `$(PKGDIRBASE)` variable
- Create a `CACHEDIR.TAG` file in the `$(BUILD_DIR)`
2023-05-16 22:23:03 +02:00
820a895684
Make: rename create-Makefile.ci to generate-Makefile.ci
With this rename it is in line with the other generate-* targets
2023-02-04 16:51:36 +01:00
bors[bot]
6fb340d654
Merge #19057 #19151
19057: fuzzing: Add uri_parser setup r=benpicco a=Teufelchen1

Hello!

### Contribution description

This PR is a replacement for PR #18802

In this contribution:

* The variable `AFL_FLAGS` is renamed to `FLAGS_FOR_AFL` because AFL is always complaining that `AFL_FLAGS` is not a valid env var for it. While this is not a bug nor an issue, I found it to be annoying.
*  A generic input reader is added to simplify building a test harness
*  The usage of this reader is demonstrated by adding a harness for fuzzing the uri_parser


(needs squashing after review)

### Testing procedure

Go to `fuzzing/uri_parser` and run `make all-asan` and `make fuzz` to get some action going.
Also mildly interesting: `./dist/tools/compile_test/compile_like_murdock.py -b native -a fuzzing/uri_parser`

### Issues/PRs references

The original PR #18802 is replaced because the generic input reader is present in both PRs but this PoC harness is much simpler.


19151: examples/gcoap: Fix shell parameter validation r=benpicco a=maribu

### Contribution description

Executing the shell command with an URI-Path that doesn't start with a slash results in an assertion error while composing the client side message. This is suboptimal user experience, so add an explicit check for a valid URI-Path and a dedicated error message.

### Testing procedure

#### In `master`

```
 $ make BOARD=microbit-v2 -C examples/gcoap flash term
[...]
2023-01-15 22:23:32,512 #  coap get [::1] /.well-known/core
2023-01-15 22:23:32,516 # gcoap_cli: sending msg ID 52272, 23 bytes
2023-01-15 22:23:32,520 # gcoap: response Success, code 2.05, 46 bytes
2023-01-15 22:23:32,524 # </cli/stats>;ct=0;rt="count";obs,</riot/board>
> coap get [::1] foo
2023-01-15 22:23:34,763 # coap get [::1] foo
2023-01-15 22:23:34,763 # 2329
2023-01-15 22:23:34,765 # *** RIOT kernel panic:
2023-01-15 22:23:34,767 # FAILED ASSERTION.
2023-01-15 22:23:34,767 # 
2023-01-15 22:23:34,775 # 	pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current     
2023-01-15 22:23:34,784 # 	 - | isr_stack            | -        - |   - |    512 (  200) (  312) | 0x20000000 | 0x200001c8
2023-01-15 22:23:34,793 # 	 1 | main                 | running  Q |   7 |   1536 ( 1072) (  464) | 0x200006c0 | 0x2000095c 
2023-01-15 22:23:34,802 # 	 2 | 6lo                  | bl rx    _ |   3 |   1024 (  328) (  696) | 0x200036c0 | 0x200039c4 
2023-01-15 22:23:34,810 # 	 3 | ipv6                 | bl rx    _ |   4 |   1024 (  460) (  564) | 0x20001294 | 0x20001574 
2023-01-15 22:23:34,819 # 	 4 | udp                  | bl rx    _ |   5 |    512 (  300) (  212) | 0x20003e98 | 0x20003f9c 
2023-01-15 22:23:34,828 # 	 5 | coap                 | bl anyfl _ |   6 |   1112 (  704) (  408) | 0x20000e38 | 0x200011c4 
2023-01-15 22:23:34,837 # 	 6 | nrf802154            | bl anyfl _ |   2 |    896 (  288) (  608) | 0x20001a90 | 0x20001d54 
2023-01-15 22:23:34,843 # 	   | SUM                  |            |     |   6616 ( 3352) ( 3264)
2023-01-15 22:23:34,843 # 
2023-01-15 22:23:34,844 # *** halted.
2023-01-15 22:23:34,844 # 
```

#### This PR

```
 $ make BOARD=microbit-v2 -C examples/gcoap flash term
[...]
make: Entering directory '/home/maribu/Repos/software/RIOT/examples/gcoap'
/home/maribu/Repos/software/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"  
2023-01-15 22:22:27,842 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
coap get [::1] /.well-known/core
2023-01-15 22:22:40,042 #  coap get [::1] /.well-known/core
2023-01-15 22:22:40,046 # gcoap_cli: sending msg ID 25182, 23 bytes
2023-01-15 22:22:40,050 # gcoap: response Success, code 2.05, 46 bytes
2023-01-15 22:22:40,054 # </cli/stats>;ct=0;rt="count";obs,</riot/board>
> coap get [::1] foo
2023-01-15 22:22:43,858 # coap get [::1] foo
2023-01-15 22:22:43,862 # ERROR: URI-Path must start with a "/"
2023-01-15 22:22:43,866 # usage: coap <get|post|put|ping|proxy|info>
```

### Issues/PRs references

None

Co-authored-by: Teufelchen1 <bennet.blischke@haw-hamburg.de>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
2023-01-16 02:34:21 +00:00
Marian Buschsieweke
e620736573
build system: Fix parallel build with clean
It turns out that `make clean all -j 16` previously failed every second
time, as a dependency to a generated header (`preprocessor_succesor.h`
in this case) is checked and considered to be up to date before running
the `clean` target. However, after the `clean` target it is removed.

This fixes:

```
$ BOARD=nrf52840dk make -C examples/emcute_mqttsn clean all --jobs 16
make: Entering directory '/home/maribu/Repos/software/RIOT/examples/emcute_mqttsn'
make: Circular clean <- clean dependency dropped.
Building application "emcute_mqttsn" for "nrf52840dk" with MCU "nrf52".
[...]
cc1: error: /home/maribu/Repos/software/RIOT/examples/emcute_mqttsn/bin/nrf52840dk/preprocessor: No such file or directory [-Werror=missing-include-dirs]
[...]
```
2023-01-03 08:24:53 +01:00
Gunar Schorcht
d000e19754 makefiles: additional dependency of ELFFILE on LD_SCRIPTS
The additional dependency of the ELFFILE variable on a LD_SCRIPTS variable allows to define rules for the generation of the used ld files from configurable LD templates.
2022-12-31 15:30:34 +01:00
Teufelchen1
f7f9eddd9e fuzzing: Rename AFL flag to prevent spelling warning from AFL 2022-12-15 13:10:19 +01:00
Gunar Schorcht
3100345214 makefiles: add riotboot_dfu-util.mk to override board's dfu-util config
Boards that are shipped with a DFU bootloader define the `dfu-util` configuration in their `Makefile.include`. However, when `riotboot_dfu` is used as the DFU bootloader, the board's `dfu-util` configuration must be overridden by the configuration as required by `riotboot_dfu` to use it to flash applications. Therefore, all `dfu-util` configurations are defined as overridable in the board's `Makefile.include` and the configuration as required by `riotboot_dfu` is included before the board's `Makefile.include`.
2022-11-30 19:28:14 +01:00
Teufelchen1
35a06c4806 boards/native: Remove macOS as native target 2022-10-25 19:11:23 +02:00
chrysn
62a6d3c128 makefiles: Add openocd-rtt
JLink presumably has information about the device's RAM available
internally. Not passing the precise symbol area (which would be
available in the ELF file) because a) that'd make the terminal break
when the flashed firmware does not equal the built one, and b) that
would introduce a dependency from `term` to the ELF file that other
terminals don't have.
2022-08-30 09:34:22 +02:00
MrKevinWeiss
01eebc7000
Makefile.include: remove CI-build: skipping link step
This creates diff failures when calling info-modules and info-packages.
Ideally info-modules and info-packages have clean output for the CI build
2022-08-16 10:57:25 +02:00
Marian Buschsieweke
04fc22e031
Merge pull request #18194 from benpicco/dist/tools/cosy-port
dist/tools/cosy: allow to specify port
2022-07-04 14:44:44 +02:00
Marian Buschsieweke
a247e87f8e
Makefile.include: fix typo 2022-06-17 18:31:17 +02:00
Marian Buschsieweke
d1317abc02
makefiles/tests: use FLASHFILE for hash comparision instead of ELFFILE
Let's consider firmwares as identical if their flash files are matching.
This will have the side effect that hash mismatches for ESP32 due to
different .debug sections in the ELFFILE are prevented, as for ESP32
the BINFILE is used.
2022-06-17 18:31:17 +02:00
Benjamin Valentin
1dc555e362 dist/tools/cosy: allow to specify port 2022-06-11 14:46:44 +02:00
Marian Buschsieweke
055a26d9d2
Merge pull request #17662 from fjmolinas/pr_default_modules_early_late
buildsystem: split default modules include early and late
2022-06-02 21:18:17 +02:00
Francisco Molina
b5197db03f buildsystem: split default modules include early and late
DEFAULT_MODULEs declared in defaultmodules_regular.inc.mk MAY only be
disabled at APPLICATION level or in BOARD/CPU Makefile.default. These
modules MAY have complex dependencies themselfs.

DEFAULT_MODULEs declared in defaultmodules_no_recursive_deps.inc.mk MAY be disabled
during dependency resolution. The MUST only have dependencies against
modules with no dependencies themselfs, and these dependencies must
be defined in makefiles/defaultmodules._deps.inc.mk
2022-06-02 12:56:59 +02:00
Benjamin Valentin
1111631c45 makefiles/tools: define DEBUG_ELFFILE and use it for debugging 2022-05-31 12:39:16 +02:00
Francisco Molina
1de00ba504 makefiles/pkg/nimble.adv.mk: add utility to assign adv instance 2022-04-27 08:22:58 +02:00
Francisco Molina
ce35647f6a makefiles: allow to override suit manifest payloads
This adds:

* SUIT_MANIFEST_BASENAME: allow for non slotfiles payloads to have
different names that slotfiles payloads.
* SUIT_MANIFEST_PAYLOADS: firmware payloads to be published with the
manifest.
* SUIT_MANIFEST_SLOTFILES: firmware payloads referenced by the manifest
in the form 'filename:[offset]:[comp_name]' as expected by
gen_manifest.py.

With this the same recipes suit/publish suit/notify can be used with
non slotfiles payloads.
2022-04-21 11:39:25 +02:00
e59a6786a6
Merge pull request #17652 from kaspar030/split_core_lib
core: split out library code
2022-03-10 20:17:07 +01:00
3db7c1150a core: split out library code
This commit splits core into it's scheduler/IPC part and into other code
that is either used or uses the scheduler, through defined APIs.
2022-03-09 21:43:05 +01:00
Marian Buschsieweke
b296ade6b2
dist/tools/usb-serial: Add ttys.py
- Provide a new tool to list and filter TTYs
- Change `Makefile.include` to use `$(RIOTTOOLS)/usb-serial/ttys.py`
  instead of `$(Q)$(RIOTTOOLS)/usb-serial/list-ttys.sh` to implement
  `make list-ttys`
- Extend `makefiles/tools/serial.inc.mk` to allow using the most recent
  port by passing `MOST_RECENT_PORT=1` as environment variable or
  parameter to make

Co-authored-by: chrysn <chrysn@fsfe.org>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
2022-03-09 15:40:36 +01:00
Benjamin Valentin
4d7a3c1dba sys/board_common: add generic board_init() function 2022-02-22 10:04:44 +01:00
ba0f8a7429 make: add initial ubsan support 2022-02-16 12:20:45 +01:00
NikLeberg
a411841322 buildsystem: implement EXTERNAL_PKG_DIRS feature 2022-02-01 18:06:54 +00:00
Leandro Lanzieri
9b95605f78
Merge pull request #17596 from fjmolinas/pr_external_module_deps_kconfig
makefiles.kconfig.mk: use EXTERNAL_MODULE_DIRS in Kconfig resolution
2022-02-01 14:10:15 +01:00
Leandro Lanzieri
83a16fca47
makefiles: avoid extra "/" when including files from external modules
As the `dir` make function considers the last slash as part of the
directory-part of a file name, we don't need to add an extra one.
2022-02-01 11:22:06 +01:00
Francisco Molina
80f63ba1fa makefiles.kconfig.mk: use EXTERNAL_MODULE_DIRS in Kconfig resolution
Using EXTERNAL_MODULE_PATHS works fine when only using Kconfig for
configuratio, but when using it for dependencies this value is not
set since it depends on Kconfig. Instead use EXTERNAL_MODULE_DIRS
and filter matching on Kconfig files.
2022-02-01 10:22:20 +01:00
NikLeberg
140824e69c buildsystem/pkg: expand paths early 2022-01-30 19:58:52 +01:00