diff options
| author | Denys Dmytriyenko <denys@konsulko.com> | 2025-05-06 21:58:07 -0400 |
|---|---|---|
| committer | Ryan Eatmon <reatmon@ti.com> | 2025-05-13 11:10:36 -0500 |
| commit | 0bff199673355cff95f0fc422463ccd9111f0bf1 (patch) | |
| tree | a36bcccec572a8dfd12e6f59129ea7b902f9c6b8 /meta-ti-bsp | |
| parent | 60bb6b1d275feb51efb2a58ef7678b65a37b2b30 (diff) | |
| download | meta-ti-0bff199673355cff95f0fc422463ccd9111f0bf1.tar.gz | |
optee-test: Suppress new gcc-15 -Wunterminated-string-initialization
Mark corresponding arrays with nonstring attribute to suppress the new
gcc-15 warning -Wunterminated-string-initialization that becomes an
error due to the global -Werror.
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Diffstat (limited to 'meta-ti-bsp')
| -rw-r--r-- | meta-ti-bsp/recipes-security/optee/optee-test-ti-version.inc | 3 | ||||
| -rw-r--r-- | meta-ti-bsp/recipes-security/optee/optee-test/0001-Suppress-new-gcc-15-Wunterminated-string-initializat.patch | 68 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta-ti-bsp/recipes-security/optee/optee-test-ti-version.inc b/meta-ti-bsp/recipes-security/optee/optee-test-ti-version.inc index 3c1fedc9..e4b3a384 100644 --- a/meta-ti-bsp/recipes-security/optee/optee-test-ti-version.inc +++ b/meta-ti-bsp/recipes-security/optee/optee-test-ti-version.inc | |||
| @@ -1,2 +1,5 @@ | |||
| 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/optee-test:" | ||
| 2 | |||
| 1 | PV = "4.4.0+git" | 3 | PV = "4.4.0+git" |
| 2 | SRCREV = "695231ef8987866663a9ed5afd8f77d1bae3dc08" | 4 | SRCREV = "695231ef8987866663a9ed5afd8f77d1bae3dc08" |
| 5 | SRC_URI += "file://0001-Suppress-new-gcc-15-Wunterminated-string-initializat.patch" | ||
diff --git a/meta-ti-bsp/recipes-security/optee/optee-test/0001-Suppress-new-gcc-15-Wunterminated-string-initializat.patch b/meta-ti-bsp/recipes-security/optee/optee-test/0001-Suppress-new-gcc-15-Wunterminated-string-initializat.patch new file mode 100644 index 00000000..018952f8 --- /dev/null +++ b/meta-ti-bsp/recipes-security/optee/optee-test/0001-Suppress-new-gcc-15-Wunterminated-string-initializat.patch | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | From a8e58203dcb4c13ee340259cd2692202ac8414d1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Denys Dmytriyenko <denys@konsulko.com> | ||
| 3 | Date: Tue, 6 May 2025 21:35:55 -0400 | ||
| 4 | Subject: [PATCH] Suppress new gcc-15 -Wunterminated-string-initialization | ||
| 5 | |||
| 6 | GCC 15 now warns when character arrays are being initialized by strings | ||
| 7 | and terminating NUL character doesn't fit. GCC 15.1 also allows marking | ||
| 8 | such arrays with nonstring attribute to suppress the warning. W/o such | ||
| 9 | attribute, the warning becomes error due to the global -Werror. Add the | ||
| 10 | attribute accordingly. | ||
| 11 | |||
| 12 | Fixes these errors: | ||
| 13 | |||
| 14 | | ./regression_4000_data.h:7919:9: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (20 chars into 19 available) [-Werror=unterminated-string-initialization] | ||
| 15 | | 7919 | "encryption standard"; | ||
| 16 | | | ^~~~~~~~~~~~~~~~~~~~~ | ||
| 17 | | ./regression_4000_data.h:8387:9: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (113 chars into 112 available) [-Werror=unterminated-string-initialization] | ||
| 18 | | 8387 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomn" | ||
| 19 | | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 20 | | ./regression_4000.c:1295:47: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (4 chars into 3 available) [-Werror=unterminated-string-initialization] | ||
| 21 | | 1295 | static const uint8_t hash_data_sm3_a1_in[3] = "abc"; | ||
| 22 | | | ^~~~~ | ||
| 23 | |||
| 24 | Upstream-Status: Pending | ||
| 25 | |||
| 26 | Signed-off-by: Denys Dmytriyenko <denys@konsulko.com> | ||
| 27 | --- | ||
| 28 | host/xtest/regression_4000.c | 2 +- | ||
| 29 | host/xtest/regression_4000_data.h | 4 ++-- | ||
| 30 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
| 31 | |||
| 32 | diff --git a/host/xtest/regression_4000.c b/host/xtest/regression_4000.c | ||
| 33 | index 3aa15be..46e6f8e 100644 | ||
| 34 | --- a/host/xtest/regression_4000.c | ||
| 35 | +++ b/host/xtest/regression_4000.c | ||
| 36 | @@ -1292,7 +1292,7 @@ static const uint8_t hash_data_shake256_out2[] = { | ||
| 37 | * https://tools.ietf.org/html/draft-sca-cfrg-sm3-02 | ||
| 38 | * Appendix A.1 | ||
| 39 | */ | ||
| 40 | -static const uint8_t hash_data_sm3_a1_in[3] = "abc"; | ||
| 41 | +static const uint8_t hash_data_sm3_a1_in[3] __attribute__((nonstring)) = "abc"; | ||
| 42 | |||
| 43 | static const uint8_t hash_data_sm3_a1_out[] = { | ||
| 44 | 0x66, 0xc7, 0xf0, 0xf4, 0x62, 0xee, 0xed, 0xd9, | ||
| 45 | diff --git a/host/xtest/regression_4000_data.h b/host/xtest/regression_4000_data.h | ||
| 46 | index 0881ac3..eb101b2 100644 | ||
| 47 | --- a/host/xtest/regression_4000_data.h | ||
| 48 | +++ b/host/xtest/regression_4000_data.h | ||
| 49 | @@ -7914,7 +7914,7 @@ static struct derive_key_ecdh_t { | ||
| 50 | }; | ||
| 51 | |||
| 52 | /* G/MT 0003 (SM2) Part 5 Annex C.2 - encryption/decryption */ | ||
| 53 | -static const uint8_t gmt_0003_part5_c2_sm2_testvector_ptx[19] = | ||
| 54 | +static const uint8_t gmt_0003_part5_c2_sm2_testvector_ptx[19] __attribute__((nonstring)) = | ||
| 55 | /* M */ | ||
| 56 | "encryption standard"; | ||
| 57 | static const uint8_t gmt_0003_part5_c2_sm2_testvector_private[] = { | ||
| 58 | @@ -8383,7 +8383,7 @@ static const uint8_t mac_data_sha3_512_out1[] = { | ||
| 59 | * GM/T 0042-2015 | ||
| 60 | * Section D.3 Test vector 1 | ||
| 61 | */ | ||
| 62 | -static const uint8_t mac_data_sm3_d31_in[112] = | ||
| 63 | +static const uint8_t mac_data_sm3_d31_in[112] __attribute__((nonstring)) = | ||
| 64 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomn" | ||
| 65 | "opnopqabcdbcdecdefdefgefghfghighijhijkijkljklmklmn" | ||
| 66 | "lmnomnopnopq"; | ||
| 67 | -- | ||
| 68 | 2.25.1 | ||
