⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283430 in webkit


Ignore:
Timestamp:
Oct 1, 2021, 7:35:30 PM (5 years ago)
Author:
commit-queue@webkit.org
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 <rdemarest@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:
Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r283425 r283430  
     12021-10-01  Remy Demarest  <rdemarest@apple.com>
     2
     3        Use DYLD_FRAMEWORK_PATH instead of DYLD_VERSIONED_FRAMEWORK_PATH on Safari Big Sur
     4        https://bugs.webkit.org/show_bug.cgi?id=231058
     5
     6        Reviewed by David Kilzer.
     7
     8        Modify the DYLD environment variable that is used when compiling with staged frameworks.
     9        We want to use DYLD_VERSIONED_FRAMEWORK_PATH to define the search path of the frameworks
     10        for DYLD because this makes launching Safari and its child processes faster. However,
     11        on Apple Silicon Big Sur using that environment variable does not work and results in Safari
     12        loading frameworks from the System folder rather than from the StagedFrameworks/Safari
     13        folder, this is because dyld on M1 does not look up that variable properly. To make sure
     14        we actually load the frameworks from the desired location, we need to use DYLD_FRAMEWORK_PATH
     15        instead, this makes dyld perform more stat() calls than usual to link the frameworks hence
     16        why we prefer the other variable, but this is the only way to workaround the issue in
     17        Big Sur on M1. In Monterey and above, this bug will be fixed in dyld so we only need this
     18        variable before macOS 11.
     19
     20        Override OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH_YES based on SDK and architecture to use
     21        DYLD_FRAMEWORK_PATH instead of DYLD_VERSIONED_FRAMEWORK_PATH when building for macOS 11 and arm64.
     22
     23        * Configurations/BaseTarget.xcconfig:
     24
    1252021-10-01  Brent Fulgham  <bfulgham@apple.com>
    226
  • trunk/Source/WebKit/Configurations/BaseTarget.xcconfig

    r279375 r283430  
    108108OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH = $(OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH_$(USE_STAGING_INSTALL_PATH));
    109109OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH_YES = -Wl,-dyld_env,DYLD_VERSIONED_FRAMEWORK_PATH=$(WK_INSTALL_PATH_PREFIX)/System/Library/StagedFrameworks/Safari;
     110OTHER_LDFLAGS_VERSIONED_FRAMEWORK_PATH_YES[arch=arm64*][sdk=macosx11*] = -Wl,-dyld_env,DYLD_FRAMEWORK_PATH=$(WK_INSTALL_PATH_PREFIX)/System/Library/StagedFrameworks/Safari;
    110111
    111112WK_USE_OVERRIDE_FRAMEWORKS_DIR = $(WK_NOT_$(WK_EMPTY_$(WK_OVERRIDE_FRAMEWORKS_DIR)));
Note: See TracChangeset for help on using the changeset viewer.