From f83bc39a18f41dac134b85737ba2a8381bda8374 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?=
 <bernhard.rosenkraenzer.ext@huawei.com>
Date: Fri, 3 Sep 2021 15:57:22 +0200
Subject: [PATCH] openssl: Remove -Werror=format-nonliteral from compiler flags
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

openssl's opt tool uses a non-literal format string for
help texts.
This has been verified to be harmless in 1.1.1k (the "unsafe"
use of a printf style function happens only with hardcoded,
safe strings).

Removing -Werror=format-nonliteral here allows us to use
-Werror=format-nonliteral globally in OPTIMIZE_FOR=security mode
while keeping openssl building.

Signed-off-by: Bernhard Rosenkränzer <bernhard.rosenkraenzer.ext@huawei.com>
---
 .../openssl/openssl_%.bbappend                     | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 meta-ohos-core/recipes-connectivity/openssl/openssl_%.bbappend

diff --git a/meta-ohos-core/recipes-connectivity/openssl/openssl_%.bbappend b/meta-ohos-core/recipes-connectivity/openssl/openssl_%.bbappend
new file mode 100644
index 00000000..2b264088
--- /dev/null
+++ b/meta-ohos-core/recipes-connectivity/openssl/openssl_%.bbappend
@@ -0,0 +1,14 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# openssl's opt tool uses a non-literal format string for
+# help texts.
+# This has been verified to be harmless in 1.1.1k (the "unsafe"
+# use of a printf style function happens only with hardcoded,
+# safe strings).
+#
+# Removing -Werror=format-nonliteral here allows us to use
+# -Werror=format-nonliteral globally in OPTIMIZE_FOR=security mode
+# while keeping openssl building.
+
+TARGET_CFLAGS_remove = "-Werror=format-nonliteral"
-- 
GitLab