repo/extra/lvm2/patches/disable-symver.patch

137 lines
4.3 KiB
Diff
Raw Normal View History

2019-09-03 13:13:08 -06:00
diff --git a/configure b/configure
2019-10-25 01:58:01 -06:00
index 6dd7eda..ef6a416 100755
2019-09-03 13:13:08 -06:00
--- a/configure
+++ b/configure
2019-10-25 01:58:01 -06:00
@@ -959,6 +959,7 @@ enable_fsadm
2019-09-03 13:13:08 -06:00
enable_blkdeactivate
enable_dmeventd
enable_selinux
+enable_symvers
enable_nls
with_localedir
with_confdir
2019-10-25 01:58:01 -06:00
@@ -1677,6 +1678,9 @@ Optional Features:
2019-09-03 13:13:08 -06:00
--disable-blkdeactivate disable blkdeactivate
--enable-dmeventd enable the device-mapper event daemon
--disable-selinux disable selinux support
+ --enable-symvers[=STYLE]
+ enables symbol versioning of the shared library
+ [default=gnu]
--enable-nls enable Native Language Support
2019-10-25 01:58:01 -06:00
2019-09-03 13:13:08 -06:00
Optional Packages:
2019-10-25 01:58:01 -06:00
@@ -3077,7 +3081,6 @@ if test -z "$CFLAGS"; then :
2019-09-03 13:13:08 -06:00
fi
case "$host_os" in
linux*)
2019-10-25 01:58:01 -06:00
- CLDFLAGS="${CLDFLAGS-"$LDFLAGS"} -Wl,--version-script,.export.sym"
2019-09-03 13:13:08 -06:00
# equivalent to -rdynamic
ELDFLAGS="-Wl,--export-dynamic"
# FIXME Generate list and use --dynamic-list=.dlopen.sym
2019-10-25 01:58:01 -06:00
@@ -12969,6 +12972,33 @@ done
2019-09-03 13:13:08 -06:00
LIBS=$lvm_saved_libs
fi
2019-10-25 01:58:01 -06:00
2019-09-03 13:13:08 -06:00
+################################################################################
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable symbol versioning" >&5
+$as_echo_n "checking whether to enable symbol versioning... " >&6; }
+# Check whether --enable-symvers was given.
+if test "${enable_symvers+set}" = set; then :
+ enableval=$enable_symvers;
+ case "$enableval" in
+ gnu|no) ;;
+ *) as_fn_error $? "Unknown argument to enable/disable symvers" "$LINENO" 5 ;;
+ esac
+else
+ enable_symvers=gnu
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_symvers" >&5
+$as_echo "$enable_symvers" >&6; }
+
+if test x$GCC = xyes && test x$enable_symvers = xgnu ; then
+
+$as_echo "#define GNU_SYMVER 1" >>confdefs.h
+
+ case "$host_os" in
+ linux*) CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym" ;;
+ esac
+fi
2019-10-25 01:58:01 -06:00
+
2019-09-03 13:13:08 -06:00
+
################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable internationalisation" >&5
$as_echo_n "checking whether to enable internationalisation... " >&6; }
diff --git a/lib/misc/lib.h b/lib/misc/lib.h
2019-10-25 01:58:01 -06:00
index c14f437..79b36a3 100644
2019-09-03 13:13:08 -06:00
--- a/lib/misc/lib.h
+++ b/lib/misc/lib.h
2019-10-25 01:58:01 -06:00
@@ -62,7 +62,7 @@
2019-09-03 13:13:08 -06:00
* versions of library symbols prior to the introduction of symbol
* versioning: it must never be used for new symbols.
*/
-#if defined(__GNUC__)
+#if defined(GNU_SYMVER)
#define DM_EXPORT_SYMBOL(func, ver) \
__asm__(".symver " #func "_v" #ver ", " #func "@DM_" #ver )
#define DM_EXPORT_SYMBOL_BASE(func) \
diff --git a/libdm/datastruct/bitset.c b/libdm/datastruct/bitset.c
2019-10-25 01:58:01 -06:00
index 06bd31a..8f36ec7 100644
2019-09-03 13:13:08 -06:00
--- a/libdm/datastruct/bitset.c
+++ b/libdm/datastruct/bitset.c
@@ -242,7 +242,7 @@ bad:
return NULL;
}
2019-10-25 01:58:01 -06:00
2019-09-03 13:13:08 -06:00
-#if defined(__GNUC__)
+#if defined(GNU_SYMVER)
/*
* Maintain backward compatibility with older versions that did not
* accept a 'min_num_bits' argument to dm_bitset_parse_list().
2019-10-25 01:58:01 -06:00
@@ -254,6 +254,4 @@ dm_bitset_t dm_bitset_parse_list_v1_02_129(const char *str, struct dm_pool *mem)
2019-09-03 13:13:08 -06:00
}
DM_EXPORT_SYMBOL(dm_bitset_parse_list, 1_02_129);
2019-10-25 01:58:01 -06:00
2019-09-03 13:13:08 -06:00
-#else /* if defined(__GNUC__) */
-
#endif
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
2019-10-25 01:58:01 -06:00
index dd46b67..b09abdc 100644
2019-09-03 13:13:08 -06:00
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
2019-10-25 01:58:01 -06:00
@@ -2176,7 +2176,7 @@ void dm_lib_exit(void)
2019-09-03 13:13:08 -06:00
_version_checked = 0;
}
2019-10-25 01:58:01 -06:00
2019-09-03 13:13:08 -06:00
-#if defined(__GNUC__)
+#if defined(GNU_SYMVER)
/*
* Maintain binary backward compatibility.
* Version script mechanism works with 'gcc' compatible compilers only.
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
2019-10-25 01:58:01 -06:00
index ee12da2..08829c5 100644
2019-09-03 13:13:08 -06:00
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
2019-10-25 01:58:01 -06:00
@@ -3811,7 +3811,7 @@ void dm_tree_node_set_callback(struct dm_tree_node *dnode,
2019-09-03 13:13:08 -06:00
dnode->callback_data = data;
}
2019-10-25 01:58:01 -06:00
2019-09-03 13:13:08 -06:00
-#if defined(__GNUC__)
+#if defined(GNU_SYMVER)
/*
* Backward compatible implementations.
*
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
2019-10-25 01:58:01 -06:00
index 420e3e1..066bcdf 100644
2019-09-03 13:13:08 -06:00
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
2019-10-25 01:58:01 -06:00
@@ -5067,7 +5067,7 @@ int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
2019-09-03 13:13:08 -06:00
* current dm_stats_create_region() version.
*/
2019-10-25 01:58:01 -06:00
2019-09-03 13:13:08 -06:00
-#if defined(__GNUC__)
+#if defined(GNU_SYMVER)
int dm_stats_create_region_v1_02_106(struct dm_stats *dms, uint64_t *region_id,
uint64_t start, uint64_t len, int64_t step,
int precise, const char *program_id,