Remove SHA1 from LP64 in favor of libcrypto.
Keep the symbols around on LP32 for binary compatibility.
Bug: 11156955
Change-Id: I379a7e0fa3092e9a70daeafcbcb2aacfc314031a
diff --git a/libc/Android.mk b/libc/Android.mk
index bc6cf78..37f3059 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -262,7 +262,6 @@
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_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 38301bc..47e436c 100644
--- a/libc/arch-arm/arm.mk
+++ b/libc/arch-arm/arm.mk
@@ -65,6 +65,9 @@
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 fe5e24d..0a3718b 100644
--- a/libc/arch-mips/mips.mk
+++ b/libc/arch-mips/mips.mk
@@ -68,6 +68,8 @@
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 3dc71d1..8aa2645 100644
--- a/libc/arch-x86/x86.mk
+++ b/libc/arch-x86/x86.mk
@@ -40,6 +40,9 @@
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 7f6cf5d..0000000
--- 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 <sys/sha1.h> instead for better portability"
-#include <sys/sha1.h>
-
-#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