How to use this porject in shared library context?

90 views
Skip to first unread message

Arnaud Botella

unread,
Apr 29, 2020, 6:01:13 AM4/29/20
to lice...@googlegroups.com
I want to check the license inside a shared library. Is it possible?

For now, there are issues regarding the position independent code property.
It can be fixed in cmake by setting CMAKE_POSITION_INDEPENDENT_CODE to ON.

However, you are still linking (at least on linux) with other static libraries such as libcrypto.a which as the same issue:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcrypto.a(bio_lib.o): relocation R_X86_64_PC32 against symbole `BIO_set' can not be used when making a shared object; recompilez avec -fPIC

What do you think about this? Limiting the usage of your project to executables or static libraries is a important limit for me.
I can try to help you on this if you want to support this usage.

Edit: It seems you need to remove the flag OPENSSL_USE_STATIC_LIBS or set it to OFF to work on shared context. Both in open-license-manager and in lcc-license-generator.

Gabriele Contini

unread,
Apr 30, 2020, 9:59:15 AM4/30/20
to lice...@googlegroups.com
Hi Arnaud,
well the license generator is a standalone executable... It would be better to have a generic re-distributable executable (statically linked) on the licensecc website and exclude it from the compilation.

If you plan to have the license library compiled as a standalone ".so" or ".dll" unfortunately its api is public. It doesn't take a genius to prepare an implementation of the library that always returns 'LICENSE_OK' and replace the .so file in your software :-P
That's why i'm focusing on having it statically linked. But maybe what you want to do is having it linked statically in another ".so"?

That said compile it as  a shared library is planned, also to support Java and C#, but it has to pass through some kind of obfuscation process (eg.changing function names per-project, or using magic numbers in the api)... It will take some time. You can read the discussion here.

about the cmake CMAKE_POSITION_INDEPENDENT_CODE option, i didn't use it... why? there was a reason 4 years ago...

Regards
Reply all
Reply to author
Forward
0 new messages