aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Shebs <stanshebs@google.com>2018-09-25 07:48:20 -0700
committerFangrui Song <i@maskray.me>2021-08-27 17:23:12 -0700
commit96509a9dcec99892802cdf7ac16f9b5e51ffccde (patch)
tree16b33fca3be59581d5d9975fa4a1201019856d97
parent9b6c937b0041de8b65a6f11db9c5a05efd3fd7c6 (diff)
downloadglibc-96509a9dcec99892802cdf7ac16f9b5e51ffccde.zip
glibc-96509a9dcec99892802cdf7ac16f9b5e51ffccde.tar.gz
glibc-96509a9dcec99892802cdf7ac16f9b5e51ffccde.tar.bz2
Work around a ppc clang inlining bug
-rw-r--r--sysdeps/pthread/aio_misc.c3
-rw-r--r--sysdeps/unix/sysv/linux/aio_misc.h8
2 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/pthread/aio_misc.c b/sysdeps/pthread/aio_misc.c
index fb13d62..8d4a258 100644
--- a/sysdeps/pthread/aio_misc.c
+++ b/sysdeps/pthread/aio_misc.c
@@ -27,6 +27,9 @@
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/time.h>
+#if defined __clang__ && defined __powerpc64__
+#define UGLY_INLINE_HACK
+#endif
#include <aio_misc.h>
#ifndef aio_create_helper_thread
diff --git a/sysdeps/unix/sysv/linux/aio_misc.h b/sysdeps/unix/sysv/linux/aio_misc.h
index 0d8aa45..f463c8f 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)
{