[SSSD] [PATCH][ding_libs] Add version symbol files

Lukas Slebodnik lslebodn at redhat.com
Tue Feb 25 19:02:01 UTC 2014


On (21/02/14 11:21), Lukas Slebodnik wrote:
>On (21/02/14 10:54), Lukas Slebodnik wrote:
>>On (16/01/14 10:17), Lukas Slebodnik wrote:
>>>On (13/01/14 19:42), Lukas Slebodnik wrote:
>>>>ehlo,
>>>>
>>>>attached patch addresses ticket #2193
>>>>
>>>>I have just a question about refarray/libref_array.sym
>>>>There is extern function ref_array_debug, which is not defined
>>>>in public header file (not exposed in public API), but it is used in ref_array
>>>>unit tests. It needs to be in global section because linker with fail to find
>>>>symbol. Should I add any comment to the file libref_array.sym or does anyone
>>>>better solution?
>>>>
>>>>LS
>>>
>>>I forgot to include files into lib..._SOURCES, they was not part of dist
>>>tarball. Updated patch is attached.
>>>
>>>I would like to know what we want to do with function ref_array_debug.
>>>
>>>LS
>>
>>The previous patch cannot be applied on ding-libs master due to conflict in
>>Makefile.am
>>
>>Rebased version is attached.
>>
>>LS
>
>and now with correctly resolved problems after rebase.
>Is should have tested patch before sending mail.
>
>LS

Replying to the different thread.

>>
>>You started this discussion about version dependency in ding-libs.
>>There is opportunity to be active and help us with testing and reviewing patch.
>>https://lists.fedorahosted.org/pipermail/sssd-devel/2014-February/018553.html
>>
>>Any comments are appreciated.
>
>Certainly.
>[That mail has not hit the downloadable .gz archives yet and there is no git
>branch for it, so building the package on my side will be delayed./
>The non-gz mailman archive has tabs replaced by spaces.]
>Comments without building thus:
>
>The .sym files should be listed in Makefile.am in a _DEPENDENCIES line
>instead of _SOURCES. When they are in _SOURCES, `touch *.sym && make`
>won't relink the library, when they are in _DEPENDENCIES, they will:
>
>libpath_utils_la_SOURCES = path_utils/path_utils.c
>libpath_utils_la_DEPENDENCIES = path_utils/libpath_utils.sym
>
Nice catch

>The sym file will be part of `make dist` as before without having it
>to list in _SOURCES.
>
It did't work, but it is not a problem.


>>+LIBBASICOBJECTS_0.1.0 {
>>+global:
>>+    simplebuffer_free;
>>+    ...
>>+local:
>>+    *;
>>+};
>>+
>>+LIBBASICOBJECTS_0.1.1 {
>>+global:
>>+    simplebuffer_get_vbuf;
>>+} LIBBASICOBJECTS_0.1.0;
>
>Since this is the initial presence of symvers in the library, there is not
>specifically a need to have more than one symbol: there exists no program
>out there that already references the LIBBASICOBJECTS_0.1.0 symbol,
>so you can just put all symbols under _0.1.1.
>This also applies to all the other .sym files.
>
It was not necessary to write symvers in this way. I wanted to write reference
implementation of version symbol file. So, it would be easy to extend symvers
in the future even for beginners.

>
>Referring to libini_config for this next example:
>
>The symbol name is connected to the library, so it does not need to try to
>be unique across the entire system AFAICS. If you like you can make it shorter,
>for example "ABI_4 { ... }" to point out that these functions were added
>in version 4 (cf. libtool number in -version-info). Or V_4. Whichever :)

This is true. I checked installed libraries on my desktop and it seems to be
unwritten rule to use uppercased name of library for this purpose.
Some libraries contain also string LIB in this identifier
    e.g libidn.so.11 (LIBIDN_1.0), libxml2.so.2(LIBXML2_2.4.30)
        libvirt.so.0(LIBVIRT_0.0.3), libsystemd-daemon.so.0(LIBSYSTEMD_DAEMON_31)
Other libraries ommit string LIB from identifier
    e.g libsolv.so.0(SOLV_1.0), libtevent.so.0(TEVENT_0.9.9)
        libgcrypt.so.11(GCRYPT_1.2), libnss3.so(NSS_3.2)

Only two libraries from package setools-libs use identifier VERS_4.1
    e.g libseaudit.so.4, libapol.so.4

The biggest group uses upperace identifier without string LIB.
I decided to remove "prefix" LIB.

Updated patch is attached

Thank you very much for your comments.

LS
-------------- next part --------------
>From 4861b50c0d6878fb620edf1f979ef3847b33f838 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Fri, 10 Jan 2014 21:14:46 +0100
Subject: [PATCH] Add version symbol files

Resolves:
https://fedorahosted.org/sssd/ticket/2193
---
 Makefile.am                      |  32 +++++++--
 basicobjects/libbasicobjects.sym |  20 ++++++
 collection/libcollection.sym     | 150 +++++++++++++++++++++++++++++++++++++++
 dhash/libdhash.sym               |  22 ++++++
 ini/libini_config.sym            | 136 +++++++++++++++++++++++++++++++++++
 path_utils/libpath_utils.sym     |  20 ++++++
 refarray/libref_array.sym        |  24 +++++++
 7 files changed, 397 insertions(+), 7 deletions(-)
 create mode 100644 basicobjects/libbasicobjects.sym
 create mode 100644 collection/libcollection.sym
 create mode 100644 dhash/libdhash.sym
 create mode 100644 ini/libini_config.sym
 create mode 100644 path_utils/libpath_utils.sym
 create mode 100644 refarray/libref_array.sym

diff --git a/Makefile.am b/Makefile.am
index 99e8565df633b50ab49c1ed0434ffb1c47a491c0..44a9dff9ccaec9f13c9de34ccabbb8c31ce81e0a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,7 +8,13 @@ builddir ?= .
 dist_noinst_DATA = \
     m4 \
     COPYING \
-    COPYING.LESSER
+    COPYING.LESSER \
+    path_utils/libpath_utils.sym \
+    dhash/libdhash.sym \
+    collection/libcollection.sym \
+    refarray/libref_array.sym \
+    basicobjects/libbasicobjects.sym \
+    ini/libini_config.sym
 
 ##############################################################################
 # Common
@@ -57,8 +63,10 @@ dist_pkgconfig_DATA += path_utils/path_utils.pc
 dist_include_HEADERS += path_utils/path_utils.h
 
 libpath_utils_la_SOURCES = path_utils/path_utils.c
+libpath_utils_la_DEPENDENCIES = path_utils/libpath_utils.sym
 libpath_utils_la_LDFLAGS = \
-    -version-info 1:0:0
+    -version-info 1:0:0 \
+    -Wl,--version-script=$(top_srcdir)/path_utils/libpath_utils.sym
 
 if HAVE_CHECK
     check_PROGRAMS += path_utils_ut
@@ -90,8 +98,10 @@ dist_pkgconfig_DATA += dhash/dhash.pc
 dist_include_HEADERS += dhash/dhash.h
 
 libdhash_la_SOURCES = dhash/dhash.c
+libdhash_la_DEPENDENCIES = dhash/libdhash.sym
 libdhash_la_LDFLAGS = \
-    -version-info 1:1:0
+    -version-info 1:1:0 \
+    -Wl,--version-script=$(top_srcdir)/dhash/libdhash.sym
 
 check_PROGRAMS += dhash_test dhash_example
 TESTS += dhash_test dhash_example
@@ -130,8 +140,10 @@ libcollection_la_SOURCES = \
     collection/collection_iter.c \
     collection/collection_priv.h \
     trace/trace.h
+libcollection_la_DEPENDENCIES = collection/libcollection.sym
 libcollection_la_LDFLAGS = \
-    -version-info 3:0:1
+    -version-info 3:0:1 \
+    -Wl,--version-script=$(top_srcdir)/collection/libcollection.sym
 
 check_PROGRAMS += \
     collection_ut \
@@ -166,8 +178,10 @@ dist_include_HEADERS += refarray/ref_array.h
 libref_array_la_SOURCES = \
     refarray/ref_array.c \
     trace/trace.h
+libref_array_la_DEPENDENCIES = refarray/libref_array.sym
 libref_array_la_LDFLAGS = \
-    -version-info 2:0:1
+    -version-info 2:0:1 \
+    -Wl,--version-script=$(top_srcdir)/refarray/libref_array.sym
 
 check_PROGRAMS += ref_array_ut
 TESTS += ref_array_ut
@@ -193,8 +207,10 @@ dist_include_HEADERS += basicobjects/simplebuffer.h
 libbasicobjects_la_SOURCES = \
     basicobjects/simplebuffer.c \
     trace/trace.h
+libbasicobjects_la_DEPENDENCIES = basicobjects/libbasicobjects.sym
 libbasicobjects_la_LDFLAGS = \
-    -version-info 0:0:0
+    -version-info 0:0:0 \
+    -Wl,--version-script=$(top_srcdir)/basicobjects/libbasicobjects.sym
 
 check_PROGRAMS += simplebuffer_ut
 TESTS += simplebuffer_ut
@@ -240,13 +256,15 @@ libini_config_la_SOURCES = \
     ini/ini_get_array_valueobj.c \
     ini/ini_list_valueobj.c \
     trace/trace.h
+EXTRA_libini_config_la_DEPENDENCIES = ini/libini_config.sym
 libini_config_la_LIBADD = \
     libcollection.la \
     libpath_utils.la \
     libref_array.la \
     libbasicobjects.la
 libini_config_la_LDFLAGS = \
-    -version-info 4:0:1
+    -version-info 4:0:1 \
+    -Wl,--version-script=$(top_srcdir)/ini/libini_config.sym
 
 dist_noinst_DATA += \
     ini/ini.conf \
diff --git a/basicobjects/libbasicobjects.sym b/basicobjects/libbasicobjects.sym
new file mode 100644
index 0000000000000000000000000000000000000000..532b969faa15d41cffee7eeb36a2aabcddef9bc6
--- /dev/null
+++ b/basicobjects/libbasicobjects.sym
@@ -0,0 +1,20 @@
+BASICOBJECTS_0.1.0 {
+global:
+    simplebuffer_free;
+    simplebuffer_alloc;
+    simplebuffer_grow;
+    simplebuffer_add_raw;
+    simplebuffer_add_str;
+    simplebuffer_add_cr;
+    simplebuffer_write;
+    simplebuffer_get_buf;
+    simplebuffer_get_len;
+
+local:
+    *;
+};
+
+BASICOBJECTS_0.1.1 {
+global:
+    simplebuffer_get_vbuf;
+} BASICOBJECTS_0.1.0;
diff --git a/collection/libcollection.sym b/collection/libcollection.sym
new file mode 100644
index 0000000000000000000000000000000000000000..e526636151f459af98dc0f45319439a7f49006ed
--- /dev/null
+++ b/collection/libcollection.sym
@@ -0,0 +1,150 @@
+COLLECTION_0.6.0 {
+global:
+    /* collection.h */
+    col_create_collection;
+    col_destroy_collection;
+    col_copy_collection_with_cb;
+    col_copy_collection;
+    col_add_collection_to_collection;
+    col_traverse_collection;
+    col_get_item_and_do;
+    col_get_item;
+    col_sort_collection;
+    col_delete_property;
+    col_is_item_in_collection;
+    col_get_collection_reference;
+    col_get_reference_from_item;
+    col_get_collection_class;
+    col_set_collection_class;
+    col_get_collection_count;
+    col_is_of_class;
+    col_add_str_property;
+    col_add_binary_property;
+    col_add_int_property;
+    col_add_unsigned_property;
+    col_add_long_property;
+    col_add_ulong_property;
+    col_add_double_property;
+    col_add_bool_property;
+    col_add_any_property;
+    col_add_str_property_with_ref;
+    col_add_binary_property_with_ref;
+    col_add_int_property_with_ref;
+    col_add_unsigned_property_with_ref;
+    col_add_long_property_with_ref;
+    col_add_ulong_property_with_ref;
+    col_add_double_property_with_ref;
+    col_add_bool_property_with_ref;
+    col_add_any_property_with_ref;
+    col_insert_str_property;
+    col_insert_binary_property;
+    col_insert_int_property;
+    col_insert_unsigned_property;
+    col_insert_long_property;
+    col_insert_ulong_property;
+    col_insert_double_property;
+    col_insert_bool_property;
+    col_insert_str_property_with_ref;
+    col_insert_binary_property_with_ref;
+    col_insert_int_property_with_ref;
+    col_insert_unsigned_property_with_ref;
+    col_insert_long_property_with_ref;
+    col_insert_ulong_property_with_ref;
+    col_insert_double_property_with_ref;
+    col_insert_bool_property_with_ref;
+    col_insert_property_with_ref;
+    col_update_str_property;
+    col_update_binary_property;
+    col_update_int_property;
+    col_update_unsigned_property;
+    col_update_long_property;
+    col_update_ulong_property;
+    col_update_double_property;
+    col_update_bool_property;
+    col_update_property;
+    col_get_item_property;
+    col_get_item_type;
+    col_get_item_length;
+    col_get_item_data;
+    col_get_item_hash;
+    col_make_hash;
+    col_compare_items;
+    col_modify_item;
+    col_modify_item_property;
+    col_modify_str_item;
+    col_modify_binary_item;
+    col_modify_bool_item;
+    col_modify_int_item;
+    col_modify_long_item;
+    col_modify_ulong_item;
+    col_modify_unsigned_item;
+    col_modify_double_item;
+    col_extract_item;
+    col_extract_item_from_current;
+    col_remove_item;
+    col_remove_item_from_current;
+    col_insert_item;
+    col_insert_item_into_current;
+    col_delete_item;
+    col_bind_iterator;
+    col_unbind_iterator;
+    col_iterate_collection;
+    col_iterate_up;
+    col_get_iterator_depth;
+    col_get_item_depth;
+    col_pin_iterator;
+    col_rewind_iterator;
+
+    /* collection_queue.h */
+    col_create_queue;
+    col_destroy_queue;
+    col_enqueue_str_property;
+    col_enqueue_binary_property;
+    col_enqueue_int_property;
+    col_enqueue_unsigned_property;
+    col_enqueue_long_property;
+    col_enqueue_ulong_property;
+    col_enqueue_double_property;
+    col_enqueue_bool_property;
+    col_enqueue_any_property;
+    col_enqueue_item;
+    col_dequeue_item;
+
+    /* collection_stack.h */
+    col_create_stack;
+    col_destroy_stack;
+    col_push_str_property;
+    col_push_binary_property;
+    col_push_int_property;
+    col_push_unsigned_property;
+    col_push_long_property;
+    col_push_ulong_property;
+    col_push_double_property;
+    col_push_bool_property;
+    col_push_any_property;
+    col_push_item;
+    col_pop_item;
+
+    /* collection_tools.h */
+    col_get_data_len;
+    col_grow_buffer;
+    col_put_marker;
+    col_serialize;
+    col_debug_handle;
+    col_debug_item;
+    col_debug_collection;
+    col_print_collection;
+    col_print_collection2;
+    col_print_item;
+    col_collection_to_list;
+    col_free_property_list;
+
+local:
+    *;
+};
+
+COLLECTION_0.6.2 {
+global:
+    /* collection.h */
+    col_destroy_collection_with_cb;
+} COLLECTION_0.6.0;
diff --git a/dhash/libdhash.sym b/dhash/libdhash.sym
new file mode 100644
index 0000000000000000000000000000000000000000..513bfc5a68998adb376784228c0a36578ec7c242
--- /dev/null
+++ b/dhash/libdhash.sym
@@ -0,0 +1,22 @@
+DHASH_0.4.3 {
+global:
+    hash_error_string;
+    hash_create;
+    hash_create_ex;
+    hash_get_statistics;
+    hash_destroy;
+    hash_enter;
+    hash_lookup;
+    hash_get_default;
+    hash_delete;
+    hash_iterate;
+    new_hash_iter_context;
+    hash_count;
+    hash_keys;
+    hash_values;
+    hash_entries;
+    hash_has_key;
+
+local:
+    *;
+};
diff --git a/ini/libini_config.sym b/ini/libini_config.sym
new file mode 100644
index 0000000000000000000000000000000000000000..d38b17b8d4e44bbc50c24d59e5f6ed41b7db1f74
--- /dev/null
+++ b/ini/libini_config.sym
@@ -0,0 +1,136 @@
+INI_CONFIG_1.0.0 {
+global:
+    /* ini_config.h */
+    config_from_file;
+    config_from_fd;
+    config_from_file_with_metadata;
+    config_from_fd_with_metadata;
+    config_for_app;
+    config_for_app_with_metadata;
+    config_access_check;
+    config_changed;
+    free_ini_config;
+    free_ini_config_errors;
+    free_ini_config_metadata;
+    print_file_parsing_errors;
+    print_config_parsing_errors;
+    get_section_list;
+    free_section_list;
+    get_attribute_list;
+    free_attribute_list;
+    get_config_item;
+    get_int_config_value;
+    get_long_config_value;
+    get_unsigned_config_value;
+    get_ulong_config_value;
+    get_int32_config_value;
+    get_uint32_config_value;
+    get_int64_config_value;
+    get_uint64_config_value;
+    get_double_config_value;
+    get_bool_config_value;
+    get_string_config_value;
+    get_const_string_config_value;
+    get_bin_config_value;
+    free_bin_config_value;
+    get_string_config_array;
+    get_raw_string_config_array;
+    get_long_config_array;
+    get_double_config_array;
+    free_string_config_array;
+    free_long_config_array;
+    free_double_config_array;
+
+    /* ini_configobj.h */
+    ini_config_create;
+    ini_config_destroy;
+    ini_config_clean_state;
+    ini_config_file_open;
+    ini_config_file_close;
+    ini_config_file_reopen;
+    ini_config_file_destroy;
+    ini_config_error_count;
+    ini_config_get_errors;
+    ini_config_free_errors;
+    ini_config_print_errors;
+    ini_config_get_filename;
+    ini_config_get_stat;
+    ini_config_file_print;
+    ini_config_access_check;
+    ini_config_changed;
+    ini_config_parse;
+    ini_config_copy;
+    ini_config_merge;
+    ini_config_set_wrap;
+    ini_config_serialize;
+    ini_get_section_list;
+    ini_free_section_list;
+    ini_get_attribute_list;
+    ini_free_attribute_list;
+    ini_get_config_valueobj;
+    ini_get_int_config_value;
+    ini_get_unsigned_config_value;
+    ini_get_long_config_value;
+    ini_get_ulong_config_value;
+    ini_get_int32_config_value;
+    ini_get_uint32_config_value;
+    ini_get_int64_config_value;
+    ini_get_uint64_config_value;
+    ini_get_double_config_value;
+    ini_get_bool_config_value;
+    ini_get_string_config_value;
+    ini_get_const_string_config_value;
+    ini_get_bin_config_value;
+    ini_free_bin_config_value;
+    ini_get_string_config_array;
+    ini_get_raw_string_config_array;
+    ini_get_long_config_array;
+    ini_get_double_config_array;
+    ini_free_string_config_array;
+    ini_free_long_config_array;
+    ini_free_double_config_array;
+
+    /* ini_valueobj.h */
+    value_create_from_refarray;
+    value_lines_cleanup_cb;
+    value_create_arrays;
+    value_add_to_arrays;
+    value_destroy_arrays;
+    value_create_new;
+    value_copy;
+    value_destroy;
+    value_get_concatenated;
+    value_get_concatenated_len;
+    value_get_origin;
+    value_get_line;
+    value_set_keylen;
+    value_set_boundary;
+    value_update;
+    value_extract_comment;
+    value_put_comment;
+    value_merge_comment;
+    value_serialize;
+    value_print;
+
+    /* ini_comment.h */
+    ini_comment_create;
+    ini_comment_destroy;
+    ini_comment_build;
+    ini_comment_build_wl;
+    ini_comment_insert;
+    ini_comment_append;
+    ini_comment_remove;
+    ini_comment_clear;
+    ini_comment_replace;
+    ini_comment_reset;
+    ini_comment_get_numlines;
+    ini_comment_get_line;
+    ini_comment_swap;
+    ini_comment_copy;
+    ini_comment_add;
+    ini_comment_serialize;
+    ini_comment_print;
+
+local:
+    *;
+};
diff --git a/path_utils/libpath_utils.sym b/path_utils/libpath_utils.sym
new file mode 100644
index 0000000000000000000000000000000000000000..842f38122db83fd6e867d99cda106ebe590b9ff0
--- /dev/null
+++ b/path_utils/libpath_utils.sym
@@ -0,0 +1,20 @@
+PATH_UTILS_0.2.1 {
+global:
+    path_utils_error_string;
+    get_basename;
+    get_dirname;
+    get_directory_and_base_name;
+    is_absolute_path;
+    path_concat;
+    make_path_absolute;
+    split_path;
+    normalize_path;
+    common_path_prefix;
+    make_normalized_absolute_path;
+    find_existing_directory_ancestor;
+    directory_list;
+    is_ancestor_path;
+
+local:
+    *;
+};
diff --git a/refarray/libref_array.sym b/refarray/libref_array.sym
new file mode 100644
index 0000000000000000000000000000000000000000..3a1d434587061ba2adf5f8f92c22d0b57baccc2b
--- /dev/null
+++ b/refarray/libref_array.sym
@@ -0,0 +1,24 @@
+REF_ARRAY_0.1.1 {
+global:
+    ref_array_create;
+    ref_array_getref;
+    ref_array_destroy;
+    ref_array_append;
+    ref_array_get;
+    ref_array_getlen;
+    ref_array_len;
+    ref_array_insert;
+    ref_array_replace;
+    ref_array_remove;
+    ref_array_swap;
+    ref_array_reset;
+    ref_array_debug;
+
+local:
+    *;
+};
+
+REF_ARRAY_0.1.3 {
+global:
+    ref_array_copy;
+} REF_ARRAY_0.1.1;
-- 
1.8.5.3



More information about the sssd-devel mailing list