summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2014-06-25 15:02:13 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-25 15:02:13 +0000
commite36eaf9d3c84b381d3d6556efc00a454eb0d69e8 (patch)
tree2f4ca545f2ee67bb309c0892a89435ed39576548
parent8cfc86f43db78ad9ce72c6bbb40b980b2aab0a3c (diff)
parenta5dc6a8e3ca30e815d59cab72e7b0abf9a147e30 (diff)
downloadextras-e36eaf9d3c84b381d3d6556efc00a454eb0d69e8.tar.gz
am a5dc6a8e: Merge "f2fs utils: set correct dependency on dynamic libf2fs"
* commit 'a5dc6a8e3ca30e815d59cab72e7b0abf9a147e30': f2fs utils: set correct dependency on dynamic libf2fs
-rw-r--r--f2fs_utils/Android.mk44
-rw-r--r--f2fs_utils/f2fs_dlutils.c2
2 files changed, 20 insertions, 26 deletions
diff --git a/f2fs_utils/Android.mk b/f2fs_utils/Android.mk
index 8fb607c1..60fe081a 100644
--- a/f2fs_utils/Android.mk
+++ b/f2fs_utils/Android.mk
@@ -2,12 +2,19 @@
LOCAL_PATH:= $(call my-dir)
-libf2fs_ioutils_src_files := \
- f2fs_ioutils.c
+ifeq ($(HOST_OS),linux)
-# ---------------------------------------
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(libf2fs_ioutils_src_files)
+LOCAL_MODULE := libf2fs_utils_host
+LOCAL_SRC_FILES := f2fs_utils.c
+LOCAL_STATIC_LIBRARIES := \
+ libsparse_host \
+ libz
+LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
+include $(BUILD_HOST_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := f2fs_ioutils.c
LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
LOCAL_STATIC_LIBRARIES := \
libsparse_host \
@@ -16,7 +23,6 @@ LOCAL_STATIC_LIBRARIES := \
LOCAL_MODULE := libf2fs_ioutils_host
include $(BUILD_HOST_STATIC_LIBRARY)
-# ---------------------------------------
include $(CLEAR_VARS)
LOCAL_SRC_FILES := f2fs_dlutils.c
LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
@@ -26,29 +32,17 @@ LOCAL_MODULE := libf2fs_dlutils_host
include $(BUILD_HOST_STATIC_LIBRARY)
include $(CLEAR_VARS)
-LOCAL_MODULE := libf2fs_utils_host
-LOCAL_SRC_FILES := f2fs_utils.c
-LOCAL_STATIC_LIBRARIES := \
- libsparse_host \
- libz
-LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
-include $(BUILD_HOST_STATIC_LIBRARY)
-
-#
-# -- All host/targets excluding windows
-#
-
-ifneq ($(HOST_OS),windows)
-
-include $(CLEAR_VARS)
LOCAL_SRC_FILES := make_f2fs_main.c
LOCAL_MODULE := make_f2fs
-LOCAL_STATIC_LIBRARIES += \
- libf2fs_utils_host \
- libf2fs_dlutils_host
# libf2fs_dlutils_host will dlopen("libf2fs_fmt_host_dyn")
-LOCAL_LDLIBS := -ldl
-LOCAL_SHARED_LIBRARIES := libf2fs_fmt_host_dyn
+LOCAL_LDFLAGS := -ldl -rdynamic
+# The following libf2fs_* are from system/extras/f2fs_utils,
+# and do not use code in external/f2fs-tools.
+LOCAL_STATIC_LIBRARIES := libf2fs_utils_host libf2fs_ioutils_host libf2fs_dlutils_host
+LOCAL_REQUIRED_MODULES := libf2fs_fmt_host_dyn
+LOCAL_STATIC_LIBRARIES += \
+ libsparse_host \
+ libz
include $(BUILD_HOST_EXECUTABLE)
include $(CLEAR_VARS)
diff --git a/f2fs_utils/f2fs_dlutils.c b/f2fs_utils/f2fs_dlutils.c
index 6fddc6ef..40be4161 100644
--- a/f2fs_utils/f2fs_dlutils.c
+++ b/f2fs_utils/f2fs_dlutils.c
@@ -52,7 +52,7 @@ void f2fs_init_configuration(struct f2fs_configuration *config) {
int dlopenf2fs() {
void* f2fs_lib;
- f2fs_lib = dlopen(F2FS_DYN_LIB, RTLD_LAZY);
+ f2fs_lib = dlopen(F2FS_DYN_LIB, RTLD_NOW);
if (!f2fs_lib) {
return -1;
}