Skip to content

Commit

Permalink
resolved several hidden unresolved symbol errors
Browse files Browse the repository at this point in the history
Both the kvs and core libraries are now built with flags that require all of
their symbols to resolve at link time for them rather than load time.  This
should probably be a requirement on every shared library we build, if only for
debugging purposes.  The other main change is that the flux command now
detects when it is being invoked by a libtool run script, by checking the path
for containing a .libs component, and adds an extra '../' in that case.  This
was the cause of the keygen error from the previous commit.
  • Loading branch information
Thomas R. W. Scogland committed May 18, 2015
1 parent 04cb83a commit 8a54fe7
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/bindings/lua/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ flux_la_LIBADD = \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/libev/libev.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
-L$(top_builddir)/src/modules/kvs -lkvs
-L$(top_builddir)/src/common -lflux-core \
$(JSON_LIBS) \
$(LIBZMQ) \
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ AM_CPPFLAGS = \
-DMANDIR=\"$(mandir)\"

fluxcmd_ldadd = \
$(top_builddir)/src/modules/live/liblive.la \
$(top_builddir)/src/modules/kvs/libkvs.la \
$(top_builddir)/src/common/libflux/libflux.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(top_builddir)/src/common/libev/libev.la \
-L$(top_builddir)/src/modules/live -llive \
-L$(top_builddir)/src/modules/kvs -lkvs \
$(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ) $(LIBMUNGE) $(LIBPTHREAD) $(LIBDL)

LDADD = $(fluxcmd_ldadd)
Expand Down
9 changes: 6 additions & 3 deletions src/cmd/flux.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static const struct option longopts[] = {

static void usage (void)
{
fprintf (stderr,
fprintf (stderr,
"Usage: flux [OPTIONS] COMMAND ARGS\n"
" -x,--exec-path PATH prepend PATH to command search path\n"
" -M,--module-path PATH prepend PATH to module search path\n"
Expand Down Expand Up @@ -270,8 +270,11 @@ char *intree_confdir (void)
char *confdir = NULL;
char *selfdir = dir_self ();

if (strcmp (selfdir, X_BINDIR) != 0)
confdir = xasprintf ("%s/../../etc/flux", selfdir);
if (strcmp (selfdir, X_BINDIR) != 0){
confdir = xasprintf ("%s/%s../../etc/flux",
selfdir,
strstr(selfdir, "/.libs") != NULL ? "../" : "");
}
free (selfdir);
return confdir;
}
Expand Down
9 changes: 5 additions & 4 deletions src/common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ fluxlib_LTLIBRARIES = libflux-core.la
libflux_core_la_SOURCES =
libflux_core_la_LIBADD = \
$(builddir)/libflux/libflux.la \
$(builddir)/libev/libev.la \
$(builddir)/liblsd/liblsd.la \
$(builddir)/libzio/libzio.la \
$(builddir)/libutil/libutil.la \
$(builddir)/libev/libev.la \
$(LIBMUNGE) $(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ) $(LIBPTHREAD) $(LIBUTIL) \
$(LIBDL)
$(LIBDL) -lrt
#-lrt is for clock_gettime, this should be abstracted

libflux_core_la_LDFLAGS = -Wl,--version-script=$(srcdir)/version.map \
-shared -export-dynamic --disable-static
-shared -export-dynamic --disable-static \
-Wl,--no-undefined

EXTRA_DIST = version.map
5 changes: 4 additions & 1 deletion src/modules/kvs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ libkvs_la_SOURCES = \
conf.c \
proto.c
libkvs_la_LDFLAGS = -shared -export-dynamic --disable-static \
-Wl,--no-undefined \
$(top_builddir)/src/common/libflux/libflux.la \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/libev/libev.la \
$(top_builddir)/src/common/liblsd/liblsd.la \
$(LIBMUNGE) $(LIBDL)
-L$(top_builddir)/src/common -lflux-core

#-lrt is for clock_gettime, this should be abstracted

TESTS = \
test_waitqueue.t \
Expand Down
3 changes: 2 additions & 1 deletion src/modules/libmrpc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ AM_CPPFLAGS = \
$(JSON_CFLAGS) \
-I$(top_srcdir) -I$(top_srcdir)/src/include

noinst_LTLIBRARIES = libmrpc.la
fluxlib_LTLIBRARIES = libmrpc.la

libmrpc_la_SOURCES = \
mrpc.c \
mrpc.h
libmrpc_la_LDFLAGS = -shared -export-dynamic
1 change: 1 addition & 0 deletions src/modules/mecho/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fluxmod_LTLIBRARIES = mecho.la
fluxmod_libadd = \
$(JSON_LIBS) $(LIBZMQ) $(LIBCZMQ)
general_ldflags = --disable-static -avoid-version -shared -export-dynamic \
$(top_builddir)/src/modules/libmrpc/libmrpc.la \
-L$(top_builddir)/src/common -lflux-core \
-L$(top_builddir)/src/modules/kvs -lkvs
fluxmod_ldflags = -module \
Expand Down
1 change: 1 addition & 0 deletions src/modules/wreck/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fluxmod_libadd = \

fluxmod_ldflags = --disable-static -avoid-version -module -shared -export-dynamic \
-export-symbols-regex '^mod_(main|name)$$' \
$(top_builddir)/src/modules/libmrpc/libmrpc.la \
-L$(top_builddir)/src/common -lflux-core \
-L$(top_builddir)/src/modules/kvs -lkvs

Expand Down

0 comments on commit 8a54fe7

Please sign in to comment.