SOONG - cc_prebuilt_library_shared

1,745 views
Skip to first unread message

Michael Lekman

unread,
Sep 12, 2017, 5:09:15 PM9/12/17
to Android Building
What is the recommended way to set src file path to prebuilt libs? There are different libs for target variants.

Android.mk file:
LOCAL_PATH := $(call my-dir)

PREBUILT_PATH := prebuilts/$(TARGET_BUILD_VARIANT)
PREBUILT_SYSTEM_PATH := $(PREBUILT_PATH)/system
PREBUILT_SYSTEM_BIN_PATH := = $(PREBUILT_SYSTEM_PATH)/lib
PREBUILT_SYSTEM_LIB64_PATH := $(PREBUILT_SYSTEM_PATH)/lib64

include $(CLEAR_VARS)
LOCAL_MODULE := libmytest
LOCAL_MODULE_TAGS   := optional
LOCAL_MODULE_CLASS  := SHARED_LIBRARIES
LOCAL_MODULE_SUFFIX := .so
LOCAL_MULTILIB      := both
LOCAL_SRC_FILES_32 := $(PREBUILT_SYSTEM_LIB32_PATH)/$(LOCAL_MODULE)$(LOCAL_MODULE_SUFFIX)
LOCAL_SRC_FILES_64 := $(PREBUILT_SYSTEM_LIB64_PATH)/$(LOCAL_MODULE)$(LOCAL_MODULE_SUFFIX)
LOCAL_SHARED_LIBRARIES := liblog libutils libcutils libbase libpcrecpp
include $(BUILD_PREBUILT)
 

Colin Cross

unread,
Sep 12, 2017, 5:37:17 PM9/12/17
to android-...@googlegroups.com
See https://android.googlesource.com/platform/prebuilts/sdk/+/master/tools/Android.bp# for an example.  In this case it would be something like:

target: {
    android_arm: {
        srcs: ["lib/libmytest.so"],
    },
    android_arm64: {
        srcs: ["lib64/libmytest.so"],
    },
},

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Lekman

unread,
Sep 13, 2017, 10:41:05 AM9/13/17
to Android Building
but how should we  handle the case with one lib for user build and another for userdebug and eng? We did use $(TARGET_BUILD_VARIANT) in Android.mk. 
To post to this group, send email to android-...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.

Michael Lekman

unread,
Sep 13, 2017, 10:41:05 AM9/13/17
to Android Building
What is the requirements on prebuilt libraries? 

Symbols are missing and it breaks the build:

 target Strip (mini debug info): libmytest (out/target/product/mytest/obj/lib/libmytest.so)
....
prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-nm: out/target/product/mytest/symbols/system/lib64/libmytest.so: no symbols


Are debug symbols mandatory for prebuilt libs? 

Colin Cross

unread,
Sep 13, 2017, 1:15:17 PM9/13/17
to android-...@googlegroups.com
Oh, missed that, we don't currently have a way to vary the prebuilt based on TARGET_BUILD_VARIANT.  What's the use case for it?

Try adding strip: none to turn off stripping.  

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-building@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.

Colin Cross

unread,
Sep 13, 2017, 1:15:21 PM9/13/17
to android-...@googlegroups.com
Correction:
strip: {
    none: true,
}

Michael Lekman

unread,
Sep 13, 2017, 6:49:33 PM9/13/17
to Android Building
Thanks. I will try to use ro.build.type property instead.
Correction:
strip: {
    none: true,
}

To post to this group, send email to android-...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages