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

Fix Windows build #176

Merged
merged 1 commit into from
Sep 5, 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
4 changes: 3 additions & 1 deletion tools/asm_processor/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ CC="$1"
shift
AS="$1"
shift
OBJCOPY="$1"
shift
IN="$1"
shift
OUT="$1"
Expand All @@ -29,6 +31,6 @@ $PYTHON tools/asm_processor/asm_processor.py "$IN" > "$TEMP/$STEM.c"
$CC "$TEMP/$STEM.c" -c -o "$TEMP"
$PYTHON tools/asm_processor/asm_processor.py "$IN" --post-process "$TEMP/$STEM.o" --assembler "$AS" --asm-prelude include/macros.inc
# Remove sections that don't work with our reloc hacks
${BINUTILS_PATH:-build/binutils}/powerpc-eabi-objcopy --remove-section .mwcats.text --remove-section .comment "$TEMP/$STEM.o" "$OUT"
$OBJCOPY --remove-section .mwcats.text --remove-section .comment "$TEMP/$STEM.o" "$OUT"
# Copy depfile, replacing the first line with the correct input/output files
( echo "$OUT: $IN \\"; tail -n +2 "$TEMP/$STEM.d" ) > "${OUT%.*}.d"
12 changes: 5 additions & 7 deletions tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ def write_cargo_rule():
gnu_as_implicit = [binutils_implicit or gnu_as, dtk]

# MWCC with asm_processor
mwcc_asm_processor_cmd = f'tools/asm_processor/compile.sh "{wrapper_cmd} {mwcc} $cflags -MMD" "{gnu_as} $asflags" $in $out'
objcopy = binutils / f"powerpc-eabi-objcopy{EXE}"
mwcc_asm_processor_cmd = f'tools/asm_processor/compile.sh "{wrapper_cmd} {mwcc} $cflags -MMD" "{gnu_as} $asflags" {objcopy} $in $out'
mwcc_asm_processor_implicit: List[Optional[Path]] = [
*mwcc_implicit,
binutils_implicit or gnu_as,
Expand All @@ -530,7 +531,7 @@ def write_cargo_rule():
]

# MWCC with asm_processor and UTF-8 to Shift JIS wrapper
mwcc_asm_processor_sjis_cmd = f'tools/asm_processor/compile.sh "{wrapper_cmd}{sjiswrap} {mwcc} $cflags -MMD" "{gnu_as} $asflags" $in $out'
mwcc_asm_processor_sjis_cmd = f'tools/asm_processor/compile.sh "{wrapper_cmd}{sjiswrap} {mwcc} $cflags -MMD" "{gnu_as} $asflags" {objcopy} $in $out'
mwcc_asm_processor_sjis_implicit: List[Optional[Path]] = [
*mwcc_asm_processor_implicit,
sjiswrap,
Expand All @@ -548,12 +549,9 @@ def write_cargo_rule():
mwcc_sjis_implicit.append(transform_dep)
mwcc_asm_processor_implicit.append(transform_dep)
mwcc_asm_processor_sjis_implicit.append(transform_dep)

mwcc_asm_processor_cmd = f'env "BINUTILS_PATH={binutils}" ' + mwcc_asm_processor_cmd
mwcc_asm_processor_sjis_cmd = f'env "BINUTILS_PATH={binutils}" ' + mwcc_asm_processor_sjis_cmd
else:
mwcc_asm_processor_cmd = f'set "BINUTILS_PATH={binutils}" && sh ' + mwcc_asm_processor_cmd
mwcc_asm_processor_sjis_cmd = f'set "BINUTILS_PATH={binutils}" && sh ' + mwcc_asm_processor_sjis_cmd
mwcc_asm_processor_cmd = "sh " + mwcc_asm_processor_cmd
mwcc_asm_processor_sjis_cmd = "sh " + mwcc_asm_processor_sjis_cmd

n.comment("Link ELF file")
n.rule(
Expand Down