From 96509a9dcec99892802cdf7ac16f9b5e51ffccde Mon Sep 17 00:00:00 2001 From: Stan Shebs Date: Tue, 25 Sep 2018 07:48:20 -0700 Subject: [PATCH] Work around a ppc clang inlining bug --- sysdeps/pthread/aio_misc.c | 3 +++ sysdeps/unix/sysv/linux/aio_misc.h | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sysdeps/pthread/aio_misc.c b/sysdeps/pthread/aio_misc.c index fb13d6210b7..8d4a25894c6 100644 --- a/sysdeps/pthread/aio_misc.c +++ b/sysdeps/pthread/aio_misc.c @@ -27,6 +27,9 @@ #include #include #include +#if defined __clang__ && defined __powerpc64__ +#define UGLY_INLINE_HACK +#endif #include #ifndef aio_create_helper_thread diff --git a/sysdeps/unix/sysv/linux/aio_misc.h b/sysdeps/unix/sysv/linux/aio_misc.h index 0d8aa455167..f463c8fca78 100644 --- a/sysdeps/unix/sysv/linux/aio_misc.h +++ b/sysdeps/unix/sysv/linux/aio_misc.h @@ -35,7 +35,13 @@ __aio_start_notify_thread (void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &ss, NULL, _NSIG / 8); } -extern inline int +extern +/* clang fails to inline properly in one case, and then linking fails + because the function was discarded, so ensure it's kept. */ +#ifndef UGLY_INLINE_HACK +inline +#endif +int __aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *), void *arg) { -- 2.47.2