[libc-commits] [libc] [libc] Fix fixed point detection and add compile option. (PR #81788)
via libc-commits
libc-commits at lists.llvm.org
Wed Feb 14 12:57:45 PST 2024
https://github.com/lntue created https://github.com/llvm/llvm-project/pull/81788
None
>From 310bb5f5ad07464e167ad779bda3f1db7a8366e0 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue.h at gmail.com>
Date: Wed, 14 Feb 2024 20:56:29 +0000
Subject: [PATCH] [libc] Fix fixed point detection and add compile option.
---
libc/cmake/modules/LLVMLibCObjectRules.cmake | 4 ++++
libc/cmake/modules/compiler_features/check_fixed_point.cpp | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake
index ef1f24863f61ab..54c7e1eaed0bfd 100644
--- a/libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -49,6 +49,10 @@ function(_get_common_compile_options output_var flags)
list(APPEND compile_options "-ffreestanding")
endif()
+ if(LIBC_COMPILER_HAS_FIXED_POINT)
+ list(APPEND compile_options "-ffixed-point")
+ endif()
+
list(APPEND compile_options "-fno-builtin")
list(APPEND compile_options "-fno-exceptions")
list(APPEND compile_options "-fno-lax-vector-conversions")
diff --git a/libc/cmake/modules/compiler_features/check_fixed_point.cpp b/libc/cmake/modules/compiler_features/check_fixed_point.cpp
index 02932dbf4d722d..a5192697d43f77 100644
--- a/libc/cmake/modules/compiler_features/check_fixed_point.cpp
+++ b/libc/cmake/modules/compiler_features/check_fixed_point.cpp
@@ -1,4 +1,4 @@
-#include "include/llvm-libc-macross/stdfix_macros.h"
+#include "include/llvm-libc-macros/stdfix-macros.h"
#ifndef LIBC_COMPILER_HAS_FIXED_POINT
#error unsupported
More information about the libc-commits
mailing list