mirror of
https://github.com/pmret/papermario.git
synced 2024-09-08 02:29:49 +02:00
Fix INCLUDE_IMG and INCLUDE_PAL on modern GCC (#1143)
* fix INCLUDE_IMG and INCLUDE_PAL on modern GCC * use .pushsection/.popsection * use pushsection/popsection on modern compiler only * add gcc-mips-linux-gnu to debian deps * remove rogue ) * move -DMODERN_COMPILER to cflags_modern
This commit is contained in:
parent
070a5488d0
commit
029de584b7
@ -3,15 +3,24 @@
|
|||||||
#define ASTRINGIFY_(x) #x
|
#define ASTRINGIFY_(x) #x
|
||||||
#define ASTRINGIFY(x) ASTRINGIFY_(x)
|
#define ASTRINGIFY(x) ASTRINGIFY_(x)
|
||||||
|
|
||||||
|
#ifdef MODERN_COMPILER
|
||||||
|
# define PUSHSECTION(SECTION) ".pushsection " SECTION "\n"
|
||||||
|
# define POPSECTION ".popsection\n"
|
||||||
|
#else
|
||||||
|
# define PUSHSECTION(SECTION) SECTION "\n"
|
||||||
|
# define POPSECTION
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _INCLUDE_IMG(FILENAME, SYMBOLNAME) \
|
#define _INCLUDE_IMG(FILENAME, SYMBOLNAME) \
|
||||||
extern unsigned char SYMBOLNAME[]; \
|
extern unsigned char SYMBOLNAME[]; \
|
||||||
__asm__( \
|
__asm__( \
|
||||||
".globl " #SYMBOLNAME"\n" \
|
".globl " #SYMBOLNAME"\n" \
|
||||||
".data\n" \
|
PUSHSECTION(".data") \
|
||||||
".align 2\n" \
|
".align 2\n" \
|
||||||
".type " #SYMBOLNAME", @object\n" \
|
".type " #SYMBOLNAME", @object\n" \
|
||||||
#SYMBOLNAME":\n" \
|
#SYMBOLNAME":\n" \
|
||||||
".incbin \"ver/"ASTRINGIFY(VERSION)"/build/" FILENAME ".bin\"\n" \
|
".incbin \"ver/"ASTRINGIFY(VERSION)"/build/" FILENAME ".bin\"\n" \
|
||||||
|
POPSECTION \
|
||||||
)
|
)
|
||||||
|
|
||||||
// two macros are needed for N() usage
|
// two macros are needed for N() usage
|
||||||
@ -22,11 +31,12 @@
|
|||||||
extern unsigned short SYMBOLNAME[]; \
|
extern unsigned short SYMBOLNAME[]; \
|
||||||
__asm__( \
|
__asm__( \
|
||||||
".globl " #SYMBOLNAME"\n" \
|
".globl " #SYMBOLNAME"\n" \
|
||||||
".data\n" \
|
PUSHSECTION(".data") \
|
||||||
".align 2\n" \
|
".align 2\n" \
|
||||||
".type " #SYMBOLNAME", @object\n" \
|
".type " #SYMBOLNAME", @object\n" \
|
||||||
#SYMBOLNAME":\n" \
|
#SYMBOLNAME":\n" \
|
||||||
".incbin \"ver/"ASTRINGIFY(VERSION)"/build/" FILENAME ".bin\"\n" \
|
".incbin \"ver/"ASTRINGIFY(VERSION)"/build/" FILENAME ".bin\"\n" \
|
||||||
|
POPSECTION \
|
||||||
)
|
)
|
||||||
|
|
||||||
#endif // _H_INCLUDE_ASSET
|
#endif // _H_INCLUDE_ASSET
|
||||||
|
@ -37,7 +37,7 @@ if cat /etc/os-release | grep -E 'ID=debian|ID_LIKE=(.*)debian' &> /dev/null; th
|
|||||||
|
|
||||||
echo "Installing packages for Debian or derivative (apt)"
|
echo "Installing packages for Debian or derivative (apt)"
|
||||||
|
|
||||||
${SUDO} apt install -y curl git python3 python3-pip python3-setuptools build-essential binutils-mips-linux-gnu zlib1g-dev libyaml-dev ninja-build cpp-mips-linux-gnu || exit 1
|
${SUDO} apt install -y curl git python3 python3-pip python3-setuptools build-essential binutils-mips-linux-gnu zlib1g-dev libyaml-dev ninja-build cpp-mips-linux-gnu gcc-mips-linux-gnu || exit 1
|
||||||
python3 -m pip install -U -r requirements.txt
|
python3 -m pip install -U -r requirements.txt
|
||||||
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
|
||||||
|
|
||||||
|
@ -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 -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_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 -DMODERN_COMPILER -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user