diff options
-rw-r--r-- | NativeCode.mk | 66 | ||||
-rw-r--r-- | crypto/src/main/native/org_conscrypt_NativeCrypto.cpp | 9 |
2 files changed, 28 insertions, 47 deletions
diff --git a/NativeCode.mk b/NativeCode.mk index 93f3b20..78e64fd 100644 --- a/NativeCode.mk +++ b/NativeCode.mk @@ -67,7 +67,8 @@ $(foreach dir, \ core_c_includes := $(sort libcore/include $(LOCAL_C_INCLUDES) $(JNI_H_INCLUDE)) core_shared_libraries := $(sort $(LOCAL_SHARED_LIBRARIES)) core_static_libraries := $(sort $(LOCAL_STATIC_LIBRARIES)) -core_cflags := -DJNI_JARJAR_PREFIX="com/android/" +core_cflags := -Wall -Wextra -Werror +core_cflags += -DJNI_JARJAR_PREFIX="com/android/" core_test_files := \ luni/src/test/native/test_openssl_engine.cpp \ @@ -77,53 +78,34 @@ core_test_files := \ # include $(CLEAR_VARS) - -LOCAL_CFLAGS += -Wall -Wextra -Werror LOCAL_CFLAGS += $(core_cflags) LOCAL_CPPFLAGS += $(core_cppflags) -ifeq ($(TARGET_ARCH),arm) -# Ignore "note: the mangling of 'va_list' has changed in GCC 4.4" -LOCAL_CFLAGS += -Wno-psabi -endif - -# Define the rules. -LOCAL_SRC_FILES := $(core_src_files) -LOCAL_CFLAGS := $(core_cflags) -LOCAL_C_INCLUDES := $(core_c_includes) -LOCAL_SHARED_LIBRARIES := $(core_shared_libraries) libexpat libicuuc libicui18n libssl libcrypto libz libnativehelper -LOCAL_STATIC_LIBRARIES := $(core_static_libraries) +LOCAL_SRC_FILES += $(core_src_files) +LOCAL_C_INCLUDES += $(core_c_includes) +LOCAL_SHARED_LIBRARIES += $(core_shared_libraries) libexpat libicuuc libicui18n libssl libcrypto libz libnativehelper +LOCAL_STATIC_LIBRARIES += $(core_static_libraries) LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libjavacore LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/NativeCode.mk - -LOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include -LOCAL_SHARED_LIBRARIES += libstlport - +include external/stlport/libstlport.mk include $(BUILD_SHARED_LIBRARY) -# Test library +# Test JNI library. ifeq ($(LIBCORE_SKIP_TESTS),) -include $(CLEAR_VARS) -LOCAL_CFLAGS += -Wall -Wextra -Werror +include $(CLEAR_VARS) LOCAL_CFLAGS += $(core_cflags) LOCAL_CPPFLAGS += $(core_cppflags) -ifeq ($(TARGET_ARCH),arm) -# Ignore "note: the mangling of 'va_list' has changed in GCC 4.4" -LOCAL_CFLAGS += -Wno-psabi -endif - -# Define the rules. -LOCAL_SRC_FILES := $(core_test_files) -LOCAL_C_INCLUDES := libcore/include external/openssl/include -LOCAL_SHARED_LIBRARIES := libcrypto +LOCAL_SRC_FILES += $(core_test_files) +LOCAL_C_INCLUDES += libcore/include external/openssl/include +LOCAL_SHARED_LIBRARIES += libcrypto LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libjavacoretests LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/NativeCode.mk include external/stlport/libstlport.mk - include $(BUILD_SHARED_LIBRARY) + endif # LIBCORE_SKIP_TESTS @@ -133,40 +115,38 @@ endif # LIBCORE_SKIP_TESTS ifeq ($(WITH_HOST_DALVIK),true) include $(CLEAR_VARS) - # Define the rules. - LOCAL_SRC_FILES := $(core_src_files) + LOCAL_SRC_FILES += $(core_src_files) LOCAL_CFLAGS += $(core_cflags) - LOCAL_C_INCLUDES := $(core_c_includes) + LOCAL_C_INCLUDES += $(core_c_includes) LOCAL_CPPFLAGS += $(core_cppflags) LOCAL_LDLIBS += -ldl -lpthread -lrt LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libjavacore LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/NativeCode.mk - LOCAL_SHARED_LIBRARIES := $(core_shared_libraries) libexpat-host libicuuc-host libicui18n-host libssl-host libcrypto-host libz-host - LOCAL_STATIC_LIBRARIES := $(core_static_libraries) + LOCAL_SHARED_LIBRARIES += $(core_shared_libraries) libexpat-host libicuuc-host libicui18n-host libssl-host libcrypto-host libz-host + LOCAL_STATIC_LIBRARIES += $(core_static_libraries) include $(BUILD_HOST_SHARED_LIBRARY) # Conscrypt native library for nojarjar'd version include $(CLEAR_VARS) - LOCAL_SRC_FILES := \ + LOCAL_SRC_FILES += \ crypto/src/main/native/org_conscrypt_NativeCrypto.cpp \ luni/src/main/native/AsynchronousSocketCloseMonitor.cpp - LOCAL_C_INCLUDES := $(core_c_includes) + LOCAL_C_INCLUDES += $(core_c_includes) LOCAL_CPPFLAGS += $(core_cppflags) LOCAL_LDLIBS += -lpthread LOCAL_MODULE_TAGS := optional LOCAL_MODULE := libconscrypt_jni LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/NativeCode.mk - LOCAL_SHARED_LIBRARIES := $(core_shared_libraries) libssl-host libcrypto-host - LOCAL_STATIC_LIBRARIES := $(core_static_libraries) + LOCAL_SHARED_LIBRARIES += $(core_shared_libraries) libssl-host libcrypto-host + LOCAL_STATIC_LIBRARIES += $(core_static_libraries) include $(BUILD_HOST_SHARED_LIBRARY) ifeq ($(LIBCORE_SKIP_TESTS),) include $(CLEAR_VARS) - # Define the rules. - LOCAL_SRC_FILES := $(core_test_files) + LOCAL_SRC_FILES += $(core_test_files) LOCAL_CFLAGS += $(core_cflags) - LOCAL_C_INCLUDES := libcore/include external/openssl/include + LOCAL_C_INCLUDES += libcore/include external/openssl/include LOCAL_CPPFLAGS += $(core_cppflags) LOCAL_LDLIBS += -ldl -lpthread LOCAL_MODULE_TAGS := optional diff --git a/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp b/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp index 3fccdef..8a59fdc 100644 --- a/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp +++ b/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp @@ -4179,7 +4179,7 @@ static jint NativeCrypto_get_X509_ex_flags(JNIEnv* env, jclass, jlong x509Ref) { return x509->ex_flags; } -static jboolean NativeCrypto_X509_check_issued(JNIEnv* env, jclass, jlong x509Ref1, jlong x509Ref2) { +static jboolean NativeCrypto_X509_check_issued(JNIEnv*, jclass, jlong x509Ref1, jlong x509Ref2) { X509* x509_1 = reinterpret_cast<X509*>(static_cast<uintptr_t>(x509Ref1)); X509* x509_2 = reinterpret_cast<X509*>(static_cast<uintptr_t>(x509Ref2)); JNI_TRACE("X509_check_issued(%p, %p)", x509_1, x509_2); @@ -6756,7 +6756,8 @@ static jstring NativeCrypto_SSL_get_servername(JNIEnv* env, jclass, jlong ssl_ad * same protocol. The list of protocols in "primary" is considered the order * which should take precedence. */ -static int proto_select(SSL* ssl, unsigned char **out, unsigned char *outLength, +static int proto_select(SSL* ssl __attribute__ ((unused)), + unsigned char **out, unsigned char *outLength, const unsigned char *primary, const unsigned int primaryLength, const unsigned char *secondary, const unsigned int secondaryLength) { if (primary != NULL) { @@ -6799,8 +6800,8 @@ static int alpn_select_callback(SSL* ssl, const unsigned char **out, unsigned ch /** * Callback for the client to select an NPN protocol. */ -static int next_proto_select_callback(SSL* ssl, unsigned char **out, unsigned char *outlen, - const unsigned char *in, unsigned int inlen, void *arg) +static int next_proto_select_callback(SSL* ssl, unsigned char** out, unsigned char* outlen, + const unsigned char* in, unsigned int inlen, void*) { JNI_TRACE("ssl=%p next_proto_select_callback", ssl); |