summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-05-08 11:47:25 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-05-08 11:47:25 +0200
commit6ad842c81900b8be9bfdb945bec297ebae215c32 (patch)
tree9f2c0917c22c8f1271a650b0bfd64f484a5b78e7
parent64d89ed40ba6796d0705ded4b1b1526be8476fc4 (diff)
parentfddd776e5fe3dc2435e9b849e6c59b8b8c6e881f (diff)
downloadrules-cc-6ad842c81900b8be9bfdb945bec297ebae215c32.tar.gz
Merge subtree 'rules' into rules-cc
-rw-r--r--rules/CC/RULES43
-rw-r--r--rules/CC/proto/RULES31
2 files changed, 39 insertions, 35 deletions
diff --git a/rules/CC/RULES b/rules/CC/RULES
index a33e4f2..82305d9 100644
--- a/rules/CC/RULES
+++ b/rules/CC/RULES
@@ -120,21 +120,8 @@
["The architecture on which the build actions are carried out."]
, "TARGET_ARCH": ["The architecture for which to build."]
, "DEBUG":
- [ "Map configuring the debug-stage, needed for local debugging."
- , "If non-empty, debug mode is enabled."
- , ""
- , "The key \"USE_DEBUG_FISSION\" expects a flag which enables the debug"
- , "fission mode, but does not add any flags. Explicitly setting it to a"
- , "false value is needed to enable regular debug mode."
- , "The key \"FISSION_CONFIG\" expects a map configuring debug fission."
- , " - subkey \"USE_SPLIT_DWARF\" expects a flag that, if true, adds the"
- , "-gsplit-dwarf compile flag."
- , " - subkey \"DWARF_VERSION\" expects a string that adds the"
- , "-gdwarf-<value> compile flag."
- , " - subkey \"USE_GDB_INDEX\" expects a flag that, if true, adds the"
- , "-Wl,--gdb-index linker flag."
- , " - subkey \"USE_DEBUG_TYPES_SECTION\" expects a flag that, if true,"
- , "adds the -fdebug-types-section compile flag."
+ [ "If logically true (typically, a non-empty map), use debug-related"
+ , "options, otherwise not."
]
}
, "imports":
@@ -696,8 +683,9 @@
, "ENV": ["The environment for any action generated."]
, "BUILD_POSITION_INDEPENDENT": ["Build with -fPIC."]
, "DEBUG":
- [ "Map configuring the debug-stage, needed for local debugging."
- , "If non-empty, debug mode is enabled."
+ [ "Either a logically false value to disable debugging, or a non-empty"
+ , "map to enable debugging. If debugging is enabled, the following values"
+ , "of the map are used."
, ""
, "The key \"USE_DEBUG_FISSION\" expects a flag which enables the debug"
, "fission mode, but does not add any flags. Explicitly setting it to a"
@@ -806,6 +794,13 @@
{ "type": "let*"
, "bindings":
[ ["name", {"type": "join", "$1": {"type": "FIELD", "name": "name"}}]
+ , [ "DEBUG"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUG"}
+ , "then": {"type": "var", "name": "DEBUG"}
+ , "else": {"type": "empty_map"}
+ }
+ ]
, ["pure C", {"type": "FIELD", "name": "pure C"}]
, [ "cflags"
, { "type": "++"
@@ -989,7 +984,7 @@
, "with \"/\"."
]
, "pure C":
- [ "If non-empty, compile as C sources rathter than C++ sources."
+ [ "If non-empty, compile as C sources rather than C++ sources."
, "In particular, CC is used to compile rather than CXX"
]
, "private-defines":
@@ -1046,8 +1041,9 @@
, "ENV": ["The environment for any action generated."]
, "BUILD_POSITION_INDEPENDENT": ["Build with -fPIC."]
, "DEBUG":
- [ "Map configuring the debug-stage, needed for local debugging."
- , "If non-empty, debug mode is enabled."
+ [ "Either a logically false value to disable debugging, or a non-empty"
+ , "map to enable debugging. If debugging is enabled, the following values"
+ , "of the map are used."
, ""
, "The key \"USE_DEBUG_FISSION\" expects a flag which enables the debug"
, "fission mode, but does not add any flags. Explicitly setting it to a"
@@ -1097,6 +1093,13 @@
, "$1": {"type": "join", "$1": {"type": "FIELD", "name": "name"}}
}
]
+ , [ "DEBUG"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUG"}
+ , "then": {"type": "var", "name": "DEBUG"}
+ , "else": {"type": "empty_map"}
+ }
+ ]
, ["pure C", {"type": "FIELD", "name": "pure C"}]
, [ "stage"
, { "type": "join"
diff --git a/rules/CC/proto/RULES b/rules/CC/proto/RULES
index 35e13e6..910b6a1 100644
--- a/rules/CC/proto/RULES
+++ b/rules/CC/proto/RULES
@@ -77,21 +77,8 @@
, "HOST_ARCH":
["The architecture on which the build actions are carried out."]
, "DEBUG":
- [ "Map configuring the debug-stage, needed for local debugging."
- , "If non-empty, debug mode is enabled."
- , ""
- , "The key \"USE_DEBUG_FISSION\" expects a flag which enables debug"
- , "fission, but does not add any flags. Explicitly setting it to a false"
- , "value is needed to enable regular debug mode."
- , "The key \"FISSION_CONFIG\" expects a map configuring debug fission."
- , " - subkey \"USE_SPLIT_DWARF\" expects a flag that, if true, adds the"
- , "-gsplit-dwarf compile flag."
- , " - subkey \"DWARF_VERSION\" expects a string that adds the"
- , "-gdwarf-<value> compile flag."
- , " - subkey \"USE_GDB_INDEX\" expects a flag that, if true, adds the"
- , "-Wl,--gdb-index linker flag."
- , " - subkey \"USE_DEBUG_TYPES_SECTION\" expects a flag that, if true,"
- , "adds the -fdebug-types-section compile flag."
+ [ "If logically true (typically, a non-empty map), use debug-related"
+ , "options, otherwise not."
]
}
, "imports":
@@ -340,6 +327,13 @@
{ "type": "let*"
, "bindings":
[ ["name", {"type": "join", "$1": {"type": "FIELD", "name": "name"}}]
+ , [ "DEBUG"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUG"}
+ , "then": {"type": "var", "name": "DEBUG"}
+ , "else": {"type": "empty_map"}
+ }
+ ]
, [ "stage"
, { "type": "join"
, "separator": "/"
@@ -372,6 +366,13 @@
, "bindings":
[ ["service support", true]
, ["name", {"type": "join", "$1": {"type": "FIELD", "name": "name"}}]
+ , [ "DEBUG"
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUG"}
+ , "then": {"type": "var", "name": "DEBUG"}
+ , "else": {"type": "empty_map"}
+ }
+ ]
, [ "stage"
, { "type": "join"
, "separator": "/"