mirror of
https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
synced 2024-12-28 04:23:38 +01:00
meta: enable LTO
Also set -Wa,--dsp also on C files because the fxSDK sets it globally and LTO complains if -Wa/-Xassembler options are not uniform across all compilation units.
This commit is contained in:
parent
d6f709f36e
commit
6b0ea3f33e
1 changed files with 10 additions and 1 deletions
|
@ -23,6 +23,7 @@ endif()
|
|||
if(FXLIBC_TARGET STREQUAL gint)
|
||||
list(APPEND TARGET_FOLDERS sh-generic)
|
||||
set(FXLIBC_ARCH sh)
|
||||
set(FXLIBC_LTO 1)
|
||||
add_definitions(-D__SUPPORT_GINT)
|
||||
|
||||
# Default to fxSDK install path
|
||||
|
@ -58,11 +59,19 @@ add_compile_options(-Wall -Wextra -std=c11 -ffreestanding -Os)
|
|||
if(FXLIBC_PIC)
|
||||
add_compile_options(-fpic)
|
||||
endif()
|
||||
if(FXLIBC_LTO)
|
||||
add_compile_options(-flto)
|
||||
# Generate the archive with gcc-ar instead of ar as it will load the LTO
|
||||
# plugin which is required to generate a usable archive.
|
||||
set(CMAKE_C_ARCHIVE_CREATE "${CMAKE_C_COMPILER_AR} qcs <TARGET> <OBJECTS>")
|
||||
# Also the ranlib rule (useless because ar is passed the s flag anyway)
|
||||
set(CMAKE_C_ARCHIVE_FINISH "${CMAKE_C_COMPILER_RANLIB} <TARGET>")
|
||||
endif()
|
||||
|
||||
if(FXLIBC_ARCH STREQUAL sh)
|
||||
add_compile_options(
|
||||
"$<$<COMPILE_LANGUAGE:C>:-m3;-mb>"
|
||||
"$<$<COMPILE_LANGUAGE:ASM>:-m4-nofpu;-mb;-Wa,--dsp>")
|
||||
"$<$<COMPILE_LANGUAGE:ASM>:-m4-nofpu;-mb>" -Wa,--dsp)
|
||||
endif()
|
||||
|
||||
# Building
|
||||
|
|
Loading…
Reference in a new issue