Cross-compiling libgcrypt fails

Eronen, Jussi (GE Healthcare) jussi.eronen at med.ge.com
Tue Mar 24 08:14:18 CET 2009


Libgcrypt build fails with error messages
...
../src/.libs/libgcrypt.so: undefined reference to `_gcry_mpih_addmul_1'
../src/.libs/libgcrypt.so: undefined reference to `_gcry_mpih_rshift'
../src/.libs/libgcrypt.so: undefined reference to `_gcry_mpih_add_n'
../src/.libs/libgcrypt.so: undefined reference to `_gcry_mpih_mul_1'
../src/.libs/libgcrypt.so: undefined reference to `_gcry_mpih_submul_1'
../src/.libs/libgcrypt.so: undefined reference to `_gcry_mpih_lshift'
../src/.libs/libgcrypt.so: undefined reference to `_gcry_mpih_sub_n'
...

I am building for powerpc 603e target with toolchain gcc-4.2.4, glibc-2.6.1 and binutils-2.19 on Fedora8.

My fix (hack?) was to patch mpi/powerpc32/syntax.h with this patch:

--- libgcrypt-1.4.4/mpi/powerpc32/syntax.h	2008-08-19 18:20:01.000000000 +0300
+++ libgcrypt-1.4.4.new/mpi/powerpc32/syntax.h	2009-03-13 11:42:45.000000000 +0200
@@ -46,9 +46,12 @@
 
 #define        ENTRY(name)				    \
   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);		    \
+  ASM_GLOBAL_DIRECTIVE name;         \
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name), at function)	    \
+  ASM_TYPE_DIRECTIVE (name, at function)        \
   .align ALIGNARG(2);					    \
   C_LABEL(name) 					    \
+  name##:   \
   CALL_MCOUNT
 
 #define EALIGN_W_0  /* No words to insert.  */
@@ -64,10 +67,13 @@
    past a 2^align boundary.  */
 #define EALIGN(name, alignt, words)			\
   ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);		\
+  ASM_GLOBAL_DIRECTIVE name;         \
   ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name), at function)	\
+  ASM_TYPE_DIRECTIVE (name, at function)        \
   .align ALIGNARG(alignt);				\
   EALIGN_W_##words;					\
-  C_LABEL(name)
+  C_LABEL(name)     \
+  name##:
 
 #undef END
 #define END(name)		     \

Doesn't look the _right_ way but couldn't figure out anything else. After patching compiles and builds ok.

--Jussi


More information about the Gnupg-devel mailing list