Skip to content

Commit e7b676b

Browse files
committed
build: cease static linking of libgromox_abtree
ab_tree.cpp is linked twice into the gromox-http program image, since ews.so and nsp.so each contain a copy from libgromox_abtree.a. Switch abtree to .so. ==27140==ERROR: AddressSanitizer: odr-violation (0x7f69465b3b80): [1] size=360 'AB' lib/ab_tree.cpp:19:4 in /home/ej/work/gromox/.libs/libgxh_ews.so.0 [2] size=360 'AB' lib/ab_tree.cpp:19:4 in /home/ej/work/gromox/.libs/libgxp_exchange_nsp.so.0 Fixes: gromox-2.40-22-gd4f1761ba
1 parent 49839da commit e7b676b

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ AM_LDFLAGS = ${my_LDFLAGS}
88
AM_DISTCHECK_CONFIGURE_FLAGS = --with-dcprefix='$${prefix}'
99
AM_TESTS_ENVIRONMENT = export TEST_PATH=${top_srcdir}/data;
1010

11-
lib_LTLIBRARIES = libgromox_common.la libgromox_dbop.la libgromox_epoll.la libgromox_mapi.la libgromox_exrpc.la libgromox_rpc.la ${program_plugins}
12-
noinst_LTLIBRARIES = libgromox_abtree.la
11+
lib_LTLIBRARIES = libgromox_abtree.la libgromox_common.la libgromox_dbop.la libgromox_epoll.la libgromox_mapi.la libgromox_exrpc.la libgromox_rpc.la ${program_plugins}
1312
pkglibexec_PROGRAMS = delivery delivery-queue event gromox-snapshot http imap midb pop3 timer zcore tools/authtry tools/eidprint tools/textmapquery
1413
if WITH_GNU_LD
1514
version_sc_SYFLAGS = -Wl,--version-script=${srcdir}/default.sym
@@ -66,7 +65,8 @@ noinst_DATA = dldcheck.stamp
6665
BUILT_SOURCES = exch/exmdb/rpc.cpp include/exmdb_dispatch.cpp include/mapierr.cpp include/mapitags.cpp include/zrpc_dispatch.cpp include/gromox/paths.h lib/exmdb_rpc.cpp php_mapi/zrpc.cpp
6766
CLEANFILES = ${BUILT_SOURCES} dldcheck.stamp
6867
libgromox_abtree_la_SOURCES = lib/ab_tree.cpp
69-
libgromox_abtree_la_LIBADD = libgxs_mysql_adaptor.la
68+
libgromox_abtree_la_LDFLAGS = ${default_SYFLAGS}
69+
libgromox_abtree_la_LIBADD = ${fmt_LIBS} libgxs_mysql_adaptor.la
7070
libgromox_auth_la_SOURCES = exch/authmgr.cpp exch/ldap_adaptor.cpp exch/ldap_adaptor.hpp
7171
libgromox_auth_la_LDFLAGS = ${default_SYFLAGS}
7272
libgromox_auth_la_LIBADD = ${libcrypto_LIBS} ${libHX_LIBS} ${jsoncpp_LIBS} ${libldap_LIBS} ${pam_LIBS} libgromox_common.la libgxs_mysql_adaptor.la

default.sym

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ global:
1515
_ZT*;
1616

1717
extern "C++" {
18+
gromox::ab_tree::*;
1819
midb_agent::*;
1920
mysql_adaptor_*;
2021
sql_user::*;

include/gromox/ab_tree.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ struct GX_EXPORT ab_domain {
123123
* Contains all domain and user nodes from an organization. Provides a common
124124
* interface to access node properties.
125125
*/
126-
class ab_base {
126+
class GX_EXPORT ab_base {
127127
public:
128128
/**
129129
* @brief Address book iterator
@@ -278,7 +278,7 @@ class ab_base {
278278
*
279279
* Manages ab_bases. There should only exist one instance.
280280
*/
281-
class ab {
281+
class GX_EXPORT ab {
282282
public:
283283
using base_ref = std::shared_ptr<ab_base>;
284284
using const_base_ref = std::shared_ptr<const ab_base>;
@@ -313,7 +313,7 @@ class ab {
313313

314314
void work();
315315
};
316-
extern class ab AB;
316+
extern GX_EXPORT class ab AB;
317317

318318
/**
319319
* @brief Node proxy, bundling minid with ab_base

0 commit comments

Comments
 (0)