Title: [165480] trunk
Revision
165480
Author
[email protected]
Date
2014-03-12 10:55:34 -0700 (Wed, 12 Mar 2014)

Log Message

It should be possible to build WebKit with FTL on iOS
https://bugs.webkit.org/show_bug.cgi?id=130116

Reviewed by Dan Bernstein.

Source/_javascript_Core: 

* Configurations/Base.xcconfig:

Tools: 

* Scripts/build-webkit:
* Scripts/copy-webkitlibraries-to-product-directory:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (165479 => 165480)


--- trunk/Source/_javascript_Core/ChangeLog	2014-03-12 17:51:54 UTC (rev 165479)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-03-12 17:55:34 UTC (rev 165480)
@@ -1,3 +1,12 @@
+2014-03-11  Filip Pizlo  <[email protected]>
+
+        It should be possible to build WebKit with FTL on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=130116
+
+        Reviewed by Dan Bernstein.
+
+        * Configurations/Base.xcconfig:
+
 2014-03-10  Filip Pizlo  <[email protected]>
 
         GetById list caching should use something object-oriented rather than PolymorphicAccessStructureList

Modified: trunk/Source/_javascript_Core/Configurations/Base.xcconfig (165479 => 165480)


--- trunk/Source/_javascript_Core/Configurations/Base.xcconfig	2014-03-12 17:51:54 UTC (rev 165479)
+++ trunk/Source/_javascript_Core/Configurations/Base.xcconfig	2014-03-12 17:55:34 UTC (rev 165480)
@@ -78,8 +78,14 @@
 LINKER_DISPLAYS_MANGLED_NAMES = YES;
 PREBINDING = NO;
 WARNING_CFLAGS = -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wextra-tokens -Wformat=2 -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough;
-HEADER_SEARCH_PATHS = . icu "${BUILT_PRODUCTS_DIR}/usr/local/LLVMForJavaScriptCore/include" "${BUILT_PRODUCTS_DIR}/ExtraIncludesForLocalLLVMBuild" /usr/local/LLVMForJavaScriptCore/include "${BUILT_PRODUCTS_DIR}/usr/local/include" $(HEADER_SEARCH_PATHS);
 
+SYSTEM_LLVM_SEARCH_PATHS = $(SYSTEM_LLVM_SEARCH_PATHS_$(PLATFORM_NAME));
+SYSTEM_LLVM_SEARCH_PATHS_macosx = /usr/local/LLVMForJavaScriptCore/include;
+SYSTEM_LLVM_SEARCH_PATHS_iphoneos = ;
+SYSTEM_LLVM_SEARCH_PATHS_iphonesimulator = ;
+
+HEADER_SEARCH_PATHS = . icu "${BUILT_PRODUCTS_DIR}/usr/local/LLVMForJavaScriptCore/include" "${BUILT_PRODUCTS_DIR}/ExtraIncludesForLocalLLVMBuild" $(SYSTEM_LLVM_SEARCH_PATHS) "${BUILT_PRODUCTS_DIR}/usr/local/include" $(HEADER_SEARCH_PATHS);
+
 TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
 
 SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx;

Modified: trunk/Tools/ChangeLog (165479 => 165480)


--- trunk/Tools/ChangeLog	2014-03-12 17:51:54 UTC (rev 165479)
+++ trunk/Tools/ChangeLog	2014-03-12 17:55:34 UTC (rev 165480)
@@ -1,3 +1,13 @@
+2014-03-11  Filip Pizlo  <[email protected]>
+
+        It should be possible to build WebKit with FTL on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=130116
+
+        Reviewed by Dan Bernstein.
+
+        * Scripts/build-webkit:
+        * Scripts/copy-webkitlibraries-to-product-directory:
+
 2014-03-12  Brent Fulgham  <[email protected]>
 
         [Win] Remove use of QTSDK

Modified: trunk/Tools/Scripts/build-webkit (165479 => 165480)


--- trunk/Tools/Scripts/build-webkit	2014-03-12 17:51:54 UTC (rev 165479)
+++ trunk/Tools/Scripts/build-webkit	2014-03-12 17:55:34 UTC (rev 165480)
@@ -228,6 +228,16 @@
         (system(@copyLibrariesArgs) == 0) or die;
     } else {
         push @projects, ("Source/WebKit2");
+        
+        if ($hasFTLJIT) {
+            my @copyLibrariesArgs = (
+                "perl", "Tools/Scripts/copy-webkitlibraries-to-product-directory",
+                "--llvm", "--prefer-system-llvm", "--llvm-subdirectory", "internal-llvm",
+                productDir()
+            );
+            print(join(" ", @copyLibrariesArgs) . "\n");
+            (system(@copyLibrariesArgs) == 0) or die;
+        }
     }
 
     # Build Tools needed for Apple ports

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


--- trunk/Tools/Scripts/copy-webkitlibraries-to-product-directory	2014-03-12 17:51:54 UTC (rev 165479)
+++ trunk/Tools/Scripts/copy-webkitlibraries-to-product-directory	2014-03-12 17:55:34 UTC (rev 165480)
@@ -36,6 +36,8 @@
 my $llvmIncludePackage = "";
 my $llvmLibraryPackage = "";
 my $useFullLibPaths = 0;
+my $preferSystemLLVMOverDrops = 0;
+my $llvmSubdirectoryName = "llvm";
 my $force = 0;
 
 my $programName = basename($0);
@@ -47,6 +49,8 @@
   --use-llvm-includes=<path>    Get the LLVM inludes package from <path>
   --use-llvm-libraries=<path>   Get the LLVM libraries package from <path>
   --[no-]use-full-lib-paths     Toggle using full library paths
+  --[no-]prefer-system-llvm     Toggle preferring the system LLVM over the binary drops (default: $preferSystemLLVMOverDrops)
+  --llvm-subdirectory=<name>    Set the name of the LLVM subdirectory to search for (default: $llvmSubdirectoryName)
   --[no-]force                  Toggle forcing the copy - i.e. ignoring timestamps (default: $force)
 EOF
 
@@ -57,6 +61,8 @@
     'use-llvm-includes=s' => \$llvmIncludePackage,
     'use-llvm-libraries=s' => \$llvmLibraryPackage,
     'use-full-lib-paths!' => \$useFullLibPaths,
+    'prefer-system-llvm!' => \$preferSystemLLVMOverDrops,
+    'llvm-subdirectory=s' => \$llvmSubdirectoryName,
     'force!' => \$force
 );
 
@@ -140,16 +146,23 @@
     my $useOwnLLVM = 0;
     my $ownLLVMDirectory;
     if (defined($ENV{LLVM_SOURCE_PATH})) {
+        print "Using LLVM from \$LLVM_SOURE_PATH: " . $ENV{LLVM_SOURCE_PATH} . "\n";
         $useOwnLLVM = 1;
         $ownLLVMDirectory = $ENV{LLVM_SOURCE_PATH};
-    } elsif (-d "llvm" && -e "llvm/LLVMBuild.txt") {
+    } elsif (-d $llvmSubdirectoryName && -e "$llvmSubdirectoryName/LLVMBuild.txt") {
+        print "Using LLVM from $llvmSubdirectoryName subdirectory.\n";
         $useOwnLLVM = 1;
-        $ownLLVMDirectory = sourceDir() . "/llvm";
+        $ownLLVMDirectory = sourceDir() . "/$llvmSubdirectoryName";
     } elsif ($llvmLibraryPackage ne "" && $llvmIncludePackage ne "") {
         # Command-line arguments override our other ways of finding the packages.
+        print "Using LLVM binary drops specified on command-line: $llvmLibraryPackage and $llvmIncludePackage.\n";
     } elsif (defined($ENV{LLVM_LIBRARY_PACKAGE}) && defined($ENV{LLVM_INCLUDE_PACKAGE})) {
         $llvmLibraryPackage = $ENV{LLVM_LIBRARY_PACKAGE};
         $llvmIncludePackage = $ENV{LLVM_INCLUDE_PACKAGE};
+        print "Using LLVM binary drops specified by \$LLVM_LIBRARY_PACKAGE and \$LLVM_INCLUDE_PACKAGE: $llvmLibraryPackage and $llvmIncludePackage.\n";
+    } elsif ($preferSystemLLVMOverDrops) {
+        # Don't fall through to drop detection.
+        print "Using system LLVM.\n";
     } elsif ($majorDarwinVersion == 11) {
         $llvmLibraryPackage = "WebKitLibraries/LLVMLibrariesLion.tar.bz2";
         $llvmIncludePackage = "WebKitLibraries/LLVMIncludesLion.tar.bz2";
@@ -200,13 +213,18 @@
         }
 
         print("Building LLVM.\n");
+        my $oldPath = $ENV{"PATH"};
         chdir "$ownLLVMDirectory/wkLLVMBuild";
-        my $oldPath = $ENV{"PATH"};
         my $binariesDirectory = "binariesForLLVMBuild";
+        my $pathCommand = "";
         if (-e $binariesDirectory) {
-            $ENV{"PATH"} = File::Spec->rel2abs($binariesDirectory) . ":" . $oldPath;
+            my $binariesPath = File::Spec->rel2abs($binariesDirectory);
+            print "Detected binaries directory; prepending to path: $binariesPath\n";
+            $pathCommand = "PATH=\\\$PWD/$binariesDirectory:\\\$PATH";
         }
-        (system("(unset PROJECT_NAME ; make -j `sysctl -n hw.activecpu`)") == 0) or die;
+        my $makeCommand = "env -i bash -l -c \"$pathCommand make -j `sysctl -n hw.activecpu`\"";
+        print $makeCommand . "\n";
+        (system($makeCommand) == 0) or die;
         $ENV{"PATH"} = $oldPath;
         chdirWebKit();
         
@@ -250,7 +268,7 @@
             }
         }
         closedir $dirHandle;
-    } else {
+    } elsif (!$preferSystemLLVMOverDrops) {
         $shouldUpdateLLVMLibraryToken =
             unpackIfNecessary($libraryDir, "$libraryDir/libLLVMCore.a", $llvmLibraryPackage, 1);
     }
@@ -262,7 +280,7 @@
         symlink("$ownLLVMDirectory/include/llvm", "$productDir/usr/local/LLVMForJavaScriptCore/include/llvm") or die;
         symlink("$ownLLVMDirectory/include/llvm-c", "$productDir/usr/local/LLVMForJavaScriptCore/include/llvm-c") or die;
         symlink("$ownLLVMDirectory/wkLLVMBuild/include", "$productDir/ExtraIncludesForLocalLLVMBuild") or die;
-    } else {
+    } elsif (!$preferSystemLLVMOverDrops) {
         unpackIfNecessary("$productDir/usr/local/LLVMForJavaScriptCore/include", "$productDir/usr/local/LLVMForJavaScriptCore/include/llvm-c/Core.h", $llvmIncludePackage, 0);
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to