From 7dbb9816651fc419ff26fd2a087b994c862f0e55 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Fri, 22 May 2026 15:39:08 +0100 Subject: [PATCH] build(runtime): enable pipefail so compiler errors fail the build The Pascal RTL recipes pipe $(BLAISE) --emit-ir through sed to strip the program section before writing the .ssa file. Without pipefail, sed's exit code masks a failing compiler invocation: the recipe succeeds with an empty .ssa, QBE emits an empty .s, gcc archives an empty .o, and the first symptom is a downstream link failure with "no symbols". Set SHELL=/bin/bash and .SHELLFLAGS=-o pipefail -c at the top of the Makefile so every recipe inherits pipefail. Verified by injecting a parse error into a build driver: make now exits with Error 1 and prints the compiler's diagnostic, instead of silently producing an empty archive member. --- runtime/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/Makefile b/runtime/Makefile index da9be85..16108e7 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -5,6 +5,13 @@ # Licensed under the Apache License v2.0 with Runtime Library Exception. # See LICENSE file in the project root for full license terms. # +# Use bash with pipefail so that compiler errors in a `... | sed ...` +# pipeline propagate, instead of being masked by sed's exit code. +# Without this, a failing $(BLAISE) invocation produces an empty .ssa +# file and the build silently archives an empty .o (see bugs.txt BUG-004). +SHELL = /bin/bash +.SHELLFLAGS = -o pipefail -c + CC = gcc CFLAGS = -O2 -Wall -Wextra -std=c11