From c82c0b7e072491da4818e7de37411fbb2055fce1 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Mon, 16 Jun 2014 16:52:27 -0700 Subject: [PATCH] Remove SHA1 from LP64 in favor of libcrypto. Keep the symbols around on LP32 for binary compatibility. Bug: 11156955 Change-Id: I379a7e0fa3092e9a70daeafcbcb2aacfc314031a --- libc/Android.mk | 2 +- libc/arch-arm/arm.mk | 3 +++ libc/arch-mips/mips.mk | 2 ++ libc/arch-x86/x86.mk | 3 +++ libc/include/sha1.h | 23 ------------------- .../android}/include/sys/sha1.h | 0 6 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 libc/include/sha1.h rename libc/{ => upstream-netbsd/android}/include/sys/sha1.h (100%) diff --git a/libc/Android.mk b/libc/Android.mk index bc6cf78f9..37f305970 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -262,7 +262,6 @@ libc_upstream_freebsd_src_files := \ upstream-freebsd/lib/libc/string/wmemset.c \ libc_upstream_netbsd_src_files := \ - upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \ upstream-netbsd/common/lib/libc/stdlib/random.c \ upstream-netbsd/lib/libc/gen/ftw.c \ upstream-netbsd/lib/libc/gen/nftw.c \ @@ -699,6 +698,7 @@ LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_SYSTEM_SHARED_LIBRARIES := $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) +$(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_netbsd_src_files)) include $(BUILD_STATIC_LIBRARY) diff --git a/libc/arch-arm/arm.mk b/libc/arch-arm/arm.mk index 38301bc20..47e436c6e 100644 --- a/libc/arch-arm/arm.mk +++ b/libc/arch-arm/arm.mk @@ -65,6 +65,9 @@ libc_bionic_src_files_arm += \ libc_arch_static_src_files_arm := arch-arm/bionic/exidx_static.c libc_arch_dynamic_src_files_arm := arch-arm/bionic/exidx_dynamic.c +libc_netbsd_src_files_arm := \ + upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \ + ## CPU variant specific source files ifeq ($(strip $(TARGET_$(my_2nd_arch_prefix)CPU_VARIANT)),) $(warning TARGET_$(my_2nd_arch_prefix)ARCH is arm, but TARGET_$(my_2nd_arch_prefix)CPU_VARIANT is not defined) diff --git a/libc/arch-mips/mips.mk b/libc/arch-mips/mips.mk index fe5e24d59..0a3718bc4 100644 --- a/libc/arch-mips/mips.mk +++ b/libc/arch-mips/mips.mk @@ -68,6 +68,8 @@ libc_bionic_src_files_mips += \ arch-mips/string/memset.S \ arch-mips/string/mips_strlen.c \ +libc_netbsd_src_files_mips := \ + upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \ libc_crt_target_cflags_mips := \ $($(my_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \ diff --git a/libc/arch-x86/x86.mk b/libc/arch-x86/x86.mk index 3dc71d15b..8aa2645d3 100644 --- a/libc/arch-x86/x86.mk +++ b/libc/arch-x86/x86.mk @@ -40,6 +40,9 @@ endif include $(arch_variant_mk) libc_common_additional_dependencies += $(arch_variant_mk) +libc_netbsd_src_files_x86 := \ + upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \ + arch_variant_mk := libc_crt_target_cflags_x86 := \ diff --git a/libc/include/sha1.h b/libc/include/sha1.h deleted file mode 100644 index 7f6cf5d8c..000000000 --- a/libc/include/sha1.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _SHA1_H_ -#define _SHA1_H_ - -#warning "include instead for better portability" -#include - -#endif diff --git a/libc/include/sys/sha1.h b/libc/upstream-netbsd/android/include/sys/sha1.h similarity index 100% rename from libc/include/sys/sha1.h rename to libc/upstream-netbsd/android/include/sys/sha1.h