Fix the SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL macro so it passes the full path to dlopen.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 May 2012 19:33:42 +0000 (19:33 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 May 2012 19:33:42 +0000 (19:33 +0000)
dyld only considers libraries in the versioned framework path if their install name
matches the library that it is attempting to load. The path we were passing to
dlopen lacked the Versions/A component of the path so dyld did not recognize that
we wanted it to use the staged version if it is newer.

<rdar://problem/11406517>

Reviewed by Mark Rowe.

Source/WebCore:

* platform/mac/SoftLinking.h: Have SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL take the
framework version as an argument and use it when constructing the path to dlopen.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm: Pass A to SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL for the version.

Source/WebKit2:

* UIProcess/mac/WebInspectorProxyMac.mm: Pass A to SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL for the version.
* WebProcess/WebPage/mac/WebInspectorMac.mm: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116449 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/SoftLinking.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
Source/WebKit2/WebProcess/WebPage/mac/WebInspectorMac.mm

index 8c4a442..bebc178 100644 (file)
@@ -1,3 +1,19 @@
+2012-05-08  Timothy Hatcher  <timothy@apple.com>
+
+        Fix the SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL macro so it passes the full path to dlopen.
+
+        dyld only considers libraries in the versioned framework path if their install name
+        matches the library that it is attempting to load. The path we were passing to
+        dlopen lacked the Versions/A component of the path so dyld did not recognize that
+        we wanted it to use the staged version if it is newer.
+
+        <rdar://problem/11406517>
+
+        Reviewed by Mark Rowe.
+
+        * platform/mac/SoftLinking.h: Have SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL take the
+        framework version as an argument and use it when constructing the path to dlopen.
+
 2012-05-08  Rafael Brandao  <rafael.lobo@openbossa.org>
 
         Build fix for Qt Snowleopard Release
index a102ae5..7aef20f 100644 (file)
         return frameworkLibrary; \
     }
 
-#define SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(framework, unstagedLocation) \
+#define SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(framework, unstagedLocation, version) \
     static void* framework##Library() \
     { \
         static void* frameworkLibrary = ^{ \
-            void* result = dlopen("/System/Library/" #unstagedLocation "/" #framework ".framework/" #framework, RTLD_LAZY); \
+            void* result = dlopen("/System/Library/" #unstagedLocation "/" #framework ".framework/Versions/" #version "/" #framework, RTLD_LAZY); \
             if (!result) \
-                result = dlopen("/System/Library/StagedFrameworks/Safari/" #framework ".framework/" #framework, RTLD_LAZY); \
+                result = dlopen("/System/Library/StagedFrameworks/Safari/" #framework ".framework/Versions/" #version "/" #framework, RTLD_LAZY); \
             return result; \
         }(); \
         return frameworkLibrary; \
index 59d55e1..55500d8 100644 (file)
@@ -1,3 +1,13 @@
+2012-05-08  Timothy Hatcher  <timothy@apple.com>
+
+        Fix the SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL macro so it passes the full path to dlopen.
+
+        <rdar://problem/11406517>
+
+        Reviewed by Mark Rowe.
+
+        * WebCoreSupport/WebInspectorClient.mm: Pass A to SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL for the version.
+
 2012-05-07  Andy Estes  <aestes@apple.com>
 
         ENABLE_IFRAME_SEAMLESS should be part of FEATURE_DEFINES.
index edee884..bd7b600 100644 (file)
@@ -47,7 +47,7 @@
 #import <WebKitSystemInterface.h>
 #import <wtf/PassOwnPtr.h>
 
-SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks)
+SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks, A)
 
 using namespace WebCore;
 
index b744fb3..3e12dfb 100644 (file)
@@ -1,3 +1,14 @@
+2012-05-08  Timothy Hatcher  <timothy@apple.com>
+
+        Fix the SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL macro so it passes the full path to dlopen.
+
+        <rdar://problem/11406517>
+
+        Reviewed by Mark Rowe.
+
+        * UIProcess/mac/WebInspectorProxyMac.mm: Pass A to SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL for the version.
+        * WebProcess/WebPage/mac/WebInspectorMac.mm: Ditto.
+
 2012-05-08  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
 
         [WK2] Integrate Page Visibility state change and WK2 Suspend/Resume API
index cfb756c..bcdfbc2 100644 (file)
@@ -42,7 +42,7 @@
 #import <WebCore/SoftLinking.h>
 #import <wtf/text/WTFString.h>
 
-SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks)
+SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks, A)
 
 using namespace WebCore;
 using namespace WebKit;
index 1fa8795..48ac886 100644 (file)
@@ -28,7 +28,7 @@
 
 #import <WebCore/SoftLinking.h>
 
-SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks)
+SOFT_LINK_STAGED_FRAMEWORK_OPTIONAL(WebInspector, PrivateFrameworks, A)
 
 namespace WebKit {