Skip to content

Commit

Permalink
Merge pull request #6476 from garlick/macos4
Browse files Browse the repository at this point in the history
fix macos portability issues (fourth batch)
  • Loading branch information
mergify[bot] authored Dec 5, 2024
2 parents f761aec + 4a17c06 commit 72ae1f0
Show file tree
Hide file tree
Showing 20 changed files with 59 additions and 98 deletions.
2 changes: 1 addition & 1 deletion config/x_ac_sanitize.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)

##
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/lua/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 = \
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/python/_flux/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 = \
Expand Down
45 changes: 17 additions & 28 deletions src/common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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 =
Expand All @@ -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 =
Expand All @@ -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 =
Expand All @@ -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 =
Expand All @@ -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
6 changes: 0 additions & 6 deletions src/common/libflux-core.map

This file was deleted.

6 changes: 0 additions & 6 deletions src/common/libflux-hostlist.map

This file was deleted.

6 changes: 0 additions & 6 deletions src/common/libflux-idset.map

This file was deleted.

6 changes: 0 additions & 6 deletions src/common/libflux-optparse.map

This file was deleted.

6 changes: 0 additions & 6 deletions src/common/libflux-schedutil.map

This file was deleted.

6 changes: 0 additions & 6 deletions src/common/libflux-taskmap.map

This file was deleted.

7 changes: 0 additions & 7 deletions src/common/libpmi.map

This file was deleted.

3 changes: 2 additions & 1 deletion src/common/libpmi/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
20 changes: 20 additions & 0 deletions src/common/libpmi/sentinel.c
Original file line number Diff line number Diff line change
@@ -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
7 changes: 0 additions & 7 deletions src/common/libpmi2.map

This file was deleted.

2 changes: 1 addition & 1 deletion src/connectors/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/modules/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
5 changes: 1 addition & 4 deletions src/shell/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 0 additions & 6 deletions src/shell/flux-shell.map

This file was deleted.

9 changes: 9 additions & 0 deletions t/valgrind/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,12 @@
fun:hwloc_topology_load
...
}
{
<libuuid_tls_leak>
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
...
fun:uuid_generate*
...
}

0 comments on commit 72ae1f0

Please sign in to comment.