diff --git a/meta-ohos-core/recipes-graphics/cairo/cairo_%.bbappend b/meta-ohos-core/recipes-graphics/cairo/cairo_%.bbappend
new file mode 100644
index 0000000000000000000000000000000000000000..7d81f0d447f97d2b2e20282096b09c5e002751b0
--- /dev/null
+++ b/meta-ohos-core/recipes-graphics/cairo/cairo_%.bbappend
@@ -0,0 +1,12 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+# cairo uses zero-length array tricks that trigger warnings with
+# -Warray-bounds.
+#
+# Those have been verified to be harmless in 1.16.0.
+#
+# Removing -Werror=array-bounds here allows us to use -Werror=array-bounds
+# globally in OPTIMIZE_FOR=security mode while keeping mesa building.
+
+TARGET_CFLAGS_remove = "-Werror=array-bounds"