[Libreoffice-commits] core.git: bin/check-elf-dynamic-objects config_host/config_global.h.in configure.ac odk/CustomTarget_check.mk odk/Module_odk.mk odk/Package_lib.mk Repository.mk sal/cpprt sal/Module_sal.mk sal/StaticLibrary_salcpprt.mk

Stephan Bergmann sbergman at redhat.com
Mon Dec 12 09:17:14 UTC 2016


 Repository.mk                      |    1 
 bin/check-elf-dynamic-objects      |    5 
 config_host/config_global.h.in     |    1 
 configure.ac                       |   39 ------
 odk/CustomTarget_check.mk          |    1 
 odk/Module_odk.mk                  |    1 
 odk/Package_lib.mk                 |   18 --
 sal/Module_sal.mk                  |    1 
 sal/StaticLibrary_salcpprt.mk      |   17 --
 sal/cpprt/operators_new_delete.cxx |  232 -------------------------------------
 10 files changed, 316 deletions(-)

New commits:
commit cfd2691e5bf398304d7816227b933e53907b6204
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 9 21:42:04 2016 +0100

    [API CHANGE] Remove salcpprt static library
    
    ...containing replacements for global operator new/delete (that can be linked
    into executables), but which is no longer used.  The mail thread starting at
    <https://lists.freedesktop.org/archives/libreoffice/2012-March/028690.html>
    "operator new no longer routes through rtl_AllocMemory in libsalcpprt under
    gbuild link rules" has the details of how this was used on some platforms (but
    not on others) before the switch to gbuild, and has been "lost" ever since---but
    apparently a loss not mourned much over the years.
    
    For the SDK, c5f974287fd04bb529de145113133b9e35687702 "INTEGRATION: CWS jsc3:
    #i62434# copy libsalcpprt.a" added the library (under Linux) and
    6db9c5af960f9787e33e4addc56bddbb1695a402 "INTEGRATION: CWS jsc3: #i62434# extend
    link options for executbales to link libsalcpprt.a, LINUX only" added its use to
    odk/settings/settings.mk, but fc0ca57f2cd649c6330171445a06b80e2143a0e9
    "INTEGRATION: CWS jsc21" removed that use again (for no documented reason).  So
    this is an incompatible change, but unlikely to actually affect any users of the
    SDK.
    
    Change-Id: Ia38b4c439f21fca3f5d9af7d1a34054e992054e9
    Reviewed-on: https://gerrit.libreoffice.org/31810
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/Repository.mk b/Repository.mk
index 245befa..5f2654b 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -829,7 +829,6 @@ $(eval $(call gb_Helper_register_packages_for_install,sdk,\
 	odk_examples \
 	odk_headers \
 	odk_html \
-	odk_lib \
 	odk_settings \
 	odk_settings_generated \
 	offapi_idl \
diff --git a/bin/check-elf-dynamic-objects b/bin/check-elf-dynamic-objects
index f05d513..d22bc49 100755
--- a/bin/check-elf-dynamic-objects
+++ b/bin/check-elf-dynamic-objects
@@ -84,11 +84,6 @@ local file="$1"
             # skip the majority of files, no ELF binaries here
             skip=1
         ;;
-        */libsalcpprt.a)
-            # strangely readelf -d "succeeds" on a static library so
-            # have to filter it manually
-            skip=1
-        ;;
         */libcairocanvaslo.so)
             whitelist="${whitelist} libcairo.so.2"
         ;;
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
index e70cd5a..1e68f4a 100644
--- a/config_host/config_global.h.in
+++ b/config_host/config_global.h.in
@@ -16,7 +16,6 @@ Any change in this header will cause a rebuild of almost everything.
 #define HAVE_CXX14_CONSTEXPR 0
 #define HAVE_CXX11_REF_QUALIFIER 0
 #define HAVE_CXX11_UTF16_STRING_LITERAL 0
-#define HAVE_CXX14_SIZED_DEALLOCATION 0
 #define HAVE_GCC_BUILTIN_ATOMIC 0
 /* _Pragma */
 #define HAVE_GCC_PRAGMA_OPERATOR 0
diff --git a/configure.ac b/configure.ac
index 2cf3ebf..4a0dac7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6394,45 +6394,6 @@ if test "$cxx11_utf16_string_literal" = yes; then
     AC_DEFINE([HAVE_CXX11_UTF16_STRING_LITERAL])
 fi
 
-AC_MSG_CHECKING([whether $CXX supports C++14 sized deallocation])
-dnl At least Clang -fsanitize=address causes "multiple definition of
-dnl `operator delete(void*, unsigned long)'" also defined in
-dnl projects/compiler-rt/lib/asan/asan_new_delete.cc:
-save_CXX=$CXX
-if test "$COM_IS_CLANG" = TRUE; then
-    my_CXX=
-    for i in $CXX; do
-        case $i in
-        -fsanitize=address)
-            ;;
-        *)
-            my_CXX="$my_CXX $i"
-            ;;
-        esac
-    done
-    CXX=$my_CXX
-fi
-save_CXXFLAGS=$CXXFLAGS
-CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
-AC_LANG_PUSH([C++])
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-    #include <cstddef>
-    #include <cstdlib>
-    void operator delete(void *) throw () { std::exit(1); }
-    void operator delete(void *, std::size_t) throw () { std::exit(0); }
-    struct S { S() { throw 0; } };
-    ]],[[
-    try { new S; } catch (...) {}
-    return 1;
-    ]])], [cxx14_sized_deallocation=yes], [cxx14_sized_deallocation=no], [cxx14_sized_deallocation=no])
-AC_LANG_POP([C++])
-CXX=$save_CXX
-CXXFLAGS=$save_CXXFLAGS
-AC_MSG_RESULT([$cxx14_sized_deallocation])
-if test "$cxx14_sized_deallocation" = yes; then
-    AC_DEFINE([HAVE_CXX14_SIZED_DEALLOCATION])
-fi
-
 HAVE_GCC_PRAGMA_OPERATOR=
 dnl _Pragma support (may require C++11)
 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
diff --git a/odk/CustomTarget_check.mk b/odk/CustomTarget_check.mk
index 109a0c9..8328fc8 100644
--- a/odk/CustomTarget_check.mk
+++ b/odk/CustomTarget_check.mk
@@ -36,7 +36,6 @@ $(call gb_CustomTarget_get_workdir,odk/check)/checkbin : \
 		$(call gb_Package_get_target,odk_docs) \
 		$(call gb_Package_get_target,odk_html) \
 		$(if $(ENABLE_JAVA),$(call gb_GeneratedPackage_get_target,odk_javadoc)) \
-		$(call gb_Package_get_target,odk_lib) \
 		$(call gb_Package_get_target,odk_settings) \
 		$(call gb_Package_get_target,odk_settings_generated) \
 		$(if $(ENABLE_JAVA),$(call gb_Package_get_target,odk_unowinreg))
diff --git a/odk/Module_odk.mk b/odk/Module_odk.mk
index 1dea657..98dacfc 100644
--- a/odk/Module_odk.mk
+++ b/odk/Module_odk.mk
@@ -22,7 +22,6 @@ $(eval $(call gb_Module_add_targets,odk,\
 	Package_docs \
 	Package_html \
 	Package_examples \
-	Package_lib \
 	Package_odk_headers \
 	Package_odk_headers_generated \
 	Package_settings \
diff --git a/odk/Package_lib.mk b/odk/Package_lib.mk
deleted file mode 100644
index 05465c0..0000000
--- a/odk/Package_lib.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_Package_Package,odk_lib,$(WORKDIR)/LinkTarget/StaticLibrary))
-
-$(eval $(call gb_Package_set_outdir,odk_lib,$(INSTDIR)))
-
-$(eval $(call gb_Package_add_files,odk_lib,$(SDKDIRNAME)/lib,\
-	$(if $(filter LINUX,$(OS)),$(notdir $(call gb_StaticLibrary_get_target,salcpprt))) \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/sal/Module_sal.mk b/sal/Module_sal.mk
index cea7f89..46ca260 100644
--- a/sal/Module_sal.mk
+++ b/sal/Module_sal.mk
@@ -18,7 +18,6 @@ $(eval $(call gb_Module_add_targets,sal,\
 		Library_sal_textenc) \
 	$(if $(filter $(OS),WNT), \
 		Library_uwinapi) \
-	StaticLibrary_salcpprt \
 ))
 
 ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
diff --git a/sal/StaticLibrary_salcpprt.mk b/sal/StaticLibrary_salcpprt.mk
deleted file mode 100644
index 9127a8a..0000000
--- a/sal/StaticLibrary_salcpprt.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_StaticLibrary_StaticLibrary,salcpprt))
-
-$(eval $(call gb_StaticLibrary_add_exception_objects,salcpprt, \
-	sal/cpprt/operators_new_delete \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/sal/cpprt/operators_new_delete.cxx b/sal/cpprt/operators_new_delete.cxx
deleted file mode 100644
index a8d77eb..0000000
--- a/sal/cpprt/operators_new_delete.cxx
+++ /dev/null
@@ -1,232 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <algorithm>
-#include <cstddef>
-#include <new>
-#include <string.h>
-
-#include <config_global.h>
-#include <osl/diagnose.h>
-#include <rtl/alloc.h>
-
-// AllocatorTraits
-
-namespace
-{
-
-struct AllocatorTraits
-{
-    typedef char const signature_type[8];
-    const signature_type & m_signature;
-
-    explicit AllocatorTraits (signature_type const & s)
-        : m_signature (s)
-    {}
-
-    static std::size_t size (std::size_t n)
-    {
-        n = std::max(n, std::size_t(1));
-#if OSL_DEBUG_LEVEL > 0
-        n += sizeof(signature_type);
-#endif  /* OSL_DEBUG_LEVEL  */
-        return n;
-    }
-
-    void* init (void * p) const
-    {
-#if OSL_DEBUG_LEVEL > 0
-        memcpy (p, m_signature, sizeof(signature_type));
-        p = static_cast<char*>(p) + sizeof(signature_type);
-#else
-        (void) this; // silence loplugin:staticmethods
-#endif  /* OSL_DEBUG_LEVEL */
-        return p;
-    }
-
-    void* fini (void * p) const
-    {
-#if OSL_DEBUG_LEVEL > 0
-        p = static_cast<char*>(p) - sizeof(signature_type);
-        if (memcmp (p, m_signature, sizeof(signature_type)) != 0)
-        {
-            OSL_FAIL("operator delete mismatch");
-        }
-#else
-        (void) this; // silence loplugin:staticmethods
-#endif  /* OSL_DEBUG_LEVEL */
-        return p;
-    }
-};
-
-struct VectorTraits : public AllocatorTraits
-{
-    static const signature_type g_signature;
-
-    VectorTraits()
-        : AllocatorTraits (g_signature)
-    {}
-};
-
-struct ScalarTraits : public AllocatorTraits
-{
-    static const signature_type g_signature;
-
-    ScalarTraits()
-        : AllocatorTraits (g_signature)
-    {}
-};
-
-const AllocatorTraits::signature_type VectorTraits::g_signature = "new[]()";
-const AllocatorTraits::signature_type ScalarTraits::g_signature = "new()  ";
-
-} // anonymous namespace
-
-// Allocator
-
-static void default_handler()
-{
-    // Multithreading race in 'std::set_new_handler()' call sequence below.
-    throw std::bad_alloc();
-}
-
-static void* allocate (
-    std::size_t n, AllocatorTraits const & rTraits)
-{
-    n = AllocatorTraits::size (n);
-    for (;;)
-    {
-        void * p = rtl_allocateMemory (sal_Size(n));
-        if (p != nullptr)
-            return rTraits.init (p);
-
-        std::new_handler d = default_handler, f = std::set_new_handler (d);
-        if (f != d)
-            std::set_new_handler (f);
-
-        if (f == nullptr)
-            throw std::bad_alloc();
-        (*f)();
-    }
-}
-
-static void* allocate_nothrow (
-    std::size_t n, AllocatorTraits const & rTraits)
-{
-    try
-    {
-        return allocate (n, rTraits);
-    }
-    catch (std::bad_alloc const &)
-    {
-        return nullptr;
-    }
-}
-
-static void deallocate (void * p, AllocatorTraits const & rTraits)
-{
-    if (p)
-    {
-        rtl_freeMemory (rTraits.fini(p));
-    }
-}
-
-// T * p = new T; delete p;
-
-void* SAL_CALL operator new (std::size_t n)
-#if !defined _MSC_VER
-     throw (std::bad_alloc)
-#endif
-{
-    return allocate (n, ScalarTraits());
-}
-
-void SAL_CALL operator delete (void * p) throw ()
-{
-    deallocate (p, ScalarTraits());
-}
-
-#if HAVE_CXX14_SIZED_DEALLOCATION
-#if defined __clang__
-#pragma GCC diagnostic push // as happens on Mac OS X:
-#pragma GCC diagnostic ignored "-Wimplicit-exception-spec-mismatch"
-#endif
-void SAL_CALL operator delete (void * p, std::size_t) noexcept
-{
-    deallocate (p, ScalarTraits());
-}
-#if defined __clang__
-#pragma GCC diagnostic pop
-#endif
-#endif
-
-// T * p = new(nothrow) T; delete(nothrow) p;
-
-void* SAL_CALL operator new (std::size_t n, std::nothrow_t const &) throw ()
-{
-    return allocate_nothrow (n, ScalarTraits());
-}
-
-void SAL_CALL operator delete (void * p, std::nothrow_t const &) throw ()
-{
-    deallocate (p, ScalarTraits());
-}
-
-// T * p = new T[n]; delete[] p;
-
-void* SAL_CALL operator new[] (std::size_t n) throw (std::bad_alloc)
-{
-    return allocate (n, VectorTraits());
-}
-
-void SAL_CALL operator delete[] (void * p)
-#if !defined _MSC_VER || _MSC_VER >= 1900
-    throw ()
-#endif
-{
-    deallocate (p, VectorTraits());
-}
-
-#if HAVE_CXX14_SIZED_DEALLOCATION
-#if defined __clang__
-#pragma GCC diagnostic push // as happens on Mac OS X:
-#pragma GCC diagnostic ignored "-Wimplicit-exception-spec-mismatch"
-#endif
-void SAL_CALL operator delete[] (void * p, std::size_t) noexcept
-{
-    deallocate (p, VectorTraits());
-}
-#if defined __clang__
-#pragma GCC diagnostic pop
-#endif
-#endif
-
-// T * p = new(nothrow) T[n]; delete(nothrow)[] p;
-
-void* SAL_CALL operator new[] (std::size_t n, std::nothrow_t const &) throw ()
-{
-    return allocate_nothrow (n, VectorTraits());
-}
-
-void SAL_CALL operator delete[] (void * p, std::nothrow_t const &) throw ()
-{
-    deallocate (p, VectorTraits());
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list