[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

abecsi at webkit.org abecsi at webkit.org
Wed Dec 22 13:51:56 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c031b8167fc42171af989a36b97940381bcb525a
Author: abecsi at webkit.org <abecsi at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 28 16:01:47 2010 +0000

    2010-09-28  Andras Becsi  <abecsi at webkit.org>
    
            Reviewed by Csaba Osztrogonác.
    
            Undefined reference errors when linking due to gperf and inlining.
            webkit.org/b/29244
    
            EFL CMake changes by Leandro Pereira <leandro at profusion.mobi>
    
            Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
            Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
            to access the functionality provided. This resulted in debug build failure with newer gcc versions
            because of a behaviour change of gcc, which disables C style inlining in debug mode.
            The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
            in their own compilation unit.
            The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
            for multiple inclusions of generated C files to access these functions.
    
            * WebCoreSupport/FrameLoaderClientQt.cpp:
            (WebCore::FrameLoaderClientQt::createPlugin):
    2010-09-28  Andras Becsi  <abecsi at webkit.org>
    
            Reviewed by Csaba Osztrogonác.
    
            Undefined reference errors when linking due to gperf and inlining.
            webkit.org/b/29244
    
            EFL CMake changes by Leandro Pereira <leandro at profusion.mobi>
    
            Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
            Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
            to access the functionality provided. This resulted in debug build failure with newer gcc versions
            because of a behaviour change of gcc, which disables C style inlining in debug mode.
            The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
            in their own compilation unit.
            The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
            for multiple inclusions of generated C files to access these functions.
    
            No new tests needed.
    
            * CMakeLists.txt:
            * WebCore.gyp/WebCore.gyp:
            * WebCore.pri:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * css/CSSParser.cpp:
            * css/makeprop.pl:
            * css/makevalues.pl:
            * html/DocTypeStrings.gperf:
            * html/HTMLDocument.cpp:
            * make-hash-tools.pl:
            * platform/ColorData.gperf:
            * platform/graphics/Color.cpp:
    2010-09-28  Andras Becsi  <abecsi at webkit.org>
    
            Reviewed by Csaba Osztrogonác.
    
            Undefined reference errors when linking due to gperf and inlining.
            webkit.org/b/29244
    
            EFL CMake changes by Leandro Pereira <leandro at profusion.mobi>
    
            Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
            Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
            to access the functionality provided. This resulted in debug build failure with newer gcc versions
            because of a behaviour change of gcc, which disables C style inlining in debug mode.
            The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
            in their own compilation unit.
            The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
            for multiple inclusions of generated C files to access these functions.
    
            * cmake/WebKitMacros.cmake:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68521 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/ChangeLog b/ChangeLog
index 2468e01..3178f18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2010-09-28  Andras Becsi  <abecsi at webkit.org>
+
+        Reviewed by Csaba Osztrogonác.
+
+        Undefined reference errors when linking due to gperf and inlining.
+        webkit.org/b/29244
+
+        EFL CMake changes by Leandro Pereira <leandro at profusion.mobi>
+
+        Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
+        Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
+        to access the functionality provided. This resulted in debug build failure with newer gcc versions
+        because of a behaviour change of gcc, which disables C style inlining in debug mode.
+        The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
+        in their own compilation unit.
+        The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
+        for multiple inclusions of generated C files to access these functions.
+
+        * cmake/WebKitMacros.cmake:
+
 2010-09-27  Philippe Normand  <pnormand at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 50f64cf..4c562a8 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -536,6 +536,10 @@ IF (ENABLE_SVG)
 ENDIF()
 
 SET(WebCore_SOURCES
+    ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp
+    ${DERIVED_SOURCES_DIR}/CSSValueKeywords.cpp
+    ${DERIVED_SOURCES_DIR}/CSSPropertyNames.cpp
+    ${DERIVED_SOURCES_DIR}/ColorData.cpp
     ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp
     ${DERIVED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp
     ${DERIVED_SOURCES_DIR}/InspectorBackendDispatcher.cpp
@@ -1909,12 +1913,10 @@ LIST(APPEND WebCore_SOURCES ${JS_IDL_FILES} ${Inspector_IDL_FILES})
 
 GENERATE_ENTITIES(${WEBCORE_DIR}/html/parser/HTMLEntityNames.in ${DERIVED_SOURCES_DIR}/HTMLEntityTable.cpp ${WEBCORE_DIR}/html/parser/create-html-entity-table)
 
-
-GENERATE_GPERF(${WEBCORE_DIR}/platform/ColorData.gperf ${DERIVED_SOURCES_DIR}/ColorData.cpp findColor "")
+MAKE_HASH_TOOLS(${WEBCORE_DIR}/platform/ColorData)
 ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/platform/graphics/Color.cpp ColorData.cpp)
 
-
-GENERATE_GPERF(${WEBCORE_DIR}/html/DocTypeStrings.gperf ${DERIVED_SOURCES_DIR}/DocTypeStrings.cpp findDoctypeEntry "-F,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards")
+MAKE_HASH_TOOLS(${WEBCORE_DIR}/html/DocTypeStrings)
 ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLDocument.cpp DocTypeStrings.cpp)
 
 
@@ -1934,6 +1936,7 @@ GENERATE_CSS_PROPERTY_NAMES()
 GENERATE_CSS_VALUE_KEYWORDS()
 
 
+ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/HashTools.h DocTypeStrings.cpp CSSValueKeywords.cpp CSSPropertyNames.cpp ColorData.cpp)
 ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSValueKeywords.h)
 ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSPropertyNames.h)
 ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSPrimitiveValueMappings.h CSSValueKeywords.h)
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9d63883..5901dac 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,37 @@
+2010-09-28  Andras Becsi  <abecsi at webkit.org>
+
+        Reviewed by Csaba Osztrogonác.
+
+        Undefined reference errors when linking due to gperf and inlining.
+        webkit.org/b/29244
+
+        EFL CMake changes by Leandro Pereira <leandro at profusion.mobi>
+
+        Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
+        Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
+        to access the functionality provided. This resulted in debug build failure with newer gcc versions
+        because of a behaviour change of gcc, which disables C style inlining in debug mode.
+        The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
+        in their own compilation unit.
+        The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
+        for multiple inclusions of generated C files to access these functions.
+
+        No new tests needed.
+
+        * CMakeLists.txt:
+        * WebCore.gyp/WebCore.gyp:
+        * WebCore.pri:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSParser.cpp:
+        * css/makeprop.pl:
+        * css/makevalues.pl:
+        * html/DocTypeStrings.gperf:
+        * html/HTMLDocument.cpp:
+        * make-hash-tools.pl:
+        * platform/ColorData.gperf:
+        * platform/graphics/Color.cpp:
+
 2010-09-28  Andreas Kling  <andreas.kling at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 2745cfa..8fda04a 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -646,7 +646,6 @@
             '<(SHARED_INTERMEDIATE_DIR)/webkit',
             '<(RULE_INPUT_PATH)',
           ],
-          'process_outputs_as_sources': 0,
         },
         # Rule to build generated JavaScript (V8) bindings from .idl source.
         {
@@ -743,6 +742,12 @@
         # in webcore_files.
         '<@(derived_sources_aggregate_files)',
 
+        # Additional .cpp files for HashTools.h
+        '<(SHARED_INTERMEDIATE_DIR)/webkit/DocTypeStrings.cpp',
+        '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorData.cpp',
+        '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
+        '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
+
         # Additional .cpp files from webcore_bindings_sources actions.
         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index d15c343..3331626 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -547,7 +547,7 @@ cssprops.wkScript = $$PWD/css/makeprop.pl
 cssprops.output = $${WC_GENERATED_SOURCES_DIR}/CSSPropertyNames.cpp
 cssprops.input = WALDOCSSPROPS
 cssprops.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssprops.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
-cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES}
+cssprops.depends = ${QMAKE_FILE_NAME} $${DASHBOARDSUPPORTCSSPROPERTIES} $${EXTRACSSPROPERTIES} $$cssprops.wkScript
 addExtraCompiler(cssprops)
 
 # GENERATOR 6-B:
@@ -555,7 +555,7 @@ cssvalues.wkScript = $$PWD/css/makevalues.pl
 cssvalues.output = $${WC_GENERATED_SOURCES_DIR}/CSSValueKeywords.cpp
 cssvalues.input = WALDOCSSVALUES
 cssvalues.commands = perl -ne \"print lc\" ${QMAKE_FILE_NAME} $$EXTRACSSVALUES > $${WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.in && cd $$WC_GENERATED_SOURCES_DIR && perl $$cssvalues.wkScript && $(DEL_FILE) ${QMAKE_FILE_BASE}.in ${QMAKE_FILE_BASE}.gperf
-cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES}
+cssvalues.depends = ${QMAKE_FILE_NAME} $${EXTRACSSVALUES} $$cssvalues.wkScript
 cssvalues.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_WC_GENERATED_SOURCES_DIR}/${QMAKE_FILE_BASE}.h
 addExtraCompiler(cssvalues)
 
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 83ca957..254b02a 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -545,6 +545,26 @@
 				>
 			</File>
 			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\HashTools.h"
+				>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\DocTypeStrings.cpp"
+				>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\CSSValueKeywords.cpp"
+				>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\CSSPropertyNames.cpp"
+				>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\ColorData.cpp"
+				>
+			</File>
+			<File
 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\InspectorBackendDispatcher.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index c312f49..fd1a00b 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -495,6 +495,10 @@
 		1AB7FC860A8B92EC00D9D37B /* XPathValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC650A8B92EC00D9D37B /* XPathValue.h */; };
 		1AB7FC870A8B92EC00D9D37B /* XPathVariableReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC660A8B92EC00D9D37B /* XPathVariableReference.cpp */; };
 		1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7FC670A8B92EC00D9D37B /* XPathVariableReference.h */; };
+		1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FB1198307D009D59D6 /* ColorData.cpp */; };
+		1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */; };
+		1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */; };
+		1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */; };
 		1ABFE7530CD968D000FE4834 /* SQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABFE7520CD968D000FE4834 /* SQLTransaction.cpp */; };
 		1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC2260A0DB69F190089B669 /* JSDOMApplicationCache.cpp */; };
 		1AC2260D0DB69F190089B669 /* JSDOMApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC2260B0DB69F190089B669 /* JSDOMApplicationCache.h */; };
@@ -20902,6 +20906,10 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
+				1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
+				1ABA76CB11D20E57004C201C /* CSSValueKeywords.cpp in Sources */,
+				1ABA76CC11D20E5B004C201C /* DocTypeStrings.cpp in Sources */,
 				B5B5DC69119BB3D5002A8790 /* AbstractDatabase.cpp in Sources */,
 				41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
 				29A812280FBB9C1D00510293 /* AccessibilityARIAGrid.cpp in Sources */,
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 86bcd0d..5479bdf 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -62,6 +62,7 @@
 #include "FloatConversion.h"
 #include "FontFamilyValue.h"
 #include "FontValue.h"
+#include "HashTools.h"
 #include "MediaList.h"
 #include "MediaQueryExp.h"
 #include "Pair.h"
@@ -89,9 +90,6 @@ extern int cssyyparse(void* parser);
 using namespace std;
 using namespace WTF;
 
-#include "CSSPropertyNames.cpp"
-#include "CSSValueKeywords.cpp"
-
 namespace WebCore {
 
 static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
diff --git a/WebCore/css/makeprop.pl b/WebCore/css/makeprop.pl
index 8810e8d..64f5a6b 100644
--- a/WebCore/css/makeprop.pl
+++ b/WebCore/css/makeprop.pl
@@ -41,15 +41,14 @@ print GPERF << "EOF";
 #include \"CSSPropertyNames.h\"
 %}
 %struct-type
-struct Property {
-    const char* name;
-    int id;
-};
-%language=ANSI-C
+struct Property;
+%omit-struct-type
+%language=C++
 %readonly-tables
 %global-table
 %compare-strncmp
-%define lookup-function-name findProperty
+%define class-name CSSPropertyNamesHash
+%define lookup-function-name findPropertyImpl
 %define hash-function-name propery_hash_function
 %define word-array-name property_wordlist
 %includes
@@ -72,6 +71,10 @@ print HEADER << "EOF";
 #ifndef CSSPropertyNames_h
 #define CSSPropertyNames_h
 
+#include <string.h>
+
+namespace WebCore {
+
 enum CSSPropertyID {
     CSSPropertyInvalid = 0,
 EOF
@@ -105,17 +108,41 @@ print HEADER << "EOF";
 
 const char* getPropertyName(CSSPropertyID);
 
+} // namespace WebCore
+
 #endif // CSSPropertyNames_h
 
 EOF
 
 close HEADER;
 
-system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNames.cpp") == 0 || die "calling gperf failed: $?";
+system("gperf --key-positions=\"*\" -D -n -s 2 CSSPropertyNames.gperf > CSSPropertyNamesHash.h") == 0 || die "calling gperf failed: $?";
 
-open C, ">>CSSPropertyNames.cpp" || die "Could not open CSSPropertyNames.cpp for writing";
+open C, ">>CSSPropertyNamesHash.h" || die "Could not open CSSPropertyNamesHash.h for writing";
 print C << "EOF";
 
+EOF
+
+close C;
+
+my $propertyNamesImpl = "CSSPropertyNames.cpp";
+
+open PROPERTYNAMES, ">$propertyNamesImpl" || die "Could not open $propertyNamesImpl for writing";
+print PROPERTYNAMES << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+
+#include "CSSPropertyNames.h"
+#include "HashTools.h"
+
+namespace WebCore {
+#include "CSSPropertyNamesHash.h"
+
+const Property* findProperty (register const char* str, register unsigned int len)
+{
+    return CSSPropertyNamesHash::findPropertyImpl(str, len);
+}
+
 const char* getPropertyName(CSSPropertyID id)
 {
     if (id < firstCSSProperty)
@@ -125,7 +152,10 @@ const char* getPropertyName(CSSPropertyID id)
         return 0;
     return propertyNameStrings[index];
 }
+
+} // namespace WebCore
+
 EOF
 
-close C;
+close PROPERTYNAMES;
 
diff --git a/WebCore/css/makevalues.pl b/WebCore/css/makevalues.pl
index 421e470..c9f7f70 100644
--- a/WebCore/css/makevalues.pl
+++ b/WebCore/css/makevalues.pl
@@ -42,14 +42,13 @@ print GPERF << "EOF";
 #include \"CSSValueKeywords.h\"
 %}
 %struct-type
-struct Value {
-    const char* name;
-    int id;
-};
-%language=ANSI-C
+struct Value;
+%omit-struct-type
+%language=C++
 %readonly-tables
 %compare-strncmp
-%define lookup-function-name findValue
+%define class-name CSSValueKeywordsHash
+%define lookup-function-name findValueImpl
 %define hash-function-name value_hash_function
 %define word-array-name value_word_list
 %includes
@@ -72,6 +71,10 @@ print HEADER << "EOF";
 #ifndef CSSValueKeywords_h
 #define CSSValueKeywords_h
 
+#include <string.h>
+
+namespace WebCore {
+
 const int CSSValueInvalid = 0;
 EOF
 
@@ -92,13 +95,16 @@ print HEADER << "EOF";
 
 const char* getValueName(unsigned short id);
 
+} // namespace WebCore
+
 #endif // CSSValueKeywords_h
+
 EOF
 close HEADER;
 
-system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywords.cpp") == 0 || die "calling gperf failed: $?";
+system("gperf --key-positions=\"*\" -D -n -s 2 CSSValueKeywords.gperf > CSSValueKeywordsHash.h") == 0 || die "calling gperf failed: $?";
 
-open C, ">>CSSValueKeywords.cpp" || die "Could not open CSSValueKeywords.cpp for writing";
+open C, ">>CSSValueKeywordsHash.h" || die "Could not open CSSValueKeywordsHash.h for writing";
 print C  "static const char * const valueList[] = {\n";
 print C  "\"\",\n";
 foreach my $name (@names) {
@@ -107,12 +113,38 @@ foreach my $name (@names) {
 print C << "EOF";
     0
 };
+
+EOF
+
+close C;
+
+my $valueKeywordsImpl = "CSSValueKeywords.cpp";
+
+open VALUEKEYWORDS, ">$valueKeywordsImpl" || die "Could not open $valueKeywordsImpl for writing";
+print VALUEKEYWORDS << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+#include "CSSValueKeywords.h"
+#include "HashTools.h"
+
+namespace WebCore {
+#include "CSSValueKeywordsHash.h"
+
+const Value* findValue (register const char* str, register unsigned int len)
+{
+    return CSSValueKeywordsHash::findValueImpl(str, len);
+}
+
 const char* getValueName(unsigned short id)
 {
     if (id >= numCSSValueKeywords || id <= 0)
         return 0;
     return valueList[id];
 }
+
+} // namespace WebCore
+
 EOF
 
-close C;
+close VALUEKEYWORDS;
+
diff --git a/WebCore/html/DocTypeStrings.gperf b/WebCore/html/DocTypeStrings.gperf
index 5c213b0..6b7da04 100644
--- a/WebCore/html/DocTypeStrings.gperf
+++ b/WebCore/html/DocTypeStrings.gperf
@@ -1,21 +1,13 @@
 %struct-type
-struct PubIDInfo {
-    enum eMode { 
-        eQuirks,         
-        eQuirks3,       
-        eAlmostStandards
-    };
-
-    const char* name;
-    eMode mode_if_no_sysid;
-    eMode mode_if_sysid;
-}
-%language=ANSI-C
+struct PubIDInfo;
+%omit-struct-type
+%language=C++
 %readonly-tables
 %global-table
 %compare-strncmp
+%define class-name DocTypeStringsHash
 %define initializer-suffix ,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards
-%define lookup-function-name findDoctypeEntry
+%define lookup-function-name findDoctypeEntryImpl
 %define hash-function-name doctype_hash_function
 %includes
 %enum
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index 08c4e22..8bb7789 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -64,6 +64,7 @@
 #include "FrameLoader.h"
 #include "FrameTree.h"
 #include "FrameView.h"
+#include "HashTools.h"
 #include "HTMLDocumentParser.h"
 #include "HTMLBodyElement.h"
 #include "HTMLElementFactory.h"
@@ -74,8 +75,6 @@
 #include "Settings.h"
 #include <wtf/text/CString.h>
 
-#include "DocTypeStrings.cpp"
-
 namespace WebCore {
 
 using namespace HTMLNames;
diff --git a/WebCore/make-hash-tools.pl b/WebCore/make-hash-tools.pl
index 8cc9952..a8c684d 100644
--- a/WebCore/make-hash-tools.pl
+++ b/WebCore/make-hash-tools.pl
@@ -27,24 +27,121 @@ my $outdir = $ARGV[0];
 shift;
 my $option = basename($ARGV[0],".gperf");
 
+my $hashToolsHeader = "$outdir/HashTools.h";
+
+sub createHashToolsHeader() {
+
+open HEADER, ">$hashToolsHeader" || die "Could not open $hashToolsHeader for writing";
+print HEADER << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+#ifndef HashTools_h
+#define HashTools_h
+
+#include "wtf/Platform.h"
+
+namespace WebCore {
+
+struct PubIDInfo {
+    enum eMode {
+        eQuirks,
+        eQuirks3,
+        eAlmostStandards
+    };
+
+    const char* name;
+    eMode mode_if_no_sysid;
+    eMode mode_if_sysid;
+};
+
+struct NamedColor {
+    const char* name;
+    int RGBValue;
+};
+
+struct Property {
+    const char* name;
+    int id;
+};
+
+struct Value {
+    const char* name;
+    int id;
+};
+
+const PubIDInfo* findDoctypeEntry(register const char* str, register unsigned int len);
+const NamedColor* findColor(register const char* str, register unsigned int len);
+const Property* findProperty(register const char* str, register unsigned int len);
+const Value* findValue(register const char* str, register unsigned int len);
+}
+
+#endif // HashTools_h
+
+EOF
+close HEADER;
+
+}
+
 switch ($option) {
 
 case "DocTypeStrings" {
 
-    my $docTypeStringsGenerated    = "$outdir/DocTypeStrings.cpp";
+    createHashToolsHeader();
+
+    my $docTypeStringsImpl         = "$outdir/DocTypeStrings.cpp";
+    my $docTypeStringsGenerated    = "$outdir/DocTypeStringsHash.h";
     my $docTypeStringsGperf        = $ARGV[0];
     shift;
 
+    open DOCTYPESTRINGS, ">$docTypeStringsImpl" || die "Could not open $docTypeStringsImpl for writing";
+    print DOCTYPESTRINGS << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+#include "HashTools.h"
+
+namespace WebCore {
+#include "DocTypeStringsHash.h"
+
+const PubIDInfo* findDoctypeEntry (register const char* str, register unsigned int len)
+{
+    return DocTypeStringsHash::findDoctypeEntryImpl(str, len);
+}
+
+}
+
+EOF
+    close DOCTYPESTRINGS;
+
     system("gperf --key-positions=\"*\" -s 2 $docTypeStringsGperf > $docTypeStringsGenerated") == 0 || die "calling gperf failed: $?";
 
 } # case "DocTypeStrings"
 
 case "ColorData" {
 
-    my $colorDataGenerated   = "$outdir/ColorData.cpp";
-    my $colorDataGperf       = $ARGV[0];
+    my $colorDataImpl              = "$outdir/ColorData.cpp";
+    my $colorDataGenerated         = "$outdir/ColorDataHash.h";
+    my $colorDataGperf             = $ARGV[0];
     shift;
 
+    open COLORDATA, ">$colorDataImpl" || die "Could not open $colorDataImpl for writing";
+    print COLORDATA << "EOF";
+/* This file is automatically generated by make-hash-tools.pl, do not edit */
+
+#include "HashTools.h"
+
+namespace WebCore {
+#include "ColorDataHash.h"
+
+const struct NamedColor* findColor (register const char* str, register unsigned int len)
+{
+    return ColorDataHash::findColorImpl(str, len);
+}
+
+}
+
+EOF
+    close COLORDATA;
+
     system("gperf --key-positions=\"*\" -D -s 2 $colorDataGperf > $colorDataGenerated") == 0 || die "calling gperf failed: $?";
 
 } # case "ColorData"
diff --git a/WebCore/platform/ColorData.gperf b/WebCore/platform/ColorData.gperf
index 11ef798..d684cb9 100644
--- a/WebCore/platform/ColorData.gperf
+++ b/WebCore/platform/ColorData.gperf
@@ -1,13 +1,12 @@
 %struct-type
-struct NamedColor {
-    const char *name;
-    int RGBValue;
-};
-%language=ANSI-C
+struct NamedColor;
+%omit-struct-type
+%language=C++
 %readonly-tables
 %global-table
 %compare-strncmp
-%define lookup-function-name findColor
+%define class-name ColorDataHash
+%define lookup-function-name findColorImpl
 %define hash-function-name colordata_hash_function
 %includes
 %enum
diff --git a/WebCore/platform/graphics/Color.cpp b/WebCore/platform/graphics/Color.cpp
index 80c8286..f28d51c 100644
--- a/WebCore/platform/graphics/Color.cpp
+++ b/WebCore/platform/graphics/Color.cpp
@@ -26,13 +26,12 @@
 #include "config.h"
 #include "Color.h"
 
+#include "HashTools.h"
 #include "PlatformString.h"
 #include <math.h>
 #include <wtf/Assertions.h>
 #include <wtf/MathExtras.h>
 
-#include "ColorData.cpp"
-
 using namespace std;
 using namespace WTF;
 
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 18f7c4f..03263f4 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,24 @@
+2010-09-28  Andras Becsi  <abecsi at webkit.org>
+
+        Reviewed by Csaba Osztrogonác.
+
+        Undefined reference errors when linking due to gperf and inlining.
+        webkit.org/b/29244
+
+        EFL CMake changes by Leandro Pereira <leandro at profusion.mobi>
+
+        Refactor gperf code generation and usage to fix the debug build with gcc>4.4.
+        Hitherto gperf generated C code, these files were included in multiple C++ files across WebCore
+        to access the functionality provided. This resulted in debug build failure with newer gcc versions
+        because of a behaviour change of gcc, which disables C style inlining in debug mode.
+        The make-hash-tools.pl script lets gperf generate C++ code for all gperf files now, which are compiled
+        in their own compilation unit.
+        The functionality provided by the generated code is wrapped behind HashTools.h, so there is no need
+        for multiple inclusions of generated C files to access these functions.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::createPlugin):
+
 2010-09-28  Benjamin Poulain  <benjamin.poulain at nokia.com>
 
         Reviewed by Andreas Kling.
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 3b8d860..13015ad 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -1451,7 +1451,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
             for (unsigned i = 0; i < numqStyleSheetProperties; ++i) {
                 CSSPropertyID property = qstyleSheetProperties[i];
 
-                styleSheet += QString::fromLatin1(::getPropertyName(property));
+                styleSheet += QString::fromLatin1(getPropertyName(property));
                 styleSheet += QLatin1Char(':');
                 styleSheet += computedStyle(element)->getPropertyValue(property);
                 styleSheet += QLatin1Char(';');
diff --git a/cmake/WebKitMacros.cmake b/cmake/WebKitMacros.cmake
index b4f1153..f221747 100644
--- a/cmake/WebKitMacros.cmake
+++ b/cmake/WebKitMacros.cmake
@@ -84,15 +84,24 @@ MACRO (GENERATE_GRAMMAR _prefix _input _output_header _output_source)
         VERBATIM)
 ENDMACRO ()
 
+MACRO(MAKE_HASH_TOOLS _source)
+    GET_FILENAME_COMPONENT(_name ${_source} NAME_WE)
+
+    IF (${_source} STREQUAL "DocTypeStrings")
+        SET(_hash_tools_h "${DERIVED_SOURCES_DIR}/HashTools.h")
+    ELSE ()
+        SET(_hash_tools_h "")
+    ENDIF ()
 
-MACRO (GENERATE_GPERF _input _output _func _opts)
     ADD_CUSTOM_COMMAND(
-        OUTPUT ${_output}
-        MAIN_DEPENDENCY ${_input}
-        COMMAND ${GPERF_EXECUTABLE} -CDEGIot -L ANSI-C --key-positions=* -s 2 -N ${_func} ${_opts} < ${_input} > ${_output}
+        OUTPUT ${DERIVED_SOURCES_DIR}/${_name}.cpp ${_hash_tools_h}
+        MAIN_DEPENDENCY ${_source}.gperf 
+        COMMAND ${PERL_EXECUTABLE} ${WEBCORE_DIR}/make-hash-tools.pl ${DERIVED_SOURCES_DIR} ${_source}.gperf
         VERBATIM)
-ENDMACRO ()
 
+    UNSET(_name)
+    UNSET(_hash_tools_h)
+ENDMACRO()
 
 MACRO (WEBKIT_WRAP_SOURCELIST _input)
     IF (WTF_PLATFORM_QT)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list