summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwuruilong <wuruilong@loongson.cn>2024-06-05 12:46:55 -0700
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2024-06-05 12:46:55 -0700
commit61d10fe0c355d089d2789e5d41d20de907708c2b (patch)
tree8c72bcb3e36f89c5424f5c2e497a14f484303a70
parent9f4c597d839ed9fa9d1a5ed7ea393a150fa9adf8 (diff)
Fix compile errors on loongarch (#12739)
Summary: Failed to compile when using cmake on loongarch architecture with the following error details:[https://buildd.debian.org/status/fetch.php?pkg=rocksdb&arch=loong64&ver=9.2.1-2&stamp= 1717362107&raw=0](url). The reason for the error is that loongarch does not support the mcpu option, refer to the link for details: [https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/LoongArch-Options.html](url) Pull Request resolved: https://github.com/facebook/rocksdb/pull/12739 Reviewed By: ltamasi Differential Revision: D58200695 Pulled By: ajkr fbshipit-source-id: 00e1a51e15defaa8983524cdd3fc25240833c08b
-rw-r--r--CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c09ea5fe6..5d9e65ba1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -267,8 +267,8 @@ endif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64")
CHECK_C_COMPILER_FLAG("-march=loongarch64" HAS_LOONGARCH64)
if(HAS_LOONGARCH64)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=loongarch64 -mtune=loongarch64")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=loongarch64 -mtune=loongarch64")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=loongarch64 -mtune=loongarch64")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=loongarch64 -mtune=loongarch64")
endif(HAS_LOONGARCH64)
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64")