Add "Libs.private: -m" to wolfssl.pc.in for a static linking#7224
Add "Libs.private: -m" to wolfssl.pc.in for a static linking#7224douzzer merged 2 commits intowolfSSL:masterfrom
Conversation
|
Can one of the admins verify this patch? |
|
Hi @mpsuzuki , The -lm math for pow/log is only required for DH is not using the standard DH P/G params. If you add Thanks, |
|
Hi @dgarske, Thank you for comment. Umm, maybe I failed to describe my intention. I have no problem about the dependency itself, but I want "pkg-config --libs --static" to return appropriate options to link libwolfssl statically. In my understanding, your comment might be negative to introduce "Libs.private: -lm" to wolfssl.pc. Looking at configure.ac and CMakeLists.txt carefully, I understand the background of your position as follows:
I think my last patch is unacceptable for the viewpoint of the portability, I apologize. Checking configure.ac more carefully, I found that LT_LIB_M (a macro to set LIBM variable pointing a math library, defined by GNU libtool) is invoked if needed, like Thus, I revised my patch (e4b1e54) as following:
I cannot find other meta-build tool files caring about wolfssl.pc in IDE directory. Is this more considerable? |
|
Hi @mpsuzuki , The changes look good. Can you tell us more about your project? Are you planning on making additional PR's? For code contributions we required a signed contributor agreement. Thanks, |
|
Dear @dgarske , Although I made a forked repository to develop my patch, my patches in future (if there is) would be only for the meta-build tools or the compatibility macros for OpenSSL, because I have little expertise in the cryptography, secure network programming. |
|
Hi @mpsuzuki , I recommend you email support at wolfssl dot com and provide some additional details and request a contributor agreement. Typically you would sign the contributor agreement yourself. It would be great to hear more about your education materials and we will happily support you in efforts involving wolfSSL in those. Thanks, |
|
@mpsuzuki is approved as a contributor. |
Description
Currently wolfssl.pc returns -lwolfssl only, regardless whether the linking is dynamic or static. libwolfssl uses a few math functions, like log() and pow(), so static linking of libwolfssl needs "-lm" explicitly. Please consider "Libs.private: -lm" to wolfssl.pc.in.
Testing
Before this patch, both of "pkg-config --libs wolfssl" and "pkg-config --libs --static wolfssl" return "-L... -lwolfssl".
After this patch, "pkg-confg --libs wolfssl" returns "-L... -lwolfssl", but "pkg-config --libs --static wolfssl" returns "-L... -lwolfssl -lm".
Checklist