Title: [285415] trunk/Source/bmalloc
Revision
285415
Author
[email protected]
Date
2021-11-08 10:52:24 -0800 (Mon, 08 Nov 2021)

Log Message

Unreviewed, fix internal build failure on Catalina
https://bugs.webkit.org/show_bug.cgi?id=231815

Several pthread functions are not available.

* bmalloc/BPlatform.h:
* libpas/src/libpas/pas_thread_local_cache.h:
(pas_thread_local_cache_is_guaranteed_to_destruct):
(pas_thread_local_cache_can_set):
* libpas/src/libpas/pas_utils.h:

Modified Paths

Diff

Modified: trunk/Source/bmalloc/ChangeLog (285414 => 285415)


--- trunk/Source/bmalloc/ChangeLog	2021-11-08 18:45:48 UTC (rev 285414)
+++ trunk/Source/bmalloc/ChangeLog	2021-11-08 18:52:24 UTC (rev 285415)
@@ -1,5 +1,18 @@
 2021-11-08  Yusuke Suzuki  <[email protected]>
 
+        Unreviewed, fix internal build failure on Catalina
+        https://bugs.webkit.org/show_bug.cgi?id=231815
+
+        Several pthread functions are not available.
+
+        * bmalloc/BPlatform.h:
+        * libpas/src/libpas/pas_thread_local_cache.h:
+        (pas_thread_local_cache_is_guaranteed_to_destruct):
+        (pas_thread_local_cache_can_set):
+        * libpas/src/libpas/pas_utils.h:
+
+2021-11-08  Yusuke Suzuki  <[email protected]>
+
         [libpas] Enable libpas on macOS
         https://bugs.webkit.org/show_bug.cgi?id=231815
 

Modified: trunk/Source/bmalloc/bmalloc/BPlatform.h (285414 => 285415)


--- trunk/Source/bmalloc/bmalloc/BPlatform.h	2021-11-08 18:45:48 UTC (rev 285414)
+++ trunk/Source/bmalloc/bmalloc/BPlatform.h	2021-11-08 18:52:24 UTC (rev 285415)
@@ -93,7 +93,7 @@
 #endif
 
 #if defined(__SCE__)
-#define BPLATORM_PLAYSTATION 1
+#define BPLATFORM_PLAYSTATION 1
 #endif
 
 /* ==== Feature decision macros: these define feature choices for a particular port. ==== */

Modified: trunk/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.h (285414 => 285415)


--- trunk/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.h	2021-11-08 18:45:48 UTC (rev 285414)
+++ trunk/Source/bmalloc/libpas/src/libpas/pas_thread_local_cache.h	2021-11-08 18:52:24 UTC (rev 285415)
@@ -43,6 +43,12 @@
 #define PAS_HAVE_PTHREAD_PRIVATE 0
 #endif
 
+#ifdef __APPLE__
+#include <Availability.h>
+#include <AvailabilityMacros.h>
+#include <TargetConditionals.h>
+#endif
+
 PAS_BEGIN_EXTERN_C;
 
 struct pas_magazine;
@@ -89,21 +95,30 @@
 }
 
 #if PAS_HAVE_PTHREAD_PRIVATE
-#define PAS_THREAD_LOCAL_CACHE_CAN_DETECT_THREAD_EXIT \
-    __builtin_available(macos 10.16, ios 14.0, tvos 14.0, watchos 7.0, *)
+#if (PAS_PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
+    || (PAS_PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
+    || (PAS_PLATFORM(IOS) && PAS_PLATFORM(IOS_FAMILY_SIMULATOR) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
+    || (PAS_PLATFORM(WATCHOS) && PAS_PLATFORM(IOS_FAMILY_SIMULATOR) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
+    || (PAS_PLATFORM(APPLETV) && PAS_PLATFORM(IOS_FAMILY_SIMULATOR) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
+#define PAS_THREAD_LOCAL_CACHE_CAN_DETECT_THREAD_EXIT 1
+#endif
 
 static inline bool pas_thread_local_cache_is_guaranteed_to_destruct(void)
 {
-    if (PAS_THREAD_LOCAL_CACHE_CAN_DETECT_THREAD_EXIT)
-        return true;
+#ifdef PAS_THREAD_LOCAL_CACHE_CAN_DETECT_THREAD_EXIT
+    return true;
+#else
     return false;
+#endif
 }
 
 static inline bool pas_thread_local_cache_can_set(void)
 {
-    if (PAS_THREAD_LOCAL_CACHE_CAN_DETECT_THREAD_EXIT)
-        return !pthread_self_is_exiting_np();
+#ifdef PAS_THREAD_LOCAL_CACHE_CAN_DETECT_THREAD_EXIT
+    return !pthread_self_is_exiting_np();
+#else
     return true;
+#endif
 }
 #else /* PAS_HAVE_PTHREAD_PRIVATE -> so !PAS_HAVE_PTHREAD_PRIVATE */
 static inline bool pas_thread_local_cache_is_guaranteed_to_destruct(void)

Modified: trunk/Source/bmalloc/libpas/src/libpas/pas_utils.h (285414 => 285415)


--- trunk/Source/bmalloc/libpas/src/libpas/pas_utils.h	2021-11-08 18:45:48 UTC (rev 285414)
+++ trunk/Source/bmalloc/libpas/src/libpas/pas_utils.h	2021-11-08 18:52:24 UTC (rev 285415)
@@ -83,6 +83,69 @@
 
 #define PAS_ARM __PAS_ARM
 
+#define PAS_PLATFORM(PLATFORM) (defined PAS_PLATFORM_##PLATFORM && PAS_PLATFORM_##PLATFORM)
+#define PAS_OS(OS) (defined PAS_OS_##OS && PAS_OS_##OS)
+
+#ifdef __APPLE__
+#define PAS_OS_DARWIN 1
+#endif
+
+#if defined(__unix) || defined(__unix__)
+#define PAS_OS_UNIX 1
+#endif
+
+#ifdef __linux__
+#define PAS_OS_LINUX 1
+#endif
+
+#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
+#define PAS_OS_FREEBSD 1
+#endif
+
+#if defined(WIN32) || defined(_WIN32)
+#define PAS_OS_WINDOWS 1
+#endif
+
+#if PAS_OS(DARWIN) && !defined(BUILDING_WITH_CMAKE)
+#if TARGET_OS_IOS
+#define PAS_OS_IOS 1
+#define PAS_PLATFORM_IOS 1
+#if TARGET_OS_SIMULATOR
+#define PAS_PLATFORM_IOS_SIMULATOR 1
+#endif
+#if defined(TARGET_OS_MACCATALYST) && TARGET_OS_MACCATALYST
+#define PAS_PLATFORM_MACCATALYST 1
+#endif
+#endif
+#if TARGET_OS_IPHONE
+#define PAS_PLATFORM_IOS_FAMILY 1
+#if TARGET_OS_SIMULATOR
+#define PAS_PLATFORM_IOS_FAMILY_SIMULATOR 1
+#endif
+#elif TARGET_OS_MAC
+#define PAS_OS_MAC 1
+#define PAS_PLATFORM_MAC 1
+#endif
+#endif
+
+#if PAS_PLATFORM(MAC) || PAS_PLATFORM(IOS_FAMILY)
+#define PAS_PLATFORM_COCOA 1
+#endif
+
+#if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH
+#define PAS_OS_WATCHOS 1
+#define PAS_PLATFORM_WATCHOS 1
+#endif
+
+#if defined(TARGET_OS_TV) && TARGET_OS_TV
+#define PAS_OS_APPLETV 1
+#define PAS_PLATFORM_APPLETV 1
+#endif
+
+#if defined(__SCE__)
+#define PAS_PLATFORM_PLAYSTATION 1
+#endif
+
 /* NOTE: panic format string must have \n at the end. */
 PAS_API PAS_NO_RETURN void pas_panic(const char* format, ...) PAS_FORMAT_PRINTF(1, 2);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to