Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails on Rocky 8.7 #211

Closed
4mig4 opened this issue Feb 7, 2023 · 3 comments
Closed

Compilation fails on Rocky 8.7 #211

4mig4 opened this issue Feb 7, 2023 · 3 comments

Comments

@4mig4
Copy link

4mig4 commented Feb 7, 2023

Compilation of luaossl fails on :

  • Linux test.local 4.18.0-425.10.1.el8_7.x86_64 #1 SMP Thu Jan 12 16:32:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

  • Rocky Linux release 8.7 (Green Obsidian)

  • gcc version 8.5.0 20210514 (Red Hat 8.5.0-16) (GCC)

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.rockylinux.org/ --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.5.0 20210514 (Red Hat 8.5.0-16) (GCC) 

with:

$ luarocks install luaossl
Warning: falling back to wget - install luasec to get native HTTPS support
Installing https://luarocks.org/luaossl-20220711-0.src.rock

luaossl 20220711-0 depends on lua (5.1-1 provided by VM)
Applying patch config.h.diff...
Hunk 1 found at offset 2...
gcc -O2 -fPIC -I/home/user1/.luaver/lua/5.1.5/include -c src/openssl.c -o src/openssl.o -D_REENTRANT -D_THREAD_SAFE -DCOMPAT53_PREFIX=luaossl -D_GNU_SOURCE -I/usr/include -I/usr/include
src/openssl.c:2304:3: error: conflicting types for ‘EVP_KDF_CTX’
 } EVP_KDF_CTX;
   ^~~~~~~~~~~
In file included from /usr/include/openssl/err.h:20,
                 from src/openssl.c:68:
/usr/include/openssl/ossl_typ.h:100:31: note: previous declaration of ‘EVP_KDF_CTX’ was here
 typedef struct evp_kdf_ctx_st EVP_KDF_CTX;
                               ^~~~~~~~~~~
src/openssl.c:2306:13: error: conflicting types for ‘EVP_KDF_CTX_free’
 static void EVP_KDF_CTX_free(EVP_KDF_CTX *kctx) {
             ^~~~~~~~~~~~~~~~
In file included from src/openssl.c:619:
/usr/include/openssl/kdf.h:29:6: note: previous declaration of ‘EVP_KDF_CTX_free’ was here
 void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx);
      ^~~~~~~~~~~~~~~~
src/openssl.c:2427: warning: "EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND" redefined
 #define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND
 
In file included from src/openssl.c:619:
/usr/include/openssl/kdf.h:65: note: this is the location of the previous definition
 # define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND  0
 
src/openssl.c:2433: warning: "EVP_KDF_HKDF_MODE_EXTRACT_ONLY" redefined
 #define EVP_KDF_HKDF_MODE_EXTRACT_ONLY EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY
 
In file included from src/openssl.c:619:
/usr/include/openssl/kdf.h:66: note: this is the location of the previous definition
 # define EVP_KDF_HKDF_MODE_EXTRACT_ONLY        1
 
src/openssl.c:2437: warning: "EVP_KDF_HKDF_MODE_EXPAND_ONLY" redefined
 #define EVP_KDF_HKDF_MODE_EXPAND_ONLY EVP_PKEY_HKDEF_MODE_EXPAND_ONLY
 
In file included from src/openssl.c:619:
/usr/include/openssl/kdf.h:67: note: this is the location of the previous definition
 # define EVP_KDF_HKDF_MODE_EXPAND_ONLY         2
 
src/openssl.c:2440:12: error: conflicting types for ‘EVP_KDF_vctrl’
 static int EVP_KDF_vctrl(EVP_KDF_CTX *kctx, int cmd, va_list args) {
            ^~~~~~~~~~~~~
In file included from src/openssl.c:619:
/usr/include/openssl/kdf.h:33:5: note: previous declaration of ‘EVP_KDF_vctrl’ was here
 int EVP_KDF_vctrl(EVP_KDF_CTX *ctx, int cmd, va_list args);
     ^~~~~~~~~~~~~
src/openssl.c:2605:12: error: conflicting types for ‘EVP_KDF_ctrl’
 static int EVP_KDF_ctrl(EVP_KDF_CTX *kctx, int cmd, ...) {
            ^~~~~~~~~~~~
In file included from src/openssl.c:619:
/usr/include/openssl/kdf.h:32:5: note: previous declaration of ‘EVP_KDF_ctrl’ was here
 int EVP_KDF_ctrl(EVP_KDF_CTX *ctx, int cmd, ...);
     ^~~~~~~~~~~~
src/openssl.c:2634:12: error: conflicting types for ‘EVP_KDF_derive’
 static int EVP_KDF_derive(EVP_KDF_CTX *kctx, unsigned char *out, size_t outlen, void *params) {
            ^~~~~~~~~~~~~~
In file included from src/openssl.c:619:
/usr/include/openssl/kdf.h:36:5: note: previous declaration of ‘EVP_KDF_derive’ was here
 int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen);
     ^~~~~~~~~~~~~~
src/openssl.c: In function ‘kdf_derive’:
src/openssl.c:2427:46: error: ‘EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND’ undeclared (first use in this function)
 #define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/openssl.c:12291:5: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND’
     EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/openssl.c:2427:46: note: each undeclared identifier is reported only once for each function it appears in
 #define EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/openssl.c:12291:5: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND’
     EVP_KDF_HKDF_MODE_EXTRACT_AND_EXPAND,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/openssl.c:2433:40: error: ‘EVP_KDF_HKDF_MODE_EXTRACT_ONLY’ undeclared (first use in this function)
 #define EVP_KDF_HKDF_MODE_EXTRACT_ONLY EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/openssl.c:12294:5: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXTRACT_ONLY’
     EVP_KDF_HKDF_MODE_EXTRACT_ONLY,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/openssl.c:2437:39: error: ‘EVP_KDF_HKDF_MODE_EXPAND_ONLY’ undeclared (first use in this function)
 #define EVP_KDF_HKDF_MODE_EXPAND_ONLY EVP_PKEY_HKDEF_MODE_EXPAND_ONLY
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/openssl.c:12297:5: note: in expansion of macro ‘EVP_KDF_HKDF_MODE_EXPAND_ONLY’
     EVP_KDF_HKDF_MODE_EXPAND_ONLY,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: Build error: Failed compiling object src/openssl.o
@daurnimator
Copy link
Collaborator

Duplicate of #175 (comment)

@daurnimator daurnimator marked this as a duplicate of #175 Feb 7, 2023
@4mig4
Copy link
Author

4mig4 commented Feb 7, 2023

set HAVE_EVP_KDF_CTX=1

I'm afraid this proposed solution will now cause a different issue with OpenSSL 1.1.1.

Since #199 (20220711):

luaossl/src/openssl.c

Lines 624 to 626 in 247c0d9

#if HAVE_EVP_KDF_CTX
#include <openssl/core_names.h>
#endif

and because core_names.h does not exist in OpenSSL 1.1.1, compiling will fail with a openssl/core_names.h: No such file or directory.

This is exaclty what is happening

$ luarocks install luaossl CFLAGS="-O2 -fPIC -DHAVE_EVP_KDF_CTX=1"
Installing https://luarocks.org/luaossl-20220711-0.src.rock

luaossl 20220711-0 depends on lua (5.1-1 provided by VM)
Applying patch config.h.diff...
Hunk 1 found at offset 2...
gcc -O2 -fPIC -DHAVE_EVP_KDF_CTX=1 -I/home/user1/.luaver/lua/5.1.5/include -c src/openssl.c -o src/openssl.o -D_REENTRANT -D_THREAD_SAFE -DCOMPAT53_PREFIX=luaossl -D_GNU_SOURCE -I/usr/include -I/usr/include
src/openssl.c:623:10: fatal error: openssl/core_names.h: No such file or directory
 #include <openssl/core_names.h>
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Error: Build error: Failed compiling object src/openssl.o

@4mig4
Copy link
Author

4mig4 commented Feb 7, 2023

solution for me was to use : luarocks install mna/luaossl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants