[Libreoffice-commits] core.git: Repository.mk testtools/Library_bridgetest-common.mk testtools/Library_bridgetest.mk testtools/Library_cppobj.mk testtools/Module_testtools.mk testtools/source testtools/StaticLibrary_bridgetest.mk

Stephan Bergmann sbergman at redhat.com
Wed Sep 14 13:56:05 UTC 2016


 Repository.mk                                         |    1 
 testtools/Library_bridgetest-common.mk                |   38 ++++++++++++++++++
 testtools/Library_bridgetest.mk                       |    5 --
 testtools/Library_cppobj.mk                           |    5 --
 testtools/Module_testtools.mk                         |    2 
 testtools/StaticLibrary_bridgetest.mk                 |   28 -------------
 testtools/source/bridgetest/currentcontextchecker.hxx |    6 +-
 testtools/source/bridgetest/dllapi.hxx                |   25 +++++++++++
 testtools/source/bridgetest/multi.hxx                 |    3 +
 9 files changed, 74 insertions(+), 39 deletions(-)

New commits:
commit 16bbeb5713f4f9894e81ecf34a0e00f56a425f96
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Sep 14 15:52:04 2016 +0200

    Change the shared bridgetest code from static to dynamic library
    
    ...so ASan builds do not complain about ODR violations due to multiple instances
    of vtable for testtools::bridgetest::CurrentContextChecker after
    a53808c0ed577468393aced90963af6496706959 "loplugin:dllprivate" removed the
    SAL_DLLPRIVATE from class CurrentContextChecker (which apparently /did/ have an
    impact with -fvisibility-ms-compat, as used by Linux Clang ASan/UBSan builds).
    
    Change-Id: Ifb1ba1819f7ea989300f4696d44f9599a1436563

diff --git a/Repository.mk b/Repository.mk
index c4ebc7a..7d29e12 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -487,6 +487,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE, \
 	test-setupvcl \
 	testtools_cppobj \
 	testtools_bridgetest \
+	testtools_bridgetest-common \
 	testtools_constructors \
 	unobootstrapprotector \
 	unoexceptionprotector \
diff --git a/testtools/Library_bridgetest-common.mk b/testtools/Library_bridgetest-common.mk
new file mode 100644
index 0000000..1ca38bc
--- /dev/null
+++ b/testtools/Library_bridgetest-common.mk
@@ -0,0 +1,38 @@
+# -*- 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_Library_Library,testtools_bridgetest-common))
+
+$(eval $(call gb_Library_add_defs,testtools_bridgetest-common, \
+    -DLO_DLLIMPLEMENTATION_TESTTOOLS \
+))
+
+$(eval $(call gb_Library_use_external,testtools_bridgetest-common,boost_headers))
+
+$(eval $(call gb_Library_use_internal_api,testtools_bridgetest-common,\
+    bridgetest \
+))
+
+$(eval $(call gb_Library_use_libraries,testtools_bridgetest-common, \
+    cppu \
+    cppuhelper \
+    sal \
+))
+
+$(eval $(call gb_Library_use_api,testtools_bridgetest-common,\
+    udkapi \
+))
+
+$(eval $(call gb_Library_add_exception_objects,testtools_bridgetest-common,\
+    testtools/source/bridgetest/currentcontextchecker \
+    testtools/source/bridgetest/multi \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/testtools/Library_bridgetest.mk b/testtools/Library_bridgetest.mk
index 7953b66..52f3357 100644
--- a/testtools/Library_bridgetest.mk
+++ b/testtools/Library_bridgetest.mk
@@ -19,16 +19,13 @@ $(eval $(call gb_Library_use_api,testtools_bridgetest,\
     udkapi \
 ))
 
-$(eval $(call gb_Library_use_static_libraries,testtools_bridgetest,\
-    testtools_bridgetest_s \
-))
-
 $(eval $(call gb_Library_use_external,testtools_bridgetest,boost_headers))
 
 $(eval $(call gb_Library_use_libraries,testtools_bridgetest,\
     cppu \
     cppuhelper \
     sal \
+    testtools_bridgetest-common \
 ))
 
 $(eval $(call gb_Library_add_exception_objects,testtools_bridgetest,\
diff --git a/testtools/Library_cppobj.mk b/testtools/Library_cppobj.mk
index f2d50d7..086b1fa 100644
--- a/testtools/Library_cppobj.mk
+++ b/testtools/Library_cppobj.mk
@@ -26,14 +26,11 @@ $(eval $(call gb_Library_use_api,testtools_cppobj,\
 
 $(eval $(call gb_Library_use_external,testtools_cppobj,boost_headers))
 
-$(eval $(call gb_Library_use_static_libraries,testtools_cppobj,\
-    testtools_bridgetest_s \
-))
-
 $(eval $(call gb_Library_use_libraries,testtools_cppobj,\
     cppu \
     cppuhelper \
     sal \
+    testtools_bridgetest-common \
 ))
 
 $(eval $(call gb_Library_add_exception_objects,testtools_cppobj,\
diff --git a/testtools/Module_testtools.mk b/testtools/Module_testtools.mk
index 9ffb252..a1b84e1 100644
--- a/testtools/Module_testtools.mk
+++ b/testtools/Module_testtools.mk
@@ -15,9 +15,9 @@ $(eval $(call gb_Module_add_targets,testtools,\
 	CustomTarget_bridgetest \
 	InternalUnoApi_bridgetest \
 	InternalUnoApi_performance \
-	StaticLibrary_bridgetest \
 	Library_cppobj \
 	Library_bridgetest \
+	Library_bridgetest-common \
 	Library_constructors \
 	Rdb_uno_services \
 ))
diff --git a/testtools/StaticLibrary_bridgetest.mk b/testtools/StaticLibrary_bridgetest.mk
deleted file mode 100644
index b1a076f..0000000
--- a/testtools/StaticLibrary_bridgetest.mk
+++ /dev/null
@@ -1,28 +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,testtools_bridgetest_s))
-
-$(eval $(call gb_StaticLibrary_use_external,testtools_bridgetest_s,boost_headers))
-
-$(eval $(call gb_StaticLibrary_use_internal_api,testtools_bridgetest_s,\
-    bridgetest \
-))
-
-$(eval $(call gb_StaticLibrary_use_api,testtools_bridgetest_s,\
-    udkapi \
-))
-
-$(eval $(call gb_StaticLibrary_add_exception_objects,testtools_bridgetest_s,\
-    testtools/source/bridgetest/currentcontextchecker \
-    testtools/source/bridgetest/multi \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/testtools/source/bridgetest/currentcontextchecker.hxx b/testtools/source/bridgetest/currentcontextchecker.hxx
index f431762..1877392 100644
--- a/testtools/source/bridgetest/currentcontextchecker.hxx
+++ b/testtools/source/bridgetest/currentcontextchecker.hxx
@@ -28,9 +28,11 @@
 #include "sal/types.h"
 #include "test/testtools/bridgetest/XCurrentContextChecker.hpp"
 
+#include <dllapi.hxx>
+
 namespace testtools { namespace bridgetest {
 
-class CurrentContextChecker :
+class LO_DLLPUBLIC_TESTTOOLS CurrentContextChecker :
     public ::osl::DebugBase< CurrentContextChecker >,
     public ::cppu::WeakImplHelper<
         ::test::testtools::bridgetest::XCurrentContextChecker >
@@ -49,7 +51,7 @@ private:
     CurrentContextChecker(CurrentContextChecker &) = delete;
     void operator =(CurrentContextChecker &) = delete;
 
-    bool performCheck(
+    SAL_DLLPRIVATE bool performCheck(
         css::uno::Reference< ::test::testtools::bridgetest::XCurrentContextChecker > const & other,
         ::sal_Int32 setSteps, ::sal_Int32 checkSteps);
 };
diff --git a/testtools/source/bridgetest/dllapi.hxx b/testtools/source/bridgetest/dllapi.hxx
new file mode 100644
index 0000000..8777a93
--- /dev/null
+++ b/testtools/source/bridgetest/dllapi.hxx
@@ -0,0 +1,25 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_TESTTOOLS_SOURCE_BRIDGETEST_DLLAPI_HXX
+#define INCLUDED_TESTTOOLS_SOURCE_BRIDGETEST_DLLAPI_HXX
+
+#include <sal/config.h>
+
+#include <sal/types.h>
+
+#if defined LO_DLLIMPLEMENTATION_TESTTOOLS
+#define LO_DLLPUBLIC_TESTTOOLS SAL_DLLPUBLIC_EXPORT
+#else
+#define LO_DLLPUBLIC_TESTTOOLS SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/testtools/source/bridgetest/multi.hxx b/testtools/source/bridgetest/multi.hxx
index 9909ce5..6ed1284 100644
--- a/testtools/source/bridgetest/multi.hxx
+++ b/testtools/source/bridgetest/multi.hxx
@@ -29,6 +29,8 @@
 #include "sal/types.h"
 #include "test/testtools/bridgetest/XMulti.hpp"
 
+#include <dllapi.hxx>
+
 namespace testtools { namespace bridgetest {
 
 class Multi: public cppu::WeakImplHelper< test::testtools::bridgetest::XMulti >
@@ -109,6 +111,7 @@ private:
     double m_attribute3;
 };
 
+LO_DLLPUBLIC_TESTTOOLS
 OUString testMulti( css::uno::Reference< test::testtools::bridgetest::XMulti >  const & multi);
 
 } }


More information about the Libreoffice-commits mailing list