Title: [283430] trunk/Source/WebKit
Revision
283430
Author
commit-qu...@webkit.org
Date
2021-10-01 19:35:30 -0700 (Fri, 01 Oct 2021)

Log Message

Use DYLD_FRAMEWORK_PATH instead of DYLD_VERSIONED_FRAMEWORK_PATH on Safari Big Sur
https://bugs.webkit.org/show_bug.cgi?id=231058

Patch by Remy Demarest <rdemar...@apple.com> on 2021-10-01
Reviewed by David Kilzer.

Modify the DYLD environment variable that is used when compiling with staged frameworks.
We want to use DYLD_VERSIONED_FRAMEWORK_PATH to define the search path of the frameworks
for DYLD because this makes launching Safari and its child processes faster. However,
on Apple Silicon Big Sur using that environment variable does not work and results in Safari
loading frameworks from the System folder rather than from the StagedFrameworks/Safari
folder, this is because dyld on M1 does not look up that variable properly. To make sure
we actually load the frameworks from the desired location, we need to use DYLD_FRAMEWORK_PATH
instead, this makes dyld perform more stat() calls than usual to link the frameworks hence
why we prefer the other variable, but this is the only way to workaround the issue in
Big Sur on M1. In Monterey and above, this bug will be fixed in dyld so we only need this
variable before macOS 11.

Override OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH_YES based on SDK and architecture to use
DYLD_FRAMEWORK_PATH instead of DYLD_VERSIONED_FRAMEWORK_PATH when building for macOS 11 and arm64.

* Configurations/BaseTarget.xcconfig:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (283429 => 283430)


--- trunk/Source/WebKit/ChangeLog	2021-10-02 01:04:26 UTC (rev 283429)
+++ trunk/Source/WebKit/ChangeLog	2021-10-02 02:35:30 UTC (rev 283430)
@@ -1,3 +1,27 @@
+2021-10-01  Remy Demarest  <rdemar...@apple.com>
+
+        Use DYLD_FRAMEWORK_PATH instead of DYLD_VERSIONED_FRAMEWORK_PATH on Safari Big Sur
+        https://bugs.webkit.org/show_bug.cgi?id=231058
+
+        Reviewed by David Kilzer.
+
+        Modify the DYLD environment variable that is used when compiling with staged frameworks.
+        We want to use DYLD_VERSIONED_FRAMEWORK_PATH to define the search path of the frameworks
+        for DYLD because this makes launching Safari and its child processes faster. However,
+        on Apple Silicon Big Sur using that environment variable does not work and results in Safari
+        loading frameworks from the System folder rather than from the StagedFrameworks/Safari
+        folder, this is because dyld on M1 does not look up that variable properly. To make sure
+        we actually load the frameworks from the desired location, we need to use DYLD_FRAMEWORK_PATH
+        instead, this makes dyld perform more stat() calls than usual to link the frameworks hence
+        why we prefer the other variable, but this is the only way to workaround the issue in
+        Big Sur on M1. In Monterey and above, this bug will be fixed in dyld so we only need this
+        variable before macOS 11.
+
+        Override OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH_YES based on SDK and architecture to use
+        DYLD_FRAMEWORK_PATH instead of DYLD_VERSIONED_FRAMEWORK_PATH when building for macOS 11 and arm64.
+
+        * Configurations/BaseTarget.xcconfig:
+
 2021-10-01  Brent Fulgham  <bfulg...@apple.com>
 
         Remove reference to od-server-name from sandbox profiles 

Modified: trunk/Source/WebKit/Configurations/BaseTarget.xcconfig (283429 => 283430)


--- trunk/Source/WebKit/Configurations/BaseTarget.xcconfig	2021-10-02 01:04:26 UTC (rev 283429)
+++ trunk/Source/WebKit/Configurations/BaseTarget.xcconfig	2021-10-02 02:35:30 UTC (rev 283430)
@@ -107,6 +107,7 @@
 
 OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH = $(OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH_$(USE_STAGING_INSTALL_PATH));
 OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH_YES = -Wl,-dyld_env,DYLD_VERSIONED_FRAMEWORK_PATH=$(WK_INSTALL_PATH_PREFIX)/System/Library/StagedFrameworks/Safari;
+OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH_YES[arch=arm64*][sdk=macosx11*] = -Wl,-dyld_env,DYLD_FRAMEWORK_PATH=$(WK_INSTALL_PATH_PREFIX)/System/Library/StagedFrameworks/Safari;
 
 WK_USE_OVERRIDE_FRAMEWORKS_DIR = $(WK_NOT_$(WK_EMPTY_$(WK_OVERRIDE_FRAMEWORKS_DIR)));
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to