summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-10-08 16:22:03 -0700
committerNarayan Kamath <narayan@google.com>2014-10-22 08:30:43 +0000
commit3c5c720b0b46ecd801329c09d23bb6e7098d76d3 (patch)
tree53c07b5bc941885f52f379ebfda7fecaabb19fa0 /tests
parentde01780f46e4e4540c7a1ea7d0302f460c880e9d (diff)
downloadbionic-3c5c720b0b46ecd801329c09d23bb6e7098d76d3.zip
bionic-3c5c720b0b46ecd801329c09d23bb6e7098d76d3.tar.gz
bionic-3c5c720b0b46ecd801329c09d23bb6e7098d76d3.tar.bz2
Build dlext_testzip as custom module.
Use $(BUILD_SYSTEM)/base_rules to build it as custom module, so that it's exposed to utilities like mm/mmma etc. Bug: 17887283 Bug: 17762003 (cherry picked from commit 667853d47770fbdb54aaf0b3261b0d4882725770) Change-Id: I405797d16f20dc09e5d84b93b6727b634db2fc2c
Diffstat (limited to 'tests')
-rw-r--r--tests/dlext_test.cpp2
-rw-r--r--tests/libs/Android.build.dlext_testzip.mk49
2 files changed, 22 insertions, 29 deletions
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index 5206965..55b0642 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -52,7 +52,7 @@ typedef int (*fn)(void);
#endif
#define LIBPATH LIBPATH_PREFIX "libdlext_test_fd.so"
-#define LIBZIPPATH LIBPATH_PREFIX "dlext_test.zip"
+#define LIBZIPPATH LIBPATH_PREFIX "libdlext_test_fd_zipaligned.zip"
#define LIBZIP_OFFSET 2*PAGE_SIZE
diff --git a/tests/libs/Android.build.dlext_testzip.mk b/tests/libs/Android.build.dlext_testzip.mk
index e672091..d05927e 100644
--- a/tests/libs/Android.build.dlext_testzip.mk
+++ b/tests/libs/Android.build.dlext_testzip.mk
@@ -18,31 +18,24 @@
# Library used by dlext tests - zipped and aligned
# -----------------------------------------------------------------------------
-# TODO: It there simple way to do this?
-$(bionic_2nd_arch_prefix)bionic_dlext_test_zip := \
- $($(bionic_2nd_arch_prefix)TARGET_OUT_INTERMEDIATES)/libdlext_test_fd/dlext_test_origin.zip
-$(bionic_2nd_arch_prefix)bionic_dlext_test_zip_aligned := \
- $($(bionic_2nd_arch_prefix)TARGET_OUT_DATA_NATIVE_TESTS)/libdlext_test_fd/dlext_test.zip
-ALL_MODULES += $($(bionic_2nd_arch_prefix)bionic_dlext_test_zip_aligned)
-
-$(bionic_2nd_arch_prefix)bionic_dlext_built_shared_libraries := \
- $($(bionic_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/libdlext_test_fd.so
-
-bionic_dlext_test_zip_alignment := 4096 # PAGE_SIZE
-
-$(bionic_2nd_arch_prefix)bionic_dlext_test_zip_tmpdir := $(dir $($(bionic_2nd_arch_prefix)bionic_dlext_test_zip))
-
-$($(bionic_2nd_arch_prefix)bionic_dlext_test_zip)_prepare: $($(bionic_2nd_arch_prefix)bionic_dlext_built_shared_libraries)
- $(hide) mkdir -p $(dir $@)
- $(hide) cp -p $< $(dir $@)
-
-$($(bionic_2nd_arch_prefix)bionic_dlext_test_zip): $($(bionic_2nd_arch_prefix)bionic_dlext_test_zip)_prepare
- @echo "Zip: $@"
- $(hide) (cd $(dir $@) && touch empty_file.txt && zip -rD0 $(notdir $@) empty_file.txt libdlext_test_fd.so)
-
-$($(bionic_2nd_arch_prefix)bionic_dlext_test_zip_aligned): $($(bionic_2nd_arch_prefix)bionic_dlext_test_zip) | $(ZIPALIGN)
- $(hide) rm -rf $@
- $(hide) mkdir -p $(dir $@)
- @echo "Zipalign $(bionic_dlext_test_zip_alignment): $@"
- $(hide) zipalign $(bionic_dlext_test_zip_alignment) $< $@
-
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE := libdlext_test_fd_zipaligned
+LOCAL_MODULE_SUFFIX := .zip
+LOCAL_MODULE_TAGS := tests
+LOCAL_MODULE_PATH := $($(bionic_2nd_arch_prefix)TARGET_OUT_DATA_NATIVE_TESTS)/libdlext_test_fd
+LOCAL_2ND_ARCH_VAR_PREFIX := $(bionic_2nd_arch_prefix)
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+my_shared_libs := \
+ $($(bionic_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/libdlext_test_fd.so
+
+$(LOCAL_BUILT_MODULE): PRIVATE_ALIGNMENT := 4096 # PAGE_SIZE
+$(LOCAL_BUILT_MODULE) : $(my_shared_libs) | $(ZIPALIGN)
+ @echo "Zipalign $(PRIVATE_ALIGNMENT): $@"
+ $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@)
+ $(hide) cp $^ $(dir $@)
+ $(hide) (cd $(dir $@) && touch empty_file.txt && zip -rD0 $(notdir $@).unaligned empty_file.txt *.so)
+ $(hide) $(ZIPALIGN) $(PRIVATE_ALIGNMENT) $@.unaligned $@