|
| 1 | +# Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD) |
| 2 | +# Copyright (c) 2023 Alp Sayin <[email protected]> |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +list(APPEND TOOLCHAIN_C_FLAGS -mcpu=${CONFIG_CPU_VERSION}) |
| 8 | + |
| 9 | +if(DEFINED CONFIG_DATA_IS_TEXT_RELATIVE) |
| 10 | + list(APPEND TOOLCHAIN_C_FLAGS -mpic-data-is-text-relative) |
| 11 | +endif() |
| 12 | + |
| 13 | +if(DEFINED CONFIG_USE_BARREL_SHIFT_INSTR) |
| 14 | + list(APPEND TOOLCHAIN_C_FLAGS -mxl-barrel-shift) |
| 15 | +endif() |
| 16 | + |
| 17 | +if(DEFINED CONFIG_USE_MUL_INSTR) |
| 18 | + list(APPEND TOOLCHAIN_C_FLAGS -mno-xl-soft-mul) |
| 19 | +else() |
| 20 | + list(APPEND TOOLCHAIN_C_FLAGS -mxl-soft-mul) |
| 21 | +endif() |
| 22 | + |
| 23 | +if(NOT DEFINED CONFIG_USE_PATTERN_COMPARE_INSTR) |
| 24 | + list(APPEND TOOLCHAIN_C_FLAGS -mxl-pattern-compare) |
| 25 | +endif() |
| 26 | + |
| 27 | +if(DEFINED CONFIG_USE_MULHI_INSTR) |
| 28 | + list(APPEND TOOLCHAIN_C_FLAGS -mxl-multiply-high) |
| 29 | +endif() |
| 30 | + |
| 31 | +if(DEFINED CONFIG_USE_DIV_INSTR) |
| 32 | + list(APPEND TOOLCHAIN_C_FLAGS -mno-xl-soft-div) |
| 33 | +else() |
| 34 | + list(APPEND TOOLCHAIN_C_FLAGS -mxl-soft-div) |
| 35 | +endif() |
| 36 | + |
| 37 | +if(DEFINED CONFIG_USE_HARDWARE_FLOAT_INSTR) |
| 38 | + list(APPEND TOOLCHAIN_C_FLAGS -mhard-float) |
| 39 | +else() |
| 40 | + list(APPEND TOOLCHAIN_C_FLAGS -msoft-float) |
| 41 | +endif() |
| 42 | + |
| 43 | + |
| 44 | +# Common options |
| 45 | +list(APPEND TOOLCHAIN_C_FLAGS -fdollars-in-identifiers) |
| 46 | +# TODO: Remove this when gcc microblaze variant oddity is fixed |
| 47 | +list(APPEND TOOLCHAIN_C_FLAGS -mlittle-endian) |
| 48 | +list(APPEND TOOLCHAIN_LD_FLAGS -mlittle-endian) |
| 49 | + |
| 50 | +# string(REPLACE ";" "\n " str "${TOOLCHAIN_C_FLAGS}") |
| 51 | +# message(STATUS "Final set of C Flags: ${str}") |
0 commit comments