libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cygwin vs. --disable-static


From: Eric Blake
Subject: cygwin vs. --disable-static
Date: Tue, 03 Oct 2006 06:44:29 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Compilation of CVS m4 currently fails on cygwin when configured with
- --disable-static, due to global variables referenced in the library export
lists.  If nothing else, this is yet another example of why global
variables in libraries are bad.  Somehow, these variables are getting
additional thunks defined, and the symbol extractor tries to link to the
thunks as well as the original variables, and fails:

libtool: link: rm -f src/.libs/m4.exe.nm src/.libs/m4.exe.nmS
src/.libs/m4.exe.nmT
libtool: link: creating src/.libs/m4.exeS.c
libtool: link: extracting global C symbols from `modules/.libs/m4-0.dll'
libtool: link: extracting global C symbols from
`modules/.libs/traditional-0.dll'
libtool: link: extracting global C symbols from `modules/.libs/gnu-0.dll'
libtool: link: (cd src/.libs && gcc -O2 -pipe -c -fno-builtin "m4.exeS.c")
libtool: link: rm -f "src/.libs/m4.exeS.c" "src/.libs/m4.exe.nm"
"src/.libs/m4.exe.nmS" "src/.libs/m4.exe.nmT"
libtool: link: gcc -O2 -pipe src/.libs/m4.exeS.o -o src/.libs/m4.exe
src/src_m4-version-etc-fsf.o src/src_m4-version-etc.o src/src_m4-main.o
src/src_m4-freeze.o src/src_m4-getopt.o src/src_m4-getopt1.o
- -Wl,--export-dynamic  modules/.libs/m4.dll.a -L/usr/local/lib
modules/.libs/traditional.dll.a modules/.libs/gnu.dll.a
/home/eblake/m4-head/buildb/m4/.libs/libm4.dll.a m4/.libs/libm4.dll.a
/usr/local/lib/libintl.dll.a /usr/lib/libiconv.dll.a
- -L/usr/local/libexec/m4 -L/usr/local/lib
src/.libs/m4.exeS.o:m4.exeS.c:(.data+0xc4): undefined reference to
`__fu0__m4_current_diversion'
src/.libs/m4.exeS.o:m4.exeS.c:(.data+0x3dc): undefined reference to
`__nm_thnk__m4_current_diversion'
src/.libs/m4.exeS.o:m4.exeS.c:(.data+0x95c): undefined reference to
`__fu0__program_name'
Info: resolving _m4_LTX_m4_builtin_table by linking to
__imp__m4_LTX_m4_builtin_table (auto-import)
Info: resolving _traditional_LTX_m4_macro_table by linking to
__imp__traditional_LTX_m4_macro_table (auto-import)
Info: resolving _gnu_LTX_m4_builtin_table by linking to
__imp__gnu_LTX_m4_builtin_table (auto-import)
Info: resolving _gnu_LTX_m4_macro_table by linking to
__imp__gnu_LTX_m4_macro_table (auto-import)
Info: resolving _program_name by linking to __imp__program_name (auto-import)
Info: resolving _exit_failure by linking to __imp__exit_failure (auto-import)
collect2: ld returned 1 exit status

[The fact that m4_current_diversion is a global variable, instead of
accessor functions, is a bug in m4 that I intend to address; but
program_name comes from gnulib on non-glibc systems, and I don't see any
easy way to convert it to accessor methods.]

Compare the difference in the list of symbols extracted between 'build'
that uses both static and shared, and 'buildb' which did --disable-static;
attached:

$ nm build/src/.libs/m4.exeS.o
00000000 b .bss
00000000 d .data
00000000 r .rdata
00000000 t .text
         U _gnu_LTX_m4_builtin_table
         U _gnu_LTX_m4_finish_module
         U _gnu_LTX_m4_macro_table
00000000 D _lt__PROGRAM__LTX_preloaded_symbols
         U _m4_LTX_m4_builtin_table
         U _m4_LTX_m4_dump_symbols
         U _m4_LTX_m4_expand_ranges
         U _m4_LTX_m4_init_module
         U _m4_LTX_m4_set_sysval
         U _m4_LTX_m4_sysval_flush
         U _traditional_LTX_m4_macro_table
$ diff -u <(nm build/src/.libs/m4.exeS.o) \
  <(nm buildb/src/.libs/m4.exeS.o) > nm.diff

I'm not really sure where to proceed from here.  Is there some way to keep
the temporary .libs/m4.exeS.c to see what symbols it is trying to define,
and why the __fu0_* and __m4_thnk_* are failing to link?  Maybe it is just
a matter of teaching the symbol extractor to filter out globals with
certain prefixes?

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFIlss84KuGfSFAYARAudCAJ9VMpYNuTzM2fEAB9t3iS0+ygR1HACgi5d6
WDX6X1rfIUpK0eGofxVUmRQ=
=rS66
-----END PGP SIGNATURE-----
--- /proc/self/fd/63    2006-10-03 06:35:19.171875000 -0600
+++ /proc/self/fd/62    2006-10-03 06:35:19.171875000 -0600
@@ -2,14 +2,287 @@
 00000000 d .data
 00000000 r .rdata
 00000000 t .text
+         U __CTOR_LIST__
+         U __DTOR_LIST__
+         U __RUNTIME_PSEUDO_RELOC_LIST_END__
+         U __RUNTIME_PSEUDO_RELOC_LIST__
+         U ___CTOR_LIST__
+         U ___DTOR_LIST__
+         U ___RUNTIME_PSEUDO_RELOC_LIST_END__
+         U ___RUNTIME_PSEUDO_RELOC_LIST__
+         U ___assert
+         U ___divdi3
+         U ___errno
+         U ___getreent
+         U ___moddi3
+         U ___udivdi3
+         U ___umoddi3
+         U __bss_end__
+         U __bss_start__
+         U __data_end__
+         U __data_start__
+         U __dll__
+         U __file_alignment__
+         U __fmode
+         U __fu0__m4_current_diversion
+         U __fu0__program_name
+         U __head_cygintl_8_dll
+         U __head_cygm4_0_dll
+         U __head_cygwin1_dll
+         U __head_libkernel32_a
+         U __image_base__
+         U __imp____assert
+         U __imp____errno
+         U __imp____getreent
+         U __imp___ctype_
+         U __imp___impure_ptr
+         U __imp___obstack_begin
+         U __imp___obstack_newchunk
+         U __imp__abort
+         U __imp__atof
+         U __imp__atoi
+         U __imp__atol
+         U __imp__calloc
+         U __imp__close
+         U __imp__cygwin_detach_dll
+         U __imp__cygwin_internal
+         U __imp__dll_dllcrt0
+         U __imp__exit
+         U __imp__fclose
+         U __imp__fflush
+         U __imp__fputs
+         U __imp__free
+         U __imp__getc
+         U __imp__libintl_gettext
+         U __imp__lt_dlerror
+         U __imp__lt_dlmakeresident
+         U __imp__m4__module_exit
+         U __imp__m4_bad_argc
+         U __imp__m4_builtin_find_by_name
+         U __imp__m4_current_diversion
+         U __imp__m4_debug_decode
+         U __imp__m4_debug_set_output
+         U __imp__m4_dump_args
+         U __imp__m4_error
+         U __imp__m4_get_current_file
+         U __imp__m4_get_current_line
+         U __imp__m4_get_debug_file
+         U __imp__m4_get_debug_level_opt
+         U __imp__m4_get_max_debug_arg_length_opt
+         U __imp__m4_get_module_name
+         U __imp__m4_get_no_gnu_extensions_opt
+         U __imp__m4_get_posixly_correct_opt
+         U __imp__m4_get_regexp_syntax_opt
+         U __imp__m4_get_safer_opt
+         U __imp__m4_get_symbol_table
+         U __imp__m4_get_symbol_value
+         U __imp__m4_get_symbol_value_placeholder
+         U __imp__m4_get_symbol_value_text
+         U __imp__m4_get_syntax_lquote
+         U __imp__m4_get_syntax_rquote
+         U __imp__m4_get_syntax_table
+         U __imp__m4_insert_diversion
+         U __imp__m4_insert_file
+         U __imp__m4_is_symbol_value_func
+         U __imp__m4_is_symbol_value_placeholder
+         U __imp__m4_is_symbol_value_text
+         U __imp__m4_is_symbol_value_void
+         U __imp__m4_macro_call
+         U __imp__m4_make_diversion
+         U __imp__m4_module_import
+         U __imp__m4_numeric_arg
+         U __imp__m4_path_search
+         U __imp__m4_push_builtin
+         U __imp__m4_push_file
+         U __imp__m4_push_wrapup
+         U __imp__m4_regexp_syntax_encode
+         U __imp__m4_set_comment
+         U __imp__m4_set_debug_level_opt
+         U __imp__m4_set_quotes
+         U __imp__m4_set_regexp_syntax_opt
+         U __imp__m4_set_symbol_name_traced
+         U __imp__m4_set_symbol_value_text
+         U __imp__m4_set_sync_output_opt
+         U __imp__m4_set_syntax
+         U __imp__m4_shipout_int
+         U __imp__m4_shipout_string
+         U __imp__m4_skip_line
+         U __imp__m4_symbol_define
+         U __imp__m4_symbol_lookup
+         U __imp__m4_symbol_popdef
+         U __imp__m4_symbol_print
+         U __imp__m4_symbol_pushdef
+         U __imp__m4_symbol_rename
+         U __imp__m4_symbol_value_copy
+         U __imp__m4_symbol_value_create
+         U __imp__m4_symtab_apply
+         U __imp__m4_undivert_all
+         U __imp__m4_warn
+         U __imp__malloc
+         U __imp__memcpy
+         U __imp__mkstemp
+         U __imp__obstack_free
+         U __imp__pclose
+         U __imp__popen
+         U __imp__program_name
+         U __imp__qsort
+         U __imp__realloc
+         U __imp__rpl_re_compile_pattern
+         U __imp__rpl_re_search
+         U __imp__rpl_re_set_registers
+         U __imp__rpl_re_set_syntax
+         U __imp__rpl_regfree
+         U __imp__sscanf
+         U __imp__strchr
+         U __imp__strcmp
+         U __imp__strlen
+         U __imp__strncmp
+         U __imp__system
+         U __imp__xasprintf
+         U __imp__xmalloc
+         U __imp__xstrdup
+         U __libkernel32_a_iname
+         U __loader_flags__
+         U __major_image_version__
+         U __major_os_version__
+         U __major_subsystem_version__
+         U __minor_image_version__
+         U __minor_os_version__
+         U __minor_subsystem_version__
+         U __nm___ctype_
+         U __nm___impure_ptr
+         U __nm__m4_current_diversion
+         U __nm__program_name
+         U __nm_thnk__m4_current_diversion
+         U __nm_thnk__program_name
+         U __obstack_begin
+         U __obstack_newchunk
+         U __pei386_runtime_relocator
+         U __section_alignment__
+         U __size_of_heap_commit__
+         U __size_of_heap_reserve__
+         U __size_of_stack_commit__
+         U __size_of_stack_reserve__
+         U __subsystem__
+         U _abort
+         U _atof
+         U _atoi
+         U _atol
+         U _calloc
+         U _close
+         U _cygintl_8_dll_iname
+         U _cygm4_0_dll_iname
+         U _cygwin1_dll_iname
+         U _cygwin_attach_dll
+         U _cygwin_detach_dll
+         U _cygwin_internal
+         U _cygwin_premain0
+         U _cygwin_premain1
+         U _cygwin_premain2
+         U _cygwin_premain3
+         U _dll_dllcrt0
+         U _do_pseudo_reloc
+         U _environ
+         U _exit
+         U _fclose
+         U _fflush
+         U _fputs
+         U _free
+         U _getc
          U _gnu_LTX_m4_builtin_table
          U _gnu_LTX_m4_finish_module
          U _gnu_LTX_m4_macro_table
+         U _libintl_gettext
 00000000 D _lt__PROGRAM__LTX_preloaded_symbols
+         U _lt_dlerror
+         U _lt_dlmakeresident
          U _m4_LTX_m4_builtin_table
          U _m4_LTX_m4_dump_symbols
          U _m4_LTX_m4_expand_ranges
          U _m4_LTX_m4_init_module
          U _m4_LTX_m4_set_sysval
          U _m4_LTX_m4_sysval_flush
+         U _m4__module_exit
+         U _m4_bad_argc
+         U _m4_builtin_find_by_name
+         U _m4_debug_decode
+         U _m4_debug_set_output
+         U _m4_dump_args
+         U _m4_error
+         U _m4_get_current_file
+         U _m4_get_current_line
+         U _m4_get_debug_file
+         U _m4_get_debug_level_opt
+         U _m4_get_max_debug_arg_length_opt
+         U _m4_get_module_name
+         U _m4_get_no_gnu_extensions_opt
+         U _m4_get_posixly_correct_opt
+         U _m4_get_regexp_syntax_opt
+         U _m4_get_safer_opt
+         U _m4_get_symbol_table
+         U _m4_get_symbol_value
+         U _m4_get_symbol_value_placeholder
+         U _m4_get_symbol_value_text
+         U _m4_get_syntax_lquote
+         U _m4_get_syntax_rquote
+         U _m4_get_syntax_table
+         U _m4_insert_diversion
+         U _m4_insert_file
+         U _m4_is_symbol_value_func
+         U _m4_is_symbol_value_placeholder
+         U _m4_is_symbol_value_text
+         U _m4_is_symbol_value_void
+         U _m4_macro_call
+         U _m4_make_diversion
+         U _m4_module_import
+         U _m4_numeric_arg
+         U _m4_path_search
+         U _m4_push_builtin
+         U _m4_push_file
+         U _m4_push_wrapup
+         U _m4_regexp_syntax_encode
+         U _m4_set_comment
+         U _m4_set_debug_level_opt
+         U _m4_set_quotes
+         U _m4_set_regexp_syntax_opt
+         U _m4_set_symbol_name_traced
+         U _m4_set_symbol_value_text
+         U _m4_set_sync_output_opt
+         U _m4_set_syntax
+         U _m4_shipout_int
+         U _m4_shipout_string
+         U _m4_skip_line
+         U _m4_symbol_define
+         U _m4_symbol_lookup
+         U _m4_symbol_popdef
+         U _m4_symbol_print
+         U _m4_symbol_pushdef
+         U _m4_symbol_rename
+         U _m4_symbol_value_copy
+         U _m4_symbol_value_create
+         U _m4_symtab_apply
+         U _m4_undivert_all
+         U _m4_warn
+         U _malloc
+         U _memcpy
+         U _mkstemp
+         U _obstack_free
+         U _pclose
+         U _popen
+         U _qsort
+         U _realloc
+         U _rpl_re_compile_pattern
+         U _rpl_re_search
+         U _rpl_re_set_registers
+         U _rpl_re_set_syntax
+         U _rpl_regfree
+         U _sscanf
+         U _strchr
+         U _strcmp
+         U _strlen
+         U _strncmp
+         U _system
          U _traditional_LTX_m4_macro_table
+         U _xasprintf
+         U _xmalloc
+         U _xstrdup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]