Share LP32 makefile settings between arches
Add <var>_32 to patch-up-arch-specific-flags, and move the LP32
cruft varaibles from the 32-bit arch specific makefiles into the
top level Android.mk.
Change-Id: Id3fcf6805d4af048c2524c94b1295416ebe7d057
diff --git a/libc/Android.mk b/libc/Android.mk
index 691017a..503ae6f 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -513,6 +513,23 @@
libc_arch_static_src_files := \
bionic/dl_iterate_phdr_static.cpp \
+# Various kinds of LP32 cruft.
+# ========================================================
+libc_bionic_src_files_32 += \
+ bionic/mmap.cpp \
+
+libc_common_src_files_32 += \
+ bionic/legacy_32_bit_support.cpp \
+ bionic/ndk_cruft.cpp \
+ bionic/time64.c \
+
+libc_netbsd_src_files_32 += \
+ upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \
+
+libc_openbsd_src_files_32 += \
+ upstream-openbsd/lib/libc/stdio/putw.c \
+
+
# Define some common cflags
# ========================================================
libc_common_cflags := \
@@ -569,12 +586,13 @@
$(LOCAL_PATH)/stdio \
# ========================================================
-# Add in the arch-specific flags.
+# Add in the arch or 32-bit specific flags
# Must be called with $(eval).
# $(1): the LOCAL_ variable name
# $(2): the bionic variable name to pull in
define patch-up-arch-specific-flags
$(1)_$(TARGET_ARCH) += $($(2)_$(TARGET_ARCH))
+$(1)_32 += $($(2)_32)
ifdef TARGET_2ND_ARCH
$(1)_$(TARGET_2ND_ARCH) += $($(2)_$(TARGET_2ND_ARCH))
endif
diff --git a/libc/arch-arm/arm.mk b/libc/arch-arm/arm.mk
index f712c4c..60600e5 100644
--- a/libc/arch-arm/arm.mk
+++ b/libc/arch-arm/arm.mk
@@ -1,24 +1,6 @@
# 32-bit arm.
#
-# Various kinds of LP32 cruft.
-#
-
-libc_bionic_src_files_arm += \
- bionic/mmap.cpp \
-
-libc_common_src_files_arm += \
- bionic/legacy_32_bit_support.cpp \
- bionic/ndk_cruft.cpp \
- bionic/time64.c \
-
-libc_netbsd_src_files_arm += \
- upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \
-
-libc_openbsd_src_files_arm += \
- upstream-openbsd/lib/libc/stdio/putw.c \
-
-#
# Default implementations of functions that are commonly optimized.
#
diff --git a/libc/arch-mips/mips.mk b/libc/arch-mips/mips.mk
index 7f36635..7e3fe25 100644
--- a/libc/arch-mips/mips.mk
+++ b/libc/arch-mips/mips.mk
@@ -1,24 +1,6 @@
# 32-bit mips.
#
-# Various kinds of LP32 cruft.
-#
-
-libc_bionic_src_files_mips += \
- bionic/mmap.cpp \
-
-libc_common_src_files_mips += \
- bionic/legacy_32_bit_support.cpp \
- bionic/ndk_cruft.cpp \
- bionic/time64.c \
-
-libc_netbsd_src_files_mips += \
- upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \
-
-libc_openbsd_src_files_mips += \
- upstream-openbsd/lib/libc/stdio/putw.c \
-
-#
# Default implementations of functions that are commonly optimized.
#
diff --git a/libc/arch-x86/x86.mk b/libc/arch-x86/x86.mk
index 989690c..e5d70a9 100644
--- a/libc/arch-x86/x86.mk
+++ b/libc/arch-x86/x86.mk
@@ -1,24 +1,6 @@
# 32-bit x86.
#
-# Various kinds of LP32 cruft.
-#
-
-libc_bionic_src_files_x86 += \
- bionic/mmap.cpp \
-
-libc_common_src_files_x86 += \
- bionic/legacy_32_bit_support.cpp \
- bionic/ndk_cruft.cpp \
- bionic/time64.c \
-
-libc_netbsd_src_files_x86 += \
- upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \
-
-libc_openbsd_src_files_x86 += \
- upstream-openbsd/lib/libc/stdio/putw.c \
-
-#
# Default implementations of functions that are commonly optimized.
#