Skip to content
Permalink
Browse files
[Mac] Shims used by XPC services are installed inside legacy process …
…bundles

https://bugs.webkit.org/show_bug.cgi?id=152233

Reviewed by Sam Weinig.

Have the shim dylibs installed in the framework’s Frameworks directory instead.

* Configurations/BaseLegacyProcess.xcconfig: Simplified now that EXCLUDED_SHIM_FILE_NAME is
  no longer defined, because shims aren’t copied into legacy processes.

* Configurations/NetworkProcess.xcconfig: Removed definition of EXCLUDED_SHIM_FILE_NAME.
* Configurations/PluginProcess.xcconfig: Ditto.
* Configurations/WebContentProcess.xcconfig: Ditto.

* Configurations/Shim.xcconfig: Install the shims when building for OS X. Added definitions
  of INSTALL_PATH and DYLIB_INSTALL_NAME_BASE which are now common to all shims.

* Configurations/PluginProcessShim.xcconfig: Removed definitions of INSTALL_PATH and
  DYLIB_INSTALL_NAME_BASE from here, now that they are defined for all shims in
  Shim.xcconfig.
* Configurations/SecItemShim.xcconfig: Ditto.
* Configurations/WebProcessShim.xcconfig:

* Configurations/WebKit.xcconfig: Added the shims to EXCLUDED_SOURCE_FILE_NAMES for iOS.

* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Changed
  the value of DYLD_INSERT_LIBRARIES to point to the shim’s new location.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto.
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Ditto.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::computeProcessShimPath): Changed to return the new paths, which are all inside the
  framework’s Frameworks directory.

* WebKit2.xcodeproj/project.pbxproj:
- Removed references to WRAPPER_NAME from the “Copy XPC services for engineering builds”
  build phase in the All target, becase WRAPPER_NAME is empty in an aggregate target.
- Removed the PlugInProcess target’s dependency on the PluginProcessShim target and its
  Copy Plug-in Process Shim build phase.
- Removed the NetworkProcess target’s dependency on the SecItemShim target and its Copy
  Sec Item Shim build phase.
- Removed the WebProcess target’s dependency on the WebProcessShim target and its Copy
  WebProcessShim build phase.
- Made the WebKit target depend on the shim targets, and added to it a Copy Shims build
  phase that copies the shims into the framework’s Frameworks directory.



Canonical link: https://commits.webkit.org/170347@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Dan Bernstein committed Dec 14, 2015
1 parent b5f19b5 commit 4d4931fd38a4ced6abcc254d25f105c24813a74d
@@ -1,3 +1,51 @@
2015-12-13 Dan Bernstein <mitz@apple.com>

[Mac] Shims used by XPC services are installed inside legacy process bundles
https://bugs.webkit.org/show_bug.cgi?id=152233

Reviewed by Sam Weinig.

Have the shim dylibs installed in the framework’s Frameworks directory instead.

* Configurations/BaseLegacyProcess.xcconfig: Simplified now that EXCLUDED_SHIM_FILE_NAME is
no longer defined, because shims aren’t copied into legacy processes.

* Configurations/NetworkProcess.xcconfig: Removed definition of EXCLUDED_SHIM_FILE_NAME.
* Configurations/PluginProcess.xcconfig: Ditto.
* Configurations/WebContentProcess.xcconfig: Ditto.

* Configurations/Shim.xcconfig: Install the shims when building for OS X. Added definitions
of INSTALL_PATH and DYLIB_INSTALL_NAME_BASE which are now common to all shims.

* Configurations/PluginProcessShim.xcconfig: Removed definitions of INSTALL_PATH and
DYLIB_INSTALL_NAME_BASE from here, now that they are defined for all shims in
Shim.xcconfig.
* Configurations/SecItemShim.xcconfig: Ditto.
* Configurations/WebProcessShim.xcconfig:

* Configurations/WebKit.xcconfig: Added the shims to EXCLUDED_SOURCE_FILE_NAMES for iOS.

* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Changed
the value of DYLD_INSERT_LIBRARIES to point to the shim’s new location.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto.
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Ditto.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::computeProcessShimPath): Changed to return the new paths, which are all inside the
framework’s Frameworks directory.

* WebKit2.xcodeproj/project.pbxproj:
- Removed references to WRAPPER_NAME from the “Copy XPC services for engineering builds”
build phase in the All target, becase WRAPPER_NAME is empty in an aggregate target.
- Removed the PlugInProcess target’s dependency on the PluginProcessShim target and its
Copy Plug-in Process Shim build phase.
- Removed the NetworkProcess target’s dependency on the SecItemShim target and its Copy
Sec Item Shim build phase.
- Removed the WebProcess target’s dependency on the WebProcessShim target and its Copy
WebProcessShim build phase.
- Made the WebKit target depend on the shim targets, and added to it a Copy Shims build
phase that copies the shims into the framework’s Frameworks directory.

2015-12-13 Dan Bernstein <mitz@apple.com>

Build fix.
@@ -31,9 +31,7 @@ APP_ICON_Release = WebKit.icns;
APP_ICON_Production = ;

EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(CONFIGURATION));
EXCLUDED_SOURCE_FILE_NAMES_Production = $(EXCLUDED_SHIM_FILE_NAME) WebKit.icns;
EXCLUDED_SOURCE_FILE_NAMES_Debug = $(EXCLUDED_SHIM_FILE_NAME);
EXCLUDED_SOURCE_FILE_NAMES_Release = $(EXCLUDED_SHIM_FILE_NAME);
EXCLUDED_SOURCE_FILE_NAMES_Production = WebKit.icns;

EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = $(EXCLUDED_SOURCE_FILE_NAMES_$(CONFIGURATION)) *.xib;

@@ -26,6 +26,4 @@
PRODUCT_NAME = NetworkProcess;
INFOPLIST_FILE = NetworkProcess/EntryPoint/mac/LegacyProcess/Info.plist;

EXCLUDED_SHIM_FILE_NAME[sdk=iphone*] = SecItemShim.dylib;

CODE_SIGN_ENTITLEMENTS[sdk=iphone*] = Configurations/Network-iOS.entitlements;
@@ -32,6 +32,4 @@ OTHER_LDFLAGS = $(OTHER_LDFLAGS) $(LDFLAGS_SHIM_$(CONFIGURATION));
LDFLAGS_SHIM_Production[sdk=macosx*] = $(LDFLAGS_SHIM_$(WK_LINK_SHIM));
LDFLAGS_SHIM_YES = $(BUILT_PRODUCTS_DIR)/PluginProcessShim.dylib;

EXCLUDED_SHIM_FILE_NAME[sdk=iphone*] = PluginProcessShim.dylib;

SKIP_INSTALL[sdk=iphone*] = YES;
@@ -25,8 +25,5 @@

#include "Shim.xcconfig"

INSTALL_PATH = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/PluginProcess.app/Contents/MacOS;
DYLIB_INSTALL_NAME_BASE = $(NORMAL_WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/PluginProcess.app/Contents/MacOS;

OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM);
OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = -framework AppKit -framework Carbon -framework QuartzCore;
@@ -25,8 +25,5 @@

#include "Shim.xcconfig"

INSTALL_PATH[sdk=macosx*] = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/NetworkProcess.app/Contents/MacOS;
DYLIB_INSTALL_NAME_BASE[sdk=macosx*] = $(NORMAL_WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/NetworkProcess.app/Contents/MacOS;

OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM);
OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = -framework Security;
@@ -25,4 +25,7 @@

GCC_DYNAMIC_NO_PIC = NO;
SKIP_INSTALL = YES;
SKIP_INSTALL[sdk=macosx*] = NO;

INSTALL_PATH = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/Frameworks;
DYLIB_INSTALL_NAME_BASE = $(NORMAL_WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/Frameworks;
@@ -26,6 +26,4 @@
PRODUCT_NAME = WebProcess;
INFOPLIST_FILE = WebProcess/EntryPoint/mac/LegacyProcess/Info.plist;

EXCLUDED_SHIM_FILE_NAME[sdk=iphone*] = WebProcessShim.dylib;

CODE_SIGN_ENTITLEMENTS[sdk=iphonesimulator*] = Configurations/WebContent-iOS.entitlements;
@@ -48,7 +48,7 @@ SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebKit.order;
SECTORDER_FLAGS_Production[sdk=macosx*] = -Wl,-order_file,mac/WebKit2.order;

EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = *.pdf Resources/mac/* com.apple.WebKit.Databases.sb com.apple.WebKit.NetworkProcess.sb com.apple.WebProcess.sb PlugInSandboxProfiles/*.sb;
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = PlugInProcessShim.dylib SecItemShim.dylib WebProcessShim.dylib *.pdf Resources/mac/* com.apple.WebKit.Databases.sb com.apple.WebKit.NetworkProcess.sb com.apple.WebProcess.sb PlugInSandboxProfiles/*.sb;

INSTALLHDRS_SCRIPT_PHASE = YES;

@@ -25,8 +25,5 @@

#include "Shim.xcconfig"

INSTALL_PATH = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/WebProcess.app/Contents/MacOS;
DYLIB_INSTALL_NAME_BASE = $(NORMAL_WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/WebProcess.app/Contents/MacOS;

OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM);
OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = -framework CoreServices -framework Security;
@@ -43,7 +43,7 @@
<key>EnvironmentVariables</key>
<dict>
<key>DYLD_INSERT_LIBRARIES</key>
<string>$(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/NetworkProcess.app/Contents/MacOS/SecItemShim.dylib</string>
<string>$(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Frameworks/SecItemShim.dylib</string>
</dict>
</dict>
</dict>
@@ -49,7 +49,7 @@
<key>EnvironmentVariables</key>
<dict>
<key>DYLD_INSERT_LIBRARIES</key>
<string>$(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/PluginProcess.app/Contents/MacOS/PluginProcessShim.dylib</string>
<string>$(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/Frameworks/PluginProcessShim.dylib</string>
<key>NSStringDisableTagged</key>
<string>YES</string>
</dict>
@@ -97,27 +97,15 @@ static void setUpTerminationNotificationHandler(pid_t pid)
static RetainPtr<NSString> computeProcessShimPath(const ProcessLauncher::LaunchOptions& launchOptions, NSBundle *webKitBundle)
{
#if ENABLE(NETSCAPE_PLUGIN_API)
if (launchOptions.processType == ProcessLauncher::PluginProcess) {
NSString *processPath = [webKitBundle pathForAuxiliaryExecutable:@"PluginProcess.app"];
NSString *processAppExecutablePath = [[NSBundle bundleWithPath:processPath] executablePath];

return [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"PluginProcessShim.dylib"];
}
if (launchOptions.processType == ProcessLauncher::PluginProcess)
return [[webKitBundle privateFrameworksPath] stringByAppendingPathComponent:@"PluginProcessShim.dylib"];
#endif

if (launchOptions.processType == ProcessLauncher::NetworkProcess) {
NSString *processPath = [webKitBundle pathForAuxiliaryExecutable:@"NetworkProcess.app"];
NSString *processAppExecutablePath = [[NSBundle bundleWithPath:processPath] executablePath];
if (launchOptions.processType == ProcessLauncher::NetworkProcess)
return [[webKitBundle privateFrameworksPath] stringByAppendingPathComponent:@"SecItemShim.dylib"];

return [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"SecItemShim.dylib"];
}

if (launchOptions.processType == ProcessLauncher::WebProcess) {
NSString *processPath = [webKitBundle pathForAuxiliaryExecutable:@"WebProcess.app"];
NSString *processAppExecutablePath = [[NSBundle bundleWithPath:processPath] executablePath];

return [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"WebProcessShim.dylib"];
}
if (launchOptions.processType == ProcessLauncher::WebProcess)
return [[webKitBundle privateFrameworksPath] stringByAppendingPathComponent:@"WebProcessShim.dylib"];

return nil;
}

0 comments on commit 4d4931f

Please sign in to comment.