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

compile error in x509.c (rockspec 0.6-1 and openssl 1.1.0e) #93

Closed
Lord-Helmchen opened this issue Mar 8, 2017 · 3 comments
Closed

Comments

@Lord-Helmchen
Copy link

Lord-Helmchen commented Mar 8, 2017

Compilation failed with two errors in src/x509.c:

In function 'meth_extensions':
src/x509.c:296:35: error: dereferencing pointer to incomplete type 'X509_EXTENSION {aka struct X509_extension_st}'
push_asn1_objname(L, extension->object, 1);
^~
src/x509.c: In function 'meth_pubkey':
src/x509.c:407:32: error: dereferencing pointer to incomplete type 'EVP_PKEY {aka struct evp_pkey_st}'
switch(EVP_PKEY_type(pkey->type)) {
^~

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

I don't know for sure if that is strictly a luasec issue, or if the fault lies with the openssl includes that I use, but I'd be glad for help in any case...

Using luarocks-2.4.2-win32 and luasec-0.6-1 rockspeck. compiler is mingw-w64-i868-gcc (6.3.0-2) from msys2 (I edited luarocks/lua/luarocks/cfg.lua to remove the "mingw-" prefix so the compiler would be found).
both lua (5.3) and openssl (1.1.0e) were built from within msys-mingw32.

full output:

PS C:\luarocks> ./luarocks.bat install luasec OPENSSL_DIR=C:\openssl32

C:\luarocks>SET "PATH=C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows
;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\In
tel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Compo
nents\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\GnuPG\pub;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\S
ystem32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Skype\Phone\;C:\Program Fi
les\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\lordhelmchen\AppData\Local\Microsoft\WindowsApps;C:\Program Files\cmdline-tools;C:\lu
a32\bin;C:\msys64\mingw32\bin;C:\msys64\usr\bin"
Installing https://luarocks.org/luasec-0.6-1.rockspec
Cloning into 'luasec'...
remote: Counting objects: 116, done.
remote: Compressing objects: 100% (93/93), done.
Receiving objects:  81% (94/116)   remote: Total 116 (delta 33), reused 76 (delta 22), pack-reused 0
Receiving objects: 100% (116/116), 68.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (33/33), done.
Note: checking out '20443861ebc3f6498ee7d9c70fbdaa059bec15e1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

Applying patch luarocks_vs_compiler.patch...
successfully patched C:\Users\LORDHE~1\AppData\Local\Temp/luarocks_luasec-0.6-1-4001/luasec/src/ssl.c
gcc -O2 -c -o src/x509.o -IC:/lua32/include src/x509.c -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DLSEC_EXPORTS -DBUFFER_DEBUG -DLSEC_API=__declspec(dllexport) -DLUASEC_I
NET_NTOP -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -DNTDDI_VERSION=0x05010300 -IC:\openssl32/include -Isrc/ -Isrc/luasocket
src/x509.c: In function 'push_asn1_string':
src/x509.c:149:5: warning: 'ASN1_STRING_data' is deprecated [-Wdeprecated-declarations]
     lua_pushlstring(L, (char*)ASN1_STRING_data(string),
     ^~~~~~~~~~~~~~~
In file included from C:\openssl32/include/openssl/bn.h:31:0,
                 from C:\openssl32/include/openssl/asn1.h:24,
                 from C:\openssl32/include/openssl/objects.h:916,
                 from C:\openssl32/include/openssl/evp.h:27,
                 from C:\openssl32/include/openssl/x509.h:23,
                 from C:\openssl32/include/openssl/ssl.h:50,
                 from src/x509.c:22:
C:\openssl32/include/openssl/asn1.h:553:35: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
                                   ^
C:\openssl32/include/openssl/opensslconf.h:105:35: note: in definition of macro 'DECLARE_DEPRECATED'
 # define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                   ^
C:\openssl32/include/openssl/asn1.h:553:1: note: in expansion of macro 'DEPRECATEDIN_1_1_0'
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^
src/x509.c: In function 'push_asn1_ip':
src/x509.c:185:3: warning: 'ASN1_STRING_data' is deprecated [-Wdeprecated-declarations]
   unsigned char *ip = ASN1_STRING_data(string);
   ^~~~~~~~
In file included from C:\openssl32/include/openssl/bn.h:31:0,
                 from C:\openssl32/include/openssl/asn1.h:24,
                 from C:\openssl32/include/openssl/objects.h:916,
                 from C:\openssl32/include/openssl/evp.h:27,
                 from C:\openssl32/include/openssl/x509.h:23,
                 from C:\openssl32/include/openssl/ssl.h:50,
                 from src/x509.c:22:
C:\openssl32/include/openssl/asn1.h:553:35: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
                                   ^
C:\openssl32/include/openssl/opensslconf.h:105:35: note: in definition of macro 'DECLARE_DEPRECATED'
 # define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                   ^
C:\openssl32/include/openssl/asn1.h:553:1: note: in expansion of macro 'DEPRECATEDIN_1_1_0'
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^
src/x509.c: In function 'meth_extensions':
src/x509.c:296:35: error: dereferencing pointer to incomplete type 'X509_EXTENSION {aka struct X509_extension_st}'
     push_asn1_objname(L, extension->object, 1);
                                   ^~
src/x509.c: In function 'meth_pubkey':
src/x509.c:407:32: error: dereferencing pointer to incomplete type 'EVP_PKEY {aka struct evp_pkey_st}'
       switch(EVP_PKEY_type(pkey->type)) {
                                ^~

Error: Build error: Failed compiling object src/x509.o
PS C:\luarocks>
@Lord-Helmchen Lord-Helmchen changed the title compile error in x509.c compile error in x509.c (rockspec 6.1-1 and openssl 1.1.0e) Mar 9, 2017
@Lord-Helmchen Lord-Helmchen changed the title compile error in x509.c (rockspec 6.1-1 and openssl 1.1.0e) compile error in x509.c (rockspec 0.6-1 and openssl 1.1.0e) Mar 9, 2017
@brunoos
Copy link
Member

brunoos commented Mar 9, 2017

I think I fix it... can you try install from git 'head'?

@Lord-Helmchen
Copy link
Author

Lord-Helmchen commented Mar 9, 2017

after changing the tag from luasec-0.6 to head in the rockspec it does indeed compile ... further than before...
now linking fails:
`C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/6.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llibcrypto-1_1.d

C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/6.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -llibssl-1_1.dll`

(had already changed
libraries = { "libeay32", "ssleay32", "ws2_32"
to
libraries = { "libcrypto-1_1.dll", "libssl-1_1.dll", "ws2_32"
)
but that does not seem to be strictly a luasec problem. Thus, I'll have to go to msys2 and/or luarocks for further help, I'm afraid.

@Lord-Helmchen
Copy link
Author

Lord-Helmchen commented Mar 10, 2017

and now, after deleting every remnant of previous failed attempts and starting over, this time documenting every step and deviation from the default steps, I see that there shall be no file suffix in the libraries configuration of the rockspec. (and the tag needs to read "master", not "head").

So now I'm finally back to square one, only with updated lua,openssl,luasockets and luasec.
but at least I have a working build process now, and can try whether #38 will finally resolve my "301 Moved Permanently" troubles ...

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

No branches or pull requests

2 participants