blob: af31b436dbe29392f37814cb76678d5cfa2ae705 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 8486b912281ae85db0c9fc05bb546f16872e114c Mon Sep 17 00:00:00 2001
2From: Paulo Neves <ptsneves@gmail.com>
3Date: Thu, 28 Jul 2022 14:37:18 +0200
4Subject: [PATCH] mbedtls: Do not overwrite CFLAGS
5
6bitbake passes CFLAGS that are often in conflict with the ones set
7in mbedtls' CMakeLists.txt. Such conflicts are the inability to use
8FORTIFY_SOURCE=2 except in release mode
9
10Upstream status: Innapropriate due to fluent-bit having it's own Release
11flags that also overwrite bitbake ones.
12---
13 lib/mbedtls-2.28.0/CMakeLists.txt | 2 --
14 1 file changed, 2 deletions(-)
15
16--- a/lib/mbedtls-2.28.0/CMakeLists.txt
17+++ b/lib/mbedtls-2.28.0/CMakeLists.txt
18@@ -204,8 +204,6 @@ if(CMAKE_COMPILER_IS_GNU)
19 if (GCC_VERSION VERSION_GREATER 7.0 OR GCC_VERSION VERSION_EQUAL 7.0)
20 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat-overflow=2 -Wformat-truncation")
21 endif()
22- set(CMAKE_C_FLAGS_RELEASE "-O2")
23- set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
24 set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
25 set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3")
26 set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")
27@@ -215,8 +213,6 @@ endif(CMAKE_COMPILER_IS_GNU)
28
29 if(CMAKE_COMPILER_IS_CLANG)
30 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral")
31- set(CMAKE_C_FLAGS_RELEASE "-O2")
32- set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
33 set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
34 set(CMAKE_C_FLAGS_ASAN "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O3")
35 set(CMAKE_C_FLAGS_ASANDBG "-fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover=all -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls")