Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (96880 => 96881)
--- trunk/Source/_javascript_Core/ChangeLog 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-10-07 00:34:05 UTC (rev 96881)
@@ -1,5 +1,27 @@
2011-10-06 Anders Carlsson <ander...@apple.com>
+ When building with clang, enable -Wglobal-constructors and -Wexit-time-destructors
+ https://bugs.webkit.org/show_bug.cgi?id=69586
+
+ Reviewed by Darin Adler.
+
+ * Configurations/Base.xcconfig:
+ Add -Wglobal-constructors and -Wexit-time-destructors when building with clang.
+
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ When building with clang, we don't need to run the check-for-global-initializers and
+ check-for-exit-time-destructors anymore.
+
+ * jsc.cpp:
+ (runInteractive):
+ Move interpreterName into runInteractive.
+
+ * wtf/StdLibExtras.h:
+ When building with clang, disable the -Wglobal-constructors and -Wexit-time-destructors
+ warnings around the variable declaration.
+
+2011-10-06 Anders Carlsson <ander...@apple.com>
+
Add DEFINE_DEBUG_ONLY_GLOBAL for globals that should be defined in debug builds
https://bugs.webkit.org/show_bug.cgi?id=69584
Modified: trunk/Source/_javascript_Core/Configurations/Base.xcconfig (96880 => 96881)
--- trunk/Source/_javascript_Core/Configurations/Base.xcconfig 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/_javascript_Core/Configurations/Base.xcconfig 2011-10-07 00:34:05 UTC (rev 96881)
@@ -23,6 +23,9 @@
#include "CompilerVersion.xcconfig"
+COMPILER_SPECIFIC_WARNING_CFLAGS = $(COMPILER_SPECIFIC_WARNING_CFLAGS_$(TARGET_GCC_VERSION));
+COMPILER_SPECIFIC_WARNING_CFLAGS_LLVM_COMPILER = -Wglobal-constructors -Wexit-time-destructors;
+
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DEBUGGING_SYMBOLS = default;
@@ -57,7 +60,7 @@
VALID_ARCHS_iphonesimulator = $(ARCHS_STANDARD_32_BIT);
VALID_ARCHS_macosx = i386 ppc x86_64 ppc64 $(ARCHS_UNIVERSAL_IPHONE_OS);
WARNING_CFLAGS_BASE = -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;
-WARNING_CFLAGS = $(WARNING_CFLAGS_$(REAL_PLATFORM_NAME));
+WARNING_CFLAGS = $(WARNING_CFLAGS_$(REAL_PLATFORM_NAME)) $(COMPILER_SPECIFIC_WARNING_CFLAGS);
WARNING_CFLAGS_iphoneos = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
WARNING_CFLAGS_iphonesimulator = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
WARNING_CFLAGS_macosx = $(WARNING_CFLAGS_macosx_$(CURRENT_ARCH));
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (96880 => 96881)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2011-10-07 00:34:05 UTC (rev 96881)
@@ -3138,7 +3138,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
+ shellScript = "if [ \"${TARGET_GCC_VERSION}\" = \"LLVM_COMPILER\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
};
933457200EBFDC3F00B80894 /* Check For Exit Time Destructors */ = {
isa = PBXShellScriptBuildPhase;
@@ -3153,7 +3153,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ -f ../../Tools/Scripts/check-for-exit-time-destructors ]; then\n ../../Tools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
+ shellScript = "if [ \"${TARGET_GCC_VERSION}\" = \"LLVM_COMPILER\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-exit-time-destructors ]; then\n ../../Tools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
};
/* End PBXShellScriptBuildPhase section */
Modified: trunk/Source/_javascript_Core/jsc.cpp (96880 => 96881)
--- trunk/Source/_javascript_Core/jsc.cpp 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/_javascript_Core/jsc.cpp 2011-10-07 00:34:05 UTC (rev 96881)
@@ -115,7 +115,6 @@
};
static const char interactivePrompt[] = "> ";
-static const UString interpreterName("Interpreter");
class StopWatch {
public:
@@ -479,6 +478,8 @@
static void runInteractive(GlobalObject* globalObject)
{
+ UString interpreterName("Interpreter");
+
while (true) {
#if HAVE(READLINE) && !RUNNING_FROM_XCODE
char* line = readline(interactivePrompt);
Modified: trunk/Source/_javascript_Core/wtf/StdLibExtras.h (96880 => 96881)
--- trunk/Source/_javascript_Core/wtf/StdLibExtras.h 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/_javascript_Core/wtf/StdLibExtras.h 2011-10-07 00:34:05 UTC (rev 96881)
@@ -44,10 +44,20 @@
#endif
// Use this macro to declare and define a debug-only global variable that may have a
-// non-trivial constructor and destructor.
+// non-trivial constructor and destructor. When building with clang, this will suppress
+// warnings about global constructors and exit-time destructors.
#ifndef NDEBUG
+#if COMPILER(CLANG)
#define DEFINE_DEBUG_ONLY_GLOBAL(type, name, arguments) \
+ _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") \
+ _Pragma("clang diagnostic ignored \"-Wexit-time-destructors\"") \
+ static type name arguments; \
+ _Pragma("clang diagnostic pop")
+#else
+#define DEFINE_DEBUG_ONLY_GLOBAL(type, name, arguments) \
static type name arguments;
+#endif // COMPILER(CLANG)
#else
#define DEFINE_DEBUG_ONLY_GLOBAL(type, name, arguments)
#endif // NDEBUG
Modified: trunk/Source/_javascript_Glue/ChangeLog (96880 => 96881)
--- trunk/Source/_javascript_Glue/ChangeLog 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/_javascript_Glue/ChangeLog 2011-10-07 00:34:05 UTC (rev 96881)
@@ -1,3 +1,17 @@
+2011-10-06 Anders Carlsson <ander...@apple.com>
+
+ When building with clang, enable -Wglobal-constructors and -Wexit-time-destructors
+ https://bugs.webkit.org/show_bug.cgi?id=69586
+
+ Reviewed by Darin Adler.
+
+ * Configurations/Base.xcconfig:
+ Add -Wglobal-constructors and -Wexit-time-destructors when building with clang.
+
+ * _javascript_Glue.xcodeproj/project.pbxproj:
+ When building with clang, we don't need to run the check-for-global-initializers and
+ check-for-exit-time-destructors anymore.
+
2011-10-05 Gavin Barraclough <barraclo...@apple.com>
Add explicit JSGlobalThis type.
Modified: trunk/Source/_javascript_Glue/Configurations/Base.xcconfig (96880 => 96881)
--- trunk/Source/_javascript_Glue/Configurations/Base.xcconfig 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/_javascript_Glue/Configurations/Base.xcconfig 2011-10-07 00:34:05 UTC (rev 96881)
@@ -23,6 +23,9 @@
#include "CompilerVersion.xcconfig"
+COMPILER_SPECIFIC_WARNING_CFLAGS = $(COMPILER_SPECIFIC_WARNING_CFLAGS_$(TARGET_GCC_VERSION));
+COMPILER_SPECIFIC_WARNING_CFLAGS_LLVM_COMPILER = -Wglobal-constructors -Wexit-time-destructors;
+
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -48,7 +51,7 @@
LINKER_DISPLAYS_MANGLED_NAMES = YES;
PREBINDING = NO;
VALID_ARCHS = i386 ppc x86_64 ppc64;
-WARNING_CFLAGS = $(WARNING_CFLAGS_$(CURRENT_ARCH));
+WARNING_CFLAGS = $(WARNING_CFLAGS_$(CURRENT_ARCH)) $(COMPILER_SPECIFIC_WARNING_CFLAGS);
WARNING_CFLAGS_BASE = -Wall -W -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wundef -Wno-strict-aliasing;
WARNING_CFLAGS_ = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
WARNING_CFLAGS_i386 = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
Modified: trunk/Source/_javascript_Glue/_javascript_Glue.xcodeproj/project.pbxproj (96880 => 96881)
--- trunk/Source/_javascript_Glue/_javascript_Glue.xcodeproj/project.pbxproj 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/_javascript_Glue/_javascript_Glue.xcodeproj/project.pbxproj 2011-10-07 00:34:05 UTC (rev 96881)
@@ -377,7 +377,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
+ shellScript = "if [ \"${TARGET_GCC_VERSION}\" = \"LLVM_COMPILER\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
};
/* End PBXShellScriptBuildPhase section */
Modified: trunk/Source/WebCore/ChangeLog (96880 => 96881)
--- trunk/Source/WebCore/ChangeLog 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebCore/ChangeLog 2011-10-07 00:34:05 UTC (rev 96881)
@@ -1,5 +1,25 @@
2011-10-06 Anders Carlsson <ander...@apple.com>
+ When building with clang, enable -Wglobal-constructors and -Wexit-time-destructors
+ https://bugs.webkit.org/show_bug.cgi?id=69586
+
+ Reviewed by Darin Adler.
+
+ * Configurations/Base.xcconfig:
+ Add -Wglobal-constructors and -Wexit-time-destructors when building with clang.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ When building with clang, we don't need to run the check-for-global-initializers and
+ check-for-exit-time-destructors anymore.
+
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (gaussianKernelFactor):
+ (WebCore::FEGaussianBlur::calculateKernelSize):
+ (WebCore::FEGaussianBlur::calculateStdDeviation):
+ Change the gaussian kernel factor global to be an inline function instead.
+
+2011-10-06 Anders Carlsson <ander...@apple.com>
+
Add DEFINE_DEBUG_ONLY_GLOBAL for globals that should be defined in debug builds
https://bugs.webkit.org/show_bug.cgi?id=69584
Modified: trunk/Source/WebCore/Configurations/Base.xcconfig (96880 => 96881)
--- trunk/Source/WebCore/Configurations/Base.xcconfig 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebCore/Configurations/Base.xcconfig 2011-10-07 00:34:05 UTC (rev 96881)
@@ -23,6 +23,9 @@
#include "CompilerVersion.xcconfig"
+COMPILER_SPECIFIC_WARNING_CFLAGS = $(COMPILER_SPECIFIC_WARNING_CFLAGS_$(TARGET_GCC_VERSION));
+COMPILER_SPECIFIC_WARNING_CFLAGS_LLVM_COMPILER = -Wglobal-constructors -Wexit-time-destructors;
+
CLANG_WARN_CXX0X_EXTENSIONS = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -55,7 +58,7 @@
VALID_ARCHS_iphonesimulator = $(ARCHS_STANDARD_32_BIT);
VALID_ARCHS_macosx = i386 ppc x86_64 ppc64;
WARNING_CFLAGS_BASE = -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;
-WARNING_CFLAGS = $(WARNING_CFLAGS_$(REAL_PLATFORM_NAME));
+WARNING_CFLAGS = $(WARNING_CFLAGS_$(REAL_PLATFORM_NAME)) $(COMPILER_SPECIFIC_WARNING_CFLAGS);
WARNING_CFLAGS_iphoneos = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
WARNING_CFLAGS_iphonesimulator = $(WARNING_CFLAGS_BASE) -Wshorten-64-to-32;
WARNING_CFLAGS_macosx = $(WARNING_CFLAGS_macosx_$(CURRENT_ARCH));
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (96880 => 96881)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2011-10-07 00:34:05 UTC (rev 96881)
@@ -24858,7 +24858,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-exit-time-destructors ]; then\n ../../Tools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
+ shellScript = "if [ \"${TARGET_GCC_VERSION}\" = \"LLVM_COMPILER\" ]; then\n exit 0;\nfi\n\nif [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-exit-time-destructors ]; then\n ../../Tools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
};
939D050109D9FF6B00984996 /* Check For Global Initializers */ = {
isa = PBXShellScriptBuildPhase;
@@ -24873,7 +24873,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
+ shellScript = "if [ \"${TARGET_GCC_VERSION}\" = \"LLVM_COMPILER\" ]; then\n exit 0;\nfi\n\nif [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
};
DD041FBD09D9DDBE0010AF2A /* Generate Derived Sources */ = {
isa = PBXShellScriptBuildPhase;
Modified: trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp (96880 => 96881)
--- trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp 2011-10-07 00:34:05 UTC (rev 96881)
@@ -39,7 +39,11 @@
using std::max;
-static const float gGaussianKernelFactor = 3 / 4.f * sqrtf(2 * piFloat);
+static inline float gaussianKernelFactor()
+{
+ return 3 / 4.f * sqrtf(2 * piFloat);
+}
+
static const unsigned gMaxKernelSize = 1000;
namespace WebCore {
@@ -230,10 +234,10 @@
kernelSizeX = 0;
if (stdX)
- kernelSizeX = max<unsigned>(2, static_cast<unsigned>(floorf(stdX * gGaussianKernelFactor + 0.5f)));
+ kernelSizeX = max<unsigned>(2, static_cast<unsigned>(floorf(stdX * gaussianKernelFactor() + 0.5f)));
kernelSizeY = 0;
if (stdY)
- kernelSizeY = max<unsigned>(2, static_cast<unsigned>(floorf(stdY * gGaussianKernelFactor + 0.5f)));
+ kernelSizeY = max<unsigned>(2, static_cast<unsigned>(floorf(stdY * gaussianKernelFactor() + 0.5f)));
// Limit the kernel size to 1000. A bigger radius won't make a big difference for the result image but
// inflates the absolute paint rect to much. This is compatible with Firefox' behavior.
@@ -307,7 +311,7 @@
float FEGaussianBlur::calculateStdDeviation(float radius)
{
// Blur radius represents 2/3 times the kernel size, the dest pixel is half of the radius applied 3 times
- return max((radius * 2 / 3.f - 0.5f) / gGaussianKernelFactor, 0.f);
+ return max((radius * 2 / 3.f - 0.5f) / gaussianKernelFactor(), 0.f);
}
} // namespace WebCore
Modified: trunk/Source/WebKit/ChangeLog (96880 => 96881)
--- trunk/Source/WebKit/ChangeLog 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebKit/ChangeLog 2011-10-07 00:34:05 UTC (rev 96881)
@@ -1,3 +1,14 @@
+2011-10-06 Anders Carlsson <ander...@apple.com>
+
+ When building with clang, enable -Wglobal-constructors and -Wexit-time-destructors
+ https://bugs.webkit.org/show_bug.cgi?id=69586
+
+ Reviewed by Darin Adler.
+
+ * WebKit.xcodeproj/project.pbxproj:
+ When building with clang, we don't need to run the check-for-global-initializers and
+ check-for-exit-time-destructors anymore.
+
2011-09-27 Andy Estes <aes...@apple.com>
WebKitLinkedOnOrAfter() check is ineffective for Solar Walk app-specific hack.
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (96880 => 96881)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2011-10-07 00:34:05 UTC (rev 96881)
@@ -1813,7 +1813,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-exit-time-destructors ]; then\n ../../Tools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
+ shellScript = "if [ \"${TARGET_GCC_VERSION}\" = \"LLVM_COMPILER\" ]; then\n exit 0;\nfi\n\nif [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-exit-time-destructors ]; then\n ../../Tools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
};
939811300824BF01008DF038 /* Make Frameworks Symbolic Link */ = {
isa = PBXShellScriptBuildPhase;
@@ -1844,7 +1844,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
+ shellScript = "if [ \"${TARGET_GCC_VERSION}\" = \"LLVM_COMPILER\" ]; then\n exit 0;\nfi\n\nif [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
};
/* End PBXShellScriptBuildPhase section */
Modified: trunk/Source/WebKit/mac/ChangeLog (96880 => 96881)
--- trunk/Source/WebKit/mac/ChangeLog 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebKit/mac/ChangeLog 2011-10-07 00:34:05 UTC (rev 96881)
@@ -1,5 +1,15 @@
2011-10-06 Anders Carlsson <ander...@apple.com>
+ When building with clang, enable -Wglobal-constructors and -Wexit-time-destructors
+ https://bugs.webkit.org/show_bug.cgi?id=69586
+
+ Reviewed by Darin Adler.
+
+ * Configurations/Base.xcconfig:
+ Add -Wglobal-constructors and -Wexit-time-destructors when building with clang.
+
+2011-10-06 Anders Carlsson <ander...@apple.com>
+
Add DEFINE_DEBUG_ONLY_GLOBAL for globals that should be defined in debug builds
https://bugs.webkit.org/show_bug.cgi?id=69584
Modified: trunk/Source/WebKit/mac/Configurations/Base.xcconfig (96880 => 96881)
--- trunk/Source/WebKit/mac/Configurations/Base.xcconfig 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebKit/mac/Configurations/Base.xcconfig 2011-10-07 00:34:05 UTC (rev 96881)
@@ -23,6 +23,9 @@
#include "CompilerVersion.xcconfig"
+COMPILER_SPECIFIC_WARNING_CFLAGS = $(COMPILER_SPECIFIC_WARNING_CFLAGS_$(TARGET_GCC_VERSION));
+COMPILER_SPECIFIC_WARNING_CFLAGS_LLVM_COMPILER = -Wglobal-constructors -Wexit-time-destructors;
+
CLANG_WARN_CXX0X_EXTENSIONS = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -57,7 +60,7 @@
VALID_ARCHS_macosx = i386 ppc x86_64 ppc64;
// FIXME: <rdar://problem/5070292> WebKit should build with -Wshorten-64-to-32
WARNING_CFLAGS_BASE = -Wall -Wextra -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings;
-WARNING_CFLAGS = $(WARNING_CFLAGS_$(REAL_PLATFORM_NAME));
+WARNING_CFLAGS = $(WARNING_CFLAGS_$(REAL_PLATFORM_NAME)) $(COMPILER_SPECIFIC_WARNING_CFLAGS);
WARNING_CFLAGS_iphoneos = $(WARNING_CFLAGS_BASE);
WARNING_CFLAGS_iphonesimulator = $(WARNING_CFLAGS_BASE);
WARNING_CFLAGS_macosx = $(WARNING_CFLAGS_BASE);
Modified: trunk/Source/WebKit2/ChangeLog (96880 => 96881)
--- trunk/Source/WebKit2/ChangeLog 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebKit2/ChangeLog 2011-10-07 00:34:05 UTC (rev 96881)
@@ -1,5 +1,19 @@
2011-10-06 Anders Carlsson <ander...@apple.com>
+ When building with clang, enable -Wglobal-constructors and -Wexit-time-destructors
+ https://bugs.webkit.org/show_bug.cgi?id=69586
+
+ Reviewed by Darin Adler.
+
+ * Configurations/Base.xcconfig:
+ Add -Wglobal-constructors and -Wexit-time-destructors when building with clang.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ When building with clang, we don't need to run the check-for-global-initializers and
+ check-for-exit-time-destructors anymore.
+
+2011-10-06 Anders Carlsson <ander...@apple.com>
+
Add DEFINE_DEBUG_ONLY_GLOBAL for globals that should be defined in debug builds
https://bugs.webkit.org/show_bug.cgi?id=69584
Modified: trunk/Source/WebKit2/Configurations/Base.xcconfig (96880 => 96881)
--- trunk/Source/WebKit2/Configurations/Base.xcconfig 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebKit2/Configurations/Base.xcconfig 2011-10-07 00:34:05 UTC (rev 96881)
@@ -23,6 +23,9 @@
#include "CompilerVersion.xcconfig"
+COMPILER_SPECIFIC_WARNING_CFLAGS = $(COMPILER_SPECIFIC_WARNING_CFLAGS_$(TARGET_GCC_VERSION));
+COMPILER_SPECIFIC_WARNING_CFLAGS_LLVM_COMPILER = -Wglobal-constructors -Wexit-time-destructors;
+
CLANG_WARN_CXX0X_EXTENSIONS = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -52,7 +55,7 @@
PREBINDING = NO;
VALID_ARCHS = i386 x86_64;
// FIXME: <rdar://problem/5070292> WebKit should build with -Wshorten-64-to-32
-WARNING_CFLAGS = -Wall -Wextra -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings;
+WARNING_CFLAGS = -Wall -Wextra -Wchar-subscripts -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings $(COMPILER_SPECIFIC_WARNING_CFLAGS);
// Prevent C++ standard library operator new, delete and their related exception types from being exported as weak symbols.
OTHER_LDFLAGS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv;
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (96880 => 96881)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2011-10-07 00:20:23 UTC (rev 96880)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2011-10-07 00:34:05 UTC (rev 96881)
@@ -4073,7 +4073,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
+ shellScript = "if [ \"${TARGET_GCC_VERSION}\" = \"LLVM_COMPILER\" ]; then\n exit 0;\nfi\n\nif [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-global-initializers ]; then\n ../../Tools/Scripts/check-for-global-initializers || exit $?\nfi";
};
5DF408C4131DD3DB00130071 /* Check For Exit Time Destructors */ = {
isa = PBXShellScriptBuildPhase;
@@ -4088,7 +4088,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-exit-time-destructors ]; then\n ../../Tools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
+ shellScript = "if [ \"${TARGET_GCC_VERSION}\" = \"LLVM_COMPILER\" ]; then\n exit 0;\nfi\n\nif [ \"${ACTION}\" = \"installhdrs\" ]; then\n exit 0;\nfi\n\nif [ -f ../../Tools/Scripts/check-for-exit-time-destructors ]; then\n ../../Tools/Scripts/check-for-exit-time-destructors || exit $?\nfi";
};
5DF408C5131DD46700130071 /* Check For Weak VTables and Externals */ = {
isa = PBXShellScriptBuildPhase;