Skip to content

Commit 6868d96

Browse files
committed
MDEV-34825 FreeBSD fails to build under clang natively (postfix)
The fix in MDEV-34825/#3484/dff354e7df2f originally just took the FreeBSD carried patch of inline ASM as it didn't have the __ppc_get_timebase function. What clang does have is the __builtin_ppc_get_timebase, which was replaced in the same commit, which was the fix taken from Alpine. To reduce complexity - we only need one working function rather than an equivalent asm implementation. Noted by Marko, thanks!
1 parent d1f2cee commit 6868d96

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

include/my_cpu.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,8 @@ static inline void MY_RELAX_CPU(void)
9494
__asm__ __volatile__ ("pause");
9595
#endif
9696
#elif defined(_ARCH_PWR8)
97-
#ifdef __FreeBSD__
98-
uint64_t __tb;
99-
__asm__ volatile ("mfspr %0, 268" : "=r" (__tb));
100-
#else
101-
/* Changed from __ppc_get_timebase for musl compatibility */
97+
/* Changed from __ppc_get_timebase for musl and clang compatibility */
10298
__builtin_ppc_get_timebase();
103-
#endif
10499
#elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
105100
/* Mainly, prevent the compiler from optimizing away delay loops */
106101
#ifdef _aarch64_

0 commit comments

Comments
 (0)