From e7d57da0ddad9097962ebfec4f5202b756ed93c9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 4 Jan 2015 17:24:36 +0100 Subject: [PATCH] build: add individual linker version scripts for shared libraries Instead of using a shared version script 'libnl.sym', add individual linker scripts for all libnl libraries. For now, the content of the version script is unchanged and this patch does not have any externally visible changes. Signed-off-by: Thomas Haller --- .gitignore | 1 - Makefile.am | 8 +++++++- configure.ac | 1 - lib/Makefile.am | 33 +++++++++++++++++++++++++++++++-- libnl.sym.in => libnl-3.sym | 2 +- libnl-genl-3.sym | 4 ++++ libnl-idiag-3.sym | 4 ++++ libnl-nf-3.sym | 4 ++++ libnl-route-3.sym | 4 ++++ libnl-xfrm-3.sym | 4 ++++ 10 files changed, 59 insertions(+), 6 deletions(-) rename libnl.sym.in => libnl-3.sym (88%) create mode 100644 libnl-genl-3.sym create mode 100644 libnl-idiag-3.sym create mode 100644 libnl-nf-3.sym create mode 100644 libnl-route-3.sym create mode 100644 libnl-xfrm-3.sym diff --git a/.gitignore b/.gitignore index 5f5f1cc..ad0cbc2 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,3 @@ cscope.* /configure /libtool /*.pc -/libnl.sym diff --git a/Makefile.am b/Makefile.am index 6d047a9..e48f1f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,4 +21,10 @@ pkgsysconfdir = ${sysconfdir}/libnl pkgsysconf_DATA = etc/pktloc etc/classid EXTRA_DIST = \ - $(pkgsysconf_DATA) + $(pkgsysconf_DATA) \ + libnl-3.sym \ + libnl-genl-3.sym \ + libnl-idiag-3.sym \ + libnl-nf-3.sym \ + libnl-route-3.sym \ + libnl-xfrm-3.sym diff --git a/configure.ac b/configure.ac index 9c59c05..097dca8 100644 --- a/configure.ac +++ b/configure.ac @@ -121,7 +121,6 @@ AC_CONFIG_SUBDIRS([doc]) AC_CONFIG_FILES([ Makefile -libnl.sym libnl-3.0.pc libnl-route-3.0.pc libnl-genl-3.0.pc diff --git a/lib/Makefile.am b/lib/Makefile.am index f7e5a93..f193c29 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -11,27 +11,46 @@ AM_CPPFLAGS = \ -DSYSCONFDIR=\"$(sysconfdir)/libnl\" AM_LDFLAGS = \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ - -Wl,--version-script=$(top_builddir)/libnl.sym + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) lib_LTLIBRARIES = \ libnl-3.la libnl-genl-3.la libnl-route-3.la libnl-nf-3.la libnl-idiag-3.la libnl-xfrm-3.la +libnl_3_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/libnl-3.sym +libnl_3_la_DEPENDENCIES = \ + $(top_builddir)/libnl-3.sym libnl_3_la_SOURCES = \ addr.c attr.c cache.c cache_mngr.c cache_mngt.c data.c \ error.c handlers.c msg.c nl.c object.c socket.c utils.c \ version.c hash.c hashtable.c libnl_idiag_3_la_LIBADD = libnl-3.la +libnl_idiag_3_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/libnl-idiag-3.sym +libnl_idiag_3_la_DEPENDENCIES = \ + $(top_builddir)/libnl-idiag-3.sym libnl_idiag_3_la_SOURCES = \ idiag/idiag_meminfo_obj.c idiag/idiag_vegasinfo_obj.c \ idiag/idiag_msg_obj.c idiag/idiag_req_obj.c idiag/idiag.c libnl_genl_3_la_LIBADD = libnl-3.la +libnl_genl_3_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/libnl-genl-3.sym +libnl_genl_3_la_DEPENDENCIES = \ + $(top_builddir)/libnl-genl-3.sym libnl_genl_3_la_SOURCES = \ genl/ctrl.c genl/family.c genl/genl.c genl/mngt.c libnl_nf_3_la_LIBADD = libnl-route-3.la +libnl_nf_3_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/libnl-nf-3.sym +libnl_nf_3_la_DEPENDENCIES = \ + $(top_builddir)/libnl-nf-3.sym libnl_nf_3_la_SOURCES = \ netfilter/ct.c netfilter/ct_obj.c netfilter/log.c \ netfilter/log_msg.c netfilter/log_msg_obj.c netfilter/log_obj.c \ @@ -60,6 +79,11 @@ route/cls/ematch_syntax.c: route/cls/ematch_syntax.y $(AM_V_GEN) $(MKDIR_P) route/cls; $(YACC) -d $(YFLAGS) -o $@ $^ libnl_route_3_la_LIBADD = libnl-3.la +libnl_route_3_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/libnl-route-3.sym +libnl_route_3_la_DEPENDENCIES = \ + $(top_builddir)/libnl-route-3.sym libnl_route_3_la_SOURCES = \ route/addr.c route/class.c route/cls.c route/act.c route/link.c \ route/neigh.c route/neightbl.c route/nexthop.c route/qdisc.c \ @@ -112,6 +136,11 @@ EXTRA_DIST = \ route/cls/ematch_syntax.y libnl_xfrm_3_la_LIBADD = libnl-3.la +libnl_xfrm_3_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(top_builddir)/libnl-xfrm-3.sym +libnl_xfrm_3_la_DEPENDENCIES = \ + $(top_builddir)/libnl-xfrm-3.sym libnl_xfrm_3_la_SOURCES = \ xfrm/ae.c \ xfrm/lifetime.c \ diff --git a/libnl.sym.in b/libnl-3.sym similarity index 88% rename from libnl.sym.in rename to libnl-3.sym index df8888c..b1d72ff 100644 --- a/libnl.sym.in +++ b/libnl-3.sym @@ -1,4 +1,4 @@ -libnl_@MAJ_VERSION@ { +libnl_3 { global: *; local: diff --git a/libnl-genl-3.sym b/libnl-genl-3.sym new file mode 100644 index 0000000..3532579 --- /dev/null +++ b/libnl-genl-3.sym @@ -0,0 +1,4 @@ +libnl_3 { +global: + *; +}; diff --git a/libnl-idiag-3.sym b/libnl-idiag-3.sym new file mode 100644 index 0000000..3532579 --- /dev/null +++ b/libnl-idiag-3.sym @@ -0,0 +1,4 @@ +libnl_3 { +global: + *; +}; diff --git a/libnl-nf-3.sym b/libnl-nf-3.sym new file mode 100644 index 0000000..3532579 --- /dev/null +++ b/libnl-nf-3.sym @@ -0,0 +1,4 @@ +libnl_3 { +global: + *; +}; diff --git a/libnl-route-3.sym b/libnl-route-3.sym new file mode 100644 index 0000000..3532579 --- /dev/null +++ b/libnl-route-3.sym @@ -0,0 +1,4 @@ +libnl_3 { +global: + *; +}; diff --git a/libnl-xfrm-3.sym b/libnl-xfrm-3.sym new file mode 100644 index 0000000..3532579 --- /dev/null +++ b/libnl-xfrm-3.sym @@ -0,0 +1,4 @@ +libnl_3 { +global: + *; +}; -- 2.40.0