Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modern GCC improvements #1139

Merged
merged 3 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading