diff --git a/src/port/pg_popcount_aarch64.c b/src/port/pg_popcount_aarch64.c index 0b6b86de4d0..0c93e2e625e 100644 --- a/src/port/pg_popcount_aarch64.c +++ b/src/port/pg_popcount_aarch64.c @@ -478,4 +478,10 @@ pg_popcount_masked_neon(const char *buf, int bytes, bits8 mask) return popcnt; } -#endif /* POPCNT_AARCH64 */ +#else /* POPCNT_AARCH64 */ + +/* prevent linker complaints about empty module */ +extern int pg_popcount_aarch64_dummy_variable; +int pg_popcount_aarch64_dummy_variable = 0; + +#endif /* ! POPCNT_AARCH64 */ diff --git a/src/port/pg_popcount_avx512.c b/src/port/pg_popcount_avx512.c index 80c0aee3e73..896bc7473b2 100644 --- a/src/port/pg_popcount_avx512.c +++ b/src/port/pg_popcount_avx512.c @@ -220,4 +220,11 @@ pg_popcount_masked_avx512(const char *buf, int bytes, bits8 mask) } #endif /* TRY_POPCNT_X86_64 */ -#endif /* USE_AVX512_POPCNT_WITH_RUNTIME_CHECK */ + +#else /* USE_AVX512_POPCNT_WITH_RUNTIME_CHECK */ + +/* prevent linker complaints about empty module */ +extern int pg_popcount_avx512_dummy_variable; +int pg_popcount_avx512_dummy_variable = 0; + +#endif /* ! USE_AVX512_POPCNT_WITH_RUNTIME_CHECK */