From f982e7dcc69e1db234539065834b2666588bcdf9 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 16:27:13 +0200
Subject: [PATCH] util-linux: Remove -Werror=format-nonliteral from compiler
 flags
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

util-linux uses autogenerated non-literal format strings in its hexdump
code. Those strings have been verified to be safe in 2.35.1.

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

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

diff --git a/meta-ohos-core/recipes-core/util-linux/util-linux_%.bbappend b/meta-ohos-core/recipes-core/util-linux/util-linux_%.bbappend
new file mode 100644
index 00000000..a7673ea1
--- /dev/null
+++ b/meta-ohos-core/recipes-core/util-linux/util-linux_%.bbappend
@@ -0,0 +1,11 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# util-linux uses autogenerated non-literal format strings in its hexdump
+# code. Those strings have been verified to be safe in 2.35.1.
+#
+# Removing -Werror=format-nonliteral here allows us to use
+# -Werror=format-nonliteral globally in OPTIMIZE_FOR=security mode
+# while keeping util-linux building.
+
+TARGET_CFLAGS_remove = "-Werror=format-nonliteral"
-- 
GitLab