Skip to content

Commit

Permalink
Fix alignment for bins
Browse files Browse the repository at this point in the history
  • Loading branch information
ethteck committed Sep 11, 2024
1 parent efd86ab commit 7cf0119
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/build/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def write_ninja_rules(
cc_egcs = f"{cc_egcs_dir}/gcc"
cxx = f"{BUILD_TOOLS}/cc/gcc/g++"

BFDNAME = "elf32-tradbigmips"

CPPFLAGS_COMMON = (
"-Iver/$version/include -Iver/$version/build/include -Iinclude -Isrc -Iassets/$version -D_LANGUAGE_C -D_FINALROM "
"-DVERSION=$version -DF3DEX_GBI_2 -D_MIPS_SZLONG=32"
Expand Down Expand Up @@ -166,13 +168,13 @@ def write_ninja_rules(
ninja.rule(
"cc_272",
description="cc_272 $in",
command=f"bash -o pipefail -c 'COMPILER_PATH={cc_272_dir} {cc_272} {CPPFLAGS_272} {extra_cppflags} $cppflags {cflags_272} $cflags $in -o $out && mips-linux-gnu-objcopy -N $in $out'",
command=f"bash -o pipefail -c 'COMPILER_PATH={cc_272_dir} {cc_272} {CPPFLAGS_272} {extra_cppflags} $cppflags {cflags_272} $cflags $in -o $out && {cross}objcopy -N $in $out'",
)

ninja.rule(
"cc_egcs",
description="cc_egcs $in",
command=f"bash -o pipefail -c '{cc_egcs} {CPPFLAGS_EGCS} {extra_cppflags} $cppflags {cflags_egcs} $cflags $in -o $out && mips-linux-gnu-objcopy -N $in $out && python3 ./tools/patch_64bit_compile.py $out'",
command=f"bash -o pipefail -c '{cc_egcs} {CPPFLAGS_EGCS} {extra_cppflags} $cppflags {cflags_egcs} $cflags $in -o $out && {cross}objcopy -N $in $out && python3 ./tools/patch_64bit_compile.py $out'",
)

ninja.rule(
Expand All @@ -186,13 +188,13 @@ def write_ninja_rules(
ninja.rule(
"dead_cc_fix",
description="dead_cc_fix $in",
command=f"mips-linux-gnu-objcopy --redefine-sym sqrtf=dead_sqrtf $in $out",
command=f"{cross}objcopy --redefine-sym sqrtf=dead_sqrtf $in $out",
)

ninja.rule(
"bin",
description="bin $in",
command=f"{ld} -r -b binary $in -o $out",
command=f"{cross}objcopy -I binary -O {BFDNAME} --set-section-alignment .data=8 $in $out",
)

ninja.rule(
Expand Down

0 comments on commit 7cf0119

Please sign in to comment.