diff --git a/meta-ohos-core/recipes-support/libgcrypt/libgcrypt_%.bbappend b/meta-ohos-core/recipes-support/libgcrypt/libgcrypt_%.bbappend
new file mode 100644
index 0000000000000000000000000000000000000000..96704ea89aac714098836ae374d644185ef789ab
--- /dev/null
+++ b/meta-ohos-core/recipes-support/libgcrypt/libgcrypt_%.bbappend
@@ -0,0 +1,11 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# libgcrypt uses zero-length array tricks causing array-bounds warnings.
+# The warnings have been verified to be harmless in 1.8.5; for extra
+# security, this should be re-checked after updating.
+#
+# Removing -Werror=array-bounds here allows us to use -Werror=array-bounds
+# globally in OPTIMIZE_FOR=security mode.
+
+TARGET_CFLAGS_remove = "-Werror=array-bounds"