diff --git a/config/x_ac_sanitize.m4 b/config/x_ac_sanitize.m4 index e07ef2cecdbd..452c7c567a18 100644 --- a/config/x_ac_sanitize.m4 +++ b/config/x_ac_sanitize.m4 @@ -27,7 +27,7 @@ AC_DEFUN([X_AC_ENABLE_SANITIZER], [ AS_VAR_SET(san_ld_zdef_flag, []) AC_SUBST(san_ld_zdef_flag) elif test "x$san_enabled" = "xno" ; then - AS_VAR_SET(san_ld_zdef_flag, [-Wl,--no-undefined]) + AS_VAR_SET(san_ld_zdef_flag, [-no-undefined]) AC_SUBST(san_ld_zdef_flag) else AC_MSG_ERROR($san_enabled is a unsupported option.) diff --git a/configure.ac b/configure.ac index 1d5f7d1a9a70..ca2b74a2dbfe 100644 --- a/configure.ac +++ b/configure.ac @@ -244,7 +244,7 @@ X_AC_CHECK_COND_LIB(rt, clock_gettime) X_AC_CHECK_COND_LIB(dl, dlerror) X_AC_MALLOC AC_CHECK_LIB(m, floor) -AC_SEARCH_LIBS(epoll, libepoll-shim) +AC_SEARCH_LIBS(epoll_create1, epoll-shim) AC_MSG_CHECKING([for pthread_setname_np with tid parameter]) AC_COMPILE_IFELSE( @@ -549,13 +549,13 @@ AC_SUBST(fluxbindingincludedir) ## # Macros to avoid repetition in Makefiles.am's ## -fluxmod_ldflags="$san_ld_zdef_flag -avoid-version -export-symbols-regex '^mod_(main|name)\$\$' --disable-static -shared -export-dynamic -Wl,--gc-sections" +fluxmod_ldflags="$san_ld_zdef_flag -avoid-version -export-symbols-regex '^mod_(main|name)\$\$' --disable-static -shared -export-dynamic $ld_gc_sections" AC_SUBST(fluxmod_ldflags) -fluxplugin_ldflags="-avoid-version -export-symbols-regex '^flux_plugin_init\$\$' --disable-static -shared -export-dynamic -Wl,--gc-sections" +fluxplugin_ldflags="-avoid-version -export-symbols-regex '^flux_plugin_init\$\$' --disable-static -shared -export-dynamic $ld_gc_sections" AC_SUBST(fluxplugin_ldflags) -fluxlib_ldflags="-shared -export-dynamic --disable-static $san_ld_zdef_flag -Wl,--gc-sections" +fluxlib_ldflags="-shared -export-dynamic --disable-static $san_ld_zdef_flag $ld_gc_sections" AC_SUBST(fluxlib_ldflags) ## diff --git a/src/bindings/lua/Makefile.am b/src/bindings/lua/Makefile.am index 4c57a40bd4da..8e3cc40429d3 100644 --- a/src/bindings/lua/Makefile.am +++ b/src/bindings/lua/Makefile.am @@ -42,7 +42,7 @@ noinst_LTLIBRARIES = \ luamod_ldflags = \ -avoid-version -module -shared --disable-static \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(san_ld_zdef_flag) luamod_libadd = \ diff --git a/src/bindings/python/_flux/Makefile.am b/src/bindings/python/_flux/Makefile.am index 6629d2d46f0d..c3767250db86 100644 --- a/src/bindings/python/_flux/Makefile.am +++ b/src/bindings/python/_flux/Makefile.am @@ -14,7 +14,7 @@ AM_LDFLAGS = \ -module \ $(san_ld_zdef_flag) \ -Wl,-rpath,$(PYTHON_PREFIX)/lib \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(CODE_COVERAGE_LIBS) common_libs = \ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 859235f041f2..e7b6002bc5ab 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -98,10 +98,10 @@ libflux_core_la_LIBADD = \ $(builddir)/libsubprocess/libsubprocess.la \ libflux-internal.la libflux_core_la_LDFLAGS = \ - -Wl,--version-script=$(srcdir)/libflux-core.map \ + -export-symbols-regex "^(flux_|__asan)" \ -version-info @LIBFLUX_CORE_VERSION_INFO@ \ -shared -export-dynamic --disable-static \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(san_ld_zdef_flag) libflux_optparse_la_SOURCES = @@ -114,20 +114,20 @@ libflux_optparse_la_LIBADD = \ $(builddir)/libmissing/libmissing.la \ $(LIBPTHREAD) libflux_optparse_la_LDFLAGS = \ - -Wl,--version-script=$(srcdir)/libflux-optparse.map \ + -export-symbols-regex "^(optparse_|__asan)" \ -version-info @LIBFLUX_OPTPARSE_VERSION_INFO@ \ -shared -export-dynamic --disable-static \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(san_ld_zdef_flag) libflux_idset_la_SOURCES = libflux_idset_la_LIBADD = \ $(builddir)/libidset/libidset.la libflux_idset_la_LDFLAGS = \ - -Wl,--version-script=$(srcdir)/libflux-idset.map \ + -export-symbols-regex "^(idset_|__asan)" \ -version-info @LIBFLUX_IDSET_VERSION_INFO@ \ -shared -export-dynamic --disable-static \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(san_ld_zdef_flag) libflux_schedutil_la_SOURCES = @@ -137,20 +137,20 @@ libflux_schedutil_la_LIBADD = \ libflux-core.la \ $(JANSSON_LIBS) libflux_schedutil_la_LDFLAGS = \ - -Wl,--version-script=$(srcdir)/libflux-schedutil.map \ + -export-symbols-regex "^(schedutil_|__asan)" \ -version-info @LIBFLUX_SCHEDUTIL_VERSION_INFO@ \ -shared -export-dynamic --disable-static \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(san_ld_zdef_flag) libflux_hostlist_la_SOURCES = libflux_hostlist_la_LIBADD = \ $(builddir)/libhostlist/libhostlist.la libflux_hostlist_la_LDFLAGS = \ - -Wl,--version-script=$(srcdir)/libflux-hostlist.map \ + -export-symbols-regex "^(hostlist_|__asan)" \ -version-info @LIBFLUX_HOSTLIST_VERSION_INFO@ \ -shared -export-dynamic --disable-static \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(san_ld_zdef_flag) libflux_taskmap_la_SOURCES = @@ -161,14 +161,15 @@ libflux_taskmap_la_LIBADD = \ $(builddir)/libccan/libccan.la \ $(builddir)/libtomlc99/libtomlc99.la \ $(builddir)/libyuarel/libyuarel.la \ + $(builddir)/libmissing/libmissing.la \ libflux-core.la \ libflux-idset.la \ $(JANSSON_LIBS) libflux_taskmap_la_LDFLAGS = \ - -Wl,--version-script=$(srcdir)/libflux-taskmap.map \ + -export-symbols-regex "^(taskmap_|__asan)" \ -version-info @LIBFLUX_TASKMAP_VERSION_INFO@ \ -shared -export-dynamic --disable-static \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(san_ld_zdef_flag) flux_libpmi_la_SOURCES = @@ -181,11 +182,10 @@ flux_libpmi_la_LIBADD = \ $(builddir)/libmissing/libmissing.la flux_libpmi_la_LDFLAGS = \ - -Wl,--version-script=$(srcdir)/libpmi.map \ + -export-symbols-regex "^(PMI_|flux_pmi_library|__asan)" \ -version-info 0:0:0 \ - -Wl,--defsym=flux_pmi_library=1 \ -shared -export-dynamic --disable-static \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(san_ld_zdef_flag) flux_libpmi2_la_SOURCES = @@ -197,19 +197,8 @@ flux_libpmi2_la_LIBADD = \ $(builddir)/libutil/aux.lo \ $(builddir)/libmissing/libmissing.la flux_libpmi2_la_LDFLAGS = \ - -Wl,--version-script=$(srcdir)/libpmi2.map \ + -export-symbols-regex "^(PMI2_|flux_pmi_library|__asan)" \ -version-info 0:0:0 \ - -Wl,--defsym=flux_pmi_library=1 \ -shared -export-dynamic --disable-static \ - -Wl,--gc-sections \ + $(ld_gc_sections) \ $(san_ld_zdef_flag) - -EXTRA_DIST = \ - libflux-core.map \ - libflux-optparse.map \ - libflux-idset.map \ - libflux-schedutil.map \ - libflux-hostlist.map \ - libflux-taskmap.map \ - libpmi.map \ - libpmi2.map diff --git a/src/common/libflux-core.map b/src/common/libflux-core.map deleted file mode 100644 index 9d79e12e8cfc..000000000000 --- a/src/common/libflux-core.map +++ /dev/null @@ -1,6 +0,0 @@ -{ global: - flux_*; - __asan*; - local: *; -}; - diff --git a/src/common/libflux-hostlist.map b/src/common/libflux-hostlist.map deleted file mode 100644 index 6eac62e7684c..000000000000 --- a/src/common/libflux-hostlist.map +++ /dev/null @@ -1,6 +0,0 @@ -{ global: - hostlist_*; - __asan*; - local: *; -}; - diff --git a/src/common/libflux-idset.map b/src/common/libflux-idset.map deleted file mode 100644 index 2937af2fab7f..000000000000 --- a/src/common/libflux-idset.map +++ /dev/null @@ -1,6 +0,0 @@ -{ global: - idset_*; - __asan*; - local: *; -}; - diff --git a/src/common/libflux-optparse.map b/src/common/libflux-optparse.map deleted file mode 100644 index 29c3d2c09df4..000000000000 --- a/src/common/libflux-optparse.map +++ /dev/null @@ -1,6 +0,0 @@ -{ global: - optparse_*; - __asan*; - local: *; -}; - diff --git a/src/common/libflux-schedutil.map b/src/common/libflux-schedutil.map deleted file mode 100644 index 9794a2b4d12f..000000000000 --- a/src/common/libflux-schedutil.map +++ /dev/null @@ -1,6 +0,0 @@ -{ global: - schedutil_*; - __asan*; - local: *; -}; - diff --git a/src/common/libflux-taskmap.map b/src/common/libflux-taskmap.map deleted file mode 100644 index ba22d142cac3..000000000000 --- a/src/common/libflux-taskmap.map +++ /dev/null @@ -1,6 +0,0 @@ -{ global: - taskmap_*; - __asan*; - local: *; -}; - diff --git a/src/common/libpmi.map b/src/common/libpmi.map deleted file mode 100644 index 742ac050544d..000000000000 --- a/src/common/libpmi.map +++ /dev/null @@ -1,7 +0,0 @@ -{ global: - PMI_*; - flux_pmi_library; - __asan*; - local: *; -}; - diff --git a/src/common/libpmi/Makefile.am b/src/common/libpmi/Makefile.am index c04642560923..528e808b842c 100644 --- a/src/common/libpmi/Makefile.am +++ b/src/common/libpmi/Makefile.am @@ -23,7 +23,8 @@ libpmi_common_la_SOURCES = \ pmi_strerror.c \ pmi_strerror.h \ keyval.c \ - keyval.h + keyval.h \ + sentinel.c libpmi_client_la_SOURCES = \ simple_client.c \ diff --git a/src/common/libpmi/sentinel.c b/src/common/libpmi/sentinel.c new file mode 100644 index 000000000000..5633c102d575 --- /dev/null +++ b/src/common/libpmi/sentinel.c @@ -0,0 +1,20 @@ +/************************************************************\ + * Copyright 2014 Lawrence Livermore National Security, LLC + * (c.f. AUTHORS, NOTICE.LLNS, COPYING) + * + * This file is part of the Flux resource manager framework. + * For details, see https://github.com/flux-framework. + * + * SPDX-License-Identifier: LGPL-3.0 +\************************************************************/ + +/* Define a symbol that can be used to tell the Flux pmi libs from others. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +void *flux_pmi_library; + +// vi:ts=4 sw=4 expandtab diff --git a/src/common/libpmi2.map b/src/common/libpmi2.map deleted file mode 100644 index e7bb5a8cc9ad..000000000000 --- a/src/common/libpmi2.map +++ /dev/null @@ -1,7 +0,0 @@ -{ global: - PMI2_*; - flux_pmi_library; - __asan*; - local: *; -}; - diff --git a/src/connectors/Makefile.am b/src/connectors/Makefile.am index c956ad4bd7df..240397c2e9e6 100644 --- a/src/connectors/Makefile.am +++ b/src/connectors/Makefile.am @@ -18,7 +18,7 @@ fluxconnector_LTLIBRARIES = \ connector_ldflags = -module $(san_ld_zdef_flag) \ -export-symbols-regex '^connector_init$$' \ --disable-static -avoid-version -shared -export-dynamic \ - -Wl,--gc-sections + $(ld_gc_sections) ssh_la_SOURCES = \ ssh/ssh.c diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am index bffcbdc346b3..f1a1d7bd3e20 100644 --- a/src/modules/Makefile.am +++ b/src/modules/Makefile.am @@ -80,7 +80,8 @@ content_la_SOURCES = \ content_la_LIBADD = \ $(top_builddir)/src/common/libfilemap/libfilemap.la \ $(top_builddir)/src/common/libflux-internal.la \ - $(top_builddir)/src/common/libflux-core.la + $(top_builddir)/src/common/libflux-core.la \ + $(LIBARCHIVE_LIBS) content_la_LDFLAGS = $(fluxmod_ldflags) -module content_files_la_SOURCES = diff --git a/src/shell/Makefile.am b/src/shell/Makefile.am index 66b57f0cf478..9986b7ac4271 100644 --- a/src/shell/Makefile.am +++ b/src/shell/Makefile.am @@ -128,10 +128,7 @@ flux_shell_LDADD = \ flux_shell_LDFLAGS = \ -export-dynamic \ - -Wl,--version-script=$(srcdir)/flux-shell.map - -EXTRA_DIST = \ - flux-shell.map + -export-symbols-regex "(flux_shell_.*|flux_plugin_get_shell|__asan.*)" TESTS = \ test_jobspec.t \ diff --git a/src/shell/flux-shell.map b/src/shell/flux-shell.map deleted file mode 100644 index d3ec526e7fb4..000000000000 --- a/src/shell/flux-shell.map +++ /dev/null @@ -1,6 +0,0 @@ -{ global: - flux_shell_*; - flux_plugin_get_shell; - __asan*; - local: *; -}; diff --git a/t/valgrind/valgrind.supp b/t/valgrind/valgrind.supp index c772aa859e31..f164a525ee87 100644 --- a/t/valgrind/valgrind.supp +++ b/t/valgrind/valgrind.supp @@ -150,3 +150,12 @@ fun:hwloc_topology_load ... } +{ + + Memcheck:Leak + match-leak-kinds: possible + fun:malloc + ... + fun:uuid_generate* + ... +}