[Libreoffice-commits] core.git: 2 commits - configure.ac include/unoidl README.md svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 4 16:01:32 UTC 2018


 README.md                                                     |    6 
 configure.ac                                                  |   67 ++++++----
 include/unoidl/unoidl.hxx                                     |    4 
 svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx |    3 
 4 files changed, 43 insertions(+), 37 deletions(-)

New commits:
commit 685aca47da835e80f34b295c5d6389df03d1a8c2
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Nov 23 19:04:07 2018 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Dec 4 17:01:13 2018 +0100

    Bump (Linux) Clang baseline to 5.0.2
    
    ...as discussed at
    <https://lists.freedesktop.org/archives/libreoffice/2018-November/081435.html>
    "minutes of ESC call ...".
    
    This no longer sets CLANGVER, CLANG_VERSION, and CLANG_FULL_VERSION when using
    Apple Clang (on macOS), which uses different version numbers from upstream
    anyway.  But those variables are only used in the context of compiler plugins,
    which do not work with Apple Clang anyway (which lacks necessary include files).
    
    (Also, move "AC_SUBST(COM_IS_CLANG)" up to where it belongs.)
    
    Change-Id: Iee37c42ecacf52fa5a07e35241bcd404025e1cdf
    Reviewed-on: https://gerrit.libreoffice.org/63899
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/README.md b/README.md
index 45abb593bf9d..d72e9549c4fa 100644
--- a/README.md
+++ b/README.md
@@ -40,15 +40,11 @@ run and compile LibreOffice, also used by the TDF builds:
     * Build: 10.13.2 + Xcode 9.3
 * Linux:
     * Runtime: RHEL 6 or CentOS 6
-    * Build: GCC 4.8.1 or Clang
+    * Build: either GCC 4.8.1; or Clang 5.0.2 with libstdc++ 7.3.0
 * iOS (only for LibreOfficeKit):
     * Runtime: 11.4 (only support for newer i devices == 64 bit)
     * Build: Xcode 9.3 and iPhone SDK 11.4
 
-At least Clang 3.4.2 is known to be too old to pass the configure.ac check "whether $CXX supports
-C++17, C++14, or C++11" in its current form (due to the #pragma GCC diagnostic ignored "-Wpragmas"
-that it does not understand).
-
 If you want to use Clang with the LibreOffice compiler plugins, the minimal
 version of Clang is 5.0.2. Since Xcode doesn't provide the compiler plugin
 headers, you have to compile your own Clang to use them on macOS.
diff --git a/configure.ac b/configure.ac
index 947fc3920782..cb54af0e828f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3639,37 +3639,52 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
     [AC_MSG_RESULT([yes])
      COM_IS_CLANG=TRUE],
     [AC_MSG_RESULT([no])])
+AC_SUBST(COM_IS_CLANG)
 
 CC_PLAIN=$CC
+CLANGVER=
 if test "$COM_IS_CLANG" = TRUE; then
-    AC_MSG_CHECKING([the Clang version])
-    if test "$_os" = WINNT; then
-        dnl In which case, assume clang-cl:
-        my_args="/EP /TC"
-        dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
-        dnl clang-cl:
-        CC_PLAIN=
-        for i in $CC; do
-            case $i in
-            -FIIntrin.h)
-                ;;
-            *)
-                CC_PLAIN="$CC_PLAIN $i"
-                ;;
-            esac
-        done
-    else
-        my_args="-E -P"
+    AC_MSG_CHECKING([whether Clang is new enough])
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+        #if !defined __apple_build_version__
+        #error
+        #endif
+        ]])],
+        [my_apple_clang=yes],[my_apple_clang=])
+    if test "$my_apple_clang" = yes; then
+        AC_MSG_RESULT([assumed yes (Apple Clang)])
+    else
+        if test "$_os" = WINNT; then
+            dnl In which case, assume clang-cl:
+            my_args="/EP /TC"
+            dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
+            dnl clang-cl:
+            CC_PLAIN=
+            for i in $CC; do
+                case $i in
+                -FIIntrin.h)
+                    ;;
+                *)
+                    CC_PLAIN="$CC_PLAIN $i"
+                    ;;
+                esac
+            done
+        else
+            my_args="-E -P"
+        fi
+        clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args -`
+        CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
+        CLANGVER=`echo $clang_version \
+            | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
+        if test "$CLANGVER" -ge 50002; then
+            AC_MSG_RESULT([yes ($clang_version)])
+        else
+            AC_MSG_ERROR(["$CLANG_FULL_VERSION" is too old or unrecognized, must be at least Clang 5.0.2])
+        fi
+        AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
+        AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
     fi
-    clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args -`
-    CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
-    CLANGVER=`echo $clang_version \
-        | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
-    AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
-    AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
-    AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
 fi
-AC_SUBST(COM_IS_CLANG)
 
 SHOWINCLUDES_PREFIX=
 if test "$_os" = WINNT; then
commit 60610d4f5d9fc7f04e3bf458f603395ab6b272a7
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Nov 23 18:59:22 2018 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Dec 4 17:01:05 2018 +0100

    Remove obsolete CLANG_VERSION checks
    
    ...now that the (Linux) Clang baseline has been bumped ot 5.0.2 (see
    <https://lists.freedesktop.org/archives/libreoffice/2018-November/081435.html>
    "minutes of ESC call ...").
    
    (This commit precedes a commit that will actually enforce Clang >= 5.0.2 in
    configure.ac.  However, it was easier to do it in this order, as that other
    commit will drop CLANG_VERSION when building with Apple Clang (where version
    numbers are different from upstream), so these checks would start to fail
    there.)
    
    Change-Id: Icb3df0d0cf476e14c5453f02bdfc9e5bed066ca1
    Reviewed-on: https://gerrit.libreoffice.org/63898
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/unoidl/unoidl.hxx b/include/unoidl/unoidl.hxx
index 89a7dd593863..27f2071fc4b1 100644
--- a/include/unoidl/unoidl.hxx
+++ b/include/unoidl/unoidl.hxx
@@ -15,7 +15,6 @@
 #include <cassert>
 #include <vector>
 
-#include <config_clang.h>
 #include <osl/mutex.hxx>
 #include <rtl/ref.hxx>
 #include <rtl/ustring.hxx>
@@ -506,9 +505,6 @@ public:
         };
 
         Constructor():
-#if defined __clang__ && CLANG_VERSION == 30800
-            annotations(),
-#endif
             defaultConstructor(true) {}
 
         Constructor(
diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
index 61d2be064b0b..ee38c9d9d16b 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx
@@ -19,7 +19,6 @@
 
 #include <sal/config.h>
 
-#include <config_clang.h>
 #include <svx/EnhancedCustomShape2d.hxx>
 #include <rtl/ustring.hxx>
 #include <sal/log.hxx>
@@ -466,7 +465,7 @@ public:
         mpSecondArg( rSecondArg )
     {
     }
-#if (defined(__clang__) && CLANG_VERSION >=30700) || (defined (__GNUC__) && __GNUC__ >= 8)
+#if defined(__clang__) || (defined (__GNUC__) && __GNUC__ >= 8)
     //GetEquationValueAsDouble calls isFinite on the result
     __attribute__((no_sanitize("float-divide-by-zero")))
 #endif


More information about the Libreoffice-commits mailing list