Build against vanilla OpenSSL 1.1.0h (#125)
Summary: This uses OpenSSL 1.1.0h to build and link against. The `.so`s are precompiled and hand-patched from [this repository](https://github.com/passy/android-database-sqlcipher). The patching was necessary to fix the `SONAME` and corresponding `NEEDED` flags to *not* contain a `.1.1` version suffix as Gradle will refuse to bundle those. We basically only use the headers for the remaining part. The precompiled version contains ABI support for `arm64-v8a`, `armeabi`, `armeabi-v7a`, `x86` and most importantly `x86_64`. HOWEVER, `x86_64` is still excluded for now because folly fails to compile due to a missing compiler flag: ``` error: needs target feature pclmul ``` This should be easily fixable by ensuring that `-mpclmul` is added to the CFLAGS if we're compiling for an `x86_64` target in the `CMakeLists.txt` for Folly. Closes #113. Closes https://github.com/facebook/Sonar/pull/125 Reviewed By: priteshrnandgaonkar Differential Revision: D8723636 Pulled By: passy fbshipit-source-id: 41c61047d2793ebaef5793a3c937c4d628471d6a
This commit is contained in:
committed by
Facebook Github Bot
parent
bcc47bfe0c
commit
69711642c9
@@ -140,26 +140,40 @@ task finalizeEvent2(dependsOn: [finalizeEvent], type: Copy) {
|
|||||||
into "$thirdPartyNdkDir/LibEvent/"
|
into "$thirdPartyNdkDir/LibEvent/"
|
||||||
}
|
}
|
||||||
|
|
||||||
task downloadOpenSSL(dependsOn: [], type: Download) {
|
task downloadOpenSSLSource(dependsOn: [], type: Download) {
|
||||||
src 'https://github.com/priteshrnandgaonkar/openssl-android/archive/1.0.0.tar.gz'
|
src 'https://www.openssl.org/source/openssl-1.1.0h.tar.gz'
|
||||||
onlyIfNewer true
|
onlyIfNewer true
|
||||||
overwrite false
|
overwrite false
|
||||||
dest new File(downloadsDir, 'openssl-android-1.0.0.tar.gz');
|
dest new File(downloadsDir, 'openssl-android-1.0.0.tar.gz');
|
||||||
}
|
}
|
||||||
|
|
||||||
task prepareOpenSSL(dependsOn: [downloadOpenSSL], type: Copy) {
|
task downloadOpenSSLLibs(dependsOn: [], type: Download) {
|
||||||
from tarTree(downloadOpenSSL.dest)
|
src 'https://github.com/passy/openssl-android/releases/download/1.1.0h/openssl-1.1.0h-prebuilt.tar.gz'
|
||||||
|
onlyIfNewer true
|
||||||
|
overwrite false
|
||||||
|
dest new File(downloadsDir, 'openssl-1.1.0h-prebuilt.tar.gz');
|
||||||
|
}
|
||||||
|
|
||||||
|
task prepareOpenSSL(dependsOn: [downloadOpenSSLSource, downloadOpenSSLLibs], type: Copy) {
|
||||||
|
from tarTree(downloadOpenSSLSource.dest)
|
||||||
|
from tarTree(downloadOpenSSLLibs.dest)
|
||||||
from './third-party/OpenSSL/'
|
from './third-party/OpenSSL/'
|
||||||
include 'openssl-android-1.0.0/**/*', 'libs/**/*'
|
include 'openssl-1.1.0h/**/*'
|
||||||
|
include 'libs/**/*'
|
||||||
includeEmptyDirs = false
|
includeEmptyDirs = false
|
||||||
into "$thirdPartyNdkDir/OpenSSL/"
|
into "$thirdPartyNdkDir/OpenSSL/"
|
||||||
}
|
}
|
||||||
|
|
||||||
task finalizeOpenSSL(dependsOn: [prepareOpenSSL], type: Copy) {
|
task configureOpenSSL(dependsOn: [prepareOpenSSL], type: Exec) {
|
||||||
from './third-party/OpenSSL/'
|
workingDir "$thirdPartyNdkDir/OpenSSL/openssl-1.1.0h/"
|
||||||
include 'build.gradle', 'ApplicationManifest.xml'
|
// This is only to generate a buildconfig.h in the next step. I **believe**
|
||||||
includeEmptyDirs = false
|
// that the options here don't really matter for that file.
|
||||||
into "$thirdPartyNdkDir/OpenSSL/openssl-android-1.0.0/"
|
commandLine './Configure', 'dist'
|
||||||
|
}
|
||||||
|
|
||||||
|
task finalizeOpenSSL(dependsOn: [configureOpenSSL], type: Exec) {
|
||||||
|
workingDir "$thirdPartyNdkDir/OpenSSL/openssl-1.1.0h/"
|
||||||
|
commandLine 'make', 'build_generated'
|
||||||
}
|
}
|
||||||
|
|
||||||
task downloadRSocket(dependsOn: [], type: Download) {
|
task downloadRSocket(dependsOn: [], type: Download) {
|
||||||
@@ -225,7 +239,7 @@ android {
|
|||||||
srcDir 'res'
|
srcDir 'res'
|
||||||
}
|
}
|
||||||
jniLibs {
|
jniLibs {
|
||||||
srcDir 'third-party/OpenSSL/libs'
|
srcDir "$thirdPartyNdkDir/OpenSSL/libs/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
android/third-party/Folly/CMakeLists.txt
vendored
8
android/third-party/Folly/CMakeLists.txt
vendored
@@ -16,7 +16,7 @@ list(APPEND dir_list ${FOLLY_DIR}/memory/detail)
|
|||||||
|
|
||||||
set(BOOST_DIR ../boost/boost_1_63_0/)
|
set(BOOST_DIR ../boost/boost_1_63_0/)
|
||||||
set(GLOG_DIR ../glog/)
|
set(GLOG_DIR ../glog/)
|
||||||
set(OPENSSL_DIR ../OpenSSL/openssl-android-1.0.0/)
|
set(OPENSSL_DIR ../OpenSSL/openssl-1.1.0h/)
|
||||||
set(LIBEVENT_DIR ../LibEvent/libevent-release-2.1.9/)
|
set(LIBEVENT_DIR ../LibEvent/libevent-release-2.1.9/)
|
||||||
set(DOUBLECONVERSION_DIR ../double-conversion/double-conversion-3.0.0/)
|
set(DOUBLECONVERSION_DIR ../double-conversion/double-conversion-3.0.0/)
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ list(APPEND dir_list ${BOOST_DIR})
|
|||||||
list(APPEND dir_list ${BOOST_DIR}/../)
|
list(APPEND dir_list ${BOOST_DIR}/../)
|
||||||
list(APPEND dir_list ${LIBEVENT_DIR}/)
|
list(APPEND dir_list ${LIBEVENT_DIR}/)
|
||||||
list(APPEND dir_list ${LIBEVENT_DIR}/include/)
|
list(APPEND dir_list ${LIBEVENT_DIR}/include/)
|
||||||
list(APPEND dir_list ${OPENSSL_DIR})
|
list(APPEND dir_list ${OPENSSL_DIR}/include/)
|
||||||
|
|
||||||
include_directories(${dir_list})
|
include_directories(${dir_list})
|
||||||
|
|
||||||
@@ -121,9 +121,7 @@ add_subdirectory(${GLOG_DIR} ${libglog_build_DIR})
|
|||||||
add_subdirectory(${DOUBLECONVERSION_DIR} ${doubleconversion_build_DIR})
|
add_subdirectory(${DOUBLECONVERSION_DIR} ${doubleconversion_build_DIR})
|
||||||
add_subdirectory(${LIBEVENT_DIR} ${libevent_build_DIR})
|
add_subdirectory(${LIBEVENT_DIR} ${libevent_build_DIR})
|
||||||
target_include_directories(${PACKAGE_NAME} PRIVATE
|
target_include_directories(${PACKAGE_NAME} PRIVATE
|
||||||
${OPENSSL_DIR}/jni/openssl-android/
|
${OPENSSL_DIR}/include/
|
||||||
${OPENSSL_DIR}/jni/openssl-android/include
|
|
||||||
${OPENSSL_DIR}/jni/openssl-android/include/openssl
|
|
||||||
${BOOST_DIR}
|
${BOOST_DIR}
|
||||||
${BOOST_DIR}/../
|
${BOOST_DIR}/../
|
||||||
${GLOG_DIR}/../
|
${GLOG_DIR}/../
|
||||||
|
|||||||
2
android/third-party/Folly/build.gradle
vendored
2
android/third-party/Folly/build.gradle
vendored
@@ -30,9 +30,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':glog')
|
implementation project(':glog')
|
||||||
//implementation project(':libevent')
|
|
||||||
implementation project(':doubleconversion')
|
implementation project(':doubleconversion')
|
||||||
implementation project(':openssl')
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/arm64-v8a/libssl.so
vendored
BIN
android/third-party/OpenSSL/libs/arm64-v8a/libssl.so
vendored
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/arm64-v8a/openssl
vendored
BIN
android/third-party/OpenSSL/libs/arm64-v8a/openssl
vendored
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/arm64-v8a/ssltest
vendored
BIN
android/third-party/OpenSSL/libs/arm64-v8a/ssltest
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/armeabi-v7a/openssl
vendored
BIN
android/third-party/OpenSSL/libs/armeabi-v7a/openssl
vendored
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/armeabi-v7a/ssltest
vendored
BIN
android/third-party/OpenSSL/libs/armeabi-v7a/ssltest
vendored
Binary file not shown.
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/armeabi/libssl.so
vendored
BIN
android/third-party/OpenSSL/libs/armeabi/libssl.so
vendored
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/armeabi/openssl
vendored
BIN
android/third-party/OpenSSL/libs/armeabi/openssl
vendored
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/armeabi/ssltest
vendored
BIN
android/third-party/OpenSSL/libs/armeabi/ssltest
vendored
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/x86/libcrypto.so
vendored
BIN
android/third-party/OpenSSL/libs/x86/libcrypto.so
vendored
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/x86/libssl.so
vendored
BIN
android/third-party/OpenSSL/libs/x86/libssl.so
vendored
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/x86/openssl
vendored
BIN
android/third-party/OpenSSL/libs/x86/openssl
vendored
Binary file not shown.
BIN
android/third-party/OpenSSL/libs/x86/ssltest
vendored
BIN
android/third-party/OpenSSL/libs/x86/ssltest
vendored
Binary file not shown.
6
android/third-party/RSocket/CMakeLists.txt
vendored
6
android/third-party/RSocket/CMakeLists.txt
vendored
@@ -11,7 +11,7 @@ set(glog_DIR ${third_party_ndk}/glog)
|
|||||||
set(BOOST_DIR ${third_party_ndk}/boost/boost_1_63_0/)
|
set(BOOST_DIR ${third_party_ndk}/boost/boost_1_63_0/)
|
||||||
set(LIBEVENT_DIR ${third_party_ndk}/LibEvent/libevent-release-2.1.9/)
|
set(LIBEVENT_DIR ${third_party_ndk}/LibEvent/libevent-release-2.1.9/)
|
||||||
set(DOUBLECONVERSION_DIR ${third_party_ndk}/double-conversion/double-conversion-3.0.0/)
|
set(DOUBLECONVERSION_DIR ${third_party_ndk}/double-conversion/double-conversion-3.0.0/)
|
||||||
set(OPENSSL_DIR ${third_party_ndk}/OpenSSL/openssl-android-1.0.0/)
|
set(OPENSSL_DIR ${third_party_ndk}/OpenSSL/openssl-1.1.0h/)
|
||||||
|
|
||||||
set(RSOCKET_ROOT_DIR ${PROJECT_SOURCE_DIR}/rsocket-cpp-0.10.1)
|
set(RSOCKET_ROOT_DIR ${PROJECT_SOURCE_DIR}/rsocket-cpp-0.10.1)
|
||||||
set(RSOCKET_DIR ${PROJECT_SOURCE_DIR}/rsocket-cpp-0.10.1/rsocket)
|
set(RSOCKET_DIR ${PROJECT_SOURCE_DIR}/rsocket-cpp-0.10.1/rsocket)
|
||||||
@@ -76,9 +76,7 @@ target_include_directories(${PACKAGE_NAME} PRIVATE
|
|||||||
${LIBEVENT_DIR}/
|
${LIBEVENT_DIR}/
|
||||||
${LIBEVENT_DIR}/include/
|
${LIBEVENT_DIR}/include/
|
||||||
${LIBEVENT_DIR}/include/event2
|
${LIBEVENT_DIR}/include/event2
|
||||||
${OPENSSL_DIR}/jni/openssl-android/
|
${OPENSSL_DIR}/include/
|
||||||
${OPENSSL_DIR}/jni/openssl-android/include
|
|
||||||
${OPENSSL_DIR}/jni/openssl-android/include/openssl
|
|
||||||
${glog_DIR}
|
${glog_DIR}
|
||||||
${glog_DIR}/../
|
${glog_DIR}/../
|
||||||
${glog_DIR}/glog-0.3.5/src/
|
${glog_DIR}/glog-0.3.5/src/
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ include ':sample'
|
|||||||
include ':doubleconversion'
|
include ':doubleconversion'
|
||||||
include ':glog'
|
include ':glog'
|
||||||
include ':libevent'
|
include ':libevent'
|
||||||
include ':openssl'
|
|
||||||
include ':rsocket'
|
include ':rsocket'
|
||||||
|
|
||||||
project(':fbjni').projectDir = file('libs/fbjni')
|
project(':fbjni').projectDir = file('libs/fbjni')
|
||||||
@@ -30,5 +29,4 @@ project(':doubleconversion').projectDir = file('android/build/third-party-ndk/do
|
|||||||
project(':glog').projectDir = file('android/build/third-party-ndk/glog/')
|
project(':glog').projectDir = file('android/build/third-party-ndk/glog/')
|
||||||
project(':folly').projectDir = file('android/build/third-party-ndk/folly/')
|
project(':folly').projectDir = file('android/build/third-party-ndk/folly/')
|
||||||
project(':libevent').projectDir = file('android/build/third-party-ndk/LibEvent/')
|
project(':libevent').projectDir = file('android/build/third-party-ndk/LibEvent/')
|
||||||
project(':openssl').projectDir = file('android/build/third-party-ndk/OpenSSL/openssl-android-1.0.0')
|
|
||||||
project(':rsocket').projectDir = file('android/build/third-party-ndk/RSocket')
|
project(':rsocket').projectDir = file('android/build/third-party-ndk/RSocket')
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ set(glog_DIR ${third_party_ndk}/glog)
|
|||||||
set(BOOST_DIR ${third_party_ndk}/boost/boost_1_63_0/)
|
set(BOOST_DIR ${third_party_ndk}/boost/boost_1_63_0/)
|
||||||
set(LIBEVENT_DIR ${third_party_ndk}/LibEvent/libevent-release-2.1.9/)
|
set(LIBEVENT_DIR ${third_party_ndk}/LibEvent/libevent-release-2.1.9/)
|
||||||
set(DOUBLECONVERSION_DIR ${third_party_ndk}/double-conversion/double-conversion-3.0.0/)
|
set(DOUBLECONVERSION_DIR ${third_party_ndk}/double-conversion/double-conversion-3.0.0/)
|
||||||
set(OPENSSL_DIR ${third_party_ndk}/OpenSSL/openssl-android-1.0.0/)
|
set(OPENSSL_DIR ${third_party_ndk}/OpenSSL/openssl-1.1.0h/)
|
||||||
|
|
||||||
list(APPEND dir_list ./)
|
list(APPEND dir_list ./)
|
||||||
list(APPEND dir_list ./Sonar)
|
list(APPEND dir_list ./Sonar)
|
||||||
@@ -61,9 +61,7 @@ target_include_directories(${PACKAGE_NAME} PRIVATE
|
|||||||
${rsocket_DIR}/rsocket-cpp-0.10.1
|
${rsocket_DIR}/rsocket-cpp-0.10.1
|
||||||
${LIBEVENT_DIR}/include/
|
${LIBEVENT_DIR}/include/
|
||||||
${LIBEVENT_DIR}/include/event2
|
${LIBEVENT_DIR}/include/event2
|
||||||
${OPENSSL_DIR}/jni/openssl-android/
|
${OPENSSL_DIR}/include
|
||||||
${OPENSSL_DIR}/jni/openssl-android/include
|
|
||||||
${OPENSSL_DIR}/jni/openssl-android/include/openssl
|
|
||||||
${glog_DIR}
|
${glog_DIR}
|
||||||
${glog_DIR}/../
|
${glog_DIR}/../
|
||||||
${glog_DIR}/glog-0.3.5/src/
|
${glog_DIR}/glog-0.3.5/src/
|
||||||
|
|||||||
Reference in New Issue
Block a user