summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-05-31 11:31:19 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-05-31 16:34:29 -0400
commit9f37797e68febd9f35715f85fcee146366b81ca8 (patch)
treeae1b7b4645dfe57e172c3eb10df30e5a1c15cd1c /Makefile
parent16c9105ffc1bb0adf33e5daede3fd0e67c63624a (diff)
downloadbfs-9f37797e68febd9f35715f85fcee146366b81ca8.tar.xz
Makefile: Pass -std=gnu11 for gcov builds
Otherwise, libgcov doesn't intercept functions like fork() and exec(), so we lose some coverage data in xspawn.c. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82457
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d368cf8..b521b30 100644
--- a/Makefile
+++ b/Makefile
@@ -160,6 +160,8 @@ endif
ifneq ($(filter gcov,$(MAKECMDGOALS)),)
LOCAL_CFLAGS += --coverage
+# gcov only intercepts fork()/exec() with -std=gnu*
+LOCAL_CFLAGS := $(patsubst -std=c%,-std=gnu%,$(LOCAL_CFLAGS))
endif
ifneq ($(filter release,$(MAKECMDGOALS)),)