Projects
Eulaceura:Mainline
abseil-cpp
_service:obs_scm:0001-add-loongarch-suopport-fo...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0001-add-loongarch-suopport-for-abseil-cpp.patch of Package abseil-cpp
From 560380189ff29687e011eada93774af59452f2c5 Mon Sep 17 00:00:00 2001 From: Wenlong Zhang <zhangwenlong@loongson.cn> 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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2