From 89e1a4e5720509c096ff6860c1a8c483e0019278 Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Thu, 10 May 2018 18:25:56 +0530 Subject: build: Disallow unresolved symbol references In the past, it was often[1] forgotten for xlators to be linked against the symbols they refer to. This often caused glusterd2 to fail while loading xlator's shared object (.so) file. This change adds "--no-undefined" as a linker flag which causes the linker to treat unresolved symbol references as an error and hence fail linking. [1]: https://review.gluster.org/#/c/19912/ https://review.gluster.org/#/c/19664/ https://review.gluster.org/#/c/19056/ https://review.gluster.org/#/c/17659/ https://bugzilla.redhat.com/show_bug.cgi?id=1532238 Bonus: Added cloudsync and utime xlator's generated source files to .gitignore Updates: bz#1193929 Change-Id: I9604a4a87b7313a5fa43bda5fdb37dfa7ef8facd Signed-off-by: Prashanth Pai --- xlators/cluster/dht/src/Makefile.am | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/dht/src/Makefile.am b/xlators/cluster/dht/src/Makefile.am index 525a214c24..59f87cf7bd 100644 --- a/xlators/cluster/dht/src/Makefile.am +++ b/xlators/cluster/dht/src/Makefile.am @@ -18,20 +18,24 @@ nufa_la_SOURCES = $(dht_common_source) nufa.c switch_la_SOURCES = $(dht_common_source) switch.c tier_la_SOURCES = $(dht_common_source) tier.c tier-common.c -dht_la_LDFLAGS = -module -avoid-version -export-symbols \ - $(top_srcdir)/xlators/cluster/dht/src/dht.sym +dht_la_LDFLAGS = -module -avoid-version \ + -export-symbols $(top_srcdir)/xlators/cluster/dht/src/dht.sym \ + $(GF_NO_UNDEFINED) dht_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la -nufa_la_LDFLAGS = -module -avoid-version -export-symbols \ - $(top_srcdir)/xlators/cluster/dht/src/nufa.sym +nufa_la_LDFLAGS = -module -avoid-version \ + -export-symbols $(top_srcdir)/xlators/cluster/dht/src/nufa.sym \ + $(GF_NO_UNDEFINED) nufa_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la -switch_la_LDFLAGS = -module -avoid-version -export-symbols \ - $(top_srcdir)/xlators/cluster/dht/src/switch.sym +switch_la_LDFLAGS = -module -avoid-version + -export-symbols $(top_srcdir)/xlators/cluster/dht/src/switch.sym \ + $(GF_NO_UNDEFINED) switch_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la -tier_la_LDFLAGS = -module -avoid-version -export-symbols \ - $(top_srcdir)/xlators/cluster/dht/src/tier.sym +tier_la_LDFLAGS = -module -avoid-version \ + -export-symbols $(top_srcdir)/xlators/cluster/dht/src/tier.sym \ + $(GF_NO_UNDEFINED) tier_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la noinst_HEADERS = dht-common.h dht-mem-types.h dht-messages.h \ -- cgit