Work around a ppc clang inlining bug

This commit is contained in:
Stan Shebs 2018-09-25 07:48:20 -07:00 committed by Fangrui Song
parent 9b6c937b00
commit 96509a9dce
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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)
{