[PATCH] D43106: [RISCV] Enable -fforce-enable-int128 through cmake flag COMPILER_RT_HAS_FINT128_FLAG
Mandeep Singh Grang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 23 11:09:12 PST 2018
mgrang added a comment.
In https://reviews.llvm.org/D43106#1017081, @kito-cheng wrote:
> Hi all:
>
> I propose it should check in the `foreach (arch ${BUILTIN_SUPPORTED_ARCH})`, because COMPILER_RT_DEFAULT_TARGET_ARCH is not always set (I only set COMPILER_RT_DEFAULT_TARGET_TRIPLE instead of COMPILER_RT_DEFAULT_TARGET_ARCH in my build).
>
> And that place seems more like right place to put target specific compilation flags.
>
> diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
> index 991108b..364a4f6 100644
> --- a/lib/builtins/CMakeLists.txt
> +++ b/lib/builtins/CMakeLists.txt
> @@ -546,6 +546,12 @@ else ()
> list(APPEND BUILTIN_CFLAGS -fomit-frame-pointer -DCOMPILER_RT_ARMHF_TARGET)
> endif()
>
> + # For RISC-V 32 bits, we must force enable int128 for compiling long
> + # double routines.
> + if("${arch}" STREQUAL "riscv32")
> + list(APPEND BUILTIN_CFLAGS -fforce-enable-int128)
> + endif()
> +
> add_compiler_rt_runtime(clang_rt.builtins
> STATIC
> ARCHS ${arch}
>
So, do we want to enable this flag only based on a CMake macro like COMPILER_RT_HAS_FINT128_FLAG, or always add -fforce-enable-int128 to compiler-rt builds for RISCV32?
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D43106
More information about the llvm-commits
mailing list