Reland refactoring of sources in Android.bp am: 5cfe912553 am: 906e656994 am: 029261e331 am: 0d5bfb5030

Original change: https://android-review.googlesource.com/c/platform/external/selinux/+/2222602

Change-Id: Ie52217e0eb9d423334f9be84d142bd89a0f279f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Thiébaud Weksteen 2022-09-26 02:32:17 +00:00 committed by Automerger Merge Worker
commit 0fed5250b6
3 changed files with 78 additions and 116 deletions

View file

@ -45,6 +45,9 @@ common_CFLAGS = [
"-Wno-error=missing-noreturn",
"-Wno-error=unused-function",
"-Wno-error=unused-variable",
"-DUSE_PCRE2",
// 1003 corresponds to auditd, from system/core/logd/event.logtags
"-DAUDITD_LOG_TAG=1003",
]
cc_defaults {
@ -53,15 +56,49 @@ cc_defaults {
cflags: common_CFLAGS,
srcs: [
"src/android/android.c",
"src/avc.c",
"src/avc_internal.c",
"src/avc_sidtab.c",
"src/booleans.c",
"src/callbacks.c",
"src/canonicalize_context.c",
"src/checkAccess.c",
"src/check_context.c",
"src/compute_av.c",
"src/compute_create.c",
"src/compute_member.c",
"src/context.c",
"src/deny_unknown.c",
"src/disable.c",
"src/enabled.c",
"src/fgetfilecon.c",
"src/freecon.c",
"src/label_backends_android.c",
"src/fsetfilecon.c",
"src/get_initial_context.c",
"src/getenforce.c",
"src/getfilecon.c",
"src/getpeercon.c",
"src/init.c",
"src/label.c",
"src/label_backends_android.c",
"src/label_file.c",
"src/label_support.c",
"src/lgetfilecon.c",
"src/load_policy.c",
"src/lsetfilecon.c",
"src/mapping.c",
"src/matchpathcon.c",
"src/policyvers.c",
"src/procattr.c",
"src/regex.c",
"src/reject_unknown.c",
"src/sestatus.c",
"src/setenforce.c",
"src/setfilecon.c",
"src/setrans_client.c",
"src/sha1.c",
"src/stringrep.c",
],
target: {
@ -70,60 +107,46 @@ cc_defaults {
"-DBUILD_HOST",
],
},
android: {
srcs: [
"src/android/android.c",
"src/avc.c",
"src/avc_internal.c",
"src/avc_sidtab.c",
"src/canonicalize_context.c",
"src/checkAccess.c",
"src/check_context.c",
"src/compute_av.c",
"src/compute_create.c",
"src/compute_member.c",
"src/context.c",
"src/deny_unknown.c",
"src/disable.c",
"src/enabled.c",
"src/fgetfilecon.c",
"src/fsetfilecon.c",
"src/getenforce.c",
"src/getfilecon.c",
"src/get_initial_context.c",
"src/getpeercon.c",
"src/init.c",
"src/lgetfilecon.c",
"src/load_policy.c",
"src/lsetfilecon.c",
"src/mapping.c",
"src/policyvers.c",
"src/procattr.c",
"src/reject_unknown.c",
"src/sestatus.c",
"src/setenforce.c",
"src/setfilecon.c",
"src/stringrep.c",
"src/android/android_platform.c",
],
static: {
whole_static_libs: [
"libpackagelistparser",
],
},
shared_libs: [
"liblog",
],
shared: {
shared_libs: [
"libpackagelistparser",
],
},
system_shared_libs: ["libc"],
header_libs: ["libcutils_headers"],
local_include_dirs: [ "src" ],
// 1003 corresponds to auditd, from system/core/logd/event.logtags
cflags: [
"-DAUDITD_LOG_TAG=1003",
],
}
},
},
local_include_dirs: ["include"],
static: {
whole_static_libs: [
"libpcre2",
"liblog",
],
},
shared: {
shared_libs: [
"libpcre2",
"liblog",
],
},
header_libs: [
"libbase_headers",
"libcutils_headers",
"liblog_headers",
],
local_include_dirs: [
"include",
"src",
],
export_include_dirs: ["include"],
stl: "none",
@ -140,76 +163,18 @@ cc_library {
ramdisk_available: true,
vendor_ramdisk_available: true,
recovery_available: true,
host_supported: true,
cflags: ["-DUSE_PCRE2"],
srcs: [
"src/label_file.c",
"src/regex.c",
],
target: {
host_linux: {
srcs: [
"src/avc.c",
"src/avc_internal.c",
"src/avc_sidtab.c",
"src/compute_av.c",
"src/compute_create.c",
"src/compute_member.c",
"src/context.c",
"src/deny_unknown.c",
"src/enabled.c",
"src/getenforce.c",
"src/getfilecon.c",
"src/get_initial_context.c",
"src/init.c",
"src/load_policy.c",
"src/mapping.c",
"src/procattr.c",
"src/reject_unknown.c",
"src/sestatus.c",
"src/setexecfilecon.c",
"src/stringrep.c",
],
},
linux_glibc: {
srcs: [
"src/fgetfilecon.c",
"src/lgetfilecon.c",
"src/lsetfilecon.c",
"src/setfilecon.c",
],
},
linux_bionic: {
enabled: true,
},
android: {
srcs: [
"src/android/android_platform.c",
],
static: {
whole_static_libs: ["libpackagelistparser"],
},
shared: {
shared_libs: ["libpackagelistparser"],
},
version_script: "exported.map.txt",
},
},
static: {
whole_static_libs: ["libpcre2"],
},
shared: {
shared_libs: ["libpcre2"],
},
stubs: {
symbol_file: "exported.map.txt",
versions: ["30"],
@ -219,14 +184,14 @@ cc_library {
cc_binary_host {
name: "sefcontext_compile",
defaults: ["libselinux_defaults"],
cflags: ["-DUSE_PCRE2"],
srcs: ["utils/sefcontext_compile.c"],
static_libs: [
"libselinux",
"libsepol",
],
whole_static_libs: ["libpcre2"],
stl: "",
}
rust_bindgen {

View file

@ -13,14 +13,10 @@
#include <sys/stat.h>
#include <sys/xattr.h>
#include <fcntl.h>
#include <fts.h>
#include <selinux/selinux.h>
#include <selinux/context.h>
#include <selinux/android.h>
#include <selinux/label.h>
#ifndef __ANDROID_VNDK__
#include <private/android_filesystem_config.h>
#endif
#include <log/log.h>
#include "policy.h"
#include "callbacks.h"
@ -32,9 +28,6 @@
#include <linux/magic.h>
#include <libgen.h>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define FC_DIGEST_SIZE SHA_DIGEST_LENGTH

View file

@ -1,6 +1,10 @@
#include "android_common.h"
#include "android_internal.h"
#include <fts.h>
#include <packagelistparser/packagelistparser.h>
#include <private/android_filesystem_config.h>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
/* Locations for the file_contexts files. For each partition, only the first
* existing entry will be used (for example, if