[uClibc]problems building gnupg 1.0.7

Torrey Hoffman thoffman at arnor.net
Fri Jul 19 17:58:37 UTC 2002


I'm having problems building gnupg 1.0.7 using the uClibc - gcc3.1
toolchain.  I'm not sure if this is an error on my part, or a problem
with the toolchain / library.

I'd really appreciate any insight or advice.  I've tried to include all
the relevant information below.

Part way through during the gnupg make, "mpicalc.o" is linked with the
gnupg version of the "mpi" library, which is actually an "ar" archive of
object files.  Part of the mpi library is written in assembler, and it
seems like those assembler routines are not found by the gcc linker in
the libmpi.ar file.  The problematic command and errors are:

gcc  -g -O2 -Wall   -o mpicalc  mpicalc.o ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a  -ldl  -lz
../mpi/libmpi.a(mpi-add.o): In function `mpi_add':
/home/thoffman/depot/thoffman/TakeTwo/build/gnupg-1.0.7/mpi/mpi-inline.h:119: undefined reference to `mpihelp_sub_n'

This is followed by many similar "undefined reference" errors, all to
functions which are in .S assembler files.  What I don't understand is
why these are undefined references.

For example, the mpihelp_sub_n function is in mpih_sub1.S (a symlink
created during configuration to i386/mpih_sub1.S) which was successfully
assembled earlier in the build - here's an excerpt from the Make output:

gcc -E -I.. -I../include -DHAVE_CONFIG_H mpih-sub1.S | grep -v '^#' > _mpih-sub1.s
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include    -g -O2 -Wall  -c _mpih-sub1.s
mv -f _mpih-sub1.o mpih-sub1.o

... and mpih-sub1.o was included in libmpi.a, according to "ar t libmpi.a"

So why aren't those functions found when linking?  Why is it only the
assembler routines that cause a problem?

Here's some information on how I'm configuring and compiling. I'm fairly
new to building things with uClibc, but have managed to successfully
compile several other apps and libraries against it.  Gnupg is the first
program with autoconf though...

I configure gnupg with:

	(cd $(GNUPG_DIR); \
		PATH=$(TARGET_PATH)/usr/bin:$(PATH) \
		./configure \
			--host=i386-uclibc-linux \
			--prefix=$(INSTFS_PATH) \
			--disable-nls \
			--disable-ldap \
			--disable-mailto \
	);

Note that $(TARGET_PATH)/usr/bin is where my uClibc gcc3.1 toolchain is
installed (the symlinks for gcc and the binutils).  The configuration
seems to work fine, cross-compile mode is detected and no errors are
reported.  When I do the compile, using this command:

	(PATH=$(TARGET_PATH)/usr/bin:$(PATH) \
		$(MAKE) -C $(GNUPG_DIR) \
	);
	
the compile runs fine until it hits the problem I describe above.

Thanks for any help or suggestions...  and of course I'd be happy to
provide more information.

Torrey Hoffman
thoffman at arnor.net
torrey.hoffman at myrio.com






More information about the uClibc mailing list