Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 604842 - dev-python/m2crypto-0.25.1-r2 with dev-libs/openssl-1.1.0c - SWIG/_m2crypto_wrap.c:3991:35: error: 'CRYPTO_NUM_LOCKS' undeclared here (not in a function)
Summary: dev-python/m2crypto-0.25.1-r2 with dev-libs/openssl-1.1.0c - SWIG/_m2crypto_w...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: openssl-1.1 openssl-1.1_disable-deprecated
  Show dependency tree
 
Reported: 2017-01-06 14:49 UTC by eroen
Modified: 2018-10-24 16:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-python/m2crypto-0.25.1-r2:20170106-143924.log (m2crypto-0.25.1-r2:20170106-143924.log,33.94 KB, text/plain)
2017-01-06 14:49 UTC, eroen
Details
m2crypto-0.27.0-openssl-1.1.patch (m2crypto-0.27.0-openssl-1.1.patch,6.99 KB, patch)
2017-12-03 02:32 UTC, Mark Wright
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description eroen 2017-01-06 14:49:29 UTC
Created attachment 458952 [details]
dev-python/m2crypto-0.25.1-r2:20170106-143924.log

x86_64-pc-linux-gnu-gcc -O0 -g -fPIC -I/usr/include/python2.7 -I/usr/include -I/usr/include/openssl -I/var/tmp/portage/dev-python/m2crypto-0.25.1-r2/work/M2Crypto-0.25.1/SWIG -c SWIG/_m2crypto_wrap.c -o /var/tmp/portage/dev-python/m2crypto-0.25.1-r2/work/M2Crypto-0.25.1-python2_7/temp.linux-x86_64-2.7/SWIG/_m2crypto_wrap.o -DTHREADING
SWIG/_m2crypto_wrap.c:3991:35: error: 'CRYPTO_NUM_LOCKS' undeclared here (not in a function)
 static PyThread_type_lock lock_cs[CRYPTO_NUM_LOCKS];
                                   ^~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'threading_locking_callback':
SWIG/_m2crypto_wrap.c:3998:20: error: 'CRYPTO_LOCK' undeclared (first use in this function)
         if (mode & CRYPTO_LOCK) {
                    ^~~~~~~~~~~
SWIG/_m2crypto_wrap.c:3998:20: note: each undeclared identifier is reported only once for each function it appears in
SWIG/_m2crypto_wrap.c: In function 'threading_init':
SWIG/_m2crypto_wrap.c:4025:9: warning: implicit declaration of function 'CRYPTO_set_id_callback' [-Wimplicit-function-declaration]
         CRYPTO_set_id_callback(threading_id_callback);
         ^~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c:4026:9: warning: implicit declaration of function 'CRYPTO_set_locking_callback' [-Wimplicit-function-declaration]
         CRYPTO_set_locking_callback(threading_locking_callback);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'lib_init':
SWIG/_m2crypto_wrap.c:4396:5: warning: implicit declaration of function 'SSLeay_add_all_algorithms' [-Wimplicit-function-declaration]
     SSLeay_add_all_algorithms();
     ^~~~~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'bn_to_mpi':
SWIG/_m2crypto_wrap.c:4408:11: warning: implicit declaration of function 'BN_bn2mpi' [-Wimplicit-function-declaration]
     len = BN_bn2mpi(bn, NULL);
           ^~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'mpi_to_bn':
SWIG/_m2crypto_wrap.c:4433:12: warning: implicit declaration of function 'BN_mpi2bn' [-Wimplicit-function-declaration]
     return BN_mpi2bn(vbuf, vlen, NULL);
            ^~~~~~~~~
SWIG/_m2crypto_wrap.c:4433:12: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return BN_mpi2bn(vbuf, vlen, NULL);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'bn_to_bin':
SWIG/_m2crypto_wrap.c:4441:11: warning: implicit declaration of function 'BN_num_bytes' [-Wimplicit-function-declaration]
     len = BN_num_bytes(bn);
           ^~~~~~~~~~~~
SWIG/_m2crypto_wrap.c:4446:5: warning: implicit declaration of function 'BN_bn2bin' [-Wimplicit-function-declaration]
     BN_bn2bin(bn, bin);
     ^~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'bin_to_bn':
SWIG/_m2crypto_wrap.c:4465:12: warning: implicit declaration of function 'BN_bin2bn' [-Wimplicit-function-declaration]
     return BN_bin2bn(vbuf, vlen, NULL);
            ^~~~~~~~~
SWIG/_m2crypto_wrap.c:4465:12: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return BN_bin2bn(vbuf, vlen, NULL);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'bn_to_hex':
SWIG/_m2crypto_wrap.c:4473:11: warning: implicit declaration of function 'BN_bn2hex' [-Wimplicit-function-declaration]
     hex = BN_bn2hex(bn);
           ^~~~~~~~~
SWIG/_m2crypto_wrap.c:4473:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     hex = BN_bn2hex(bn);
         ^
SWIG/_m2crypto_wrap.c: In function 'hex_to_bn':
SWIG/_m2crypto_wrap.c:4500:13: warning: implicit declaration of function 'BN_new' [-Wimplicit-function-declaration]
     if ((bn=BN_new())==NULL) {
             ^~~~~~
SWIG/_m2crypto_wrap.c:4500:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     if ((bn=BN_new())==NULL) {
            ^
SWIG/_m2crypto_wrap.c:4504:9: warning: implicit declaration of function 'BN_hex2bn' [-Wimplicit-function-declaration]
     if (BN_hex2bn(&bn, (const char *)vbuf) <= 0) {
         ^~~~~~~~~
SWIG/_m2crypto_wrap.c:4507:9: warning: implicit declaration of function 'BN_free' [-Wimplicit-function-declaration]
         BN_free(bn);
         ^~~~~~~
SWIG/_m2crypto_wrap.c: In function 'dec_to_bn':
SWIG/_m2crypto_wrap.c:4521:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     if ((bn=BN_new())==NULL) {
            ^
SWIG/_m2crypto_wrap.c:4525:10: warning: implicit declaration of function 'BN_dec2bn' [-Wimplicit-function-declaration]
     if ((BN_dec2bn(&bn, (const char *)vbuf) <= 0)) {
          ^~~~~~~~~
In file included from SWIG/_m2crypto_wrap.c:4828:0:
/usr/include/openssl/bn.h: At top level:
/usr/include/openssl/bn.h:175:9: error: conflicting types for 'BN_new'
 BIGNUM *BN_new(void);
         ^~~~~~
SWIG/_m2crypto_wrap.c:4500:13: note: previous implicit declaration of 'BN_new' was here
     if ((bn=BN_new())==NULL) {
             ^~~~~~
In file included from SWIG/_m2crypto_wrap.c:4828:0:
/usr/include/openssl/bn.h:180:9: error: conflicting types for 'BN_bin2bn'
 BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
         ^~~~~~~~~
SWIG/_m2crypto_wrap.c:4465:12: note: previous implicit declaration of 'BN_bin2bn' was here
     return BN_bin2bn(vbuf, vlen, NULL);
            ^~~~~~~~~
In file included from SWIG/_m2crypto_wrap.c:4828:0:
/usr/include/openssl/bn.h:185:9: error: conflicting types for 'BN_mpi2bn'
 BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret);
         ^~~~~~~~~
SWIG/_m2crypto_wrap.c:4433:12: note: previous implicit declaration of 'BN_mpi2bn' was here
     return BN_mpi2bn(vbuf, vlen, NULL);
            ^~~~~~~~~
In file included from SWIG/_m2crypto_wrap.c:4828:0:
/usr/include/openssl/bn.h:268:7: error: conflicting types for 'BN_bn2hex'
 char *BN_bn2hex(const BIGNUM *a);
       ^~~~~~~~~
SWIG/_m2crypto_wrap.c:4473:11: note: previous implicit declaration of 'BN_bn2hex' was here
     hex = BN_bn2hex(bn);
           ^~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'bn_rand':
SWIG/_m2crypto_wrap.c:4833:12: error: storage size of 'rnd' isn't known
     BIGNUM rnd;
            ^~~
SWIG/_m2crypto_wrap.c:4837:5: warning: implicit declaration of function 'BN_init' [-Wimplicit-function-declaration]
     BN_init(&rnd);
     ^~~~~~~
SWIG/_m2crypto_wrap.c: In function 'bn_rand_range':
SWIG/_m2crypto_wrap.c:4862:12: error: storage size of 'rnd' isn't known
     BIGNUM rnd;
            ^~~
SWIG/_m2crypto_wrap.c: In function 'rand_pseudo_bytes':
SWIG/_m2crypto_wrap.c:5013:11: warning: implicit declaration of function 'RAND_pseudo_bytes' [-Wimplicit-function-declaration]
     ret = RAND_pseudo_bytes(blob, n);
           ^~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'digest_final':
SWIG/_m2crypto_wrap.c:5157:34: error: dereferencing pointer to incomplete type 'EVP_MD_CTX {aka struct evp_md_ctx_st}'
     if (!(blob = PyMem_Malloc(ctx->digest->md_size))) {
                                  ^~
SWIG/_m2crypto_wrap.c: In function 'hmac_ctx_new':
SWIG/_m2crypto_wrap.c:5180:49: error: invalid application of 'sizeof' to incomplete type 'HMAC_CTX {aka struct hmac_ctx_st}'
     if (!(ctx = (HMAC_CTX *)PyMem_Malloc(sizeof(HMAC_CTX)))) {
                                                 ^~~~~~~~
SWIG/_m2crypto_wrap.c:5184:5: warning: implicit declaration of function 'HMAC_CTX_init' [-Wimplicit-function-declaration]
     HMAC_CTX_init(ctx);
     ^~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'hmac_ctx_free':
SWIG/_m2crypto_wrap.c:5189:5: warning: implicit declaration of function 'HMAC_CTX_cleanup' [-Wimplicit-function-declaration]
     HMAC_CTX_cleanup(ctx);
     ^~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'hmac_init':
SWIG/_m2crypto_wrap.c:5200:10: warning: implicit declaration of function 'HMAC_Init' [-Wimplicit-function-declaration]
     if (!HMAC_Init(ctx, kbuf, klen, md)) {
          ^~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'hmac_final':
SWIG/_m2crypto_wrap.c:5228:34: error: dereferencing pointer to incomplete type 'HMAC_CTX {aka struct hmac_ctx_st}'
     if (!(blob = PyMem_Malloc(ctx->md->md_size))) {
                                  ^~
SWIG/_m2crypto_wrap.c: In function 'cipher_ctx_new':
SWIG/_m2crypto_wrap.c:5280:55: error: invalid application of 'sizeof' to incomplete type 'EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}'
     if (!(ctx = (EVP_CIPHER_CTX *)PyMem_Malloc(sizeof(EVP_CIPHER_CTX)))) {
                                                       ^~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c:5284:5: warning: implicit declaration of function 'EVP_CIPHER_CTX_init' [-Wimplicit-function-declaration]
     EVP_CIPHER_CTX_init(ctx);
     ^~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'cipher_ctx_free':
SWIG/_m2crypto_wrap.c:5289:5: warning: implicit declaration of function 'EVP_CIPHER_CTX_cleanup' [-Wimplicit-function-declaration]
     EVP_CIPHER_CTX_cleanup(ctx);
     ^~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'cipher_final':
SWIG/_m2crypto_wrap.c:5373:34: error: dereferencing pointer to incomplete type 'EVP_CIPHER_CTX {aka struct evp_cipher_ctx_st}'
     if (!(obuf = PyMem_Malloc(ctx->cipher->block_size))) {
                                  ^~
SWIG/_m2crypto_wrap.c: In function 'pkey_get_modulus':
SWIG/_m2crypto_wrap.c:5539:17: error: dereferencing pointer to incomplete type 'EVP_PKEY {aka struct evp_pkey_st}'
     switch (pkey->type) {
                 ^~
SWIG/_m2crypto_wrap.c:5550:35: error: dereferencing pointer to incomplete type 'RSA {aka struct rsa_st}'
             if (!BN_print(bio, rsa->n)) {
                                   ^~
SWIG/_m2crypto_wrap.c:5577:17: warning: implicit declaration of function 'DSA_free' [-Wimplicit-function-declaration]
                 DSA_free(dsa);
                 ^~~~~~~~
SWIG/_m2crypto_wrap.c:5582:35: error: dereferencing pointer to incomplete type 'DSA {aka struct dsa_st}'
             if (!BN_print(bio, dsa->pub_key)) {
                                   ^~
SWIG/_m2crypto_wrap.c: In function 'dh_generate_parameters':
SWIG/_m2crypto_wrap.c:5795:10: warning: implicit declaration of function 'DH_generate_parameters' [-Wimplicit-function-declaration]
     dh = DH_generate_parameters(plen, g, gendh_callback, (void *)pyfunc);
          ^~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c:5795:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     dh = DH_generate_parameters(plen, g, gendh_callback, (void *)pyfunc);
        ^
SWIG/_m2crypto_wrap.c: In function 'dh_get_p':
SWIG/_m2crypto_wrap.c:5847:12: error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
     if (!dh->p) {
            ^~
SWIG/_m2crypto_wrap.c: In function 'rsa_generate_key':
SWIG/_m2crypto_wrap.c:6338:11: warning: implicit declaration of function 'RSA_generate_key' [-Wimplicit-function-declaration]
     rsa = RSA_generate_key(bits, e, genrsa_callback, (void *)pyfunc);
           ^~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c:6338:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     rsa = RSA_generate_key(bits, e, genrsa_callback, (void *)pyfunc);
         ^
SWIG/_m2crypto_wrap.c: In function 'dsa_sig_get_r':
SWIG/_m2crypto_wrap.c:6367:29: error: dereferencing pointer to incomplete type 'DSA_SIG {aka struct DSA_SIG_st}'
     return bn_to_mpi(dsa_sig->r);
                             ^~
SWIG/_m2crypto_wrap.c: In function 'dsa_generate_parameters':
SWIG/_m2crypto_wrap.c:6397:11: warning: implicit declaration of function 'DSA_generate_parameters' [-Wimplicit-function-declaration]
     dsa = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, genparam_callback, (void *)pyfunc);
           ^~~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c:6397:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     dsa = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, genparam_callback, (void *)pyfunc);
         ^
SWIG/_m2crypto_wrap.c: In function 'ssl_init':
SWIG/_m2crypto_wrap.c:6725:5: warning: implicit declaration of function 'SSL_library_init' [-Wimplicit-function-declaration]
     SSL_library_init();
     ^~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c:6726:5: warning: implicit declaration of function 'SSL_load_error_strings' [-Wimplicit-function-declaration]
     SSL_load_error_strings();
     ^~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'ssl_ctx_set_tmp_rsa':
SWIG/_m2crypto_wrap.c:6856:12: warning: implicit declaration of function 'SSL_CTX_set_tmp_rsa' [-Wimplicit-function-declaration]
     return SSL_CTX_set_tmp_rsa(ctx, rsa);
            ^~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'ssl_ctx_set_tmp_rsa_callback':
SWIG/_m2crypto_wrap.c:6863:5: warning: implicit declaration of function 'SSL_CTX_set_tmp_rsa_callback' [-Wimplicit-function-declaration]
     SSL_CTX_set_tmp_rsa_callback(ctx, ssl_set_tmp_rsa_callback);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'sk_ssl_cipher_value':
SWIG/_m2crypto_wrap.c:7318:12: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     return sk_SSL_CIPHER_value(stack, idx);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'x509_set_not_before':
SWIG/_m2crypto_wrap.c:7444:12: warning: implicit declaration of function 'X509_set_notBefore' [-Wimplicit-function-declaration]
     return X509_set_notBefore(x, tm);
            ^~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'x509_get_not_before':
SWIG/_m2crypto_wrap.c:7449:12: warning: implicit declaration of function 'X509_get_notBefore' [-Wimplicit-function-declaration]
     return X509_get_notBefore(x);
            ^~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c:7449:12: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return X509_get_notBefore(x);
            ^~~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'x509_set_not_after':
SWIG/_m2crypto_wrap.c:7454:12: warning: implicit declaration of function 'X509_set_notAfter' [-Wimplicit-function-declaration]
     return X509_set_notAfter(x, tm);
            ^~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'x509_get_not_after':
SWIG/_m2crypto_wrap.c:7459:12: warning: implicit declaration of function 'X509_get_notAfter' [-Wimplicit-function-declaration]
     return X509_get_notAfter(x);
            ^~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c:7459:12: warning: return makes pointer from integer without a cast [-Wint-conversion]
     return X509_get_notAfter(x);
            ^~~~~~~~~~~~~~~~~~~~
SWIG/_m2crypto_wrap.c: In function 'x509_name_get_der':
SWIG/_m2crypto_wrap.c:7517:43: error: dereferencing pointer to incomplete type 'X509_NAME {aka struct X509_name_st}'
     return PyString_FromStringAndSize(name->bytes->data, name->bytes->length);
                                           ^~
...

error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
 * ERROR: dev-python/m2crypto-0.25.1-r2::gentoo failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  115:  Called src_compile
 *   environment, line 2654:  Called distutils-r1_src_compile
 *   environment, line  780:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
 *   environment, line  339:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 2189:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1480:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line 1478:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
 *   environment, line  530:  Called distutils-r1_run_phase 'distutils-r1_python_compile'
 *   environment, line  771:  Called distutils-r1_python_compile
 *   environment, line  646:  Called esetup.py 'build'
 *   environment, line 1025:  Called die
 * The specific snippet of code:
 *       "${@}" || die "${die_args[@]}";
Comment 1 Hanno Böck gentoo-dev 2017-07-13 09:10:52 UTC
Upstream pull req and discussion:
https://gitlab.com/m2crypto/m2crypto/merge_requests/98
Comment 2 Mark Wright gentoo-dev 2017-12-03 02:32:50 UTC
Created attachment 507800 [details, diff]
m2crypto-0.27.0-openssl-1.1.patch

Patch by me for dev-python/m2crypto-0.27.0 to compile with openssl 1.1.0g without compiler warnings in the build.log.  As note without this patch it compiles with FEATURES=-test, but it wants to call undefined functions (functions removed from the openssl 1.1 API since they are deprecated).
Comment 3 bug2017 2018-07-25 08:31:56 UTC
dev-python/m2crypto-0.27.0-r2 does not compile against openssl-1.1.1-pre8 anymore. The previous version (-r1) with the patch from this bug report was working.


* python2_7: running distutils-r1_run_phase python_compile
python2.7 setup.py build --openssl=/usr
Traceback (most recent call last):
  File "setup.py", line 256, in <module>
    if openssl_version('1.1.0', required=True):
  File "setup.py", line 84, in openssl_version
    return StrictVersion(ver_str) >= StrictVersion(req_ver)
  File "/usr/lib64/python2.7/distutils/version.py", line 40, in __init__
    self.parse(vstring)
  File "/usr/lib64/python2.7/distutils/version.py", line 107, in parse
    raise ValueError, "invalid version number '%s'" % vstring
ValueError: invalid version number '1.1.1-pre8'
Comment 4 Lars Wendler (Polynomial-C) gentoo-dev 2018-10-24 14:23:15 UTC
Since we decided to no longer build openssl without deprecated features, this
bug can now be considered as fixed (but will eventually reappear once openssl
upstream finally removed deprecated features from their code).