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

OpenSSL forces c++_shared – why? #134

Open
alexcohn opened this issue Mar 21, 2021 · 4 comments
Open

OpenSSL forces c++_shared – why? #134

alexcohn opened this issue Mar 21, 2021 · 4 comments
Assignees
Labels
bug Something isn't working ndkports Not a Prefab bug, but we don't have a better home for these

Comments

@alexcohn
Copy link

Describe the bug
If I use prefab for openssl, it can only be linked with c++_shared, but this library is pure C, isn't it?

To Reproduce
Steps to reproduce the behavior:

  1. open a new JNI project
  2. change the C++ file to C
  3. add openssl dependency as prefab

Expected behavior
The project should build without STL

Build system:
CMake

@alexcohn alexcohn added the bug Something isn't working label Mar 21, 2021
@DanAlbert
Copy link
Member

I guess this has been in my to-do list but I never filed a bug for it. ndkports doesn't have any configuration for this yet, so it just gets the default configuration. It's a trivial fix but ndkports changes are blocked on a build infrastructure SNAFU.

@alexcohn
Copy link
Author

For openssl, of all libraries, freeze is unacceptable. Every time there is another security fix, it must become available, so this prefab must be part of a kind of continuous deployment. Maybe, there could be an initiative from Google's side to include this prefab on the official https://wiki.openssl.org/index.php/Binaries list.

Also, consider adding the static binaries (libssl.a, libcrypto.a).

@jeffboody
Copy link

I'd also like to request support for removing the C++ dependency for C libraries as this also significantly increases the app download/install size by requiring the unneeded library. The libc++_shared.so is nearly 1MB (911696 bytes) as seen in app/build/intermediates/stripped_native_libs/release/out/lib/arm64-v8a. I presume the Curl library is also impacted by this issue which is also a C only library.

@jeffboody
Copy link

Looks like the C++ dependency is still required with the latest curl and ssl update.

After applying an equivalent change as follows to my project.

android/ndk-samples@f4574a3

I found that I still require the c++ dependency to complete the build.

    externalNativeBuild {
        cmake {
            arguments "-DANDROID_STL=c++_shared"
            cppFlags ""
        }
    }

@DanAlbert DanAlbert added the ndkports Not a Prefab bug, but we don't have a better home for these label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ndkports Not a Prefab bug, but we don't have a better home for these
Projects
None yet
Development

No branches or pull requests

4 participants