ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] version script for glib2
@ 2005-09-03 21:30 Alexey Tourbin
  2005-09-03 22:06 ` Dmitry V. Levin
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Tourbin @ 2005-09-03 21:30 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 8173 bytes --]

glib2 собирается libtool'ом, скрипт для экспорта символов
генерируется автоматически:

$ pwd
/home/at/RPM/BUILD/glib-2.8.1/glib
$ head .libs/libglib-2.0.ver
{ global:
IA__g_access;
IA__g_allocator_free;
IA__g_allocator_new;
IA__g_array_append_vals;
IA__g_array_free;
IA__g_array_insert_vals;
IA__g_array_new;
IA__g_array_prepend_vals;
IA__g_array_remove_index;
$

Некоторые символы я хочу перевесить на отдельный интерфейс.
Для этого я делаю другой скрипт на основе этого *.ver скрипта.

--- .libs/libglib-2.0.ver	2005-09-04 01:26:11 +0400
+++ glib2.map	2005-09-04 01:25:26 +0400
@@ -1,3 +1,3 @@
+# based on .libs/libglib-2.0.ver
 { global:
-IA__g_access;
 IA__g_allocator_free;
@@ -51,5 +51,3 @@
 IA__g_build_filename;
-IA__g_build_filenamev;
 IA__g_build_path;
-IA__g_build_pathv;
 IA__g_byte_array_append;
@@ -71,3 +69,2 @@
 IA__g_cache_value_foreach;
-IA__g_chdir;
 IA__g_child_watch_add;
@@ -75,3 +72,2 @@
 IA__g_child_watch_source_new;
-IA__g_chmod;
 IA__g_clear_error;
@@ -89,6 +85,4 @@
 IA__g_convert_with_iconv;
-IA__g_creat;
 IA__g_datalist_clear;
 IA__g_datalist_foreach;
-IA__g_datalist_get_flags;
 IA__g_datalist_id_get_data;
@@ -97,4 +91,2 @@
 IA__g_datalist_init;
-IA__g_datalist_set_flags;
-IA__g_datalist_unset_flags;
 IA__g_dataset_destroy;
@@ -166,3 +158,2 @@
 IA__g_file_read_link;
-IA__g_file_set_contents;
 IA__g_file_test;
@@ -185,3 +176,2 @@
 IA__g_get_home_dir;
-IA__g_get_host_name;
 IA__g_get_language_names;
@@ -347,3 +337,2 @@
 IA__g_list_sort_with_data;
-IA__g_listenv;
 IA__g_locale_from_utf8;
@@ -390,6 +379,2 @@
 IA__g_malloc0;
-IA__g_mapped_file_free;
-IA__g_mapped_file_get_contents;
-IA__g_mapped_file_get_length;
-IA__g_mapped_file_new;
 IA__g_markup_error_quark;
@@ -418,3 +403,2 @@
 IA__g_mkdir;
-IA__g_mkdir_with_parents;
 IA__g_mkstemp;
@@ -791,3 +775,2 @@
 IA__g_try_malloc;
-IA__g_try_malloc0;
 IA__g_try_realloc;
@@ -832,3 +815,2 @@
 IA__g_utf8_collate_key;
-IA__g_utf8_collate_key_for_filename;
 IA__g_utf8_find_next_char;
@@ -858,3 +840,2 @@
 IA__glib_check_version;
-g_access;
 g_allocator_free;
@@ -908,5 +889,3 @@
 g_atomic_int_exchange_and_add;
-g_atomic_int_get;
 g_atomic_pointer_compare_and_exchange;
-g_atomic_pointer_get;
 g_basename;
@@ -917,5 +896,3 @@
 g_build_filename;
-g_build_filenamev;
 g_build_path;
-g_build_pathv;
 g_byte_array_append;
@@ -937,3 +914,2 @@
 g_cache_value_foreach;
-g_chdir;
 g_child_watch_add;
@@ -942,3 +918,2 @@
 g_child_watch_source_new;
-g_chmod;
 g_clear_error;
@@ -956,6 +931,4 @@
 g_convert_with_iconv;
-g_creat;
 g_datalist_clear;
 g_datalist_foreach;
-g_datalist_get_flags;
 g_datalist_id_get_data;
@@ -964,4 +937,2 @@
 g_datalist_init;
-g_datalist_set_flags;
-g_datalist_unset_flags;
 g_dataset_destroy;
@@ -1033,3 +1004,2 @@
 g_file_read_link;
-g_file_set_contents;
 g_file_test;
@@ -1053,3 +1023,2 @@
 g_get_home_dir;
-g_get_host_name;
 g_get_language_names;
@@ -1217,3 +1186,2 @@
 g_list_sort_with_data;
-g_listenv;
 g_locale_from_utf8;
@@ -1260,6 +1228,2 @@
 g_malloc0;
-g_mapped_file_free;
-g_mapped_file_get_contents;
-g_mapped_file_get_length;
-g_mapped_file_new;
 g_markup_error_quark;
@@ -1288,3 +1252,2 @@
 g_mkdir;
-g_mkdir_with_parents;
 g_mkstemp;
@@ -1678,3 +1641,2 @@
 g_try_malloc;
-g_try_malloc0;
 g_try_realloc;
@@ -1719,3 +1681,2 @@
 g_utf8_collate_key;
-g_utf8_collate_key_for_filename;
 g_utf8_find_next_char;
@@ -1754 +1715,52 @@
 local: *; };
+# symbols new to 2.8
+GLIB_2.8 {
+IA__g_access;
+IA__g_atomic_int_get;
+IA__g_atomic_pointer_get;
+IA__g_build_filenamev;
+IA__g_build_pathv;
+IA__g_chdir;
+IA__g_chmod;
+IA__g_creat;
+IA__g_datalist_get_flags;
+IA__g_datalist_set_flags;
+IA__g_datalist_unset_flags;
+IA__g_date_get_type;
+IA__g_file_set_contents;
+IA__g_get_host_name;
+IA__g_listenv;
+IA__g_mapped_file_free;
+IA__g_mapped_file_get_contents;
+IA__g_mapped_file_get_length;
+IA__g_mapped_file_new;
+IA__g_mkdir_with_parents;
+IA__g_object_add_toggle_ref;
+IA__g_object_remove_toggle_ref;
+IA__g_try_malloc0;
+IA__g_utf8_collate_key_for_filename;
+g_access;
+g_atomic_int_get;
+g_atomic_pointer_get;
+g_build_filenamev;
+g_build_pathv;
+g_chdir;
+g_chmod;
+g_creat;
+g_datalist_get_flags;
+g_datalist_set_flags;
+g_datalist_unset_flags;
+g_date_get_type;
+g_file_set_contents;
+g_get_host_name;
+g_listenv;
+g_mapped_file_free;
+g_mapped_file_get_contents;
+g_mapped_file_get_length;
+g_mapped_file_new;
+g_mkdir_with_parents;
+g_object_add_toggle_ref;
+g_object_remove_toggle_ref;
+g_try_malloc0;
+g_utf8_collate_key_for_filename;
+};

Затем подменяю в Makefile'е экспорт символов:

$ diff Makefile
--- Makefile-   2005-09-03 19:44:43 +0000
+++ Makefile    2005-09-03 21:23:02 +0000
@@ -409,6 +409,7 @@ glibsubinclude_HEADERS = \
 #export_symbols = -export-symbols glib.def

 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
+export_symbols = -Wl,--version-script=glib2.map

 #glib_win32_res = glib-win32-res.o
 #glib_win32_res_ldflag = -Wl,$(glib_win32_res)
$

Получаю:

$ rm -fv *.la
removed `libglib-2.0.la'
$ make
make  all-recursive
make[1]: Entering directory `/home/at/RPM/BUILD/glib-2.8.1/glib'
Making all in libcharset
make[2]: Entering directory `/home/at/RPM/BUILD/glib-2.8.1/glib/libcharset'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/at/RPM/BUILD/glib-2.8.1/glib/libcharset'
make[2]: Entering directory `/home/at/RPM/BUILD/glib-2.8.1/glib'
/bin/sh ../libtool --mode=link gcc  -pipe -Wall -O2 -march=i686   -o libglib-2.0.la -rpath /usr/lib -version-info 800:1:800 -export-dynamic  -Wl,--version-script=glib2.map garray.lo gasyncqueue.lo gatomic.lo gbacktrace.lo gcache.lo gcompletion.lo gconvert.lo gdataset.lo gdate.lo gdir.lo gerror.lo gfileutils.lo ghash.lo ghook.lo giochannel.lo gkeyfile.lo glist.lo gmain.lo gmappedfile.lo gmarkup.lo gmem.lo gmessages.lo gnode.lo goption.lo gpattern.lo gprimes.lo gqsort.lo gqueue.lo grel.lo grand.lo gscanner.lo gshell.lo gslist.lo gstdio.lo gstrfuncs.lo gstring.lo gthread.lo gthreadpool.lo gtimer.lo gtree.lo guniprop.lo gutf8.lo gunibreak.lo gunicollate.lo gunidecomp.lo gutils.lo gprintf.lo libcharset/libcharset.la  giounix.lo gspawn.lo
rm -fr  .libs/libglib-2.0.exp .libs/libglib-2.0.la .libs/libglib-2.0.lai .libs/libglib-2.0.so .libs/libglib-2.0.so.0 .libs/libglib-2.0.so.0.800.1 .libs/libglib-2.0.ver
gcc -shared  .libs/garray.o .libs/gasyncqueue.o .libs/gatomic.o .libs/gbacktrace.o .libs/gcache.o .libs/gcompletion.o .libs/gconvert.o .libs/gdataset.o .libs/gdate.o .libs/gdir.o .libs/gerror.o .libs/gfileutils.o .libs/ghash.o .libs/ghook.o .libs/giochannel.o .libs/gkeyfile.o .libs/glist.o .libs/gmain.o .libs/gmappedfile.o .libs/gmarkup.o .libs/gmem.o .libs/gmessages.o .libs/gnode.o .libs/goption.o .libs/gpattern.o .libs/gprimes.o .libs/gqsort.o .libs/gqueue.o .libs/grel.o .libs/grand.o .libs/gscanner.o .libs/gshell.o .libs/gslist.o .libs/gstdio.o .libs/gstrfuncs.o .libs/gstring.o .libs/gthread.o .libs/gthreadpool.o .libs/gtimer.o .libs/gtree.o .libs/guniprop.o .libs/gutf8.o .libs/gunibreak.o .libs/gunicollate.o .libs/gunidecomp.o .libs/gutils.o .libs/gprintf.o .libs/giounix.o .libs/gspawn.o -Wl,--whole-archive libcharset/.libs/libcharset.a -Wl,--no-whole-archive   -march=i686 -Wl,--version-script=glib2.map -Wl,-soname -Wl,libglib-2.0.so.0 -o .libs/libglib-2.0.so.0.800.1
/usr/bin/ld: anonymous version tag cannot be combined with other version tags
collect2: ld returned 1 exit status
make[2]: *** [libglib-2.0.la] Error 1
make[2]: Leaving directory `/home/at/RPM/BUILD/glib-2.8.1/glib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/at/RPM/BUILD/glib-2.8.1/glib'
make: *** [all] Error 2
$

Ошибка:
/usr/bin/ld: anonymous version tag cannot be combined with other version tags

Внимание, вопрос: позволяет ли version script одновременно ограничить
список экспортируемых символов (для дефелотного интерфейса, то есть без
интерфейса) и одновременно перевесить некоторые функции на отдельный
интерфейс?

И ещё вопрос: что это за IA__ символы, зачем их экспортировать?

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-09-09 11:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-03 21:30 [devel] version script for glib2 Alexey Tourbin
2005-09-03 22:06 ` Dmitry V. Levin
2005-09-03 22:18   ` [devel] " Alexey Tourbin
2005-09-03 22:27     ` Dmitry V. Levin
2005-09-03 23:15       ` Alexey Tourbin
2005-09-03 23:21         ` Dmitry V. Levin
2005-09-09  5:00           ` Alexey Tourbin
2005-09-09 11:05             ` Dmitry V. Levin
2005-09-04  2:14       ` Alexey Tourbin

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git