From 45a9d67cec4721a6f94b3c7196206eabf8d93c16 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 9 Aug 2017 17:09:04 -0700 Subject: [PATCH 1/2] init: statically link libselinux to init_tests The shared libselinux library does not export all of the symbols that we use in init and the linker is now complaining about this, so let's use the static libselinux library in init_tests to match init itself. Test: build, init unit tests Change-Id: I9011a959a7c49446b3529740e606140a4ee8c32d --- init/Android.bp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init/Android.bp b/init/Android.bp index 0d7240e37..d9cadc289 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -162,9 +162,12 @@ cc_test { shared_libs: [ "libbase", "libcutils", - "libselinux", ], - static_libs: ["libinit"], + static_libs: [ + "libinit", + "libselinux", + "libcrypto", + ], } subdirs = ["*"] From 2a978d32d28654cdfefeaaa96e4c10202fe259ce Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Wed, 9 Aug 2017 17:13:21 -0700 Subject: [PATCH 2/2] init: move property_service.cpp to libinit service.cpp, which is part of libinit, references symbols in property_service.cpp, which causes the linker to complain when linking libinit.a in some situations. Therefore, we move property_service.cpp to libinit. Separately, this will make it easier to write tests for property_service.cpp, which we will want to do in the future. Test: build, init unit tests Change-Id: If1cffa8510b97e9436efed3c8ea0724272383eba --- init/Android.bp | 10 ++++++---- init/Android.mk | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/init/Android.bp b/init/Android.bp index d9cadc289..432c29870 100644 --- a/init/Android.bp +++ b/init/Android.bp @@ -69,6 +69,7 @@ cc_library_static { "import_parser.cpp", "log.cpp", "parser.cpp", + "property_service.cpp", "service.cpp", "tokenizer.cpp", "uevent_listener.cpp", @@ -81,7 +82,12 @@ cc_library_static { "libselinux", "liblog", "libprocessgroup", + "libfs_mgr", ], + include_dirs: [ + "system/core/mkbootimg", + ], + } /* @@ -105,15 +111,11 @@ cc_binary { "init.cpp", "init_first_stage.cpp", "keychords.cpp", - "property_service.cpp", "reboot.cpp", "signal_handler.cpp", "ueventd.cpp", "watchdogd.cpp", ], - include_dirs: [ - "system/core/mkbootimg" - ], static_libs: [ "libinit", "libbootloader_message", diff --git a/init/Android.mk b/init/Android.mk index f30c2a451..3886ed52f 100644 --- a/init/Android.mk +++ b/init/Android.mk @@ -51,15 +51,12 @@ LOCAL_SRC_FILES:= \ init.cpp \ init_first_stage.cpp \ keychords.cpp \ - property_service.cpp \ reboot.cpp \ signal_handler.cpp \ ueventd.cpp \ watchdogd.cpp \ LOCAL_MODULE:= init -LOCAL_C_INCLUDES += \ - system/core/mkbootimg LOCAL_FORCE_STATIC_EXECUTABLE := true LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)