gnupgp-1.2.3 (et al) build workarounds for OpenBSD 3.2 and IBM AIX 4.x

Nelson H. F. Beebe beebe at
Mon Oct 6 19:00:02 CEST 2003

Builds of gnupgp-1.2.3 (and other nearby releases) fail on OpenBSD 3.2
and IBM AIX 4.[23] because of incompatible assembly code in the mpi

With OpenBSD 3.2 on Intel IA-32, I got builds to succeed and all tests
to pass using

	env CC=gcc CXX=g++ LDFLAGS=-Wl,-rpath,/usr/local/lib ./configure --disable-asm
	make all check

Without the --disable-asm, there are link failures because of
confusion over leading underscores in external names:

	gcc  -g -O2 -Wall  -Wl,-rpath,/usr/local/lib -o mpicalc  mpicalc.o \
		../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a ../intl/libintl.a
	mpi-inline.h:119: Undefined symbol `_mpihelp_sub_n' referenced from text segment
	mpi-add.c:143: Undefined symbol `_mpihelp_sub_n' referenced from text segment
	mpi-add.c:136: Undefined symbol `_mpihelp_sub_n' referenced from text segment
	...many many more...

The mpi/libmpi.a library has the names mpihelp_sub_n etc, without the
leading underscore:

	% nm libmpi.a | grep ' T mpi'
	00000000 T mpihelp_mul_1
	00000000 T mpihelp_addmul_1
	00000000 T mpihelp_submul_1
	00000000 T mpihelp_add_n
	00000000 T mpihelp_sub_n
	00000000 T mpihelp_lshift
	00000000 T mpihelp_rshift

The assembly code also lacks the leading underscore:

	% grep mpihelp_sub_n *.[sS]
	_mpih-sub1.s:        .globl mpihelp_sub_n
	mpih-sub1.S: *  mpihelp_sub_n( mpi_ptr_t res_ptr,  (sp + 4)
	mpih-sub1.S:    .globl C_SYMBOL_NAME(mpihelp_sub_n)

On IBM AIX 4.2 and 4.3, compilation fails with:

	gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include    -g -O2 -Wall -c `test -f 'mpih-div.c' || echo './'`mpih-div.c
	mpih-div.c: In function `mpihelp_mod_1':
	mpih-div.c:86: warning: implicit declaration of function `__udiv_w_sdiv'
	mpih-div.c:100: Invalid `asm' statement:
	mpih-div.c:100: fixed or forbidden register 64 (mq) was spilled for class MQ_REGS.
	mpih-div.c:101: Invalid `asm' statement:
	...many more

The culprit seems to be this code in mpi/longlong.h:

	#if (defined (_ARCH_PPC) || defined (_IBMR2)) && W_TYPE_SIZE == 32

On a hunch, I tried a manual build in the mpi directory with

	make CC='gcc -U_IBMR2'

and ultimately got the build to succeed, and all tests to pass, making
a gpg version available on our local AIX systems for the first time.

It looks to me like the code block in mpi/longlong.h is either
out-of-date, or for a version of AIX to which I don't have access
(perhaps 3.x, 5.[12], or 6.[01]).

It would be nice if configure tests could fix the build problems for
both of these systems, or at the very least, information about these
workarounds be included in the README files.

- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- Center for Scientific Computing       FAX: +1 801 581 4148                  -
- University of Utah                    Internet e-mail: beebe at  -
- Department of Mathematics, 110 LCB        beebe at  beebe at -
- 155 S 1400 E RM 233                                                         -
- Salt Lake City, UT 84112-0090, USA    URL:  -

More information about the Gnupg-devel mailing list