OSDN Git Service

Fix toybox_vendor dependencies on libselinux_vendor.
authorYifan Hong <elsk@google.com>
Mon, 10 Jul 2017 18:09:40 +0000 (18:09 +0000)
committerYifan Hong <elsk@google.com>
Mon, 10 Jul 2017 18:22:04 +0000 (18:22 +0000)
toybox_vendor now links to other libraries as shared libraries.
This allows toybox_vendor to use the "vendor" version of these libraries
(in particular, liblog and libselinx_vendor).

Test: mma -j
Test: m -j, flash, boots
Test: `adb shell /vendor/bin/restorecon /dev/null` shows error message
Test: `adb shell /vendor/bin/getprop -Z' shows error message
Test: mma -j BOARD_VNDK_VERSION=current

Bug: 62886649

(revert of commit 4ab405afe2668a5ca25be411df2d05a5e0995478)
(resubmit of commit e06cffe06993e0ade6f7836becb26e7f076c8a68)

Change-Id: I0812b58eb3d769d1a73e64009481075c09da2450
Merged-In: If01094b71ef7e99b5756b851132de643660a1e2c

Android.mk

index 78b794b..c1d5959 100644 (file)
@@ -228,7 +228,11 @@ toybox_upstream_version := $(shell sed 's/#define.*TOYBOX_VERSION.*"\(.*\)"/\1/p
 
 toybox_version := $(toybox_upstream_version)-android-$(BUILD_NUMBER_FROM_FILE)
 
-toybox_libraries := liblog libselinux libcutils libcrypto libz
+toybox_common_libraries := liblog libcutils libcrypto libz
+
+toybox_libraries := $(toybox_common_libraries) libselinux
+
+toybox_vendor_libraries := $(toybox_common_libraries) libselinux_vendor
 
 common_CFLAGS += -DTOYBOX_VERSION=\"$(toybox_version)\"
 
@@ -406,7 +410,7 @@ LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGE
 include $(BUILD_EXECUTABLE)
 
 ############################################
-# static version to be installed in /vendor
+# toybox for /vendor
 ############################################
 
 include $(CLEAR_VARS)
@@ -414,11 +418,8 @@ LOCAL_MODULE := toybox_vendor
 LOCAL_VENDOR_MODULE := true
 LOCAL_SRC_FILES := $(common_SRC_FILES)
 LOCAL_CFLAGS := $(common_CFLAGS)
-LOCAL_STATIC_LIBRARIES := $(toybox_libraries)
-# libc++_static is needed by static liblog
-LOCAL_CXX_STL := libc++_static
+LOCAL_SHARED_LIBRARIES := $(toybox_vendor_libraries)
 LOCAL_MODULE_TAGS := optional
-LOCAL_FORCE_STATIC_EXECUTABLE := true
 LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf ${LOCAL_MODULE} $(TARGET_OUT_VENDOR_EXECUTABLES)/$(t);)
 include $(BUILD_EXECUTABLE)