undefined references to `strerror_s' while building lua-openssl on alpine image

戏子无情 提交于 2019-12-11 19:56:44

问题


I am trying to build an openresty alpine image with lua-openssl like so

FROM openresty/openresty:alpine-fat

# Set the version
ENV RESTY_CONFIG_OPTIONS_MORE "--with-ngx_http_ssl_module"
EXPOSE 80
EXPOSE 443

RUN ls /usr/local/openresty/nginx/logs

COPY lualib /usr/local/openresty/nginx/lualib
RUN chown -R nobody:root /usr/local/openresty/nginx/lualib

RUN apk add --update \
    openssl openssl-dev \
    lua5.3 luajit-dev  lua-socket   \
    git

RUN git clone https://github.com/zhaozg/lua-openssl.git /usr/local/lua-openssl;     \
    cd /usr/local/lua-openssl;  \
    git checkout e923252b28cff43add6382853cc85ed888c4474b;   \
    make

But I get the one below and a lot of such errors:

/usr/local/lua-openssl/deps/lua-compat/c-api/compat-5.3.c:74: undefined reference to strerror_s' ./libopenssl.a(cms.o): In function compat53_strerror': /usr/local/lua-openssl/deps/lua-compat/c-api/compat-5.3.c:74: undefined reference to strerror_s' ./libopenssl.a(compat.o):/usr/local/lua-openssl/deps/lua-compat/c-api/compat-5.3.c:74: more undefined references tostrerror_s' follow collect2: error: ld returned 1 exit status make: *** [Makefile:94: openssl.so] Error 1

Am I missing a package?


回答1:


(1) We grabbed the trusty image instead of alpine-fat. (2) Overrode the make file with one that uses lcrypto lib to build.

And that is the only setting I know to make this work.

I did not try compiling with MSVC++.

My issue and it's fix is tracked in https://github.com/zhaozg/lua-openssl/issues/138



来源:https://stackoverflow.com/questions/50519633/undefined-references-to-strerror-s-while-building-lua-openssl-on-alpine-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!