From 3f5c0b6bb14d84fb8aa7e1369d70594cbb8333cb Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Sun, 23 Dec 2018 12:51:52 +0000 Subject: [PATCH] Fix Ada bootstrap for Darwin9 and earlier. 2018-12-23 Iain Sandoe gcc/ada/ * adaint.c [__APPLE__] (__gnat_lwp_self): Ensure that the system interface used is available on the target. From-SVN: r267374 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/adaint.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index ba974cdcb03..026f202af58 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-12-23 Iain Sandoe + + * adaint.c [__APPLE__] (__gnat_lwp_self): Ensure that the system + interface used is available on the target. + 2018-12-14 Eric Botcazou * gcc-interface/decl.c (rm_size): Take into account the padding in diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 88500a6e027..cc143cf3b2c 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -3239,9 +3239,13 @@ __gnat_lwp_self (void) #endif #if defined (__APPLE__) -#include -#include -#include +# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 +# include +# include +# include +# else +# include +# endif /* System-wide thread identifier. Note it could be truncated on 32 bit hosts. @@ -3249,6 +3253,7 @@ __gnat_lwp_self (void) void * __gnat_lwp_self (void) { +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1060 thread_identifier_info_data_t data; mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT; kern_return_t kret; @@ -3259,6 +3264,9 @@ __gnat_lwp_self (void) return (void *)(uintptr_t)data.thread_id; else return 0; +#else + return (void *)pthread_mach_thread_np (pthread_self ()); +#endif } #endif -- 2.30.2