all: remove need for -fcommon

Use `extern` where appropriate so that we can remove `-fcommon`
on macOS and others.  On macOS, `-fcommon` generates a number of
linker warnings.

I've tested building on macOS, Linux, FreeBSD, NetBSD, OpenBSD
and illumos.  I am not in a position to test on AIX or other
more esoteric platforms, however.
This commit is contained in:
Dan Cross
2025-07-23 06:47:21 -04:00
parent 1e6e30e91e
commit 156e745be9
39 changed files with 330 additions and 184 deletions

4
bin/9c
View File

@@ -23,7 +23,7 @@ usegcc()
-Wno-deprecated-declarations \
-fno-omit-frame-pointer \
-fsigned-char \
-fcommon \
-fno-common \
-std=gnu11 \
"
# want to put -fno-optimize-sibling-calls here but
@@ -85,7 +85,7 @@ useclang()
-Wno-unused-but-set-variable \
-fsigned-char \
-fno-caret-diagnostics \
-fcommon \
-fno-common \
"
cflags="$cflags -g"
cflags="$cflags $CC9FLAGS"