Modern GCC improvements (#1139)

* enable gcc_modern color

* add capability to compile segments with gcc_modern

* macos: install modern gcc
This commit is contained in:
Alex Bates 2024-01-07 01:40:16 +00:00 committed by GitHub
parent 262428c68a
commit 6741e3f848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -20,7 +20,7 @@ if [[ "$uname" == "Darwin" ]]; then
fi fi
# Install packages # Install packages
brew install md5sha1sum ninja gcc nanaian/brew/mips-linux-gnu-binutils || exit 1 brew install md5sha1sum ninja gcc nanaian/brew/mips-linux-gnu-binutils nanaian/brew/mips-linux-gnu-gcc || exit 1
python3 -m pip install -U -r requirements.txt || exit 1 python3 -m pip install -U -r requirements.txt || exit 1
cp tools/precommit_check_no_assets.sh "$(git rev-parse --git-path hooks)/pre-commit" || exit 1 cp tools/precommit_check_no_assets.sh "$(git rev-parse --git-path hooks)/pre-commit" || exit 1

View File

@ -75,7 +75,7 @@ def write_ninja_rules(
cflags = f"-c -G0 -O2 -gdwarf-2 -x c -B {BUILD_TOOLS}/cc/gcc/ {extra_cflags}" cflags = f"-c -G0 -O2 -gdwarf-2 -x c -B {BUILD_TOOLS}/cc/gcc/ {extra_cflags}"
cflags_modern = f"-c -G0 -O2 -gdwarf-2 -fno-builtin-bcopy -fno-tree-loop-distribute-patterns -funsigned-char -mgp32 -mfp32 -mabi=32 -mfix4300 -march=vr4300 -mno-gpopt -fno-toplevel-reorder -mno-abicalls -fno-pic -fno-exceptions -fno-stack-protector -fno-zero-initialized-in-bss -Wno-builtin-declaration-mismatch -x c {extra_cflags}" cflags_modern = f"-c -G0 -O2 -gdwarf-2 -fdiagnostics-color=always -fno-builtin-bcopy -fno-tree-loop-distribute-patterns -funsigned-char -mgp32 -mfp32 -mabi=32 -mfix4300 -march=vr4300 -mno-gpopt -fno-toplevel-reorder -mno-abicalls -fno-pic -fno-exceptions -fno-stack-protector -fno-zero-initialized-in-bss -Wno-builtin-declaration-mismatch -x c {extra_cflags}"
cflags_272 = f"-c -G0 -mgp32 -mfp32 -mips3 {extra_cflags}" cflags_272 = f"-c -G0 -mgp32 -mfp32 -mips3 {extra_cflags}"
cflags_272 = cflags_272.replace("-ggdb3", "-g1") cflags_272 = cflags_272.replace("-ggdb3", "-g1")
@ -146,7 +146,7 @@ def write_ninja_rules(
ninja.rule( ninja.rule(
"cc_modern", "cc_modern",
description="gcc $in", description="gcc_modern $in",
command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} {extra_cppflags} $cppflags -MD -MF $out.d $in -o - | $iconv | {ccache}{cc_modern} {cflags_modern} $cflags - -o $out'", command=f"bash -o pipefail -c '{cpp} {CPPFLAGS} {extra_cppflags} $cppflags -MD -MF $out.d $in -o - | $iconv | {ccache}{cc_modern} {cflags_modern} $cflags - -o $out'",
depfile="$out.d", depfile="$out.d",
deps="gcc", deps="gcc",
@ -672,6 +672,9 @@ class Configure:
elif "egcs" in cflags: elif "egcs" in cflags:
task = "cc_egcs" task = "cc_egcs"
cflags = cflags.replace("egcs", "") cflags = cflags.replace("egcs", "")
elif "gcc_modern" in cflags:
task = "cc_modern"
cflags = cflags.replace("gcc_modern", "")
encoding = "CP932" # similar to SHIFT-JIS, but includes backslash and tilde encoding = "CP932" # similar to SHIFT-JIS, but includes backslash and tilde
if version == "ique": if version == "ique":