[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

mrowe at apple.com mrowe at apple.com
Wed Feb 10 22:15:52 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit d240e1e119a9b8aad7049a6ba4789635cf771885
Author: mrowe at apple.com <mrowe at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 5 06:13:23 2010 +0000

    Build fix.  Remove a symbol corresponding to an inline function from the linker export
    file to prevent a weak external failure.
    
    Reviewed by Timothy Hatcher.
    
    JavaScriptCore:
    
    * JavaScriptCore.xcodeproj/project.pbxproj: Accommodate rename of script.
    
    JavaScriptGlue:
    
    * JavaScriptGlue.xcodeproj/project.pbxproj: Accommodate rename of script.
    
    WebCore:
    
    * WebCore.base.exp: Remove symbol.
    * WebCore.xcodeproj/project.pbxproj: Accommodate rename of script.
    
    WebKit:
    
    * WebKit.xcodeproj/project.pbxproj: Accommodate rename of script.
    
    WebKitTools:
    
    * Scripts/check-for-weak-vtables-and-externals: Renamed from WebKitTools/Scripts/check-for-weak-vtables.
    Teach the script how to detect weak external symbols so that these errors can be caught immediately
    in the future.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54405 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 9a88ac6..ef3bcbc 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,12 @@
+2010-02-04  Mark Rowe  <mrowe at apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Build fix.  Remove a symbol corresponding to an inline function from the linker export
+        file to prevent a weak external failure.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj: Accommodate rename of script.
+
 2010-02-04  Daniel Bates  <dbates at webkit.org>
 
         [Qt] Unreviewed, build fix for Qt bot.
diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 3142153..b5ac555 100644
--- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -2108,7 +2108,7 @@
 				932F5BD20822A1C700736975 /* Frameworks */,
 				9319586B09D9F91A00A56FD4 /* Check For Global Initializers */,
 				933457200EBFDC3F00B80894 /* Check For Exit Time Destructors */,
-				5D29D8BE0E9860B400C3D2D0 /* Check For Weak VTables */,
+				5D29D8BE0E9860B400C3D2D0 /* Check For Weak VTables and Externals */,
 			);
 			buildRules = (
 			);
@@ -2207,7 +2207,7 @@
 			shellPath = /bin/sh;
 			shellScript = "# exclude NPN functions on 64-bit\nsed -e s/^.\\*NPN.\\*$// \"${SRCROOT}/JavaScriptCore.exp\" > \"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore/JavaScriptCore.LP64.exp\"\n";
 		};
-		5D29D8BE0E9860B400C3D2D0 /* Check For Weak VTables */ = {
+		5D29D8BE0E9860B400C3D2D0 /* Check For Weak VTables and Externals */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -2215,12 +2215,12 @@
 			inputPaths = (
 				"$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)",
 			);
-			name = "Check For Weak VTables";
+			name = "Check For Weak VTables and Externals";
 			outputPaths = (
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "if [ -f ../WebKitTools/Scripts/check-for-weak-vtables ]; then\n    ../WebKitTools/Scripts/check-for-weak-vtables || exit $?\nfi";
+			shellScript = "if [ -f ../WebKitTools/Scripts/check-for-weak-vtables-and-externals ]; then\n    ../WebKitTools/Scripts/check-for-weak-vtables-and-externals || exit $?\nfi";
 		};
 		5D2F7CF90C6875BB00B5B72B /* Update Info.plist with version information */ = {
 			isa = PBXShellScriptBuildPhase;
diff --git a/JavaScriptGlue/ChangeLog b/JavaScriptGlue/ChangeLog
index dc4ede9..4f00b0a 100644
--- a/JavaScriptGlue/ChangeLog
+++ b/JavaScriptGlue/ChangeLog
@@ -1,3 +1,12 @@
+2010-02-04  Mark Rowe  <mrowe at apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Build fix.  Remove a symbol corresponding to an inline function from the linker export
+        file to prevent a weak external failure.
+
+        * JavaScriptGlue.xcodeproj/project.pbxproj: Accommodate rename of script.
+
 2010-01-28  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Gavin Barraclough.
diff --git a/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj b/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
index 677cf6f..36bde4a 100644
--- a/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
+++ b/JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
@@ -267,7 +267,7 @@
 				DD66F3C408F73ED700C75FD7 /* Sources */,
 				DD66F3CD08F73ED700C75FD7 /* Frameworks */,
 				939D055E09DA033400984996 /* Check For Global Initializers */,
-				5D0D53490E9862A70029E223 /* Check For Weak VTables */,
+				5D0D53490E9862A70029E223 /* Check For Weak VTables and Externals */,
 				5DA0F0C00DC2B48900EA22B4 /* Remove Headers If Needed */,
 			);
 			buildRules = (
@@ -312,7 +312,7 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		5D0D53490E9862A70029E223 /* Check For Weak VTables */ = {
+		5D0D53490E9862A70029E223 /* Check For Weak VTables and Externals */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -320,12 +320,12 @@
 			inputPaths = (
 				"$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)",
 			);
-			name = "Check For Weak VTables";
+			name = "Check For Weak VTables and Externals";
 			outputPaths = (
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "if [ -f ../WebKitTools/Scripts/check-for-weak-vtables ]; then\n    ../WebKitTools/Scripts/check-for-weak-vtables || exit $?\nfi";
+			shellScript = "if [ -f ../WebKitTools/Scripts/check-for-weak-vtables-and-externals ]; then\n    ../WebKitTools/Scripts/check-for-weak-vtables-and-externals || exit $?\nfi";
 		};
 		5D2F7D0A0C6878E000B5B72B /* Update Info.plist with version information */ = {
 			isa = PBXShellScriptBuildPhase;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index de1a3f2..562efad 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-02-04  Mark Rowe  <mrowe at apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Build fix.  Remove a symbol corresponding to an inline function from the linker export
+        file to prevent a weak external failure.
+
+        * WebCore.base.exp: Remove symbol.
+        * WebCore.xcodeproj/project.pbxproj: Accommodate rename of script.
+
 2010-02-04  Geoffrey Garen  <ggaren at apple.com>
 
         Build fix: Added a forwarding header.
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp
index ba1dd71..1f2cc91 100644
--- a/WebCore/WebCore.base.exp
+++ b/WebCore/WebCore.base.exp
@@ -683,7 +683,6 @@ __ZN7WebCore8Settings40setJavaScriptCanOpenWindowsAutomaticallyEb
 __ZN7WebCore8Settings40setTextDirectionSubmenuInclusionBehaviorENS_37TextDirectionSubmenuInclusionBehaviorE
 __ZN7WebCore8Settings41setNeedsKeyboardEventDisambiguationQuirksEb
 __ZN7WebCore8blankURLEv
-__ZN7WebCore8jsStringEPN3JSC9ExecStateERKNS_6StringE
 __ZN7WebCore8makeRGBAEiiii
 __ZN7WebCore9DOMWindow30dispatchAllPendingUnloadEventsEv
 __ZN7WebCore9DOMWindow36dispatchAllPendingBeforeUnloadEventsEv
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index f4b8b02..208f2b1 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -18526,7 +18526,7 @@
 				93F19B1208245E59001E9ABC /* Frameworks */,
 				939D050109D9FF6B00984996 /* Check For Global Initializers */,
 				933457E60EBFDF6B00B80894 /* Check For Exit Time Destructors */,
-				5D0D540D0E9862F60029E223 /* Check For Weak VTables */,
+				5D0D540D0E9862F60029E223 /* Check For Weak VTables and Externals */,
 			);
 			buildRules = (
 			);
@@ -18661,7 +18661,7 @@
 			shellPath = /bin/sh;
 			shellScript = "rsync -aq --exclude \".svn\" --exclude \".DS_Store\" \"$SRCROOT/ForwardingHeaders\" \"$BUILT_PRODUCTS_DIR/$PRIVATE_HEADERS_FOLDER_PATH\"\nrsync -aq --exclude \".svn\" --exclude \".DS_Store\" \"$SRCROOT/icu\" \"$BUILT_PRODUCTS_DIR/$PRIVATE_HEADERS_FOLDER_PATH\"\n";
 		};
-		5D0D540D0E9862F60029E223 /* Check For Weak VTables */ = {
+		5D0D540D0E9862F60029E223 /* Check For Weak VTables and Externals */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -18669,12 +18669,12 @@
 			inputPaths = (
 				"$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)",
 			);
-			name = "Check For Weak VTables";
+			name = "Check For Weak VTables and Externals";
 			outputPaths = (
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n    exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-weak-vtables ]; then\n    ../WebKitTools/Scripts/check-for-weak-vtables || exit $?\nfi";
+			shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n    exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-weak-vtables-and-externals ]; then\n    ../WebKitTools/Scripts/check-for-weak-vtables-and-externals || exit $?\nfi";
 		};
 		5D2F7DA00C6879C600B5B72B /* Update Info.plist with version information */ = {
 			isa = PBXShellScriptBuildPhase;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 6592cc1..134a252 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,12 @@
+2010-02-04  Mark Rowe  <mrowe at apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Build fix.  Remove a symbol corresponding to an inline function from the linker export
+        file to prevent a weak external failure.
+
+        * WebKit.xcodeproj/project.pbxproj: Accommodate rename of script.
+
 2010-02-04  John Sullivan  <sullivan at apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=34611
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index 0e28c14..dda5966 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -1566,7 +1566,7 @@
 				939811270824BF01008DF038 /* Frameworks */,
 				939D054F09DA02D500984996 /* Check For Global Initializers */,
 				9337D6540EBFE54D00DA3CB5 /* Check For Exit Time Destructors */,
-				5D0D54210E98631D0029E223 /* Check For Weak VTables */,
+				5D0D54210E98631D0029E223 /* Check For Weak VTables and Externals */,
 				5DE6D18C0FCF231B002DE28C /* Symlink WebKitPluginHost in to place */,
 			);
 			buildRules = (
@@ -1654,7 +1654,7 @@
 			shellPath = /bin/sh;
 			shellScript = "mkdir -p \"${TARGET_BUILD_DIR}/${PRIVATE_HEADERS_FOLDER_PATH}\"\nmkdir -p \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nmkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKit\"\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n    make -C mac -f \"MigrateHeaders.make\" -j `/usr/sbin/sysctl -n hw.availcpu`\nfi\n";
 		};
-		5D0D54210E98631D0029E223 /* Check For Weak VTables */ = {
+		5D0D54210E98631D0029E223 /* Check For Weak VTables and Externals */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -1662,12 +1662,12 @@
 			inputPaths = (
 				"$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)",
 			);
-			name = "Check For Weak VTables";
+			name = "Check For Weak VTables and Externals";
 			outputPaths = (
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n    exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-weak-vtables ]; then\n    ../WebKitTools/Scripts/check-for-weak-vtables || exit $?\nfi";
+			shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n    exit 0;\nfi\n\nif [ -f ../WebKitTools/Scripts/check-for-weak-vtables-and-externals ]; then\n    ../WebKitTools/Scripts/check-for-weak-vtables-and-externals || exit $?\nfi";
 		};
 		5D2F7DB70C687A5A00B5B72B /* Update Info.plist with version information */ = {
 			isa = PBXShellScriptBuildPhase;
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 111ade5..0fe7fdb 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-04  Mark Rowe  <mrowe at apple.com>
+
+        Reviewed by Timothy Hatcher.
+
+        Build fix.  Remove a symbol corresponding to an inline function from the linker export
+        file to prevent a weak external failure.
+
+        * Scripts/check-for-weak-vtables-and-externals: Renamed from WebKitTools/Scripts/check-for-weak-vtables.
+        Teach the script how to detect weak external symbols so that these errors can be caught immediately
+        in the future.
+
 2010-02-04  Kenneth Rohde Christiansen  <kenneth at webkit.org>
 
         Rubberstamped by Oliver Hunt.
diff --git a/WebKitTools/Scripts/check-for-weak-vtables b/WebKitTools/Scripts/check-for-weak-vtables
deleted file mode 100755
index a10a236..0000000
--- a/WebKitTools/Scripts/check-for-weak-vtables
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2006, 2007, 2008 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. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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.
-
-# "check-for-weak-vtables" script for WebKit Open Source Project
-
-# Intended to be invoked from an Xcode build step to check if there are
-# any weak vtables in a target.
-
-use warnings;
-use strict;
-
-use File::Basename;
-
-sub touch($);
-
-my $arch = $ENV{'CURRENT_ARCH'};
-my $configuration = $ENV{'CONFIGURATION'};
-my $target = $ENV{'TARGET_NAME'};
-my $variant = $ENV{'CURRENT_VARIANT'};
-my $coverageBuild = $ENV{'WEBKIT_COVERAGE_BUILD'};
-my $debugRoot = $ENV{'WEBKIT_DEBUG_ROOT'};
-
-$arch = $ENV{'NATIVE_ARCH'} if !$arch; # for Xcode 2.1, which does not have CURRENT_ARCH
-$variant = "normal" if !$variant; # for Xcode 2.1, which does not have CURRENT_VARIANT
-
-my $executablePath = "$ENV{'TARGET_BUILD_DIR'}/$ENV{'EXECUTABLE_PATH'}";
-
-my $buildTimestampPath = $ENV{'TARGET_TEMP_DIR'} . "/" . basename($0) . ".timestamp";
-my $buildTimestampAge = -M $buildTimestampPath;
-my $executablePathAge = -M $executablePath;
-
-my $sawError = 0;
-
-if (!defined $executablePathAge || !defined $buildTimestampAge || $executablePathAge > $buildTimestampAge) {
-    if (!open NM, "(nm -m '$executablePath' | c++filt | sed 's/^/STDOUT:/') 2>&1 |") {
-        print "ERROR: Could not open $executablePath\n";
-        $sawError = 1;
-        next;
-    }
-    my @weakVTableClasses = ();
-    while (<NM>) {
-        if (/^STDOUT:/) {
-            push @weakVTableClasses, $1 if /weak external vtable for (.*)$/;
-        } else {
-            print STDERR if $_ ne "nm: no name list\n";
-        }
-    }
-    close NM;
-    if (@weakVTableClasses) {
-        my $shortName = $executablePath;
-        $shortName =~ s/.*\///;
-
-        print "ERROR: $shortName has a weak vtable in it ($executablePath)\n";
-        print "ERROR: Fix by making sure the first virtual function in each of these classes is not an inline:\n";
-        for my $class (sort @weakVTableClasses) {
-            print "ERROR: class $class\n";
-        }
-        $sawError = 1;
-    }
-}
-
-if ($sawError and !$coverageBuild) {
-    unlink $executablePath;
-    exit 1;
-}
-
-touch($buildTimestampPath);
-
-exit 0;
-
-sub touch($)
-{
-    my ($path) = @_;
-    open(TOUCH, ">", $path) or die "$!";
-    close(TOUCH);
-}
diff --git a/WebKitTools/Scripts/check-for-weak-vtables-and-externals b/WebKitTools/Scripts/check-for-weak-vtables-and-externals
new file mode 100755
index 0000000..a3dc364
--- /dev/null
+++ b/WebKitTools/Scripts/check-for-weak-vtables-and-externals
@@ -0,0 +1,120 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2006, 2007, 2008, 2010 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. 
+# 3.  Neither the name of Apple Inc. ("Apple") nor the names of
+#     its contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission. 
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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.
+
+# "check-for-weak-vtables-and-externals" script for WebKit Open Source Project
+
+# Intended to be invoked from an Xcode build step to check if there are
+# any weak vtables or weak externals in a target.
+
+use warnings;
+use strict;
+
+use File::Basename;
+
+sub touch($);
+
+my $arch = $ENV{'CURRENT_ARCH'};
+my $configuration = $ENV{'CONFIGURATION'};
+my $target = $ENV{'TARGET_NAME'};
+my $variant = $ENV{'CURRENT_VARIANT'};
+my $coverageBuild = $ENV{'WEBKIT_COVERAGE_BUILD'};
+my $debugRoot = $ENV{'WEBKIT_DEBUG_ROOT'};
+
+$arch = $ENV{'NATIVE_ARCH'} if !$arch; # for Xcode 2.1, which does not have CURRENT_ARCH
+$variant = "normal" if !$variant; # for Xcode 2.1, which does not have CURRENT_VARIANT
+
+my $executablePath = "$ENV{'TARGET_BUILD_DIR'}/$ENV{'EXECUTABLE_PATH'}";
+
+my $buildTimestampPath = $ENV{'TARGET_TEMP_DIR'} . "/" . basename($0) . ".timestamp";
+my $buildTimestampAge = -M $buildTimestampPath;
+my $executablePathAge = -M $executablePath;
+
+my $sawError = 0;
+
+if (!defined $executablePathAge || !defined $buildTimestampAge || $executablePathAge > $buildTimestampAge) {
+    if (!open NM, "(nm -m '$executablePath' | c++filt | sed 's/^/STDOUT:/') 2>&1 |") {
+        print "ERROR: Could not open $executablePath\n";
+        $sawError = 1;
+        next;
+    }
+    my @weakVTableClasses = ();
+    my @weakExternalSymbols = ();
+    while (<NM>) {
+        if (/^STDOUT:/) {
+            # Ignore undefined, RTTI and typeinfo symbols.
+            next if /\bundefined\b/ or /\b__ZT[IS]/;
+
+            if (/weak external vtable for (.*)$/) {
+                push @weakVTableClasses, $1;
+            } elsif (/weak external (.*)$/) {
+                push @weakExternalSymbols, $1;
+            }
+        } else {
+            print STDERR if $_ ne "nm: no name list\n";
+        }
+    }
+    close NM;
+
+    my $shortName = $executablePath;
+    $shortName =~ s/.*\///;
+
+    if (@weakVTableClasses) {
+        print "ERROR: $shortName has a weak vtable in it ($executablePath)\n";
+        print "ERROR: Fix by making sure the first virtual function in each of these classes is not an inline:\n";
+        for my $class (sort @weakVTableClasses) {
+            print "ERROR: class $class\n";
+        }
+        $sawError = 1;
+    }
+
+    if (@weakExternalSymbols) {
+        print "ERROR: $shortName has a weak external symbol in it ($executablePath)\n";
+        print "ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.\n";
+        print "ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.\n";
+        for my $symbol (sort @weakExternalSymbols) {
+            print "ERROR: symbol $symbol\n";
+        }
+        $sawError = 1;
+    }
+}
+
+if ($sawError and !$coverageBuild) {
+    unlink $executablePath;
+    exit 1;
+}
+
+touch($buildTimestampPath);
+
+exit 0;
+
+sub touch($)
+{
+    my ($path) = @_;
+    open(TOUCH, ">", $path) or die "$!";
+    close(TOUCH);
+}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list