-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cross compiled OpenSSL and Curl android dependencies are not "installed" #995
Comments
Hi @dschmitt007 Have you figured it out? |
I have a horrid hack (I tar up the results from build and dump them into install, and then have ugly ugly CMakeLists.txt files that have to have all the aws transitive dependencies listed.) |
hi @dschmitt007 |
@dschmitt007, yes. Please provide details. |
So, the horrid hack looks like a shell script for calling CMake with
And then adding the -L parts to stuff that uses it. (The EXTRA_AWS_OPTIONS are just
|
@dschmitt007 Cool. That's a rather straightforward work-around. Maybe you can help me out on a related topic... what I'm running up against is trying to use the aws-sdk-cpp stuff from an Android Studio Native C++ project. I get link errors from the native-lib link. It's not finding symbols in the external lib .a files. Here's what my cmake looks like:
I suspect it's because native-lib is SHARED and the dependencies are STATIC? If I build aws-cpp-sdk-core as a shared lib, and change its add_library() to SHARED, aws-sdk-core.so isn't found at app run time. I guess the .so needs to be copied to somewhere? I realize this issue isn't the ideal place to raise this question. But, I'll start here. :-) Thank you for any insights you are willing to share. (It goes without saying I'm just coming up the learning curve on using aws-cpp-sdk in an Android app.) |
I'd vote stackoverflow would be a place to refine views on shared/static libs and the NDK in general. My short view is "Android doesn't do shared at the os level for versioning, just dynamic load" so I make all sub-projects static, link them into one big shared .so and drop it in my apk with the required C++ stdlib .so. The exception to that would be if you are integrating AARs into the same app that do native and might share the .so, but it would require coordination because the java side has to load it and the stdlib needs to be the same. If you do want to carry a bunch of .so files around, make sure some java does the System.loadLibrary for each and making sure they get pulled into all the abi directories for the build. |
Thanks, @dschmitt007. I went with a static linking of aws-cpp-sdk-core, but am now running into these linker errors:
I suspect this is because aws-sdk-cpp for Android is dependent on NDK 12b, which at this time is quite dated. If I move the Android API version back to something from that time, the rest of my app has issues, expecting newer API features. It looks like I'm stuck. Am I? OpenSSL was built as part of the aws-sdk-cpp build itself: |
I'm not sure how to help. Maybe run these issues down: https://stackoverflow.com/questions/38192458/linking-openssl-on-android-and-undefined-references We hacked the heck out of the android tools finding cmake stuff and have it working with r18b so I can't help much. |
Thanks, I did look at that stackoverflow article before posting my last entry on this thread. What I gained from it was I'd have to munge-around with how OpenSSL got built by the aws-sdk-cpp cmake (and thus why I made a point of stating "OpenSSL was built as part of the aws-sdk-cpp build itself".) I guess I'm headed towards either hacking aws-sdk-cpp cmake or waiting for the exciting news that the aws-sdk-cpp team has moved to a newer NDK version. @wps132230, do you have any words of encouragement? :-) |
What platform/OS are you using?
OSX 10.13.6 (and Ubuntu 16.04)
What compiler are you using? what version?
Clang 6.0.2 via Android NDK r17c
(with some modifications to pass the right args & guess the version correctly)
What's your CMake arguments?
export BUILD_ABI=arm64-v8a
export EXTRA_AWS_OPTIONS=" -DTARGET_ARCH=ANDROID -DANDROID_ABI=$BUILD_ABI "
cmake
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR
-DCMAKE_RULE_MESSAGES:BOOL=OFF
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=OFF
-DFORCE_SHARED_CRT:BOOL=OFF
$EXTRA_AWS_OPTIONS
-DBUILD_ONLY='logs;core;iam;access-management;identity-management;cognito-identity;cognito-idp;s3;kinesis;sts'
$PROJECTHOME/aws-sdk-cpp "
Can you provide a TRACE level log? (sanitize any sensitive information)
After taring up the install directory, when moving to another machine linking against the installed files fails with:
/opt/work/test/../aws-sdk-cpp/lib/libaws-cpp-sdk-core.a(CryptoImpl.cpp.o): In function
Aws::Utils::Crypto::OpenSSL::init_static_state()': CryptoImpl.cpp:(.text._ZN3Aws5Utils6Crypto7OpenSSL17init_static_stateEv+0xc): undefined reference to
ERR_load_CRYPTO_strings'CryptoImpl.cpp:(.text._ZN3Aws5Utils6Crypto7OpenSSL17init_static_stateEv+0x10): undefined reference to `OPENSSL_add_all_algorithms_noconf'
And a bunch more, and some curl references.
The root cause appears to be that the libcurl.a and libssl.a live in the build directory and make install doesn't put the dependencies where aws can find them.
It would be nice if make install could install the special built components required (they exist in the build directory, but would prefer not to archive that.)
aws-sdk-cpp/external/curl/lib/libcurl.a
aws-sdk-cpp/external/openssl/lib/libssl.a
aws-sdk-cpp/external/openssl/lib/libcrypto.a
aws-sdk-cpp/external/zlib/lib/libz.a
The text was updated successfully, but these errors were encountered: