summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2014-06-25 14:52:40 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-06-25 03:39:25 +0000
commita5dc6a8e3ca30e815d59cab72e7b0abf9a147e30 (patch)
tree9bb58a8a6f789b327bb0ce41ed04c3bba1fc3a8a
parentd2f07839cb85ad5b78665892deb12d2d353daab0 (diff)
parent5e2dc248acc52aec6aea33d2268fdf38d45cf21b (diff)
downloadextras-a5dc6a8e3ca30e815d59cab72e7b0abf9a147e30.tar.gz
Merge "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;
}