REGRESSION (r218616): Cannot build WebCore for macOS 10.12 with macOS 10.13 SDK
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2017 16:21:41 +0000 (16:21 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2017 16:21:41 +0000 (16:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173939

Reviewed by Dan Bernstein.

(The code in this change was either suggested or written by Dan Bernstein with a very
minor adjustment to get it to build).

Allow WebCore to link even though CTFontCreatePhysicalFontForCharactersWithLanguage() is
undefined when building against the macOS 10.13 SDK targeting macOS 10.12. Let the dynamic
linker resolve the undefined symbol.

For completeness the SPI CTFontCreatePhysicalFontForCharactersWithLanguage() was removed
from the macOS 10.13 SDK.

* Configurations/WebCore.xcconfig: Tell the linker that CTFontCreatePhysicalFontForCharactersWithLanguage()
can be undefined when building against macOS 10.13 or later SDK.
* platform/spi/cocoa/CoreTextSPI.h: Annotate CTFontCreatePhysicalFontForCharactersWithLanguage()
with its availability information.

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

Source/WebCore/ChangeLog
Source/WebCore/Configurations/WebCore.xcconfig
Source/WebCore/platform/spi/cocoa/CoreTextSPI.h

index d2e408f..c68d483 100644 (file)
@@ -1,3 +1,25 @@
+2017-07-10  Daniel Bates  <dabates@apple.com>
+
+        REGRESSION (r218616): Cannot build WebCore for macOS 10.12 with macOS 10.13 SDK
+        https://bugs.webkit.org/show_bug.cgi?id=173939
+
+        Reviewed by Dan Bernstein.
+
+        (The code in this change was either suggested or written by Dan Bernstein with a very
+        minor adjustment to get it to build).
+
+        Allow WebCore to link even though CTFontCreatePhysicalFontForCharactersWithLanguage() is
+        undefined when building against the macOS 10.13 SDK targeting macOS 10.12. Let the dynamic
+        linker resolve the undefined symbol.
+
+        For completeness the SPI CTFontCreatePhysicalFontForCharactersWithLanguage() was removed
+        from the macOS 10.13 SDK.
+
+        * Configurations/WebCore.xcconfig: Tell the linker that CTFontCreatePhysicalFontForCharactersWithLanguage()
+        can be undefined when building against macOS 10.13 or later SDK.
+        * platform/spi/cocoa/CoreTextSPI.h: Annotate CTFontCreatePhysicalFontForCharactersWithLanguage()
+        with its availability information.
+
 2017-07-10  Zalan Bujtas  <zalan@apple.com>
 
         Block of text is missing in iBooks sample books.
index 998e0ae..2a0acf7 100644 (file)
@@ -76,7 +76,7 @@ LIBWEBRTC_LIBRARY_DIR[sdk=macosx*] = $(LIBWEBRTC_LIBRARY_DIR_USE_OVERRIDE_FRAMEW
 LIBWEBRTC_LIBRARY_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_NO = $(WEBCORE_FRAMEWORKS_DIR)/WebCore.framework/Versions/A/Frameworks;
 LIBWEBRTC_LIBRARY_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS_DIR);
 
-OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM);
+OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM);
 OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE -framework CoreAudio -framework Metal -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy;
 // FIXME: Reduce the number of allowable_client <rdar://problem/31823969>
 OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework MobileCoreServices -framework OpenGLES -lMobileGestalt $(WK_IOS_BINCOMPAT_LDFLAGS) -allowable_client WebKit -allowable_client iTunesU -allowable_client Casablanca -allowable_client Remote -allowable_client TVBooks -allowable_client DumpRenderTree -allowable_client WebKitTestRunner -allowable_client TestWebKitAPI;
@@ -84,6 +84,10 @@ OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOS
 OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios) $(LIBWEBRTC_LDFLAGS);
 OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -framework ApplicationServices -framework AudioUnit -framework Carbon -framework Cocoa -framework DataDetectorsCore -framework IOSurface -framework OpenGL -framework SystemConfiguration $(LIBWEBRTC_LDFLAGS);
 
+WK_UNDEFINED_SYMBOLS_LDFLAGS = $(WK_UNDEFINED_SYMBOLS_LDFLAGS_$(TARGET_MAC_OS_X_VERSION_LESS_THAN_1013000));
+WK_UNDEFINED_SYMBOLS_LDFLAGS_YES = -Wl,-U,_CTFontCreatePhysicalFontForCharactersWithLanguage;
+WK_UNDEFINED_SYMBOLS_LDFLAGS_YES[sdk=macosx10.12*] =;
+
 SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
 SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebCore.order;
 SECTORDER_FLAGS_Production[sdk=macosx*] = -Wl,-order_file,WebCore.order;
index 3a559a7..d44c628 100644 (file)
@@ -130,7 +130,7 @@ extern const CFStringRef kCTUIFontTextStyleTitle3;
 extern const CFStringRef kCTUIFontTextStyleTitle4;
 CTFontDescriptorRef CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage(CTFontRef currentFont, const UTF16Char* characters, CFIndex length, CFStringRef language, CFIndex* coveredLength);
 
-CTFontRef CTFontCreatePhysicalFontForCharactersWithLanguage(CTFontRef, const UTF16Char* characters, CFIndex length, CFStringRef language, CFIndex* coveredLength);
+__attribute__((availability(macosx,obsoleted=10.13))) __attribute__((availability(ios,obsoleted=11.0))) CTFontRef CTFontCreatePhysicalFontForCharactersWithLanguage(CTFontRef, const UTF16Char* characters, CFIndex length, CFStringRef language, CFIndex* coveredLength);
 bool CTFontIsAppleColorEmoji(CTFontRef);
 CTFontRef CTFontCreateForCharacters(CTFontRef currentFont, const UTF16Char *characters, CFIndex length, CFIndex *coveredLength);