sys_prop: add a flag to enable large sys prop node only for internal
builds
Use a soong config var to control if we should use a large sys prop node
size. Node in prop_area.cpp, the PA_SIZE is controlled by a macro flag.
This macro flag is passed in as a compiler flag which is then added when
the soong configure variable (large_system_property_node) is true.
The sooong configure variable is then backed by a build system flag
defined in build/release/build_flags.scl. The value of this flag is then
determined by different release configurations. Only internal build
release configuration would set this flag to true.
Bug: b/316932568
Change-Id: Ibe2ffda9155246f2217aaa0e7d589ed7effec311
diff --git a/libc/system_properties/Android.bp b/libc/system_properties/Android.bp
index a9bdeb5..8a8d23c 100644
--- a/libc/system_properties/Android.bp
+++ b/libc/system_properties/Android.bp
@@ -10,7 +10,10 @@
cc_library_static {
name: "libsystemproperties",
- defaults: ["libc_defaults"],
+ defaults: [
+ "libc_defaults",
+ "large_system_property_node_defaults",
+ ],
native_bridge_supported: true,
srcs: [
"context_node.cpp",
@@ -53,3 +56,28 @@
"libasync_safe",
],
}
+
+soong_config_module_type {
+ name: "large_system_property_node_cc_defaults",
+ module_type: "cc_defaults",
+ config_namespace: "bionic",
+ bool_variables: [
+ "large_system_property_node",
+ ],
+ properties: [
+ "cflags",
+ ],
+}
+
+soong_config_bool_variable {
+ name: "large_system_property_node",
+}
+
+large_system_property_node_cc_defaults {
+ name: "large_system_property_node_defaults",
+ soong_config_variables: {
+ large_system_property_node: {
+ cflags: ["-DLARGE_SYSTEM_PROPERTY_NODE=1"]
+ }
+ }
+}