Title: [284487] branches/safari-612.2.9.1-branch/Source/WebKit
Revision
284487
Author
alanc...@apple.com
Date
2021-10-19 13:11:38 -0700 (Tue, 19 Oct 2021)

Log Message

Cherry-pick r283430. rdar://problem/84428809

    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:

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

Modified Paths

Diff

Modified: branches/safari-612.2.9.1-branch/Source/WebKit/ChangeLog (284486 => 284487)


--- branches/safari-612.2.9.1-branch/Source/WebKit/ChangeLog	2021-10-19 20:08:13 UTC (rev 284486)
+++ branches/safari-612.2.9.1-branch/Source/WebKit/ChangeLog	2021-10-19 20:11:38 UTC (rev 284487)
@@ -1,3 +1,56 @@
+2021-10-19  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r283430. rdar://problem/84428809
+
+    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:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    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-11  Russell Epstein  <repst...@apple.com>
 
         Cherry-pick r283846. rdar://problem/84117092

Modified: branches/safari-612.2.9.1-branch/Source/WebKit/Configurations/BaseTarget.xcconfig (284486 => 284487)


--- branches/safari-612.2.9.1-branch/Source/WebKit/Configurations/BaseTarget.xcconfig	2021-10-19 20:08:13 UTC (rev 284486)
+++ branches/safari-612.2.9.1-branch/Source/WebKit/Configurations/BaseTarget.xcconfig	2021-10-19 20:11:38 UTC (rev 284487)
@@ -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