Skip to content

Commit

Permalink
Modern GCC improvements (#1139)
Browse files Browse the repository at this point in the history
* enable gcc_modern color

* add capability to compile segments with gcc_modern

* macos: install modern gcc
  • Loading branch information
bates64 authored Jan 7, 2024
1 parent 262428c commit 6741e3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [[ "$uname" == "Darwin" ]]; then
fi

# 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
cp tools/precommit_check_no_assets.sh "$(git rev-parse --git-path hooks)/pre-commit" || exit 1

Expand Down
7 changes: 5 additions & 2 deletions tools/build/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_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 = cflags_272.replace("-ggdb3", "-g1")
Expand Down Expand Up @@ -146,7 +146,7 @@ def write_ninja_rules(

ninja.rule(
"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'",
depfile="$out.d",
deps="gcc",
Expand Down Expand Up @@ -672,6 +672,9 @@ def build(
elif "egcs" in cflags:
task = "cc_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
if version == "ique":
Expand Down

0 comments on commit 6741e3f

Please sign in to comment.