bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] tar 1.14.90 build failure on MacOX X


From: Bruno Haible
Subject: [Bug-tar] tar 1.14.90 build failure on MacOX X
Date: Fri, 10 Sep 2004 22:40:15 +0200
User-agent: KMail/1.5

On MacOS X 10.3.5 (Darwin 7.5.0), the compilation of tar terminates like this:

gcc  -g -O2   -o tar  buffer.o compare.o create.o delete.o extract.o xheader.o 
incremen.o list.o mangle.o misc.o names.o rtapelib.o sparse.o system.o tar.o 
update.o utf8.o ../lib/libtar.a -L/Volumes/UserData/local-macos/lib -lintl 
-liconv -lc  
ld: warning multiple definitions of symbol _locale_charset
/Volumes/UserData/local-macos/lib/libintl.dylib(localcharset.o) definition of 
_locale_charset
/usr/lib/libiconv.dylib(localcharset.o) definition of _locale_charset
ld: Undefined symbols:
_argp_program_version_hook
make[2]: *** [tar] Error 1

The following patch fixes it:

*** lib/argp-pvh.c.bak  Wed Jul  9 01:25:14 2003
--- lib/argp-pvh.c      Fri Sep 10 00:26:39 2004
***************
*** 28,31 ****
     this function with a stream to print the version to and a pointer to the
     current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
     used).  This variable takes precedent over ARGP_PROGRAM_VERSION.  */
! void (*argp_program_version_hook) (FILE *stream, struct argp_state *state);
--- 28,31 ----
     this function with a stream to print the version to and a pointer to the
     current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
     used).  This variable takes precedent over ARGP_PROGRAM_VERSION.  */
! void (*argp_program_version_hook) (FILE *stream, struct argp_state *state) = 
NULL;

What's happening is that without the "= NULL", the argp_program_version_hook
symbol in argp-pvh.o is of class Common ("nm" shows a 'C'), whereas with
"= NULL" it is of class Data ("nm" shows a 'D'). ranlib on Darwin doesn't
put symbols of class Common into the archive's table of contents
(a file '__.SYMDEF SORTED' in the archive), thus during linking, the
symbol, required by argp-parse.o, is not found.

ranlib's behaviour makes sense: Since symbols of class Common can have
many definitions, it is wrong to make a strong dependency to one particular
definition point for them.

Therefore I think argp-pvh.c needs to be changed.

Bruno





reply via email to

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