Mailing List Archive

error building gcrypt cvs on os x
Darwin has it's own __clz_tab in libgcc, so defining one in mpi-bit.c
causes an error. Note that this is built with configure --disable-asm.
I'm happy to send the rest of the config and build log, if needed.
Perhaps an autoconf check could notice if __clz_tab is defined and
suppress the definition of MPI_INTERNAL_NEED_CLZ_TAB in longlong.h.
"make check" succeeds after commenting out that #define.

Making all in src
/bin/sh ../libtool --mode=link gcc -I/sw/include -g -O2 -Wall -o
libgcrypt.la -rpath /usr/local/lib -version-info 6:1:5 misc.lo
global.lo sexp.lo stdmem.lo secmem.lo missing-string.lo module.lo
ath.lo ath-pthread.lo ../cipher/libcipher.la ../mpi/libmpi.la
-L/sw/lib -lgpg-error
gcc -dynamiclib -flat_namespace -undefined suppress -o
.libs/libgcrypt.1.5.1.dylib .libs/misc.o .libs/global.o .libs/sexp.o
.libs/stdmem.o .libs/secmem.o .libs/missing-string.o .libs/module.o
.libs/ath.o .libs/ath-pthread.o -all_load ../cipher/.libs/libcipher.a
../mpi/.libs/libmpi.a -L/sw/lib /sw/lib/libgpg-error.dylib
-install_name /usr/local/lib/libgcrypt.1.dylib -compatibility_version
7 -current_version 7.1
ld: multiple definitions of symbol ___clz_tab
../mpi/.libs/libmpi.a(mpi-bit.o) definition of ___clz_tab in section
(__TEXT,__const)
/usr/lib/gcc/darwin/3.1/libgcc.a(_clz.o) private external definition of
___clz_tab in section (__TEXT,__const)
/usr/bin/libtool: internal link edit command failed
make[2]: *** [libgcrypt.la] Error 1
make[1]: *** [all-recursive] Error 1

thanks,
-neil
Re: error building gcrypt cvs on os x [ In reply to ]
Hi Neil,

Neil Spring wrote:
> Darwin has it's own __clz_tab in libgcc, so defining one in mpi-bit.c
> causes an error. Note that this is built with configure --disable-asm.
> I'm happy to send the rest of the config and build log, if needed.
> Perhaps an autoconf check could notice if __clz_tab is defined and
> suppress the definition of MPI_INTERNAL_NEED_CLZ_TAB in longlong.h.
> "make check" succeeds after commenting out that #define.

The error is corrected in version 1.1.12 of libgcypt, see the recent
thread on Mac OS X.

Fred
Re: error building gcrypt cvs on os x [ In reply to ]
On Sunday, Jul 27, 2003, at 11:05 US/Pacific, Fred wrote:
> Neil Spring wrote:
>> Darwin has it's own __clz_tab in libgcc, so defining one in mpi-bit.c
>> causes an error. Note that this is built with configure
>> --disable-asm. I'm happy to send the rest of the config and build
>> log, if needed. Perhaps an autoconf check could notice if __clz_tab
>> is defined and suppress the definition of MPI_INTERNAL_NEED_CLZ_TAB
>> in longlong.h. "make check" succeeds after commenting out that
>> #define.
>
> The error is corrected in version 1.1.12 of libgcypt, see the recent
> thread on Mac OS X.

I'm familiar with that thread. ;) I wanted to play with the CVS
version and its changed interfaces.

It appears to be a problem with libtool 1.4.2a (used for
libgcrypt-1.1.11) and libtool 1.5 (sitting on my machine) but not 1.4.3
(used for 1.1.12). That is, if I copy libgcrypt-1.1.12/libtool and
.../scripts/ltmain.sh, into my sandbox, the build proceeds as it
should. If I let autogen.sh invoke glibtool (yes, I had to mod autogen
to pick up GNU libtool under a different name) or copy from
libgcrypt-1.1.11, I get the clz_tab complaint.

1.4.3 uses the "gcc -r -keep_private_externs -nostdlib" incantation as
an intermediate step in building the library, while the other versions
do not (detail below). That's the only difference I can see, so I
can't tell what should be done to fix it.

thanks,
-neil

1.4.3 does:
/bin/sh ../libtool --mode=link gcc -I/sw/include -g -O2 -Wall -o
libgcrypt.la -rpath /usr/local/lib -version-info 6:1:5 misc.lo
global.lo sexp.lo stdmem.lo secmem.lo missing-string.lo module.lo
ath.lo ath-pthread.lo ../cipher/libcipher.la ../mpi/libmpi.la
-L/sw/lib -lgpg-error
rm -fr .libs/libgcrypt.la .libs/libgcrypt.* .libs/libgcrypt.*
gcc -r -keep_private_externs -nostdlib -o
.libs/libgcrypt.1.5.1.dylib-master.o misc.lo global.lo sexp.lo
stdmem.lo secmem.lo missing-string.lo module.lo ath.lo ath-pthread.lo
-all_load ../cipher/.libs/libcipher.al ../mpi/.libs/libmpi.al && gcc
-dynamiclib -flat_namespace -undefined suppress -o
.libs/libgcrypt.1.5.1.dylib .libs/libgcrypt.1.5.1.dylib-master.o
-L/sw/lib -lgpg-error -lc -install_name
/usr/local/lib/libgcrypt.1.dylib -compatibility_version 7
-current_version 7.1
(cd .libs && rm -f libgcrypt.1.dylib && ln -s libgcrypt.1.5.1.dylib
libgcrypt.1.dylib)
(cd .libs && rm -f libgcrypt.dylib && ln -s libgcrypt.1.5.1.dylib
libgcrypt.dylib)

(and succeeds)

while 1.4.2a does:
/bin/sh ../libtool --mode=link gcc -I/sw/include -g -O2 -Wall -o
libgcrypt.la -rpath /usr/local/lib -version-info 6:1:5 misc.lo
global.lo sexp.lo stdmem.lo secmem.lo missing-string.lo module.lo
ath.lo ath-pthread.lo ../cipher/libcipher.la ../mpi/libmpi.la -L
/sw/lib -lgpg-error
rm -fr .libs/libgcrypt.la .libs/libgcrypt.* .libs/libgcrypt.*
gcc -dynamiclib -flat_namespace -undefined suppress -o
.libs/libgcrypt.1.5.1.dylib misc.lo global.lo sexp.lo stdmem.lo
secmem.lo mi
ssing-string.lo module.lo ath.lo ath-pthread.lo -all_load
../cipher/.libs/libcipher.al ../mpi/.libs/libmpi.al
../cipher/.libs/libc
ipher.al ../mpi/.libs/libmpi.al -L/sw/lib -lgpg-error -lc -install_name
/usr/local/lib/libgcrypt.1.dylib -compatibility_version 7 -
current_version 7.1
ld: multiple definitions of symbol __gcry_cipher_init
../cipher/.libs/libcipher.al(cipher.lo) definition of
__gcry_cipher_init in section (__TEXT,__text)
../cipher/.libs/libcipher.al(cipher.lo) definition of
__gcry_cipher_init in section (__TEXT,__text)
(lots of errors follow)
Re: error building gcrypt cvs on os x [ In reply to ]
Hi Neil,

I just commited a simple change into CVS, can you please check wether
this fixes the build problems you saw on MacOS X?

Thanks,
moritz
--
((gpg-key-id . "6F984199")
(email . "moritz@duesseldorf.ccc.de")
(webpage . "http://duesseldorf.ccc.de/~moritz/"))
Re: error building gcrypt cvs on os x [ In reply to ]
On Wednesday, Jul 30, 2003, at 04:43 US/Pacific, Moritz Schulte wrote:
> I just commited a simple change into CVS, can you please check wether
> this fixes the build problems you saw on MacOS X?

Great! It works now. I tested from a clean CVS and ran 'make check'
as well.

Also, I know it doesn't matter, but ath.h should probably include
sys/types.h, if only to clear out the warnings (mac include files are
as picky as bsd's):
In file included from pubkey.c:31: (and others -ns)
../src/ath.h:70: warning: `struct timeval' declared inside parameter
list
../src/ath.h:70: warning: its scope is only this definition or
declaration, which is probably not what you want
../src/ath.h:83: warning: `struct timeval' declared inside parameter
list

Finally, a strange feature of the Mac is that it includes a program
called "libtool" that is entirely unrelated. [1] Modifying autogen.sh
to test the version of "libtoolize" (the program acutally used) instead
would make it work without modification. Alternately, some way of
finding "glibtool" (say an environment variable or a search path) would
be mildly helpful. This is obviously a low-priority change, as it only
affects mac users building from CVS (unlike the __clz_tab issue, which
would probably have hit anyone compiling).

thanks!
-neil
[1] http://fink.sf.net/doc/porting/libtool.php (at the bottom)
Re: error building gcrypt cvs on os x [ In reply to ]
Neil Spring <nspring@cs.washington.edu> writes:

> Great! It works now. I tested from a clean CVS and ran 'make
> check' as well.

Thanks.

> Also, I know it doesn't matter, but ath.h should probably include
> sys/types.h, if only to clear out the warnings (mac include files are
> as picky as bsd's):

ath.h does include sys/types.h - you meant sys/time.h, right?

moritz
--
((gpg-key-id . "6F984199")
(email . "moritz@duesseldorf.ccc.de")
(webpage . "http://duesseldorf.ccc.de/~moritz/"))
Re: error building gcrypt cvs on os x [ In reply to ]
On Wednesday, Jul 30, 2003, at 11:48 US/Pacific, Moritz Schulte wrote:
>> Also, I know it doesn't matter, but ath.h should probably include
>> sys/types.h, if only to clear out the warnings (mac include files are
>> as picky as bsd's):
>
> ath.h does include sys/types.h - you meant sys/time.h, right?

Oops. Yes, that's what I meant to say. :)

-neil
Re: error building gcrypt cvs on os x [ In reply to ]
On Wed, Jul 30, 2003 at 11:35:39AM -0700, Neil Spring wrote:
> Finally, a strange feature of the Mac is that it includes a program
> called "libtool" that is entirely unrelated. [1] Modifying autogen.sh
> to test the version of "libtoolize" (the program acutally used) instead
> would make it work without modification. Alternately, some way of
> finding "glibtool" (say an environment variable or a search path) would
> be mildly helpful. This is obviously a low-priority change, as it only
> affects mac users building from CVS (unlike the __clz_tab issue, which
> would probably have hit anyone compiling).

I would recommend to try "autoreconf -f -i -s", and if that works, to use
that in autogen.sh (except for any w32 target stuff). If it doesn't work it
should be fixed :)

Thanks,
Marcus

--
`Rhubarb is no Egyptian god.' GNU http://www.gnu.org marcus@gnu.org
Marcus Brinkmann The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/