From 135812a35326a87f2618815cfd2c8018f43237d4 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 8 Jan 2023 10:36:13 +0000 Subject: [PATCH] rg99: Enable `-fipa-pta` From GCC documentation: > Perform interprocedural pointer analysis and interprocedural modification and reference analysis. > This option can cause excessive memory and compile-time usage on large compilation units. > It is not enabled by default at any optimization level. Also forces the CMake generation to `make` because `ninja` gets into an infinite loop for some reason on my laptop. --- CMake/platforms/rg99.cmake | 3 ++- Packaging/OpenDingux/build.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMake/platforms/rg99.cmake b/CMake/platforms/rg99.cmake index 450f8d464..6a31b5607 100644 --- a/CMake/platforms/rg99.cmake +++ b/CMake/platforms/rg99.cmake @@ -11,7 +11,8 @@ set(DEVILUTIONX_STATIC_CXX_STDLIB OFF) # -fmerge-all-constants saves ~4 KiB # -fsection-anchors saves ~4 KiB -set(_extra_flags "-fmerge-all-constants -fsection-anchors") +# -fipa-pta improves performance. +set(_extra_flags "-fmerge-all-constants -fsection-anchors -fipa-pta") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_extra_flags}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_extra_flags}") # -Wl,-z-stack-size: the default thread stack size for RG99 is 128 KiB, reduce it. diff --git a/Packaging/OpenDingux/build.sh b/Packaging/OpenDingux/build.sh index ad08758b4..e258f59a6 100755 --- a/Packaging/OpenDingux/build.sh +++ b/Packaging/OpenDingux/build.sh @@ -159,6 +159,7 @@ cmake_configure() { # libzt uses `-fstack-protector` GCC flag by default. # We disable `-fstack-protector` because it isn't supported by target libc. cmake -S. -B"$BUILD_DIR" \ + -G "Unix Makefiles" \ "-DTARGET_PLATFORM=$TARGET" \ -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}/usr/share/buildroot/toolchainfile.cmake" \ -DBUILD_TESTING=OFF \