summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}