summary refs log tree commit diff
path: root/pkgs/build-support/cc-wrapper/utils.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/cc-wrapper/utils.sh')
-rw-r--r--pkgs/build-support/cc-wrapper/utils.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/build-support/cc-wrapper/utils.sh b/pkgs/build-support/cc-wrapper/utils.sh
index 4b2b1380918..9215fe2dc39 100644
--- a/pkgs/build-support/cc-wrapper/utils.sh
+++ b/pkgs/build-support/cc-wrapper/utils.sh
@@ -25,7 +25,11 @@ mangleVarBool() {
     for infix in "${role_infixes[@]}"; do
         local inputVar="${var/+/${infix}}"
         if [ -v "$inputVar" ]; then
-            let "${outputVar} |= ${!inputVar}"
+            # "1" in the end makes `let` return success error code when
+            # expression itself evaluates to zero.
+            # We don't use `|| true` because that would silence actual
+            # syntax errors from bad variable values.
+            let "${outputVar} |= ${!inputVar:-0}" "1"
         fi
     done
 }