From 9ba7d16a1e09130fa9a6c03f3d050957728f1063 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 6 Jul 2021 23:07:56 +0200 Subject: [PATCH] postgresql: prevent addition of ARM target flag configure.in checks for "ARMv8 CRC32C intrinsics" and goes as far as adding "-march=armv8-a+crc" to the target flags if the compiler allows it. This can clash with the OpenWrt target flags in CONFIG_TARGET_OPTIMIZATION. If for example the latter is set to "-mcpu=cortex-a9" the following warning is issued: cc1: warning: switch '-mcpu=cortex-a9' conflicts with '-march=armv5t' switch This commit prevents configure.in from adding the mentioned flag. The addition is unwanted when cross-compiling. An issue was raised for this recently, see [1]. [1] https://github.com/openwrt/packages/issues/16034 Signed-off-by: Sebastian Kemper --- .../patches/700-no-arm-crc-march-change.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 libs/postgresql/patches/700-no-arm-crc-march-change.patch diff --git a/libs/postgresql/patches/700-no-arm-crc-march-change.patch b/libs/postgresql/patches/700-no-arm-crc-march-change.patch new file mode 100644 index 000000000..ec0b152f5 --- /dev/null +++ b/libs/postgresql/patches/700-no-arm-crc-march-change.patch @@ -0,0 +1,15 @@ +--- a/configure.in ++++ b/configure.in +@@ -2019,9 +2019,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ + # flags. If not, check if adding -march=armv8-a+crc flag helps. + # CFLAGS_ARMV8_CRC32C is set if the extra flag is required. + PGAC_ARMV8_CRC32C_INTRINSICS([]) +-if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then +- PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc]) +-fi ++#if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then ++# PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc]) ++#fi + AC_SUBST(CFLAGS_ARMV8_CRC32C) + + # Select CRC-32C implementation.