Translating Android.bp to Android.mk for upgrading external/v8

95 views
Skip to first unread message

Saurabh Banore

unread,
Sep 17, 2021, 7:28:45 PM9/17/21
to Android Building

I am upgrading one of the Nougat libraries - external/v8. The changes required for upgrading are replacing the Android.mk with Android.bp. Android.bp is not fully supported in Nougat as clarified as part of this thread, I am converting the Android.bp to equivalent the Android.mk.

I am able to translate most of the part of the Android.bp but I am not aware what should be the equivalent of the following sections in Android.mk.


genrule {
    name: "v8_generate_bytecode_builtins_list",
    tools: ["v8_bytecode_builtins_list_generator"],
    srcs: [],
    cmd: "mkdir -p $(genDir)/builtins-generated/ && $(location v8_bytecode_builtins_list_generator) $(out)",
    out: [
        "builtins-generated/bytecodes-builtins-list.h"
    ],
}

Similarly the filegroup section:

filegroup {
    name: "v8_init",
    srcs: [
        "src/init/setup-isolate-full.cc",
        ":v8_initializers",
    ]
}


Does anyone know how do I translate the sections mentioned above to Android.mk or point to some resources where I can read more on this?

Also, feel free to suggest if this is not the right approach for upgrading the external/v8 in Nougat and if there is any other way I can follow to upgrade the library from 5.8 to 8.8

Thanks!

Bala

unread,
Sep 28, 2021, 2:04:23 PM9/28/21
to Android Building
genrule{}
genrule in Android.bp is similar to genrule in Bazel - it is a general rule to run a bash command on some input files to generate an output file. This is natively supported on Android.mk - the equivalent in Android.mk is LOCAL_BUILT_MODULE. You can use it to define a similar rule in your Android.mk

filegroup{}
filegroup is probably a Android.bp specific requirement. There is no Android.mk equivalent because Android.mk doesn't need it. Android.bp can't reference files outside its folder and subfolders. So, if any module needs to access files outside the current folder (say parent folder/sibling folders) then we use filegroup to reference those files. In Android.mk, you would just directly specify the files given in srcs: through their relative path.
Reply all
Reply to author
Forward
0 new messages