libassuan-0.9.0 build problems

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Tue Sep 19 12:17:06 CEST 2006


At Mon, 18 Sep 2006 11:49:20 -0600 (MDT),
Nelson H F Beebe wrote:
> 
> In order to build gnupg-1.9.23, it is necessary to first install four
> dependent packages: libassuan, libgpg-error libksba, and pth.
> 
> I've had reasonable success with three of them, but libassuan-0.9.0
> has build failures, and test failures on several platforms.

Thanks for testing this.  Libassuan has some dark corners of known
incompatibility which we will eventually have to get around fixing.
There were a couple of surprises as well, though, which I did my best
to fix.
 
> The validation tests failed on several systems because /etc/motd does
> not exist: here is what happens:

I included a motd in the source and the corresponding tuning to enable
it:

2006-09-19  Marcus Brinkmann  <marcus at g10code.de>

        * tests/fdpassing.c (MOTD): New macro.
        * tests/Makefile.am (AM_CPPFLAGS): New variable.
        * tests/motd: New file.
 
> ============================================================
> Machinetype:            SGI Origin/200-4 (180 MHz) (4 R10000 CPUs); IRIX 6.5
> Remote c89 version:     MIPSpro Compilers: Version 7.3.1.3m
> Configure environment:  CC=c89 CXX=CC CFLAGS=-I/usr/local/include CXXFLAGS=-I/usr/local/include LDFLAGS=-Wl,-rpath,/usr/local/libn32 
> 
> 	c89 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include    -I/usr/local/include -c assuan-client.c
> cc-1185 c89: WARNING File = assuan-client.c, Line = 47
>   An enumerated type is mixed with another type.
> 
>         rc = _assuan_read_line (ctx);
>            ^

Oh well, there are a bunch of those.  I did some changes to massage
everything into the assuan_error_t type of use, but its quite a mess,
and more problems like this remain, also because of mixed support for
old-style errors and new gpg-error values (which are not correctly
typed to suppress a dependency).  Eventually we may make libassuan
dependent on gpg-error and clean it all up.
 
> cc-1162 c89: ERROR File = assuan-pipe-connect.c, Line = 324
>   Too few arguments in function call.
> 
>             unsetenv ("_assuan_connection_fd");

Simple typo with a straightforward fix:


2006-09-19  Marcus Brinkmann  <marcus at g10code.de>

        * assuan-defs.h (unsetenv): Define correctly.

> ============================================================
> Machinetype:            SGI Origin/200-4 (180 MHz) (4 R10000 CPUs); IRIX 6.5
> Remote gcc version:     gcc (GCC) 3.4.3
> Configure environment:  CC=gcc CFLAGS=-I/usr/local/include CXX=g++ CXXFLAGS=-I/usr/local/include LDFLAGS=-Wl,-rpath,/usr/local/libn32 
> 
> if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include    -I/usr/local/include -Wall -Wcast-align -Wshadow -Wstrict-prototypes -MT assuan-pipe-connect.o -MD -MP -MF ".deps/assuan-pipe-connect.Tpo" -c -o assuan-pipe-connect.o assuan-pipe-connect.c; \
> 	then mv -f ".deps/assuan-pipe-connect.Tpo" ".deps/assuan-pipe-connect.Po"; else rm -f ".deps/assuan-pipe-connect.Tpo"; exit 1; fi
> assuan-pipe-connect.c: In function `pipe_connect_unix':
> assuan-pipe-connect.c:324: error: too few arguments to function `_assuan_setenv'
> make[3]: *** [assuan-pipe-connect.o] Error 1

Same as above, just different diagnostic.

> ============================================================
> Machinetype:            Sun W40z (4 CPUs, 2400 MHz AMD64 Opteron, 8GB RAM); FreeBSD 5.0-RELEASE #0
> Remote gcc version:     gcc (GCC) 3.4.3
> Configure environment:  CC=gcc CFLAGS=-I/usr/local/include CXX=g++ LDFLAGS=-Wl,-rpath,/usr/local/lib 
> 
> if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include    -I/usr/local/include -Wall -Wcast-align -Wshadow -Wstrict-prototypes -MT putc_unlocked.o -MD -MP -MF ".deps/putc_unlocked.Tpo" -c -o putc_unlocked.o putc_unlocked.c; \
> 	then mv -f ".deps/putc_unlocked.Tpo" ".deps/putc_unlocked.Po"; else rm -f ".deps/putc_unlocked.Tpo"; exit 1; fi
> putc_unlocked.c:30: error: redefinition of '__sputc'
> /usr/local/lib/gcc/i386-unknown-freebsd5.0/3.4.3/include/stdio.h:405: error: previous definition of '__sputc' was here
> make[3]: *** [putc_unlocked.o] Error 1

This is curious.  I am not sure what's going on.  If freebsd defines
putc_unlocked, the file shouldn't get included at all.  If it doesn't,
it should not redefine it to __sputc, which it seems to do.  Maybe
AC_REPLACE_FUNCS(putc_unlocked) does not do its job properly.

Things that could help me to find out what's going on: The stdio.h
file from above and the config.log file generated by configure.
 
> ============================================================
> Machinetype:            Apple Power Mac G4 (2 1420 MHz PowerPC G4 (3.3) CPUs, 2GB RAM); Darwin 7.9.0 (Mac OS X Server 10.3.9 (7W98))
> Remote gcc version:     gcc (GCC) 3.4.3
> Configure environment:  CC=gcc CXX=g++   LIBS=-lcc_dynamic   
> 
> gcc  -g -O2 -Wall -Wcast-align -Wshadow -Wstrict-prototypes   -o fdpassing  fdpassing.o ../src/libassuan.a   -lcc_dynamic
> /usr/bin/ld: Undefined symbols:
> _pth_fdmode
> _pth_read
> _pth_select
> _pth_waitpid
> _pth_write
> collect2: ld returned 1 exit status
> 
> This failure happened on all build attempts on Apple Mac OS X.  The
> -lpth library is not being specified, although the library is
> certainly installed:

The -lpth library should not be specified.  The pth functions are
referenced with #pragma weak, which should make their omission
non-critical (and detectable by libassuan).  However, that's not very
portable (as you found out), and eventually we will probably do the
same as for GPGME, where we generate different library versions, one
without pth support and one with.  It's a TODO list item for the
shared library version, but apparently it's also a problem for the
static version on this platform.

> ============================================================
> Machinetype:            DEC Alpha 4100-5/466 (4 21164 EV5 CPUs, 466 MHz, 2GB RAM);          OSF/1 4.0F
> Remote cc version:      DEC C V5.9-005 on Digital UNIX V4.0 (Rev. 1229)
> Configure environment:  CC=cc CFLAGS="-ieee -I/usr/local/include" CXX=cxx CXXFLAGS="-ieee -I/usr/local/include" LDFLAGS="-Wl,-rpath,/usr/local/lib -Wl,-oldstyle_liblookup -L/usr/local/lib" LIBS="-lsnprintf" FC=f77 F77=f77 
> 
> 	cc -std1 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include    -ieee -I/usr/local/include -c assuan-socket-server.c
> cc: Info: assuan.h, line 283: Trailing comma found in enumerator list. (trailcomma)
> } assuan_error_t;
> ^

Oh well.  I moved the comma into the #ifdef, and it should work now.

2006-09-19  Marcus Brinkmann  <marcus at g10code.de>

        * assuan.h (enum): Avoid trailing comma in enumerator list.  Ugh.

> cc: Warning: assuan-socket-server.c, line 90: In this statement, the referenced type of the pointer value "&len" is "unsigned long", which is not compatible with "int". (ptrmismatch)
>   fd = accept (ctx->listen_fd, (struct sockaddr*)&clnt_addr, &len );
> -------------------------------------------------------------^
> source='assuan-pipe-connect.c' object='assuan-pipe-connect.o' libtool=no \
> 	DEPDIR=.deps depmode=tru64 /bin/ksh ../depcomp \
> 	cc -std1 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include    -ieee -I/usr/local/include -c assuan-pipe-connect.c
> cc: Info: assuan.h, line 283: Trailing comma found in enumerator list. (trailcomma)
> } assuan_error_t;
> ^
> cc: Error: assuan-pipe-connect.c, line 380: In this statement, "AF_LOCAL" is not declared. (undeclared)
>   if ( socketpair (AF_LOCAL, SOCK_STREAM, 0, fds) )
> -------------------^

I added the same hacks as in assuan-server-connect.c:

2006-09-19  Marcus Brinkmann  <marcus at g10code.de>

        * assuan-pipe-connect.c: Add hacks for Slowaris.
        * assuan-socket.c: Likewise here.

> ============================================================
> Machinetype:            Sun Ultra Enterprise 2900 (4 CPUs, 1050 MHz UltraSPARC-IV, 16GB); Solaris 10
> Remote gcc4 version:	gcc4 (GCC) 4.0.2
> Configure environment:  CC=/usr/local/test/bin/gcc CFLAGS=-I/usr/local/include CXX=/usr/local/test/bin/g++ CXXFLAGS=-I/usr/local/include LDFLAGS="-R/usr/local/lib -L/usr/local/lib" 
> 
> if /usr/local/test/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include    -I/usr/local/include -Wall -Wcast-align -Wshadow -Wstrict-prototypes -MT assuan-socket-server.o -MD -MP -MF ".deps/assuan-socket-server.Tpo" -c -o assuan-socket-server.o assuan-socket-server.c; \
> 	then mv -f ".deps/assuan-socket-server.Tpo" ".deps/assuan-socket-server.Po"; else rm -f ".deps/assuan-socket-server.Tpo"; exit 1; fi
> if /usr/local/test/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include    -I/usr/local/include -Wall -Wcast-align -Wshadow -Wstrict-prototypes -MT assuan-pipe-connect.o -MD -MP -MF ".deps/assuan-pipe-connect.Tpo" -c -o assuan-pipe-connect.o assuan-pipe-connect.c; \
> 	then mv -f ".deps/assuan-pipe-connect.Tpo" ".deps/assuan-pipe-connect.Po"; else rm -f ".deps/assuan-pipe-connect.Tpo"; exit 1; fi
> assuan-pipe-connect.c: In function 'socketpair_connect':
> assuan-pipe-connect.c:380: error: 'AF_LOCAL' undeclared (first use in this function)
> assuan-pipe-connect.c:380: error: (Each undeclared identifier is reported only once
> assuan-pipe-connect.c:380: error: for each function it appears in.)

Same as above.

I am not sure what your chances are with these fixes.  Somewhat
better, I guess, but the pth symbol hickup may still prevent it from
working completely.

Thanks a lot,
Marcus




More information about the Gnupg-devel mailing list