diff --git a/include/include_asset.h b/include/include_asset.h index 0e53e62e52..b867825eb7 100644 --- a/include/include_asset.h +++ b/include/include_asset.h @@ -3,15 +3,24 @@ #define ASTRINGIFY_(x) #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) \ extern unsigned char SYMBOLNAME[]; \ __asm__( \ ".globl " #SYMBOLNAME"\n" \ - ".data\n" \ + PUSHSECTION(".data") \ ".align 2\n" \ ".type " #SYMBOLNAME", @object\n" \ #SYMBOLNAME":\n" \ ".incbin \"ver/"ASTRINGIFY(VERSION)"/build/" FILENAME ".bin\"\n" \ + POPSECTION \ ) // two macros are needed for N() usage @@ -22,11 +31,12 @@ extern unsigned short SYMBOLNAME[]; \ __asm__( \ ".globl " #SYMBOLNAME"\n" \ - ".data\n" \ + PUSHSECTION(".data") \ ".align 2\n" \ ".type " #SYMBOLNAME", @object\n" \ #SYMBOLNAME":\n" \ ".incbin \"ver/"ASTRINGIFY(VERSION)"/build/" FILENAME ".bin\"\n" \ + POPSECTION \ ) #endif // _H_INCLUDE_ASSET diff --git a/install_deps.sh b/install_deps.sh index f58dfa4955..2a1a6fecf7 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -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)" - ${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 cp tools/precommit_check_no_assets.sh "$(git rev-parse --git-path hooks)/pre-commit" || exit 1 diff --git a/tools/build/configure.py b/tools/build/configure.py index 1a846fc726..17fdbe45a6 100755 --- a/tools/build/configure.py +++ b/tools/build/configure.py @@ -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 -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 = cflags_272.replace("-ggdb3", "-g1")