1# SPDX-License-Identifier: Apache-2.0 2 3if(CONFIG_X86_64) 4 string(PREPEND CMAKE_ASM_FLAGS "-m64 ") 5 string(PREPEND CMAKE_C_FLAGS "-m64 ") 6 string(PREPEND CMAKE_CXX_FLAGS "-m64 ") 7else() 8 string(PREPEND CMAKE_ASM_FLAGS "-m32 ") 9 string(PREPEND CMAKE_C_FLAGS "-m32 ") 10 string(PREPEND CMAKE_CXX_FLAGS "-m32 ") 11 12 if(CONFIG_X86_FP_USE_SOFT_FLOAT) 13 list(APPEND TOOLCHAIN_C_FLAGS -msoft-float) 14 list(APPEND TOOLCHAIN_LD_FLAGS -msoft-float) 15 endif() 16endif() 17 18# GNU Assembler, by default on non-Linux targets, treats slashes as 19# start of comments on i386. 20# (https://sourceware.org/binutils/docs-2.33.1/as/i386_002dChars.html#i386_002dChars) 21# In order to use division, `--divide` needs to be passed to 22# the assembler. 23list(APPEND TOOLCHAIN_C_FLAGS -Wa,--divide) 24