Commit Graph

1782 Commits

Author SHA1 Message Date
Minos Galanakis
1c2b690389 Test Makefiles: Updated location of psasim
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-01-27 12:07:05 +00:00
Gilles Peskine
4ffb299208 Remove local copies of makefile helpers
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-08 14:57:50 +01:00
Gilles Peskine
e23b6e4dc8 Use the crypto makefile helpers in tf-psa-crypto
Now that the crypto files have been moved to the crypto repository, consume
them there.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-08 14:57:50 +01:00
Ronald Cron
67152f3049 Merge pull request #10543 from gilles-peskine-arm/split-crypto-makefiles
Split crypto part of Mbed TLS makefiles
2026-01-07 15:18:32 +00:00
Gilles Peskine
dd255696a5 Make use of some intermediate variables
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
562677945b Use intermediate variable for TF-PSA-Crypto's contribution to LOCAL_LDFLAGS
Fix a bug whereby `crypto-common.make` was appending to `LOCAL_LDFLAGS`
before `common.make` set the initial value. This broke the build with
pthread enabled: `THREADING` was correctly getting autodetected, but the
addition of `-lpthread` to `LOCAL_LDFLAGS` didn't work.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
ef25955786 Move THREADING autodetection to crypto-common.make
Note that `THREADING` detection must be done after
`TF_PSA_CRYPTO_LIBRARY_PUBLIC_INCLUDE` is defined. Otherwise it won't detect
whether pthread is needed, and will never link with `-lpthread`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
c00bd2a6fb THREADING autodetection: only check the crypto config
When running the preprocessor to determine whether pthread is enabled, only
use TF-PSA-Crypto include paths. Don't use the rest of `LOCAL_CFLAGS`,
including Mbed TLS include paths, which aren't really useful here.

This will simplify later refactorings, because it simplifies a dependency
chain [crypto paths] → `LOCAL_CFLAGS` → `THREADING` → `LOCAL_LDFLAGS`
into just [crypto paths] → `THREADING` → `LOCAL_LDFLAGS`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
2607134998 Move configurable variables to the top
Define variables that are meant to be possibly overridden on the make
command line (or in a parent makefile) at the top. In particular, define
them before including the crypto and framework makefiles, so these makefiles
can use the default values if there's no parent setting.

Also move some internal variables earlier or later, so that a subsequent
refactoring step can have things in the right order in the mbedtls
per-directory makefile:

1. Define variables consumed by the per-directory crypto makefile.
2. Include the per-directory crypto makefile.
3. Use variables defined by the per-directory crypto makefile.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
e3e4da61a8 Use intermediate variables for TF-PSA-Crypto's contribution to LOCAL_CFLAGS
Define these intermediate variables in the crypto helper file.

No behavior change except possibly an inconsequential reordering of compiler
options.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
46568f3c6e Move some crypto core and drivers variable definitions to crypto-common.make
No behavior change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
7bef731f0b Create a TF-PSA-Crypto make helper for Mbed TLS
Currently, Mbed TLS can be built with make, and we rely on this in many
`all.sh` components. Mbed TLS knows how to build TF-PSA-Crypto, but this
changes from time to time, and it's hard to do the necessary changes in both
repositories at the same time.

Create a file that Mbed TLS can consume to find out some information needed
to build TF-PSA-Crypto, such as the locations of various files.

Create this file in Mbed TLS. Once we have finished moving code to it, the
file will move to TF-PSA-Crypto.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
d78060bda6 Get a clean run from make --warn-undefined-variables
Except in psasim, which I am not touching at this time.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
3884bf3d89 Remove a XySSL-era comment that has run its course
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 11:17:43 +01:00
Gilles Peskine
4185efafe4 Fix non-determinism when generating mbedtls_config_check_user.h
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-07 10:28:40 +01:00
Gilles Peskine
43784b54cd Create the config option list shadow file
```
tests/scripts/check_option_lists.py -u
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-05 16:29:21 +01:00
Gilles Peskine
1de879c6dd Also reject internal macros that weren't options in 3.6
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-05 16:29:21 +01:00
Gilles Peskine
30323afa6c Read current data rather than data about 4.0
It doesn't matter how a macro was used in a previous minor version of the
library. What matters is current information about options and internal
symbols, and information about past versions from which a macro may have
been removed.

The output is mostly the same, but:

* Macros that were options in 3.6, became internal in 4.0 and have now
  been completely removed are now shown as removed, not internal.
* Macros that were options in 3.6, were completely removed in 4.0, and are
  now back but internal, are now shown as internal, not removed.
* Macros that were options in 3.6, were removed in 4.0 and are back to
  being options are no longer rejected.
* Macros that were options in 3.6, were removed in 4.0 and are back to
  being internal derived macros in TF-PSA-Crypto are no longer rejected.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-05 16:29:21 +01:00
Gilles Peskine
35821e7c77 Switch from config_history to config_macros
Switch from the `config_history` module to the new module `config_macros`.
No behavior change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-01-05 16:29:21 +01:00
Pengyu Lv
8b364c7436 Fix the commands to build library
In `scripts/common.make`, used by `tests/Makefile` and `programs/Makefile`,
we have the following rules to build the library:

  ```
  $(MBEDLIBS):
      $(MAKE) -C ../library
  ```

$(MBEDLIBS) contains three library files but the command is for all
the 3 files instead of single target generation. This would cause a
race when doing parallel build. This commit fixes command so that
the recipe could generate a single library file.

Fix https://github.com/Mbed-TLS/mbedtls/issues/8229

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
Signed-off-by: Gilles Peskine <gilles.peskine@arm.com>
2025-12-04 17:07:05 +01:00
Manuel Pégourié-Gonnard
a6e59a955b Merge pull request #10450 from bjwtaylor/move-lcov
Remove lcov.sh as this will be moved to the framework
2025-11-06 11:11:59 +00:00
Ben Taylor
9b4f222f4f Update lcov.sh paths in make files
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-31 14:18:05 +00:00
Ben Taylor
284481f7ca Remove lcov.sh as this will be moved to the framework
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-31 14:18:05 +00:00
Minos Galanakis
a2cba40df6 prepare_release.sh: modify submodule files recursively
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-30 10:00:22 +00:00
Minos Galanakis
bdb1dcbdb6 prepare_release.sh: simplified regex
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-30 10:00:22 +00:00
Minos Galanakis
958d9d97a4 prepare_release.sh: Added documentation
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-30 09:58:17 +00:00
Minos Galanakis
c4d4f6b4a1 prepare_release.sh: Removed -r/-u modes
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-22 11:51:39 +01:00
Minos Galanakis
61fdef52a3 prepare_release.sh: Adjusted psed logic.
Fixed double quoting in sed.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-22 11:17:32 +01:00
Minos Galanakis
0b7966649f prepare_release.sh:Removed Makefiles modification
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-21 10:55:27 +01:00
Minos Galanakis
d995a21b6a prepare_release.sh: Adjusted logic
- Introduced a new -r to explicitely request project
  modification for release
- Changed the default behaviour to print_help when invoked
  without arguments

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-21 10:54:17 +01:00
Minos Galanakis
1f95b78310 prepare_release.sh: Limited .gitignore to current project
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-20 16:24:29 +01:00
Minos Galanakis
d0881eda4e prepare_release.sh: Added psed helper function
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-10-20 16:11:05 +01:00
Ronald Cron
6a9be3de1f Merge pull request #10416 from bensze01/abicheck-worktree-submodules
Use submodule work trees during ABI check
2025-09-30 07:32:22 +00:00
Bence Szépkúti
9defedb833 Fix comment too long for pylint
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2025-09-29 14:25:12 +02:00
David Horstmann
ee1991a387 Merge pull request #10408 from ronald-cron-arm/historical-libmbedcryto
Restore historical libmbedcrypto.* libraries
2025-09-29 08:41:06 +00:00
Bence Szépkúti
0f2a4f3d1f Prevent unnecessary submodule fetches
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2025-09-26 20:27:57 +02:00
Bence Szépkúti
8d95062aeb Eliminate use of git worktree prune
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2025-09-26 15:44:11 +02:00
Bence Szépkúti
dc88f6e1f3 Use f-string literal
This makes path-construction a bit more readable

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2025-09-26 15:37:42 +02:00
Gilles Peskine
3415d2dd5f Merge pull request #10306 from gilles-peskine-arm/config-error-on-removed-options-mbedtls
Mechanism to error out on removed configuration options
2025-09-25 16:35:51 +00:00
Bence Szépkúti
effa534e71 Use worktrees instead of fetches for submodules
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2025-09-25 15:51:07 +02:00
Gilles Peskine
c45d9ac4c2 Allow setting removed options that are now always on
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-24 17:20:35 +02:00
Gilles Peskine
8e44a94d39 Automatically generate checkers for removed options
Read the list of historical config options in 3.6, compare that to 1.0/4.0
and emit the appropriate checkers.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-24 17:20:35 +02:00
Gilles Peskine
24273c06db Checks for crypto options or internal macros set in mbedtls
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-24 17:20:35 +02:00
Ronald Cron
3a252dda0c Adapt code_size_compare.py to make deprecation and submodules
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-09-24 16:31:12 +02:00
Ronald Cron
37148d0fe3 Adapt memory.sh to make deprecation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-09-24 12:39:29 +02:00
Ronald Cron
15cd8b0a63 Adapt footprint.sh to make deprecation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-09-24 12:38:35 +02:00
Gilles Peskine
caaf52d6d0 Merge pull request #10391 from bjwtaylor/remove-deprecated-compilation-options-2
Remove deprecated compilation options 2
2025-09-23 08:40:11 +00:00
Ronald Cron
e7bac84a22 Remove the generation of MS visual studio files
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-09-22 18:00:26 +02:00
Ronald Cron
31f63210ec Deprecate Make
Move and rename the root Makefile to
scripts/legacy.make. That way running
make from the root fails.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-09-22 18:00:26 +02:00
Ronald Cron
bb02ec121e Prepare abi_check.py to scripts/legacy.make
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-09-22 18:00:26 +02:00