Project

General

Profile

Issue #332

build fails with -Wl,-z,defs

Added by Yves-Alexis Perez over 8 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
build
Affected version:
5.0.3
Resolution:
No feedback

Description

See failed log from 5.0.3:

Making all in plugins/gmp
make[5]: Entering directory `/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp'
/bin/bash ../../../../libtool --tag=CC   --mode=link gcc -rdynamic -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -include /tmp/buildd/strongswan-5.0.3/config.h -module -avoid-version -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -Wl,-O1 -Wl,-z,defs -o libstrongswan-gmp.la -rpath /usr/lib/ipsec/plugins gmp_plugin.lo gmp_diffie_hellman.lo gmp_rsa_private_key.lo gmp_rsa_public_key.lo -lgmp 
libtool: link: gcc -shared  -fPIC -DPIC  .libs/gmp_plugin.o .libs/gmp_diffie_hellman.o .libs/gmp_rsa_private_key.o .libs/gmp_rsa_public_key.o   -lgmp  -O2 -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--as-needed -Wl,-O1 -Wl,-z -Wl,defs   -Wl,-soname -Wl,libstrongswan-gmp.so -o .libs/libstrongswan-gmp.so
.libs/gmp_diffie_hellman.o: In function `set_other_public_value':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c:141: undefined reference to `dbg'
.libs/gmp_diffie_hellman.o: In function `create_generic':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c:225: undefined reference to `lib'
.libs/gmp_diffie_hellman.o: In function `chunk_free':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/chunk.h:168: undefined reference to `chunk_empty'
.libs/gmp_diffie_hellman.o: In function `create_generic':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c:249: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c:235: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c:228: undefined reference to `rng_quality_names'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c:228: undefined reference to `dbg'
.libs/gmp_diffie_hellman.o: In function `gmp_diffie_hellman_create':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c:264: undefined reference to `diffie_hellman_get_params'
.libs/gmp_rsa_private_key.o: In function `gmp_rsa_private_key_create_empty':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:627: undefined reference to `private_key_equals'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:627: undefined reference to `private_key_belongs_to'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:627: undefined reference to `private_key_has_fingerprint'
.libs/gmp_rsa_private_key.o: In function `build_emsa_pkcs1_signature':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:271: undefined reference to `chunk_empty'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:305: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:278: undefined reference to `hasher_algorithm_to_oid'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:285: undefined reference to `lib'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:294: undefined reference to `asn1_simple_object'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:294: undefined reference to `asn1_algorithmIdentifier'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:294: undefined reference to `asn1_wrap'
.libs/gmp_rsa_private_key.o: In function `sign':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:363: undefined reference to `signature_scheme_names'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:363: undefined reference to `dbg'
.libs/gmp_rsa_private_key.o: In function `destroy':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:520: undefined reference to `lib'
.libs/gmp_rsa_private_key.o: In function `compute_prime':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:162: undefined reference to `lib'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:198: undefined reference to `dbg'
.libs/gmp_rsa_private_key.o: In function `memwipe':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
.libs/gmp_rsa_private_key.o: In function `chunk_free':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/chunk.h:168: undefined reference to `chunk_empty'
.libs/gmp_rsa_private_key.o: In function `compute_prime':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:177: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:165: undefined reference to `rng_quality_names'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:165: undefined reference to `dbg'
.libs/gmp_rsa_private_key.o: In function `decrypt':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:378: undefined reference to `encryption_scheme_names'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:378: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:400: undefined reference to `dbg'
.libs/gmp_rsa_private_key.o: In function `memwipe':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
.libs/gmp_rsa_private_key.o: In function `decrypt':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:404: undefined reference to `chunk_create_clone'
.libs/gmp_rsa_private_key.o: In function `get_encoding':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:451: undefined reference to `lib'
.libs/gmp_rsa_private_key.o: In function `memwipe':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
.libs/gmp_rsa_private_key.o:/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: more undefined references to `memwipe_noinline' follow
.libs/gmp_rsa_private_key.o: In function `get_fingerprint':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:475: undefined reference to `lib'
.libs/gmp_rsa_private_key.o: In function `get_public_key':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:427: undefined reference to `lib'
.libs/gmp_rsa_private_key.o: In function `gmp_rsa_private_key_gen':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:747: undefined reference to `lib'
.libs/gmp_rsa_private_key.o: In function `memwipe':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
.libs/gmp_rsa_private_key.o: In function `chunk_free':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/chunk.h:168: undefined reference to `chunk_empty'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/chunk.h:168: undefined reference to `chunk_empty'
.libs/gmp_rsa_private_key.o: In function `gmp_rsa_private_key_gen':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:790: undefined reference to `dbg'
.libs/gmp_rsa_private_key.o: In function `gmp_rsa_private_key_load':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:809: undefined reference to `chunk_empty'
.libs/gmp_rsa_private_key.o: In function `check':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c:615: undefined reference to `dbg'
.libs/gmp_rsa_public_key.o: In function `destroy':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:439: undefined reference to `lib'
.libs/gmp_rsa_public_key.o: In function `get_encoding':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:396: undefined reference to `lib'
.libs/gmp_rsa_public_key.o: In function `get_fingerprint':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:410: undefined reference to `lib'
.libs/gmp_rsa_public_key.o: In function `verify_emsa_pkcs1_signature':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/chunk.h:239: undefined reference to `chunk_empty'
.libs/gmp_rsa_public_key.o: In function `chunk_skip':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/chunk.h:239: undefined reference to `chunk_empty'
.libs/gmp_rsa_public_key.o: In function `verify_emsa_pkcs1_signature':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/chunk.h:239: undefined reference to `chunk_empty'
.libs/gmp_rsa_public_key.o: In function `chunk_skip':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/chunk.h:239: undefined reference to `chunk_empty'
.libs/gmp_rsa_public_key.o: In function `verify_emsa_pkcs1_signature':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:186: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:199: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:200: undefined reference to `asn1_parser_create'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:210: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:219: undefined reference to `asn1_parse_algorithmIdentifier'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:222: undefined reference to `hasher_algorithm_from_oid'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:225: undefined reference to `hash_algorithm_names'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:225: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:237: undefined reference to `lib'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:247: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:240: undefined reference to `hash_algorithm_names'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:240: undefined reference to `dbg'
.libs/gmp_rsa_public_key.o: In function `verify':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:307: undefined reference to `signature_scheme_names'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:307: undefined reference to `dbg'
.libs/gmp_rsa_public_key.o: In function `encrypt_':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:338: undefined reference to `lib'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:346: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:355: undefined reference to `rng_get_bytes_not_zero'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:371: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:375: undefined reference to `dbg'
.libs/gmp_rsa_public_key.o: In function `memwipe':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
.libs/gmp_rsa_public_key.o: In function `encrypt_':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:334: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:326: undefined reference to `encryption_scheme_names'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:326: undefined reference to `dbg'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:357: undefined reference to `dbg'
.libs/gmp_rsa_public_key.o: In function `memwipe':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/utils.h:432: undefined reference to `memwipe_noinline'
.libs/gmp_rsa_public_key.o: In function `chunk_free':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/../../../../src/libstrongswan/utils/chunk.h:168: undefined reference to `chunk_empty'
.libs/gmp_rsa_public_key.o: In function `encrypt_':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:341: undefined reference to `dbg'
.libs/gmp_rsa_public_key.o: In function `gmp_rsa_public_key_load':
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:452: undefined reference to `chunk_empty'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:475: undefined reference to `public_key_equals'
/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c:475: undefined reference to `public_key_has_fingerprint'
collect2: error: ld returned 1 exit status
make[5]: *** [libstrongswan-gmp.la] Error 1
make[5]: Leaving directory `/tmp/buildd/strongswan-5.0.3/src/libstrongswan/plugins/gmp'

Related issues

Related to Issue #538: use dlopen(file, RTLD_NOW|RTLD_GLOBAL) for the plugin loaderClosed04.03.2014

History

#1 Updated by Tobias Brunner over 8 years ago

  • Description updated (diff)
  • Status changed from New to Feedback
  • Assignee set to Tobias Brunner

We currently don't link the plugins to the main libraries (libstrongswan, libhydra, libcharon). In earlier releases, before libcharon was created, the libcharon plugins actually used symbols defined by the charon executable, so at least some symbols were always unresolvable during link-time. Since then these symbols were moved to libcharon, so it would theoretically be possible to explicitly link the plugins. But as these libraries are loaded by the executables anyway before the plugins themselves are dynamically loaded their symbols will always be present at runtime. So there wasn't really a reason to change the current situation. Is there any real advantage in explicitly linking the plugins to those libraries?

#2 Updated by Tobias Brunner over 7 years ago

  • Related to Issue #538: use dlopen(file, RTLD_NOW|RTLD_GLOBAL) for the plugin loader added

#3 Updated by Tobias Brunner over 3 years ago

  • Tracker changed from Bug to Issue
  • Category set to build
  • Start date deleted (26.04.2013)
  • Resolution set to No feedback

Closing old issues. If this is still a problem, please reopen.

#4 Updated by Tobias Brunner over 3 years ago

  • Status changed from Feedback to Closed

#5 Updated by Yves-Alexis Perez over 3 years ago

Hi,

the builds still fail when using -Wl,-z,defs. Maybe this could be explicitely stripped from LDFLAGS when linking plugins?

#6 Updated by Tobias Brunner over 3 years ago

the builds still fail when using -Wl,-z,defs.

It's possible to build using it, if --enable-monolithic is used (then plugins are assembled into their respective library and those symbols won't be undefined). But that's obviously useless if you actually want individual plugins.

Maybe this could be explicitely stripped from LDFLAGS when linking plugins?

Could be tricky/ugly with automake/libtool (if it's even possible without losing the rest of the variable's value), then I'd probably prefer linking the plugins to the libraries. But the question remains whether it's worth the effort.

Also available in: Atom PDF