From 7d2d13074877bceaef0a2bae91df79d32ddc7416 Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Thu, 18 Jan 2007 13:30:01 -0800 Subject: [PATCH 1/5] Adding support for versioned libndbclient.so. bug #13522 --- configure.in | 7 +++++++ ndb/src/Makefile.am | 2 ++ 2 files changed, 9 insertions(+) diff --git a/configure.in b/configure.in index 8457a2dcad0..e85b8e795ba 100644 --- a/configure.in +++ b/configure.in @@ -14,6 +14,10 @@ DOT_FRM_VERSION=6 SHARED_LIB_MAJOR_VERSION=14 SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0 +NDB_SHARED_LIB_MAJOR_VERSION=1 +NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 + + # ndb version NDB_VERSION_MAJOR=4 NDB_VERSION_MINOR=1 @@ -73,6 +77,9 @@ AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION], [Version of .frm files]) AC_SUBST(SHARED_LIB_MAJOR_VERSION) AC_SUBST(SHARED_LIB_VERSION) +AC_SUBST(NDB_SHARED_LIB_MAJOR_VERSION) +AC_SUBST(NDB_SHARED_LIB_VERSION) + AC_SUBST(AVAILABLE_LANGUAGES) AC_SUBST(AVAILABLE_LANGUAGES_ERRORS) AC_SUBST_FILE(AVAILABLE_LANGUAGES_ERRORS_RULES) diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index eb1cf1c6543..ffa45e57196 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -6,6 +6,8 @@ ndblib_LTLIBRARIES = libndbclient.la libndbclient_la_SOURCES = +libndbclient_la_LDFLAGS = -version-info @NDB_SHARED_LIB_VERSION@ + libndbclient_la_LIBADD = \ ndbapi/libndbapi.la \ common/transporter/libtransporter.la \ From c546e4bfe1f19768c6c76f8e4c3d0118b3090ad1 Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Thu, 18 Jan 2007 14:21:50 -0800 Subject: [PATCH 2/5] Incrementing soname to 2 for 5.0 branch. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index bb4db2d5da5..9402c8d1876 100644 --- a/configure.in +++ b/configure.in @@ -16,7 +16,7 @@ DOT_FRM_VERSION=6 SHARED_LIB_MAJOR_VERSION=15 SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0 -NDB_SHARED_LIB_MAJOR_VERSION=1 +NDB_SHARED_LIB_MAJOR_VERSION=2 NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 From fd75030f930a5ec2d31e90f4ccec9c3947a8f7b2 Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Thu, 18 Jan 2007 16:21:43 -0800 Subject: [PATCH 3/5] Added version script information to actually version the symbols. --- configure.in | 9 +++++++++ ndb/src/Makefile.am | 2 +- ndb/src/libndb.ver.in | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 ndb/src/libndb.ver.in diff --git a/configure.in b/configure.in index e85b8e795ba..47965876627 100644 --- a/configure.in +++ b/configure.in @@ -449,6 +449,15 @@ if $LD --version 2>/dev/null|grep -q GNU; then fi AC_SUBST(LD_VERSION_SCRIPT) +# libndbclient versioning when linked with GNU ld. +if $LD --version 2>/dev/null|grep -q GNU; then + NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/ndb/src/libndb.ver" + AC_CONFIG_FILES(ndb/src/libndb.ver) +fi +AC_SUBST(NDB_LD_VERSION_SCRIPT) + + + # Avoid bug in fcntl on some versions of linux AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os]) # Any wariation of Linux diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index ffa45e57196..056bb5a1734 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -6,7 +6,7 @@ ndblib_LTLIBRARIES = libndbclient.la libndbclient_la_SOURCES = -libndbclient_la_LDFLAGS = -version-info @NDB_SHARED_LIB_VERSION@ +libndbclient_la_LDFLAGS = -version-info @NDB_SHARED_LIB_VERSION@ @NDB_LD_VERSION_SCRIPT@ libndbclient_la_LIBADD = \ ndbapi/libndbapi.la \ diff --git a/ndb/src/libndb.ver.in b/ndb/src/libndb.ver.in new file mode 100644 index 00000000000..72bf93d196f --- /dev/null +++ b/ndb/src/libndb.ver.in @@ -0,0 +1,2 @@ +libndbclient_@NDB_SHARED_LIB_MAJOR_VERSION@ { global: *; }; + From 3fdf318ef67fc873576d89ca53b595f4fbbe6b79 Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Thu, 18 Jan 2007 16:28:47 -0800 Subject: [PATCH 4/5] Added configure section to deal with actually versioning symbols. --- configure.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.in b/configure.in index 9402c8d1876..f73f08f85fc 100644 --- a/configure.in +++ b/configure.in @@ -388,6 +388,14 @@ if $LD --version 2>/dev/null|grep -q GNU; then fi AC_SUBST(LD_VERSION_SCRIPT) +# libndbclient versioning when linked with GNU ld. +if $LD --version 2>/dev/null|grep -q GNU; then + NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver" + AC_CONFIG_FILES(storage/ndb/src/libndb.ver) +fi +AC_SUBST(NDB_LD_VERSION_SCRIPT) + + # Avoid bug in fcntl on some versions of linux AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os]) # Any variation of Linux From 33842511464a7b490342a482c02edf4ab5e89585 Mon Sep 17 00:00:00 2001 From: "mtaylor@qualinost.(none)" <> Date: Thu, 18 Jan 2007 16:31:43 -0800 Subject: [PATCH 5/5] Add code to actually version the symbols in the library, and not just the library. bug #13522 --- configure.in | 12 ++++++++++++ storage/ndb/src/Makefile.am | 2 +- storage/ndb/src/libndb.ver.in | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 storage/ndb/src/libndb.ver.in diff --git a/configure.in b/configure.in index 17a9714c16c..0becfe00bd5 100644 --- a/configure.in +++ b/configure.in @@ -15,6 +15,8 @@ DOT_FRM_VERSION=6 # See the libtool docs for information on how to do shared lib versions. SHARED_LIB_MAJOR_VERSION=15 SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0 +NDB_SHARED_LIB_MAJOR_VERSION=3 +NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # Set all version vars based on $VERSION. How do we do this more elegant ? # Remember that regexps needs to quote [ and ] since this is run through m4 MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"` @@ -58,6 +60,8 @@ AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION], [Version of .frm files]) AC_SUBST(SHARED_LIB_MAJOR_VERSION) AC_SUBST(SHARED_LIB_VERSION) +AC_SUBST(NDB_SHARED_LIB_MAJOR_VERSION) +AC_SUBST(NDB_SHARED_LIB_VERSION) AC_SUBST(AVAILABLE_LANGUAGES) @@ -354,6 +358,14 @@ if $LD --version 2>/dev/null|grep -q GNU; then fi AC_SUBST(LD_VERSION_SCRIPT) +# libndbclient versioning when linked with GNU ld. +if $LD --version 2>/dev/null|grep -q GNU; then + NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver" + AC_CONFIG_FILES(storage/ndb/src/libndb.ver) +fi +AC_SUBST(NDB_LD_VERSION_SCRIPT) + + # Avoid bug in fcntl on some versions of linux AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os]) # Any variation of Linux diff --git a/storage/ndb/src/Makefile.am b/storage/ndb/src/Makefile.am index fa743777921..627347daf02 100644 --- a/storage/ndb/src/Makefile.am +++ b/storage/ndb/src/Makefile.am @@ -21,7 +21,7 @@ ndblib_LTLIBRARIES = libndbclient.la libndbclient_la_SOURCES = -libndbclient_la_LDFLAGS = -version-info @NDB_SHARED_LIB_VERSION@ +libndbclient_la_LDFLAGS = -version-info @NDB_SHARED_LIB_VERSION@ @NDB_LD_VERSION_SCRIPT@ libndbclient_la_LIBADD = \ ndbapi/libndbapi.la \ diff --git a/storage/ndb/src/libndb.ver.in b/storage/ndb/src/libndb.ver.in new file mode 100644 index 00000000000..72bf93d196f --- /dev/null +++ b/storage/ndb/src/libndb.ver.in @@ -0,0 +1,2 @@ +libndbclient_@NDB_SHARED_LIB_MAJOR_VERSION@ { global: *; }; +