public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/google/grte/v5-2.27/master] Work around a ppc clang inlining bug
@ 2021-08-28 0:39 Fangrui Song
0 siblings, 0 replies; only message in thread
From: Fangrui Song @ 2021-08-28 0:39 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=96509a9dcec99892802cdf7ac16f9b5e51ffccde
commit 96509a9dcec99892802cdf7ac16f9b5e51ffccde
Author: Stan Shebs <stanshebs@google.com>
Date: Tue Sep 25 07:48:20 2018 -0700
Work around a ppc clang inlining bug
Diff:
---
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 fb13d6210b..8d4a25894c 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 0d8aa45516..f463c8fca7 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)
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-28 0:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28 0:39 [glibc/google/grte/v5-2.27/master] Work around a ppc clang inlining bug Fangrui Song
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).