Skip to content

Commit af0c248

Browse files
committed
Use function attributes for SSE 4.2 even when targeting that extension
On Red Hat 9 systems (or similar), the packaged gcc targets x86-64-v2, but clang does not. This has caused build failures in the wake of commit e2809e3 when building --with-llvm. The most expedient fix is to use the same function attributes for the inlined function as we do for the global function. Reported-by: Kyotaro Horiguchi <[email protected]> (plus members skimmer and bumblebee) Diagnosed-by: Tom Lane <[email protected]> Tested-by: Todd Cook <[email protected]> Discussion: https://postgr.es/m/CANWCAZZSxs3a1YRKehkgk2OHKbrVn+xZ+AWW8Co2R_f70NqqmA@mail.gmail.com
1 parent 3dbdf86 commit af0c248

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/include/port/pg_crc32c.h

+6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ typedef uint32 pg_crc32c;
5252

5353
extern pg_crc32c pg_comp_crc32c_sse42(pg_crc32c crc, const void *data, size_t len);
5454

55+
/*
56+
* We can only get here if the host compiler targets SSE 4.2, but on some
57+
* systems gcc and clang don't have the same built-in targets, so we still
58+
* must use a function attribute here to accommodate "--with-llvm" builds.
59+
*/
5560
pg_attribute_no_sanitize_alignment()
61+
pg_attribute_target("sse4.2")
5662
static inline
5763
pg_crc32c
5864
pg_comp_crc32c_dispatch(pg_crc32c crc, const void *data, size_t len)

0 commit comments

Comments
 (0)