Skip to content

Commit c4ee4d7

Browse files
committed
build: rework SUN ld support
We _can_ support it, just without any symbol maps. (In other words, we do not need to test for it specifically, just treat it as a "everything else" case.)
1 parent d861d60 commit c4ee4d7

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ lib_LTLIBRARIES = libgromox_common.la libgromox_dbop.la libgromox_epoll.la libgr
1212
noinst_LTLIBRARIES = libgromox_abtree.la libphp_mapi.la
1313
pkglibexec_PROGRAMS = cgkrepair delivery delivery-queue event gromox-snapshot http imap midb pop3 timer zcore tools/authtry tools/eidprint tools/textmapquery
1414
pkglib_LTLIBRARIES = libmapi4zf.la
15+
if WITH_GNU_LD
1516
version_sc_SYFLAGS = -Wl,--version-script=${srcdir}/default.sym
17+
endif
1618
default_SYFLAGS = ${version_sc_SYFLAGS${NO_VSYM}}
1719
plugin_LDFLAGS = -avoid-version -module
1820
pamlibdir = ${libdir}/security

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ AS_IF([test -z "$NO_VSYM"], [
7777
my_CFLAGS="$my_CFLAGS -fvisibility=hidden"
7878
my_CXXFLAGS="$my_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
7979
])
80+
AS_IF([test "$with_gnu_ld" != yes], [NO_VSYM=1])
8081
AC_SUBST([NO_VSYM])
8182

8283

tools/dldcheck.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ int main(int argc, char **argv)
3030
fprintf(stderr, "dlopen %s: %s\n", file.c_str(), dlerror());
3131
return EXIT_FAILURE;
3232
}
33+
#if !defined(__sun)
34+
/*
35+
* Crash on Solaris ld.so: It does not know STB_GNU_UNIQUE,
36+
* so libraries get unloaded even in the face of registered
37+
* global destructors. That triggers a crash at the end of
38+
* main().
39+
*/
3340
dlclose(h);
41+
#endif
3442
}
3543
auto fd = open(stamp, O_CREAT | O_WRONLY | O_TRUNC, S_IRUGO | S_IWUGO);
3644
if (fd < 0)

0 commit comments

Comments
 (0)