WebKit Bugzilla
Attachment 347948 Details for
Bug 187785
: Build system support for LTO
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187785-20180823131314.patch (text/plain), 38.95 KB, created by
Keith Rollin
on 2018-08-23 13:13:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Keith Rollin
Created:
2018-08-23 13:13:15 PDT
Size:
38.95 KB
patch
obsolete
>Subversion Revision: 235065 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 8f4f3380b9d68081f14b45a5cc53d3b70983ff91..805676842c55eaa4a2b60768993e2948d718fbe8 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-19 Carlos Garcia Campos <cgarcia@igalia.com> > > [GLIB] Add API to throw exceptions using printf formatted strings >diff --git a/Source/ThirdParty/ANGLE/ChangeLog b/Source/ThirdParty/ANGLE/ChangeLog >index 83e05962852dee2396a357fb15d269b025d227a6..d1d36ef29e1299e2278cc751d8db59231e537b33 100644 >--- a/Source/ThirdParty/ANGLE/ChangeLog >+++ b/Source/ThirdParty/ANGLE/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-03 Alex Christensen <achristensen@webkit.org> > > Fix spelling of "overridden" >diff --git a/Source/ThirdParty/libwebrtc/ChangeLog b/Source/ThirdParty/libwebrtc/ChangeLog >index 8f6aebb7b6a3180594ca725b53c386667e26ab93..2c1e00ecf40849ad46212cbb78772658af4afe78 100644 >--- a/Source/ThirdParty/libwebrtc/ChangeLog >+++ b/Source/ThirdParty/libwebrtc/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-06 David Kilzer <ddkilzer@apple.com> > > [libwebrtc] SafeSetError() in peerconnection.cc contains use-after-move of webrtc::RTCError variable >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index eac1685f75400fd21535b435f22da825030e45b8..4d66fbfe572a55a82720640a73dfa8ba9c47a379 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-19 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > [WTF] Add WTF::unalignedLoad and WTF::unalignedStore >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 70bd1a9cd7558064b57c991ae1cbb4050ab43f7a..ab050859d24f6aae11ff3b82485e64adc8c3f53f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ No new tests -- no new WebKit functionality. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-20 Rob Buis <rbuis@igalia.com> > > Throw an exception if window.open() gets passed a URL that cannot be parsed >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 5b9fda826d86434a05a9f3e128792c33edf30cc3..9219c19e818b208947e89bd81ed38c9170858a61 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-15 Ansh Shukla <ansh_shukla@apple.com> > > NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 1d0a6261761057810a38ccd216ac3007a8d8ce7a..817359a49df6e36ef3202f9a5d44c88f433327e7 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-16 Devin Rousso <drousso@apple.com> > > Web Inspector: support breakpoints for arbitrary event names >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 65f4f102ac5f23d0bbaab46c05b406eb0ed4a9bb..217ab02db10d3bac4fbe0a38e4f419c4c4dbd7e5 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-20 Carlos Garcia Campos <cgarcia@igalia.com> > > Unreviewed. Fix GTK/WPE cookie API tests after r234396. >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 98581661ba40994932aab0d77b0c4a274a97f6cd..502fe7e8243d696fd4a5c59b1bf6de2d9cec988c 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-17 Alex Christensen <achristensen@webkit.org> > > Add some plumbing for safe browsing >diff --git a/Source/bmalloc/ChangeLog b/Source/bmalloc/ChangeLog >index 8c606ac9a45df9125c706504dbe2c162a7d5751a..05d4a1e6b82eeb27a85890078aed8f71547ae382 100644 >--- a/Source/bmalloc/ChangeLog >+++ b/Source/bmalloc/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update Base.xcconfig and DebugRelease.xcconfig to optionally enable >+ LTO. >+ >+ * Configurations/Base.xcconfig: >+ * Configurations/DebugRelease.xcconfig: >+ > 2018-08-16 Tomas Popela <tpopela@redhat.com> > > bmalloc: Coverity scan issues >diff --git a/Source/JavaScriptCore/Configurations/Base.xcconfig b/Source/JavaScriptCore/Configurations/Base.xcconfig >index 8fce98765179579319ade4c319139c5e2859a963..72907a8293f02859bc0c8583eceb4ea53d343d77 100644 >--- a/Source/JavaScriptCore/Configurations/Base.xcconfig >+++ b/Source/JavaScriptCore/Configurations/Base.xcconfig >@@ -178,3 +178,18 @@ WK_COCOA_TOUCH_watchsimulator = cocoatouch; > WK_COCOA_TOUCH_appletvos = cocoatouch; > WK_COCOA_TOUCH_appletvsimulator = cocoatouch; > WK_IS_COCOA_TOUCH = $(WK_NOT_$(WK_EMPTY_$(WK_COCOA_TOUCH))); >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full = NO; // Disable LTO for JavaScript due to <rdar://problem/24543547> >+WK_USER_LTO_MODE_thin = NO; // Disable LTO for JavaScript due to <rdar://problem/24543547> >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/JavaScriptCore/Configurations/DebugRelease.xcconfig b/Source/JavaScriptCore/Configurations/DebugRelease.xcconfig >index ef5fb0adab66fbbf03386f7cbbe5d7a5de54f0ea..f9a7564c0dcd70b220a3db5e2453f010b7de9a5c 100644 >--- a/Source/JavaScriptCore/Configurations/DebugRelease.xcconfig >+++ b/Source/JavaScriptCore/Configurations/DebugRelease.xcconfig >@@ -22,6 +22,7 @@ > // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > #include "Base.xcconfig" >+#include? "../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > >@@ -44,5 +45,7 @@ SDKROOT_YES = macosx.internal; > > WK_RELOCATABLE_FRAMEWORKS = YES; > >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >+ > WK_CCACHE_DIR = $(SRCROOT)/../../Tools/ccache; > #include "../../../Tools/ccache/ccache.xcconfig" >diff --git a/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig b/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig >index 93c970032472fec009281c944964c953f6e7294d..17d5d22ecfa452cf91b62cbcf2896a339015ec53 100644 >--- a/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig >+++ b/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig >@@ -81,3 +81,18 @@ ANGLE_INSTALL_PATH_PREFIX_DEPLOYMENT_YES_USE_ALTERNATE_YES = $(WK_ALTERNATE_FRAM > WK_PLATFORM_NAME = $(WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_$(WK_USE_ALTERNATE_FRAMEWORKS_DIR)); > WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_YES = iosmac; > WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_NO = $(PLATFORM_NAME); >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full = YES; >+WK_USER_LTO_MODE_thin = YES_THIN; >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/ThirdParty/ANGLE/Configurations/DebugRelease.xcconfig b/Source/ThirdParty/ANGLE/Configurations/DebugRelease.xcconfig >index f0ff2cc9c8b5fb0a7422dcc2a492c779a55392e1..de0ab3a58877bd3dbdaabce6b0f50318cc927812 100644 >--- a/Source/ThirdParty/ANGLE/Configurations/DebugRelease.xcconfig >+++ b/Source/ThirdParty/ANGLE/Configurations/DebugRelease.xcconfig >@@ -1,4 +1,5 @@ > #include "Base.xcconfig" >+#include? "../../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > >@@ -19,5 +20,7 @@ SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK)); > SDKROOT_ = macosx; > SDKROOT_YES = macosx.internal; > >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >+ > WK_CCACHE_DIR = $(SRCROOT)/../../../Tools/ccache; > #include "../../../../Tools/ccache/ccache.xcconfig" >diff --git a/Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig b/Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig >index 074d8b3be2d93c4974ea2a45f5fcfbfd24491f8f..c694a4cb4950f9d556d9d6b432d00b42b84f2e79 100644 >--- a/Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig >+++ b/Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig >@@ -103,3 +103,18 @@ WK_USE_OVERRIDE_FRAMEWORKS_DIR = $(WK_NOT_$(WK_EMPTY_$(WK_OVERRIDE_FRAMEWORKS_DI > > WK_OVERRIDE_FRAMEWORKS_DIR = $(WK_OVERRIDE_FRAMEWORKS_DIR_USE_STAGING_INSTALL_PATH_$(USE_STAGING_INSTALL_PATH)); > WK_OVERRIDE_FRAMEWORKS_DIR_USE_STAGING_INSTALL_PATH_YES = $(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari; >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full = YES; >+WK_USER_LTO_MODE_thin = YES_THIN; >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/ThirdParty/libwebrtc/Configurations/DebugRelease.xcconfig b/Source/ThirdParty/libwebrtc/Configurations/DebugRelease.xcconfig >index 5df1074ffbdbe3e0ffbe2534d4a885a15221a431..143f4a8a4f67e73e2456c5fda47faa8cd94d6c0d 100644 >--- a/Source/ThirdParty/libwebrtc/Configurations/DebugRelease.xcconfig >+++ b/Source/ThirdParty/libwebrtc/Configurations/DebugRelease.xcconfig >@@ -1,4 +1,5 @@ > #include "Base.xcconfig" >+#include? "../../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > >@@ -21,5 +22,7 @@ SDKROOT_YES = macosx.internal; > > WK_RELOCATABLE_FRAMEWORKS = YES; > >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >+ > WK_CCACHE_DIR = $(SRCROOT)/../../../Tools/ccache; > #include "../../../../Tools/ccache/ccache.xcconfig" >diff --git a/Source/WTF/Configurations/Base.xcconfig b/Source/WTF/Configurations/Base.xcconfig >index c7bef5b20a00fd4f0e7dc7856689607be941aaf8..123576a211684cd2f76684bf6c141c175f790002 100644 >--- a/Source/WTF/Configurations/Base.xcconfig >+++ b/Source/WTF/Configurations/Base.xcconfig >@@ -145,3 +145,18 @@ WTF_INSTALL_PATH_PREFIX_DEPLOYMENT_YES_USE_ALTERNATE_YES = $(WK_ALTERNATE_FRAMEW > WK_PLATFORM_NAME = $(WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_$(WK_USE_ALTERNATE_FRAMEWORKS_DIR)); > WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_YES = iosmac; > WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_NO = $(PLATFORM_NAME); >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full = YES; >+WK_USER_LTO_MODE_thin = YES_THIN; >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/WTF/Configurations/DebugRelease.xcconfig b/Source/WTF/Configurations/DebugRelease.xcconfig >index e41c019f3fa5fc1f02cdb313722c8332903a6f98..490dbe9b51853210d3971f06d5de0c3bf582cf2e 100644 >--- a/Source/WTF/Configurations/DebugRelease.xcconfig >+++ b/Source/WTF/Configurations/DebugRelease.xcconfig >@@ -22,6 +22,7 @@ > // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > #include "Base.xcconfig" >+#include? "../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > ONLY_ACTIVE_ARCH = YES; >@@ -41,5 +42,7 @@ SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK)); > SDKROOT_ = macosx; > SDKROOT_YES = macosx.internal; > >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >+ > WK_CCACHE_DIR = $(SRCROOT)/../../Tools/ccache; > #include "../../../Tools/ccache/ccache.xcconfig" >diff --git a/Source/WebCore/Configurations/Base.xcconfig b/Source/WebCore/Configurations/Base.xcconfig >index 93ae84be3bd1663e92f5d922554b1071f8e4c77e..1a0bbbca281a2e3865de11bca83f2f6caa4fa53d 100644 >--- a/Source/WebCore/Configurations/Base.xcconfig >+++ b/Source/WebCore/Configurations/Base.xcconfig >@@ -145,3 +145,26 @@ WK_COCOA_TOUCH_watchsimulator = cocoatouch; > WK_COCOA_TOUCH_appletvos = cocoatouch; > WK_COCOA_TOUCH_appletvsimulator = cocoatouch; > WK_IS_COCOA_TOUCH = $(WK_NOT_$(WK_EMPTY_$(WK_COCOA_TOUCH))); >+ >+// Attempting to build WebCore with full LTO for i386 results in the following >+// linker error, so we drop down to "thin" for that architecture if we were to >+// otherwise attempt to use "full". >+// >+// LLVM ERROR: Section too large, can't encode r_address (0x1000216) into 24 bits of scattered relocation entry. >+// clang: error: linker command failed with exit code 1 (use -v to see invocation) >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full[arch=i386] = $(WK_USER_LTO_MODE_thin); >+WK_USER_LTO_MODE_full = YES; >+WK_USER_LTO_MODE_thin = YES_THIN; >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/WebCore/Configurations/DebugRelease.xcconfig b/Source/WebCore/Configurations/DebugRelease.xcconfig >index 8f1c77305d4118b4dafa5c933f8f9032e9b0c264..5f26ed0d247b6366d44c587d260b43505e2f434a 100644 >--- a/Source/WebCore/Configurations/DebugRelease.xcconfig >+++ b/Source/WebCore/Configurations/DebugRelease.xcconfig >@@ -22,6 +22,7 @@ > // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > #include "Base.xcconfig" >+#include? "../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > >@@ -44,5 +45,7 @@ SDKROOT_YES = macosx.internal; > > WK_RELOCATABLE_FRAMEWORKS = YES; > >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >+ > WK_CCACHE_DIR = $(SRCROOT)/../../Tools/ccache; > #include "../../../Tools/ccache/ccache.xcconfig" >diff --git a/Source/WebCore/PAL/Configurations/Base.xcconfig b/Source/WebCore/PAL/Configurations/Base.xcconfig >index d921b6e69371c2d776412047a5a4d0757d72438b..6720942aaa4fc7e1fe9d5f4649faf20b0e68b519 100644 >--- a/Source/WebCore/PAL/Configurations/Base.xcconfig >+++ b/Source/WebCore/PAL/Configurations/Base.xcconfig >@@ -142,3 +142,26 @@ WK_COCOA_TOUCH_watchsimulator = cocoatouch; > WK_COCOA_TOUCH_appletvos = cocoatouch; > WK_COCOA_TOUCH_appletvsimulator = cocoatouch; > WK_IS_COCOA_TOUCH = $(WK_NOT_$(WK_EMPTY_$(WK_COCOA_TOUCH))); >+ >+// Attempting to build WebCore with full LTO for i386 results in the following >+// linker error, so we drop down to "thin" for that architecture if we were to >+// otherwise attempt to use "full". >+// >+// LLVM ERROR: Section too large, can't encode r_address (0x1000216) into 24 bits of scattered relocation entry. >+// clang: error: linker command failed with exit code 1 (use -v to see invocation) >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full[arch=i386] = $(WK_USER_LTO_MODE_thin); >+WK_USER_LTO_MODE_full = YES; >+WK_USER_LTO_MODE_thin = YES_THIN; >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/WebCore/PAL/Configurations/DebugRelease.xcconfig b/Source/WebCore/PAL/Configurations/DebugRelease.xcconfig >index 6067c6fcaedb504057b6e46fe3dfdae272fd498a..5c4e69999951e10740e658dddc35b9e8e9b076da 100644 >--- a/Source/WebCore/PAL/Configurations/DebugRelease.xcconfig >+++ b/Source/WebCore/PAL/Configurations/DebugRelease.xcconfig >@@ -22,6 +22,7 @@ > // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > #include "Base.xcconfig" >+#include? "../../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > >@@ -44,5 +45,7 @@ SDKROOT_YES = macosx.internal; > > WK_RELOCATABLE_FRAMEWORKS = YES; > >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >+ > WK_CCACHE_DIR = $(SRCROOT)/../../../Tools/ccache; > #include "../../../../Tools/ccache/ccache.xcconfig" >diff --git a/Source/WebInspectorUI/Configurations/Base.xcconfig b/Source/WebInspectorUI/Configurations/Base.xcconfig >index dc643f24793fd3f8ef18df423f4f306b5eb1fa38..8dfd75c4a2847c0159f3667de6ebc9370f26f801 100644 >--- a/Source/WebInspectorUI/Configurations/Base.xcconfig >+++ b/Source/WebInspectorUI/Configurations/Base.xcconfig >@@ -106,3 +106,18 @@ WK_COCOA_TOUCH_watchsimulator = cocoatouch; > WK_COCOA_TOUCH_appletvos = cocoatouch; > WK_COCOA_TOUCH_appletvsimulator = cocoatouch; > WK_IS_COCOA_TOUCH = $(WK_NOT_$(WK_EMPTY_$(WK_COCOA_TOUCH))); >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full = YES; >+WK_USER_LTO_MODE_thin = YES_THIN; >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/WebInspectorUI/Configurations/DebugRelease.xcconfig b/Source/WebInspectorUI/Configurations/DebugRelease.xcconfig >index a70218324929c99c3a0decda7549ce33db17394f..0f6f444c037c74627d84cb259b2e530f871259b4 100644 >--- a/Source/WebInspectorUI/Configurations/DebugRelease.xcconfig >+++ b/Source/WebInspectorUI/Configurations/DebugRelease.xcconfig >@@ -1,4 +1,5 @@ > #include "Base.xcconfig" >+#include? "../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > >@@ -23,3 +24,5 @@ SDKROOT_YES = macosx.internal; > > COMBINE_INSPECTOR_RESOURCES = NO; > COMBINE_TEST_RESOURCES = YES; >+ >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >diff --git a/Source/WebKit/Configurations/Base.xcconfig b/Source/WebKit/Configurations/Base.xcconfig >index 600d2ebb7b02ae06aace8c19e16392fad168a4f5..1988d13547f05c138ec2cbdb36fd19aad8fc1b24 100644 >--- a/Source/WebKit/Configurations/Base.xcconfig >+++ b/Source/WebKit/Configurations/Base.xcconfig >@@ -159,3 +159,18 @@ WK_MACOS_WEAK_FRAMEWORK_cocoatouch = -framework > WK_MACOS_WEAK_FRAMEWORK_ = -weak_framework > > WK_USE_RESTRICTED_ENTITLEMENTS = $(USE_INTERNAL_SDK); >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full = YES; >+WK_USER_LTO_MODE_thin = YES_THIN; >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/WebKit/Configurations/DebugRelease.xcconfig b/Source/WebKit/Configurations/DebugRelease.xcconfig >index 83744a05460d59eb5b694d23adb14e136bf15e6c..2e743916f17eb759acdaaadb058fc754d68e5047 100644 >--- a/Source/WebKit/Configurations/DebugRelease.xcconfig >+++ b/Source/WebKit/Configurations/DebugRelease.xcconfig >@@ -22,6 +22,7 @@ > // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > #include "Base.xcconfig" >+#include? "../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > >@@ -55,5 +56,7 @@ WK_LIBRARY_VALIDATION_ENABLED = NO; > WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT = NO; > WK_WEBCONTENT_SERVICE_NEEDS_VERSIONED_FRAMEWORK_PATH_LDFLAG[sdk=macosx*] = YES; > >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >+ > WK_CCACHE_DIR = $(SRCROOT)/../../Tools/ccache; > #include "../../../Tools/ccache/ccache.xcconfig" >diff --git a/Source/WebKitLegacy/mac/Configurations/Base.xcconfig b/Source/WebKitLegacy/mac/Configurations/Base.xcconfig >index 4ffb03bb320551e48dab68d69ee2cfe84c33678e..609b65c6edb72f94324ec26bb96fa8262c481ac0 100644 >--- a/Source/WebKitLegacy/mac/Configurations/Base.xcconfig >+++ b/Source/WebKitLegacy/mac/Configurations/Base.xcconfig >@@ -143,3 +143,18 @@ WK_COCOA_TOUCH_watchsimulator = cocoatouch; > WK_COCOA_TOUCH_appletvos = cocoatouch; > WK_COCOA_TOUCH_appletvsimulator = cocoatouch; > WK_IS_COCOA_TOUCH = $(WK_NOT_$(WK_EMPTY_$(WK_COCOA_TOUCH))); >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full = YES; >+WK_USER_LTO_MODE_thin = YES_THIN; >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/WebKitLegacy/mac/Configurations/DebugRelease.xcconfig b/Source/WebKitLegacy/mac/Configurations/DebugRelease.xcconfig >index 6e0c723e2f2baf9647390e3c0cfdbbd5bb076533..9ee72b359572d8139f33b094b53e372f9865b53f 100644 >--- a/Source/WebKitLegacy/mac/Configurations/DebugRelease.xcconfig >+++ b/Source/WebKitLegacy/mac/Configurations/DebugRelease.xcconfig >@@ -22,6 +22,7 @@ > // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > #include "Base.xcconfig" >+#include? "../../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > >@@ -44,5 +45,7 @@ SDKROOT_YES = macosx.internal; > > WK_RELOCATABLE_FRAMEWORKS = YES; > >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >+ > WK_CCACHE_DIR = $(SRCROOT)/../../Tools/ccache; > #include "../../../../Tools/ccache/ccache.xcconfig" >diff --git a/Source/bmalloc/Configurations/Base.xcconfig b/Source/bmalloc/Configurations/Base.xcconfig >index 9dfa3c06646c6b5d7cc2770ebe3206a8547c8f09..858cc6be0d9409cc35f10f824332eee02800c658 100644 >--- a/Source/bmalloc/Configurations/Base.xcconfig >+++ b/Source/bmalloc/Configurations/Base.xcconfig >@@ -137,3 +137,18 @@ BMALLOC_INSTALL_PATH_PREFIX_DEPLOYMENT_YES_USE_ALTERNATE_YES = $(WK_ALTERNATE_FR > WK_PLATFORM_NAME = $(WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_$(WK_USE_ALTERNATE_FRAMEWORKS_DIR)); > WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_YES = iosmac; > WK_PLATFORM_NAME_USE_ALTERNATE_FRAMEWORKS_DIR_NO = $(PLATFORM_NAME); >+ >+LLVM_LTO = $(WK_LLVM_LTO_$(WK_XCODE_SUPPORTS_LTO)); >+WK_LLVM_LTO_NO = NO; >+WK_LLVM_LTO_YES = $(WK_USER_LTO_MODE); >+ >+WK_XCODE_SUPPORTS_LTO = $(WK_NOT_$(WK_XCODE_VERSION_BEFORE_9_$(XCODE_VERSION_MAJOR))); >+WK_XCODE_VERSION_BEFORE_9_0800 = YES; >+WK_XCODE_VERSION_BEFORE_9_0700 = YES; >+ >+WK_USER_LTO_MODE = $(WK_USER_LTO_MODE_$(WK_LTO_MODE)); >+WK_USER_LTO_MODE_full = YES; >+WK_USER_LTO_MODE_thin = YES_THIN; >+WK_USER_LTO_MODE_none = NO; >+WK_USER_LTO_MODE_ = $(WK_DEFAULT_LTO_MODE); >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_full); >diff --git a/Source/bmalloc/Configurations/DebugRelease.xcconfig b/Source/bmalloc/Configurations/DebugRelease.xcconfig >index e41c019f3fa5fc1f02cdb313722c8332903a6f98..490dbe9b51853210d3971f06d5de0c3bf582cf2e 100644 >--- a/Source/bmalloc/Configurations/DebugRelease.xcconfig >+++ b/Source/bmalloc/Configurations/DebugRelease.xcconfig >@@ -22,6 +22,7 @@ > // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > #include "Base.xcconfig" >+#include? "../../../LocalOverrides.xcconfig" > > ARCHS = $(ARCHS_STANDARD_32_64_BIT); > ONLY_ACTIVE_ARCH = YES; >@@ -41,5 +42,7 @@ SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK)); > SDKROOT_ = macosx; > SDKROOT_YES = macosx.internal; > >+WK_DEFAULT_LTO_MODE = $(WK_USER_LTO_MODE_none); >+ > WK_CCACHE_DIR = $(SRCROOT)/../../Tools/ccache; > #include "../../../Tools/ccache/ccache.xcconfig" >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index aef2524e482848c51c3ea5d2a777e6b5c1638509..598746f28eec9f33616b7c2ebe943eab149f7e17 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,22 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add tools/scripts support for controlling LTO builds. >+ >+ * Scripts/build-webkit: Add --lto-mode={none,thin,full}. >+ * Scripts/set-webkit-configuration: Add support for saving LTO >+ configuration to WebKitBuild/LTO. >+ * Scripts/webkitdirs.pm: Add support for reading configuration from >+ WebKitBuild/LTO and providing it to xcodebuild. >+ (determineLTOMode): >+ (ltoMode): >+ (XcodeOptions): >+ > 2018-08-20 Claudio Saavedra <csaavedra@igalia.com> > > Add WPE Debug configuration to the flakiness dashboard >diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit >index 23d2ec4962ecde95f3b7f978ecc2d81158523f04..dcdbaa586149e41e2047c27c9e454871b668153c 100755 >--- a/Tools/Scripts/build-webkit >+++ b/Tools/Scripts/build-webkit >@@ -72,6 +72,7 @@ my $onlyWebKitProject = 0; > my $coverageSupport = 0; > my $shouldRunStaticAnalyzer = 0; > my $noExperimentalFeatures = 0; >+my $ltoMode = "default"; > my $startTime = time(); > my $archs32bit = 0; > my $skipLibraryUpdate = 0; >@@ -113,6 +114,7 @@ Usage: $programName [options] [options to pass to build system] > --simulator DEPRECATED alias of --ios-simulator > --coverage Enable code coverage support (Mac only) > --analyze Enable static anaylsis (iOS and Mac only) >+ --lto-mode=<mode> Set Link Time Optimization mode (full, thin, or none) (Xcode only) > > --gtk Build the GTK+ port > --wpe Build the WPE port >@@ -149,6 +151,7 @@ my %options = ( > 'coverage' => \$coverageSupport, > 'analyze' => \$shouldRunStaticAnalyzer, > 'no-experimental-features' => \$noExperimentalFeatures, >+ 'lto-mode=s' => \$ltoMode, > 'skip-library-update' => \$skipLibraryUpdate, > 'use-ccache!' => \$useCCache, > ); >@@ -331,6 +334,7 @@ if (isAppleWinWebKit() || isWinCairo()) { > my @local_options = @options; > push @local_options, XcodeCoverageSupportOptions() if $coverageSupport; > push @local_options, XcodeStaticAnalyzerOption() if $shouldRunStaticAnalyzer; >+ push @local_options, "WK_LTO_MODE=$ltoMode" if ($ltoMode ne "default"); > my $projectPath = $project =~ /gtest/ ? "xcode/gtest" : $project; > $result = buildXCodeProject($projectPath, $clean, @local_options, @ARGV); > >diff --git a/Tools/Scripts/set-webkit-configuration b/Tools/Scripts/set-webkit-configuration >index c484fb80db976136fa2a969de05fbce8d963c4b6..eab713024a30921b0545590279ff21d1a9b693c7 100755 >--- a/Tools/Scripts/set-webkit-configuration >+++ b/Tools/Scripts/set-webkit-configuration >@@ -38,6 +38,7 @@ Usage: $programName [options] > --32-bit Set the default architecture to 32-bit > --64-bit Set the default architecture to 64-bit > --[no-]asan Enable or disable clang address sanitizer >+ --lto-mode=<mode> Set LTO mode: full, thin, or none > --debug Set the default configuration to debug > --release Set the default configuration to release > --reset Reset configurations >@@ -47,6 +48,10 @@ my $configuration = passedConfiguration(); > my $architecture = passedArchitecture(); > my $enableASAN = checkForArgumentAndRemoveFromARGV("--asan"); > my $disableASAN = checkForArgumentAndRemoveFromARGV("--no-asan"); >+my $ltoMode; >+if (!checkForArgumentAndRemoveFromARGVGettingValue("--lto-mode", \$ltoMode)) { >+ $ltoMode=""; >+} > > if (!$architecture) { > # Handle --64-bit explicitly here, as we don't want our other scripts to accept it >@@ -66,10 +71,16 @@ if (checkForArgumentAndRemoveFromARGV("--reset")) { > unlink "$baseProductDir/Configuration"; > unlink "$baseProductDir/Architecture"; > unlink "$baseProductDir/ASan"; >+ unlink "$baseProductDir/LTO"; > exit 0; > } > >-if (!$configuration && !$architecture && !$enableASAN && !$disableASAN || ($enableASAN && $disableASAN)) { >+if ((!$configuration && !$architecture && !$enableASAN && !$disableASAN && !$ltoMode) || ($enableASAN && $disableASAN)) { >+ print STDERR $usage; >+ exit 1; >+} >+ >+if ($ltoMode && $ltoMode ne "full" && $ltoMode ne "thin" && $ltoMode ne "none") { > print STDERR $usage; > exit 1; > } >@@ -97,3 +108,9 @@ if ($enableASAN) { > } elsif ($disableASAN) { > unlink "$baseProductDir/ASan"; > } >+ >+if ($ltoMode) { >+ open LTO, ">", "$baseProductDir/LTO" or die; >+ print LTO "$ltoMode"; >+ close LTO; >+} >diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm >index 2f39c7c433f36dbbe7939c60c3322588ff336301..6d70f8e8b775abbb4dc8b823d4ccdffb32a48964 100755 >--- a/Tools/Scripts/webkitdirs.pm >+++ b/Tools/Scripts/webkitdirs.pm >@@ -129,6 +129,7 @@ our @EXPORT_OK; > > my $architecture; > my $asanIsEnabled; >+my $ltoMode; > my $numberOfCPUs; > my $maxCPULoad; > my $baseProductDir; >@@ -422,6 +423,18 @@ sub determineASanIsEnabled > } > } > >+sub determineLTOMode >+{ >+ return if defined $ltoMode; >+ determineBaseProductDir(); >+ >+ if (open LTO, "$baseProductDir/LTO") { >+ $ltoMode = <LTO>; >+ close LTO; >+ chomp $ltoMode; >+ } >+} >+ > sub determineNumberOfCPUs > { > return if defined $numberOfCPUs; >@@ -844,6 +857,12 @@ sub asanIsEnabled() > return $asanIsEnabled; > } > >+sub ltoMode() >+{ >+ determineLTOMode(); >+ return $ltoMode; >+} >+ > sub configurationForVisualStudio() > { > determineConfigurationForVisualStudio(); >@@ -886,6 +905,7 @@ sub XcodeOptions > determineConfiguration(); > determineArchitecture(); > determineASanIsEnabled(); >+ determineLTOMode(); > determineXcodeSDK(); > > my @options; >@@ -893,6 +913,7 @@ sub XcodeOptions > push @options, "-UseSanitizedBuildSystemEnvironment=YES"; > push @options, ("-configuration", $configuration); > push @options, ("-xcconfig", sourceDir() . "/Tools/asan/asan.xcconfig", "ASAN_IGNORE=" . sourceDir() . "/Tools/asan/webkit-asan-ignore.txt") if $asanIsEnabled; >+ push @options, "WK_LTO_MODE=$ltoMode" if $ltoMode; > push @options, @baseProductDirOption; > push @options, "ARCHS=$architecture" if $architecture; > push @options, "SDKROOT=$xcodeSDK" if $xcodeSDK; >diff --git a/.gitignore b/.gitignore >index e934031387bebcbfa0cb138f26d276b87c5681e0..58531f593f2e9a41552eb3f9f330aec7e5e33d09 100644 >--- a/.gitignore >+++ b/.gitignore >@@ -48,3 +48,6 @@ __cmake_systeminformation/ > > # Ignore YouCompleteMe symlinks > .ycm_extra_conf.py >+ >+# Local overrides configuration files >+LocalOverrides.xcconfig >diff --git a/ChangeLog b/ChangeLog >index 3eecbe1e940da57b102e943f271c25344c1bb6c9..3076b58f9b500f6e04e9d11406b159fc2d9bbf5a 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,65 @@ >+2018-08-22 Keith Rollin <krollin@apple.com> >+ >+ Build system support for LTO >+ https://bugs.webkit.org/show_bug.cgi?id=187785 >+ <rdar://problem/42353132> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add support for building WebKit with LTO (Link Time Optimization) on >+ macOS and iOS. Both variations are supported: "full" (which performs >+ all the optimizations it can regardless of the cost) and "thin" (which >+ sacrifices some optimizations in order to recover build time and >+ memory usage). >+ >+ By default, LTO is disabled for Debug and Release builds, but is >+ enabled for Production builds. For Debug and Release builds, LTO is >+ controlled as follows: >+ >+ - When using `make` from the command line, include >+ WK_LTO_MODE={none,thin,full}. For example, `make WK_LTO_MODE=full >+ release`. As when specifying debug/release, the LTO configuration >+ information is written to the WebKitBuild directory and is used as >+ the default on the next build if a new setting is not specified. >+ >+ - When using `build-webkit`, include --lto-mode={none,thin,full} on >+ the command line. For example, `build-webkit --lto-mode=full ...`. >+ >+ - When using Xcode, create a configuration file called >+ LocalOverrides.xcconfig at the root level of your WebKit checkout >+ directory. Include within it a line that says: >+ >+ WK_LTO_MODE={none,thin,full} >+ >+ For example: >+ >+ WK_LTO_MODE=full >+ >+ Note that LocalOverrides.xcconfig is included in the .gitignore file, >+ so you won't accidentally check your changes into source control. >+ >+ Enabling LTO can greatly increase build times, especially when using >+ "full" LTO with 32GB or RAM or less. Following is a table of full >+ build times for a Release build on a fully decked-out 2017 iMac Pro: >+ >+ LTO macOS iOS >+ ----- ------- ------- >+ None: 9m 11s 14m 11s >+ Thin: 11m 44s 17m 30s >+ Full: 21m 39s 28m 56s >+ >+ Incremental times are affected even more greatly. The actual >+ optimization and compilation of LLVM bitcode is moved to the link >+ phase, meaning that the link phase, which previously took only >+ seconds, can now take many minutes. It's for this reason that LTO is >+ not enabled in Debug and Release builds, since incremental builds are >+ an integral part of those configurations. However, using the >+ mechanisms described above, developers can perform optional LTO builds >+ if needed to track down build or runtime issues in that configuration. >+ >+ * .gitignore: Include LocalOverrides.xcconfig. >+ * Makefile.shared: Add support for WK_LTO_MODE on the command line. >+ > 2018-08-18 Michael Catanzaro <mcatanzaro@igalia.com> > > Adjust CMAKE_MODULE_LINKER_FLAGS for asan >diff --git a/Makefile.shared b/Makefile.shared >index b3184409df15ffd734746b0e11c6bb82113691a5..7d1feb182a7507e178e2ecf1b619a6ea886ee5c0 100644 >--- a/Makefile.shared >+++ b/Makefile.shared >@@ -56,6 +56,14 @@ ASAN_OPTION=--no-asan > endif > endif > >+ifeq ($(WK_LTO_MODE),full) >+WK_LTO_OPTION=--lto-mode=full >+else ifeq ($(WK_LTO_MODE),thin) >+WK_LTO_OPTION=--lto-mode=thin >+else ifeq ($(WK_LTO_MODE),none) >+WK_LTO_OPTION=--lto-mode=none >+endif >+ > export DSYMUTIL_NUM_THREADS = $(shell sysctl -n hw.activecpu) > > # Run xcodebuild with the same PATH with which the Xcode IDE runs, to mitigate unnecessary rebuilds due to PATH differences. >@@ -66,15 +74,15 @@ all: set_asan_configuration > ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) > > debug d development dev develop: force >- $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) >+ $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(WK_LTO_OPTION) > ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) > > release r deployment dep deploy: force >- $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) >+ $(SCRIPTS_PATH)/set-webkit-configuration --release $(ASAN_OPTION) $(WK_LTO_OPTION) > ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) > > analyze: >- $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) >+ $(SCRIPTS_PATH)/set-webkit-configuration --debug $(ASAN_OPTION) $(WK_LTO_OPTION) > ifndef PATH_TO_SCAN_BUILD > ( $(SET_COLOR_DIAGNOSTICS_ARG); xcodebuild $(OTHER_OPTIONS) $(XCODE_OPTIONS) RUN_CLANG_STATIC_ANALYZER=YES | $(OUTPUT_FILTER) && exit $${PIPESTATUS[0]} ) > else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 187785
:
345291
|
345309
|
345367
|
345371
|
345432
| 347948