Refactor the bp file to avoid arch variant in cc_genrule.

The arch variant of genrule.out will be soon disallowed in soong.

Bug: 253645813
Test: Manually build.
Change-Id: Ia07d45195de8c22f18487aef34795279d2962c4c
This commit is contained in:
Yu Liu 2022-10-17 16:36:30 -07:00
parent 81f0bdb6f3
commit ed2654cfdc

View file

@ -2478,13 +2478,8 @@ genrule {
cmd: "grep -v '^int[ \t]*setresgid' $(in) > $(out)",
}
cc_genrule {
name: "libseccomp_policy_app_zygote_sources",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
tools: [ "genseccomp" ],
filegroup {
name: "seccomp_syscalls_sources_zygote",
srcs: [
"SYSCALLS.TXT",
"SECCOMP_ALLOWLIST_COMMON.TXT",
@ -2493,62 +2488,10 @@ cc_genrule {
"SECCOMP_PRIORITY.TXT",
":generate_app_zygote_blocklist",
],
arch: {
arm: {
srcs: [
":libseccomp_gen_syscall_nrs_arm",
":libseccomp_gen_syscall_nrs_arm64",
],
out: [
"arm_app_zygote_policy.cpp",
"arm64_app_zygote_policy.cpp",
],
},
arm64: {
srcs: [
":libseccomp_gen_syscall_nrs_arm",
":libseccomp_gen_syscall_nrs_arm64",
],
out: [
"arm_app_zygote_policy.cpp",
"arm64_app_zygote_policy.cpp",
],
},
riscv64: {
srcs: [":libseccomp_gen_syscall_nrs_riscv64"],
out: ["riscv64_app_zygote_policy.cpp"],
},
x86: {
srcs: [
":libseccomp_gen_syscall_nrs_x86",
":libseccomp_gen_syscall_nrs_x86_64",
],
out: [
"x86_app_zygote_policy.cpp",
"x86_64_app_zygote_policy.cpp",
],
},
x86_64: {
srcs: [
":libseccomp_gen_syscall_nrs_x86",
":libseccomp_gen_syscall_nrs_x86_64",
],
out: [
"x86_app_zygote_policy.cpp",
"x86_64_app_zygote_policy.cpp",
],
},
},
}
cc_genrule {
name: "libseccomp_policy_app_sources",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
tools: [ "genseccomp" ],
filegroup {
name: "seccomp_syscalls_sources_app",
srcs: [
"SYSCALLS.TXT",
"SECCOMP_ALLOWLIST_COMMON.TXT",
@ -2557,62 +2500,10 @@ cc_genrule {
"SECCOMP_BLOCKLIST_APP.TXT",
"SECCOMP_PRIORITY.TXT",
],
arch: {
arm: {
srcs: [
":libseccomp_gen_syscall_nrs_arm",
":libseccomp_gen_syscall_nrs_arm64",
],
out: [
"arm_app_policy.cpp",
"arm64_app_policy.cpp",
],
},
arm64: {
srcs: [
":libseccomp_gen_syscall_nrs_arm",
":libseccomp_gen_syscall_nrs_arm64",
],
out: [
"arm_app_policy.cpp",
"arm64_app_policy.cpp",
],
},
riscv64: {
srcs: [":libseccomp_gen_syscall_nrs_riscv64"],
out: ["riscv64_app_policy.cpp"],
},
x86: {
srcs: [
":libseccomp_gen_syscall_nrs_x86",
":libseccomp_gen_syscall_nrs_x86_64",
],
out: [
"x86_app_policy.cpp",
"x86_64_app_policy.cpp",
],
},
x86_64: {
srcs: [
":libseccomp_gen_syscall_nrs_x86",
":libseccomp_gen_syscall_nrs_x86_64",
],
out: [
"x86_app_policy.cpp",
"x86_64_app_policy.cpp",
],
},
},
}
cc_genrule {
name: "libseccomp_policy_system_sources",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
tools: [ "genseccomp" ],
filegroup {
name: "seccomp_syscalls_sources_system",
srcs: [
"SYSCALLS.TXT",
"SECCOMP_ALLOWLIST_COMMON.TXT",
@ -2620,64 +2511,188 @@ cc_genrule {
"SECCOMP_BLOCKLIST_COMMON.TXT",
"SECCOMP_PRIORITY.TXT",
],
}
arch: {
arm: {
srcs: [
":libseccomp_gen_syscall_nrs_arm",
":libseccomp_gen_syscall_nrs_arm64",
],
out: [
"arm_system_policy.cpp",
"arm64_system_policy.cpp",
],
},
arm64: {
srcs: [
":libseccomp_gen_syscall_nrs_arm",
":libseccomp_gen_syscall_nrs_arm64",
],
out: [
"arm_system_policy.cpp",
"arm64_system_policy.cpp",
],
},
riscv64: {
srcs: [":libseccomp_gen_syscall_nrs_riscv64"],
out: ["riscv64_system_policy.cpp"],
},
x86: {
srcs: [
":libseccomp_gen_syscall_nrs_x86",
":libseccomp_gen_syscall_nrs_x86_64",
],
out: [
"x86_system_policy.cpp",
"x86_64_system_policy.cpp",
],
},
x86_64: {
srcs: [
":libseccomp_gen_syscall_nrs_x86",
":libseccomp_gen_syscall_nrs_x86_64",
],
out: [
"x86_system_policy.cpp",
"x86_64_system_policy.cpp",
],
},
},
cc_genrule {
name: "libseccomp_policy_app_zygote_sources_x86",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
tools: [ "genseccomp" ],
srcs: [
":seccomp_syscalls_sources_zygote",
":libseccomp_gen_syscall_nrs_x86",
":libseccomp_gen_syscall_nrs_x86_64",
],
out: [
"x86_app_zygote_policy.cpp",
"x86_64_app_zygote_policy.cpp",
],
}
cc_genrule {
name: "libseccomp_policy_app_zygote_sources_arm",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
tools: [ "genseccomp" ],
srcs: [
":seccomp_syscalls_sources_zygote",
":libseccomp_gen_syscall_nrs_arm",
":libseccomp_gen_syscall_nrs_arm64",
],
out: [
"arm_app_zygote_policy.cpp",
"arm64_app_zygote_policy.cpp",
],
}
cc_genrule {
name: "libseccomp_policy_app_zygote_sources_riscv64",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app_zygote $(in)",
tools: [ "genseccomp" ],
srcs: [
":seccomp_syscalls_sources_zygote",
":libseccomp_gen_syscall_nrs_riscv64",
],
out: [
"riscv64_app_zygote_policy.cpp",
],
}
cc_genrule {
name: "libseccomp_policy_app_sources_x86",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
tools: [ "genseccomp" ],
srcs: [
":seccomp_syscalls_sources_app",
":libseccomp_gen_syscall_nrs_x86",
":libseccomp_gen_syscall_nrs_x86_64",
],
out: [
"x86_app_policy.cpp",
"x86_64_app_policy.cpp",
],
}
cc_genrule {
name: "libseccomp_policy_app_sources_arm",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
tools: [ "genseccomp" ],
srcs: [
":seccomp_syscalls_sources_app",
":libseccomp_gen_syscall_nrs_arm",
":libseccomp_gen_syscall_nrs_arm64",
],
out: [
"arm_app_policy.cpp",
"arm64_app_policy.cpp",
],
}
cc_genrule {
name: "libseccomp_policy_app_sources_riscv64",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=app $(in)",
tools: [ "genseccomp" ],
srcs: [
":seccomp_syscalls_sources_app",
":libseccomp_gen_syscall_nrs_riscv64",
],
out: [
"riscv64_app_policy.cpp",
],
}
cc_genrule {
name: "libseccomp_policy_system_sources_x86",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
tools: [ "genseccomp" ],
srcs: [
":seccomp_syscalls_sources_system",
":libseccomp_gen_syscall_nrs_x86",
":libseccomp_gen_syscall_nrs_x86_64",
],
out: [
"x86_system_policy.cpp",
"x86_64_system_policy.cpp",
],
}
cc_genrule {
name: "libseccomp_policy_system_sources_arm",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
tools: [ "genseccomp" ],
srcs: [
":seccomp_syscalls_sources_system",
":libseccomp_gen_syscall_nrs_arm",
":libseccomp_gen_syscall_nrs_arm64",
],
out: [
"arm_system_policy.cpp",
"arm64_system_policy.cpp",
],
}
cc_genrule {
name: "libseccomp_policy_system_sources_riscv64",
recovery_available: true,
cmd: "$(location genseccomp) --out-dir=$(genDir) --name-modifier=system $(in)",
tools: [ "genseccomp" ],
srcs: [
":seccomp_syscalls_sources_system",
":libseccomp_gen_syscall_nrs_riscv64",
],
out: [
"riscv64_system_policy.cpp",
],
}
cc_library {
name: "libseccomp_policy",
recovery_available: true,
generated_headers: ["func_to_syscall_nrs"],
generated_sources: [
"libseccomp_policy_app_sources",
"libseccomp_policy_app_zygote_sources",
"libseccomp_policy_system_sources",
],
arch: {
arm: {
generated_sources: [
"libseccomp_policy_app_sources_arm",
"libseccomp_policy_app_zygote_sources_arm",
"libseccomp_policy_system_sources_arm",
],
},
arm64: {
generated_sources: [
"libseccomp_policy_app_sources_arm",
"libseccomp_policy_app_zygote_sources_arm",
"libseccomp_policy_system_sources_arm",
],
},
riscv64: {
generated_sources: [
"libseccomp_policy_app_sources_riscv64",
"libseccomp_policy_app_zygote_sources_riscv64",
"libseccomp_policy_system_sources_riscv64",
],
},
x86: {
generated_sources: [
"libseccomp_policy_app_sources_x86",
"libseccomp_policy_app_zygote_sources_x86",
"libseccomp_policy_system_sources_x86",
],
},
x86_64: {
generated_sources: [
"libseccomp_policy_app_sources_x86",
"libseccomp_policy_app_zygote_sources_x86",
"libseccomp_policy_system_sources_x86",
],
},
},
srcs: [
"seccomp/seccomp_policy.cpp",