Title: [155246] trunk
Revision
155246
Author
[email protected]
Date
2013-09-06 23:25:14 -0700 (Fri, 06 Sep 2013)

Log Message

REGRESSION(r155143): Build failures on GTK port with Clang and libstdc++ < 4.8.1
https://bugs.webkit.org/show_bug.cgi?id=120896

Reviewed by Anders Carlsson.

The GTK port currently only permits using the libstdc++ standard library when compiling with
Clang. After r155143, build failures are occurring when using Clang and libstdc++ that predates
the 4.8.0 release due to the use of std::is_trivially_destructible that isn't available in
libstdc++ < 4.8.0.

To not add additional special casing, the GTK port should move onto requiring libstdc++ >= 4.8.1
when compiling with the Clang compiler. Version 4.8.1 was chosen since it's C++11 feature-complete.
This strict requirement is possible as compiling the GTK port with the Clang compiler is not really
widespread, so we can afford to adjust the required dependencies to match other ports' progression
instead of modifying the code.

* Source/autotools/CheckSystemAndBasicDependencies.m4: If the detected compiler is Clang, also check
that the libstdc++ standard library is used by testing for the __GLIBCXX__ macro that should be defined
to the value lesser than the '20130531', the date stamp used by the 4.8.1 release of libstdc++. Since
possible future releases of the 4.6 or 4.7 series of libstdc++ will also match this check due to a newer
date stamp contained in __GLIBCXX__, the std::is_trivially_destructible struct is also used so the
compilation will fail if the libstdc++ that's used is older than allowed (and therefor does not support
the feature). If the check fails, a fatal error is thrown, describing the requirement. Everything carries
on as normal otherwise.

Modified Paths

Diff

Modified: trunk/ChangeLog (155245 => 155246)


--- trunk/ChangeLog	2013-09-07 06:13:27 UTC (rev 155245)
+++ trunk/ChangeLog	2013-09-07 06:25:14 UTC (rev 155246)
@@ -1,5 +1,32 @@
 2013-09-06  Zan Dobersek  <[email protected]>
 
+        REGRESSION(r155143): Build failures on GTK port with Clang and libstdc++ < 4.8.1
+        https://bugs.webkit.org/show_bug.cgi?id=120896
+
+        Reviewed by Anders Carlsson.
+
+        The GTK port currently only permits using the libstdc++ standard library when compiling with
+        Clang. After r155143, build failures are occurring when using Clang and libstdc++ that predates
+        the 4.8.0 release due to the use of std::is_trivially_destructible that isn't available in
+        libstdc++ < 4.8.0.
+
+        To not add additional special casing, the GTK port should move onto requiring libstdc++ >= 4.8.1
+        when compiling with the Clang compiler. Version 4.8.1 was chosen since it's C++11 feature-complete.
+        This strict requirement is possible as compiling the GTK port with the Clang compiler is not really
+        widespread, so we can afford to adjust the required dependencies to match other ports' progression
+        instead of modifying the code.
+
+        * Source/autotools/CheckSystemAndBasicDependencies.m4: If the detected compiler is Clang, also check
+        that the libstdc++ standard library is used by testing for the __GLIBCXX__ macro that should be defined
+        to the value lesser than the '20130531', the date stamp used by the 4.8.1 release of libstdc++. Since
+        possible future releases of the 4.6 or 4.7 series of libstdc++ will also match this check due to a newer
+        date stamp contained in __GLIBCXX__, the std::is_trivially_destructible struct is also used so the
+        compilation will fail if the libstdc++ that's used is older than allowed (and therefor does not support
+        the feature). If the check fails, a fatal error is thrown, describing the requirement. Everything carries
+        on as normal otherwise.
+
+2013-09-06  Zan Dobersek  <[email protected]>
+
         [GTK] Bump the required Clang version to 3.2
         https://bugs.webkit.org/show_bug.cgi?id=112537
 

Modified: trunk/Source/autotools/CheckSystemAndBasicDependencies.m4 (155245 => 155246)


--- trunk/Source/autotools/CheckSystemAndBasicDependencies.m4	2013-09-07 06:13:27 UTC (rev 155245)
+++ trunk/Source/autotools/CheckSystemAndBasicDependencies.m4	2013-09-07 06:25:14 UTC (rev 155246)
@@ -114,6 +114,20 @@
 
 if test "$cxx_compiler" = "unknown"; then
     AC_MSG_ERROR([Compiler GCC >= 4.7 or Clang >= 3.2 is required for C++ compilation])
+elif test "$cxx_compiler" = "clang++"; then
+    OLD_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="-std=c++11"
+    AC_LANG_PUSH([C++])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <type_traits>
+#if defined(__GLIBCXX__) && __GLIBCXX__ >= 20130531
+bool libstdcxxTest = std::is_trivially_destructible<bool>::value;
+#else
+#error libstdc++ >= 4.8.1 is required
+#endif
+])], [], [AC_MSG_ERROR([libstdc++ >= 4.8.1 is required as the standard library used with the Clang compiler.])])
+    AC_LANG_POP([C++])
+    CXXFLAGS="$OLD_CXXFLAGS"
 fi
 
 # C/C++ Language Features
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to