Problem building 1.4.5

Robin Getz rgetz at blackfin.uclinux.org
Tue Jun 15 19:26:23 CEST 2010


When I build up libgcrypt-1.4.5, the lib appears to build fine, but nothing 
can link against it because of the way that hidden symbols are managed...

When trying to link against the lib, I get:

version.o: In function `main':
./libgcrypt-1.4.5/tests/version.c:47: undefined reference to `_gcry_control'
./libgcrypt-1.4.5/tests/version.c:48: undefined reference to 
`_gcry_check_version'
./libgcrypt-1.4.5/tests/version.c:54: undefined reference to `_gcry_control'
collect2: ld returned 1 exit status
make[4]: *** [version] Error 1

This is because the ABI for Blackfin (the CPU I'm building for) includes a 
leading underscore "_" in the assembly/linker symbol prefixes.

The ABI automatically turns the C symbol "gcry_control", into "_gcry_control" 
in the .so, and thus turns "_gcry_control" into "__gcry_control".

configure understands this:

./config.log has:
#define WITH_SYMBOL_UNDERSCORE 1

but that doesn't seem to be used in ./src/visibility.h in the MARK_VISIBLE 
macros, etc - which seems to be where things are managed.

-Robin



More information about the Gcrypt-devel mailing list