Title: [153126] trunk
Revision
153126
Author
[email protected]
Date
2013-07-24 20:58:53 -0700 (Wed, 24 Jul 2013)

Log Message

fourthTier: WebKit's build system should relink _javascript_Core if LLVM's libraries changed but its headers didn't
https://bugs.webkit.org/show_bug.cgi?id=114926

Source/_javascript_Core:

Reviewed by Geoffrey Garen.

Use a phony file that includes a phony header to force _javascript_Core to be relinked
if necessary. The external LLVM-importing scripts will touch the header if the libraries
are known to have changed.

* _javascript_Core.xcodeproj/project.pbxproj:
* ftl/WebKitLLVMLibraryAnchor.cpp: Added.

Tools:

Reviewed by Geoffrey Garen.

If the LLVM libraries change, then touch a phony header, which will force relink
of _javascript_Core.

* Scripts/copy-webkitlibraries-to-product-directory:
(unpackIfNecessary):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (153125 => 153126)


--- trunk/Source/_javascript_Core/ChangeLog	2013-07-25 03:58:51 UTC (rev 153125)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-07-25 03:58:53 UTC (rev 153126)
@@ -1,5 +1,23 @@
 2013-07-16  Oliver Hunt <[email protected]>
 
+        Merge dfgFourthTier r148850
+
+    2013-04-21  Filip Pizlo  <[email protected]>
+
+        fourthTier: WebKit's build system should relink _javascript_Core if LLVM's libraries changed but its headers didn't
+        https://bugs.webkit.org/show_bug.cgi?id=114926
+
+        Reviewed by Geoffrey Garen.
+        
+        Use a phony file that includes a phony header to force _javascript_Core to be relinked
+        if necessary. The external LLVM-importing scripts will touch the header if the libraries
+        are known to have changed.
+
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        * ftl/WebKitLLVMLibraryAnchor.cpp: Added.
+
+2013-07-16  Oliver Hunt <[email protected]>
+
         Merge dfgFourthTier r148836
 
     2013-04-21  Filip Pizlo  <[email protected]>

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (153125 => 153126)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2013-07-25 03:58:51 UTC (rev 153125)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2013-07-25 03:58:53 UTC (rev 153126)
@@ -190,6 +190,7 @@
 		0F63948515E4811B006A597C /* DFGArrayMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F63948215E48114006A597C /* DFGArrayMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F66E16B14DF3F1600B7B2E4 /* DFGAdjacencyList.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16814DF3F1300B7B2E4 /* DFGAdjacencyList.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F66E16C14DF3F1600B7B2E4 /* DFGEdge.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		0F6E5C191724AF3D005C574F /* WebKitLLVMLibraryAnchor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6E5C181724AF3D005C574F /* WebKitLLVMLibraryAnchor.cpp */; };
 		0F7025A91714B0FA00382C0E /* DFGOSRExitCompilerCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7025A71714B0F800382C0E /* DFGOSRExitCompilerCommon.cpp */; };
 		0F7025AA1714B0FC00382C0E /* DFGOSRExitCompilerCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7025A81714B0F800382C0E /* DFGOSRExitCompilerCommon.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		0F714CA416EA92F000F3EBEB /* DFGBackwardsPropagationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F714CA116EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.cpp */; };
@@ -1162,6 +1163,7 @@
 		0F63948215E48114006A597C /* DFGArrayMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGArrayMode.h; path = dfg/DFGArrayMode.h; sourceTree = "<group>"; };
 		0F66E16814DF3F1300B7B2E4 /* DFGAdjacencyList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAdjacencyList.h; path = dfg/DFGAdjacencyList.h; sourceTree = "<group>"; };
 		0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGEdge.h; path = dfg/DFGEdge.h; sourceTree = "<group>"; };
+		0F6E5C181724AF3D005C574F /* WebKitLLVMLibraryAnchor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebKitLLVMLibraryAnchor.cpp; path = ftl/WebKitLLVMLibraryAnchor.cpp; sourceTree = "<group>"; };
 		0F7025A71714B0F800382C0E /* DFGOSRExitCompilerCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGOSRExitCompilerCommon.cpp; path = dfg/DFGOSRExitCompilerCommon.cpp; sourceTree = "<group>"; };
 		0F7025A81714B0F800382C0E /* DFGOSRExitCompilerCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExitCompilerCommon.h; path = dfg/DFGOSRExitCompilerCommon.h; sourceTree = "<group>"; };
 		0F714CA116EA92ED00F3EBEB /* DFGBackwardsPropagationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGBackwardsPropagationPhase.cpp; path = dfg/DFGBackwardsPropagationPhase.cpp; sourceTree = "<group>"; };
@@ -2151,6 +2153,7 @@
 				0F235BCE17178E1C00690C7F /* FTLValueFormat.h */,
 				0F235BCF17178E1C00690C7F /* FTLValueSource.cpp */,
 				0F235BD017178E1C00690C7F /* FTLValueSource.h */,
+				0F6E5C181724AF3D005C574F /* WebKitLLVMLibraryAnchor.cpp */,
 			);
 			name = ftl;
 			sourceTree = "<group>";
@@ -4025,6 +4028,7 @@
 				147F39BD107EC37600427A48 /* ArgList.cpp in Sources */,
 				147F39BE107EC37600427A48 /* Arguments.cpp in Sources */,
 				86D3B2C310156BDE002865E7 /* ARMAssembler.cpp in Sources */,
+				0F6E5C191724AF3D005C574F /* WebKitLLVMLibraryAnchor.cpp in Sources */,
 				A74DE1D0120B875600D40D5B /* ARMv7Assembler.cpp in Sources */,
 				65C02850171795E200351E35 /* ARMv7Disassembler.cpp in Sources */,
 				65C0285C1717966800351E35 /* ARMv7DOpcode.cpp in Sources */,

Added: trunk/Source/_javascript_Core/ftl/WebKitLLVMLibraryAnchor.cpp (0 => 153126)


--- trunk/Source/_javascript_Core/ftl/WebKitLLVMLibraryAnchor.cpp	                        (rev 0)
+++ trunk/Source/_javascript_Core/ftl/WebKitLLVMLibraryAnchor.cpp	2013-07-25 03:58:53 UTC (rev 153126)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+
+#if ENABLE(FTL_JIT)
+// This is a hack for ensuring that the build system relinks _javascript_Core if any
+// of the LLVM libraries are known to have changed.
+#include "WebKitLLVMLibraryToken.h"
+
+#endif
+

Modified: trunk/Tools/ChangeLog (153125 => 153126)


--- trunk/Tools/ChangeLog	2013-07-25 03:58:51 UTC (rev 153125)
+++ trunk/Tools/ChangeLog	2013-07-25 03:58:53 UTC (rev 153126)
@@ -1,5 +1,22 @@
 2013-07-16  Oliver Hunt <[email protected]>
 
+        Merge dfgFourthTier r148850
+
+    2013-04-21  Filip Pizlo  <[email protected]>
+
+        fourthTier: WebKit's build system should relink _javascript_Core if LLVM's libraries changed but its headers didn't
+        https://bugs.webkit.org/show_bug.cgi?id=114926
+
+        Reviewed by Geoffrey Garen.
+        
+        If the LLVM libraries change, then touch a phony header, which will force relink
+        of _javascript_Core.
+
+        * Scripts/copy-webkitlibraries-to-product-directory:
+        (unpackIfNecessary):
+
+2013-07-16  Oliver Hunt <[email protected]>
+
         Merge dfgFourthTier r148848
 
     2013-04-21  Filip Pizlo  <[email protected]>

Modified: trunk/Tools/Scripts/copy-webkitlibraries-to-product-directory (153125 => 153126)


--- trunk/Tools/Scripts/copy-webkitlibraries-to-product-directory	2013-07-25 03:58:51 UTC (rev 153125)
+++ trunk/Tools/Scripts/copy-webkitlibraries-to-product-directory	2013-07-25 03:58:53 UTC (rev 153126)
@@ -66,7 +66,9 @@
                 (system($ranlib, $targetDir . "/" . $library) == 0) or die;
             }
         }
+        return 1;
     }
+    return 0;
 }
 
 sub dittoHeaders
@@ -129,6 +131,8 @@
         return $contents eq $string;
     }
 
+    my $shouldUpdateLLVMLibraryToken = 0;
+
     if ($useOwnLLVM) {
         print("Building LLVM.\n");
         chdir $ownLLVMDirectory;
@@ -137,19 +141,20 @@
         my $numCPUs = $';
         (system("make -j $numCPUs") == 0) or die;
         chdirWebKit();
-    
+        
         my $ownLLVMBuildMode = "";
         if (fileContains($ownLLVMDirectory . "/Makefile.config", "ENABLE_OPTIMIZED=1")) {
             $ownLLVMBuildMode .= "Release";
         } else {
             $ownLLVMBuildMode .= "Debug";
         }
-    
+        
         # FIXME: Add support for builds that disable assertions.
         $ownLLVMBuildMode .= "+Asserts";
-    
+        
         my $librarySourceDirectory = "$ownLLVMDirectory/$ownLLVMBuildMode/lib";
         my $libraryTargetDirectory = $productDir;
+        $shouldUpdateLLVMLibraryToken = 0;
         print("Symlinking libraries from $librarySourceDirectory to $libraryTargetDirectory\n");
         opendir (my $dirHandle, $librarySourceDirectory);
         while (my $filename = readdir($dirHandle)) {
@@ -166,18 +171,32 @@
                 print "   Ranlib $filename\n";
                 (system($ranlib, $targetLibrary) == 0) or die;
                 (open my $fileHandle, ">", $ranlibToken) or die;
-                    print {$fileHandle} "$sourceLibrary";
-                    close $fileHandle;
+                print {$fileHandle} "$sourceLibrary";
+                close $fileHandle;
+                $shouldUpdateLLVMLibraryToken = 1;
             }
         }
         closedir $dirHandle;
+    } else {
+        $shouldUpdateLLVMLibraryToken =
+            unpackIfNecessary($productDir, "$productDir/libLLVMCore.a", $llvmLibraryPackage, 1);
+    }
+
+    if ($useOwnLLVM) {
         (system("rm", "-rf", "$productDir/usr/local/include/llvm") == 0) or die;
         (system("rm", "-rf", "$productDir/usr/local/include/llvm-c") == 0) or die;
         symlink("$ownLLVMDirectory/include/llvm", "$productDir/usr/local/include/llvm") or die;
         symlink("$ownLLVMDirectory/include/llvm-c", "$productDir/usr/local/include/llvm-c") or die;
     } else {
         unpackIfNecessary("$productDir/usr/local/include", "$productDir/usr/local/include/llvm-c/Core.h", $llvmIncludePackage, 0);
-        unpackIfNecessary($productDir, "$productDir/libLLVMCore.a", $llvmLibraryPackage, 1);
     }
 
+    my $llvmLibraryToken = "$productDir/usr/local/include/WebKitLLVMLibraryToken.h";
+    if ($shouldUpdateLLVMLibraryToken || !-e $llvmLibraryToken) {
+        (open my $fileHandle, ">", $llvmLibraryToken) or die;
+        print {$fileHandle} "/* This file fools WebKit's build system into relinking _javascript_Core if the LLVM libraries changed. */\n";
+        close $fileHandle;
+    }
+
 }
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to