8 Star 0 Fork 17

src-openEuler/abseil-cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-add-loongarch-suopport-for-abseil-cpp.patch 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
zhangwenlong01 提交于 2024-03-07 06:10 . Fix build error for loongarch64
From 560380189ff29687e011eada93774af59452f2c5 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <[email protected]>
Date: Wed, 6 Mar 2024 03:28:59 +0000
Subject: [PATCH] add loongarch suopport for abseil-cpp
---
absl/base/internal/direct_mmap.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
index 1beb2ee..80fcbbb 100644
--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -80,7 +80,8 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
(defined(__PPC__) && !defined(__PPC64__)) || \
(defined(__riscv) && __riscv_xlen == 32) || \
(defined(__s390__) && !defined(__s390x__)) || \
- (defined(__sparc__) && !defined(__arch64__))
+ (defined(__sparc__) && !defined(__arch64__)) || \
+ defined(__loongarch64)
// On these architectures, implement mmap with mmap2.
static int pagesize = 0;
if (pagesize == 0) {
@@ -99,6 +100,10 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
// Workaround by invoking __mmap2() instead.
return __mmap2(start, length, prot, flags, fd,
static_cast<size_t>(offset / pagesize));
+#elif defined(__loongarch64)
+ return reinterpret_cast<void*>(
+ syscall(SYS_mmap, start, length, prot, flags, fd,
+ static_cast<unsigned long>(offset / pagesize))); // NOLINT
#else
return reinterpret_cast<void*>(
syscall(SYS_mmap2, start, length, prot, flags, fd,
--
2.43.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/abseil-cpp.git
[email protected]:src-openeuler/abseil-cpp.git
src-openeuler
abseil-cpp
abseil-cpp
master

搜索帮助