Title: [245269] trunk/Source/WTF
Revision
245269
Author
you...@apple.com
Date
2019-05-13 19:25:56 -0700 (Mon, 13 May 2019)

Log Message

[Mac] Use realpath for dlopen_preflight
https://bugs.webkit.org/show_bug.cgi?id=197803

Reviewed by Eric Carlson.

* wtf/cocoa/SoftLinking.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (245268 => 245269)


--- trunk/Source/WTF/ChangeLog	2019-05-14 02:25:34 UTC (rev 245268)
+++ trunk/Source/WTF/ChangeLog	2019-05-14 02:25:56 UTC (rev 245269)
@@ -1,3 +1,12 @@
+2019-05-13  Youenn Fablet  <you...@apple.com>
+
+        [Mac] Use realpath for dlopen_preflight
+        https://bugs.webkit.org/show_bug.cgi?id=197803
+
+        Reviewed by Eric Carlson.
+
+        * wtf/cocoa/SoftLinking.h:
+
 2019-05-13  Yusuke Suzuki  <ysuz...@apple.com>
 
         Unreviewed, wrokaround for MACH_VM_MAX_ADDRESS in ARM32_64

Modified: trunk/Source/WTF/wtf/Platform.h (245268 => 245269)


--- trunk/Source/WTF/wtf/Platform.h	2019-05-14 02:25:34 UTC (rev 245268)
+++ trunk/Source/WTF/wtf/Platform.h	2019-05-14 02:25:56 UTC (rev 245269)
@@ -1547,6 +1547,10 @@
 #define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO 1
 #endif
 
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101500
+#define USE_REALPATH_FOR_DLOPEN_PREFLIGHT 1
+#endif
+
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000)
 #define HAVE_AVPLAYER_RESOURCE_CONSERVATION_LEVEL 1
 #endif

Modified: trunk/Source/WTF/wtf/cocoa/SoftLinking.h (245268 => 245269)


--- trunk/Source/WTF/wtf/cocoa/SoftLinking.h	2019-05-14 02:25:34 UTC (rev 245268)
+++ trunk/Source/WTF/wtf/cocoa/SoftLinking.h	2019-05-14 02:25:56 UTC (rev 245269)
@@ -24,9 +24,10 @@
 
 #pragma once
 
-#import <wtf/Assertions.h>
 #import <dlfcn.h>
 #import <objc/runtime.h>
+#import <wtf/Assertions.h>
+#import <wtf/FileSystem.h>
 
 #pragma mark - Soft-link macros for use within a single source file
 
@@ -63,10 +64,16 @@
         return frameworkLibrary; \
     }
 
+#if USE(REALPATH_FOR_DLOPEN_PREFLIGHT)
+#define DLOPEN_PREFLIGHT(path) dlopen_preflight(FileSystem::realPath(path##_s).utf8().data())
+#else
+#define DLOPEN_PREFLIGHT(path) dlopen_preflight(path)
+#endif
+
 #define SOFT_LINK_FRAMEWORK_OPTIONAL_PREFLIGHT(framework) \
     static bool framework##LibraryIsAvailable() \
     { \
-        static bool frameworkLibraryIsAvailable = dlopen_preflight("/System/Library/Frameworks/" #framework ".framework/" #framework); \
+        static bool frameworkLibraryIsAvailable = DLOPEN_PREFLIGHT("/System/Library/Frameworks/" #framework ".framework/" #framework); \
         return frameworkLibraryIsAvailable; \
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to