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

Failed building in Termux with shared OpenSSL 3.0, PCRE, and Luv #280

Open
mbekkomo opened this issue Sep 22, 2023 · 3 comments
Open

Failed building in Termux with shared OpenSSL 3.0, PCRE, and Luv #280

mbekkomo opened this issue Sep 22, 2023 · 3 comments

Comments

@mbekkomo
Copy link

Hello, I tried building luvi with shared OpenSSL 3.0, PCRE, and Luv. When cmake tried to build luvi, it failed with an error.

ld: error: jitted_tmp/src/lua/init.lua_luvi_generated.o: SHT_STRTAB string table section [index 3] is non-null terminated

The build flags.

cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DWithSharedLibluv=OFF -DWithSharedLibluv=ON -DWithSharedPCRE=ON -DCMAKE_LIBRARY_PATH=/data/data/com.termux/files/usr/lib -DOPENSSL_ROOT_DIR=/data/data/com.termux/files/usr -DOPENSSL_INCLUDE_DIR=/data/data/com.termux/files/usr/include -DOPENSSL_LIBRARIES=/data/data/com.termux/files/usr/lib -DPCRE_INCLUDE_DIR=/data/data/com.termux/files/usr/include -DPCRE_LIBRARIES=/data/data/com.termux/files/usr/lib -DLIBUV_INCLUDE_DIR=/data/data/com.termux/files/usr/include -DLIBUV_LIBRARIES=/data/data/com.termux/files/usr/lib -DLUAJIT_INCLUDE_DIR=/data/data/com.termux/files/usr/include/luajit-2.1 -DLUAJIT_LIBRARIES=/data/data/com.termux/files/usr/lib -DLIBLUV_INCLUDE_DIR=/data/data/com.termux/files/usr/include/luv -DLIBLUV_LIBRARIES=/data/data/com.termux/files/usr/lib -DWithOpenSSL=ON -DWithSharedOpenSSL=ON -DWithPCRE=ON -DWithLPEG=ON

Is there a work around to have ld not to result an error?

@mbekkomo
Copy link
Author

I forgot, I also had patch for clang not to throw -Wincompatible-function-pointer-types.

--- luvi/deps/lua-openssl/src/ocsp.c	2023-09-21 20:43:36.658538386 +0800
+++ luvi.1/deps/lua-openssl/src/ocsp.c	2023-09-21 20:59:04.998538309 +0800
@@ -121,8 +121,15 @@
   BIO *bio = load_bio_object(L, 1);
   int pem = lua_gettop(L) > 1 ? auxiliar_checkboolean(L, 2) : 0;
 
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored"-Wincompatible-function-pointer-types"
+#endif
   OCSP_REQUEST *req = pem ? PEM_read_bio_OCSP_REQUEST(bio, NULL, NULL)
                       : d2i_OCSP_REQUEST_bio(bio, NULL);
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
   BIO_free(bio);
 
   if (req)
@@ -303,8 +310,15 @@
   BIO *bio = load_bio_object(L, 1);
   int pem = lua_gettop(L) > 1 ? auxiliar_checkboolean(L, 2) : 0;
 
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored"-Wincompatible-function-pointer-types"
+#endif
   OCSP_RESPONSE *res = pem ? PEM_read_bio_OCSP_RESPONSE(bio, NULL, NULL)
                       : d2i_OCSP_RESPONSE_bio(bio, NULL);
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
   if (res)
     PUSH_OBJECT(res, "openssl.ocsp_response");
   else

@zhaozg
Copy link
Member

zhaozg commented Sep 22, 2023

upstream is https://github.com/zhaozg/lua-openssl

@mbekkomo
Copy link
Author

upstream is https://github.com/zhaozg/lua-openssl

I'm building luvi from the v2.14.0 tag, should I update the local submodule to upstream?

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

No branches or pull requests

2 participants