[gnutls-devel] Missing function. Where is version_to_entry defined?

JONES, BILL rj7252 at att.com
Mon Feb 16 18:04:49 CET 2015


Here are the full list of files missing "#include <signal.h>"
"gnutls-3.3.11/tests/resume-dtls.c", line 336: warning: implicit function declaration: kill
"gnutls-3.3.11/tests/mini-dtls-hello-verify.c", line 170: warning: implicit function declaration: kill
"gnutls-3.3.11/tests/mini-dtls-rehandshake.c", line 223: warning: implicit function declaration: kill
"gnutls-3.3.11/tests/mini-alpn.c", line 163: warning: implicit function declaration: kill
"gnutls-3.3.11/tests/mini-dtls-large.c", line 151: warning: implicit function declaration: kill
"gnutls-3.3.11/tests/mini-dtls-heartbeat.c", line 208: warning: implicit function declaration: kill
"gnutls-3.3.11/tests/mini-dtls-srtp.c", line 187: warning: implicit function declaration: kill
"gnutls-3.3.11/tests/mini-dtls-record.c", line 280: warning: implicit function declaration: kill
"gnutls-3.3.11/tests/srp/mini-srp.c", line 202: warning: implicit function declaration: kill
"gnutls-3.3.11/tests/resume.c", line 336: warning: implicit function declaration: kill


Here are other warnings showing up:
"gnutls-3.3.11/lib/x509/pkcs12_encr.c", line 140: warning: enum type mismatch: arg #1
rc = _gnutls_hash_fast(me->id, hash, mac_len,
                       hash);
should this be:
rc = _gnutls_hash_fast((gnutls_digest_algorithm_t)me->id, hash, mac_len,
                       hash);



"gnutls-3.3.11/lib/system.c", line 684: warning: argument #2 is incompatible with prototype:
        prototype: pointer to pointer to const char : "/appl/local-201501ss/include/iconv.h", line 83
        argument : pointer to pointer to char



"gnutls-3.3.11/src/certtool-cfg.c", line 1104: warning: shift count negative or too big: >> 32



"gnutls-3.3.11/src/certtool.c", line 1131: warning: integer overflow detected: op "<<"



-----Original Message-----
From: JONES, BILL 
Sent: Monday, February 16, 2015 8:51 AM
To: 'Nikos Mavrogiannopoulos'
Cc: bugs at gnutls.org
Subject: RE: [gnutls-devel] Missing function. Where is version_to_entry defined?

OK, so I looked into this.

While building libgnutls.so.28.41.3 I see that libtool is building a .exp file to be fed to cc -M {file}.exp.

This is defining which symbols to be global vs local.  I would expect this mapping to only apply to .o files being included in the archive, but it's changing functions in the .a files like libgnutls_alg.a that are GLOB to LOCL

With -M
$ nm .libs/libgnutls.so.28.41.3 | grep version_to
[296]   |   1068728|       128|FUNC |LOCL |2    |10     |version_to_entry

Without -M
$ nm .libs/libgnutls.so.28.41.3.save | grep version_to
[15274] |   1822032|       128|FUNC |GLOB |0    |9      |version_to_entry

While removing the -M from the compile line fixes this issue, I am not sure what other issues it may generate.



The same method was used for libgnutls.a and it seems to have worked:
$ nm .libs/libgnutls.a | grep version_to | grep -v UNDEF
[97]    |      6448|       128|FUNC |GLOB |0    |2      |version_to_entry

Why not just convert the .a to a .so directly instead of rebuilding it from scratch...which didn't work.

Here is the "cc" line that builds on Solaris10 with solarisstudio12.  (I formatted it for readability) and tested both with and without the -M.
Just removing the -M fixed the linking problems.  All the tests that ran passed.  SRP tests then ran into an undefined symbol.  See the bottom of this message.

cc -G \
   -z defs \
   -M libgnutls.so.28.41.3.exp \
   -h libgnutls.so.28 \
   -R/appl/local-201501ss/lib \
   -L/appl/local-201501ss/lib \
   -o .libs/libgnutls.so.28.41.3 \
   .libs/gnutls_range.o \
   .libs/gnutls_record.o \
   .libs/gnutls_compress.o \
   .libs/debug.o \
   .libs/gnutls_cipher.o \
   .libs/gnutls_mbuffers.o \
   .libs/gnutls_buffers.o \
   .libs/gnutls_handshake.o \
   .libs/gnutls_num.o \
   .libs/gnutls_errors.o \
   .libs/gnutls_dh.o \
   .libs/gnutls_kx.o \
   .libs/gnutls_priority.o \
   .libs/gnutls_hash_int.o \
   .libs/gnutls_cipher_int.o \
   .libs/gnutls_session.o \
   .libs/gnutls_db.o \
   .libs/x509_b64.o \
   .libs/gnutls_extensions.o \
   .libs/gnutls_auth.o \
   .libs/gnutls_v2_compat.o \
   .libs/gnutls_datum.o \
   .libs/gnutls_session_pack.o \
   .libs/gnutls_mpi.o \
   .libs/gnutls_pk.o \
   .libs/gnutls_cert.o \
   .libs/gnutls_global.o \
   .libs/gnutls_constate.o \
   .libs/gnutls_anon_cred.o \
   .libs/pkix_asn1_tab.o \
   .libs/gnutls_asn1_tab.o \
   .libs/gnutls_mem.o \
   .libs/gnutls_ui.o \
   .libs/vasprintf.o \
   .libs/gnutls_sig.o \
   .libs/gnutls_ecc.o \
   .libs/gnutls_alert.o \
   .libs/gnutls_privkey_raw.o \
   .libs/system.o \
   .libs/gnutls_str.o \
   .libs/gnutls_state.o \
   .libs/gnutls_x509.o \
   .libs/gnutls_rsa_export.o \
   .libs/gnutls_helper.o \
   .libs/gnutls_supplemental.o \
   .libs/random.o \
   .libs/crypto-api.o \
   .libs/gnutls_privkey.o \
   .libs/gnutls_pcert.o \
   .libs/gnutls_pubkey.o \
   .libs/locks.o \
   .libs/gnutls_dtls.o \
   .libs/system_override.o \
   .libs/crypto-backend.o \
   .libs/verify-tofu.o \
   .libs/pin.o \
   .libs/tpm.o \
   .libs/fips.o \
   .libs/safe-memset.o \
   .libs/inet_pton.o \
   .libs/gnutls_srp.o \
   .libs/gnutls_psk.o \
   -z allextract \
    ../gl/.libs/libgnu.a \
    x509/.libs/libgnutls_x509.a \
    ext/.libs/libgnutls_ext.a \
    auth/.libs/libgnutls_auth.a \
    algorithms/.libs/libgnutls_alg.a \
    extras/.libs/libgnutls_extras.a \
    accelerated/.libs/libaccelerated.a \
    openpgp/.libs/libgnutls_openpgp.a \
    opencdk/.libs/libminiopencdk.a \
    nettle/.libs/libcrypto.a \
   -z defaultextract \
   -lz \
   -lc \
   -lnsl \
   -lsocket \
   -lrt \
   -lnettle \
   -lhogweed \
   -lgen \
   -lc \
   /appl/local-201501ss/lib/libiconv.so \
   /appl/local-201501ss/lib/libintl.so \
   /appl/local-201501ss/lib/libtasn1.so \
   /appl/local-201501ss/lib/libgmp.so



Here is the "srp" issue:
Making check in srp
make[2]: Entering directory `/appl/archives/local_build/build-ss/gnutls-3.3.11/tests/srp'
make  mini-srp
make[3]: Entering directory `/appl/archives/local_build/build-ss/gnutls-3.3.11/tests/srp'
  CC       mini-srp.o
"/appl/gfpip/local_build/src/gnutls/gnutls-3.3.11/tests/srp/mini-srp.c", line 202: warning: implicit function declaration:
kill
"/appl/gfpip/local_build/src/gnutls/gnutls-3.3.11/tests/srp/mini-srp.c", line 274: undefined symbol: AF_LOCAL
cc: acomp failed for /appl/gfpip/local_build/src/gnutls/gnutls-3.3.11/tests/srp/mini-srp.c
make[3]: *** [mini-srp.o] Error 2
make[3]: Leaving directory `/appl/archives/local_build/build-ss/gnutls-3.3.11/tests/srp'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/appl/archives/local_build/build-ss/gnutls-3.3.11/tests/srp'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/appl/archives/local_build/build-ss/gnutls-3.3.11/tests'
make: *** [check-recursive] Error 1

On Solaris, AF_UNIX is defined and the CODE should be checking for this.  Some parts of gnutls ARE checking:
from lib/nettle/egd.c
	#ifdef AF_UNIX
	#define LOCAL_SOCKET_TYPE AF_UNIX
	#else
	#define LOCAL_SOCKET_TYPE AF_LOCAL
	#endif

I changed tests/srp/mini-srp.c tests/dtls/dtls-stress.c to use the same setup as in egd.c.  Can THIS at least be fixed in the code base?


Also there are a lot of these warnings around...in the entire package...
"/appl/gfpip/local_build/src/gnutls/gnutls-3.3.11/tests/srp/mini-srp.c", line 208: warning: implicit function declaration: kill

This is resulting from a missing "#include <signal.h>" in many files.



-----Original Message-----
From: n.mavrogiannopoulos at gmail.com [mailto:n.mavrogiannopoulos at gmail.com] On Behalf Of Nikos Mavrogiannopoulos
Sent: Thursday, February 12, 2015 7:01 AM
To: JONES, BILL
Cc: Daniel Kahn Gillmor; bugs at gnutls.org
Subject: Re: [gnutls-devel] Missing function. Where is version_to_entry defined?

On Thu, Feb 12, 2015 at 9:59 AM, JONES, BILL <rj7252 at att.com> wrote:
> GNUTLS Team,
> So I did some digging around...
> as previously stated, make --recon check produces this link command:
>
> echo "  CCLD    " gc;/bin/bash ../libtool --silent --tag=CC   --mode=link cc
> -no-install -R/appl/local-201501ss/lib    -R/usr/lib
> -L/appl/local-201501ss/lib -L/opt/solarisstudio12.3/lib
> -L/opt/solarisstudio12.3/lib -o gc gc.o ../lib/libgnutls.la ../gl/libgnu.la
> libutils.la  -lsocket -lnsl -lnsl -lintl -lgen
> If I add "../lib/algorithms/libgnutls_alg.la" to it link so:
> echo "  CCLD    " gc;/bin/bash ../libtool --silent --tag=CC   --mode=link cc
> -no-install -R/appl/local-201501ss/lib    -R/usr/lib
> -L/appl/local-201501ss/lib -L/opt/solarisstudio12.3/lib
> -L/opt/solarisstudio12.3/lib -o gc gc.o ../lib/libgnutls.la ../gl/libgnu.la
> ../lib/algorithms/libgnutls_alg.la  libutils.la  -lsocket -lnsl -lnsl -lintl
> -lgen

You shouldn't need to add libgnutls_alg.la there. libgnutls_alg.la is
part of libgnutls.la. You may be hitting a libtool bug for the
platform you are.



More information about the Gnutls-devel mailing list