mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-10 16:40:03 +00:00
liburing: Use libc mmap() wrapper instead of calling __NR_mmap syscall directly
Fixes build on arm and rv32 Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com>
This commit is contained in:
+59
@@ -0,0 +1,59 @@
|
|||||||
|
From cb350a8989adbd65db574325d9a86d5437d800da Mon Sep 17 00:00:00 2001
|
||||||
|
From: Guillem Jover <guillem@hadrons.org>
|
||||||
|
Date: Mon, 13 Sep 2021 23:56:08 +0200
|
||||||
|
Subject: [PATCH] test: Use syscall wrappers instead of using syscall(2) directly
|
||||||
|
|
||||||
|
Some of these syscalls have different entry points depending on the
|
||||||
|
architecture. Use the wrappers to avoid having to reimplement them
|
||||||
|
portably.
|
||||||
|
|
||||||
|
Fixes build failures on Debian armel and armhf builds.
|
||||||
|
|
||||||
|
Upstream-Status: Backport [https://github.com/kraj/liburing/commit/cb350a8989adbd65db574325d9a86d5437d800da]
|
||||||
|
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
||||||
|
---
|
||||||
|
test/sqpoll-cancel-hang.c | 7 ++-----
|
||||||
|
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/test/sqpoll-cancel-hang.c b/test/sqpoll-cancel-hang.c
|
||||||
|
index c9032c8..e561478 100644
|
||||||
|
--- a/test/sqpoll-cancel-hang.c
|
||||||
|
+++ b/test/sqpoll-cancel-hang.c
|
||||||
|
@@ -4,7 +4,6 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
-#include <sys/syscall.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
@@ -29,8 +28,6 @@ static uint64_t current_time_ms(void)
|
||||||
|
|
||||||
|
#define IORING_OFF_SQES 0x10000000ULL
|
||||||
|
|
||||||
|
-#define sys_io_uring_setup 425
|
||||||
|
-
|
||||||
|
static void kill_and_wait(int pid, int* status)
|
||||||
|
{
|
||||||
|
kill(-pid, SIGKILL);
|
||||||
|
@@ -53,7 +50,7 @@ a5)
|
||||||
|
void* vma2 = (void*)a3;
|
||||||
|
void** ring_ptr_out = (void**)a4;
|
||||||
|
void** sqes_ptr_out = (void**)a5;
|
||||||
|
- uint32_t fd_io_uring = syscall(sys_io_uring_setup, entries, setup_params);
|
||||||
|
+ uint32_t fd_io_uring = __sys_io_uring_setup(entries, setup_params);
|
||||||
|
uint32_t sq_ring_sz = setup_params->sq_off.array +
|
||||||
|
setup_params->sq_entries * sizeof(uint32_t);
|
||||||
|
uint32_t cq_ring_sz = setup_params->cq_off.cqes +
|
||||||
|
@@ -135,7 +132,7 @@ void trigger_bug(void)
|
||||||
|
}
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
- syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
|
||||||
|
+ mmap((void *)0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
|
||||||
|
int pid = fork();
|
||||||
|
if (pid < 0)
|
||||||
|
exit(1);
|
||||||
|
--
|
||||||
|
2.33.1
|
||||||
|
|
||||||
@@ -9,7 +9,9 @@ SECTION = "libs"
|
|||||||
LICENSE = "LGPLv2.1 | MIT"
|
LICENSE = "LGPLv2.1 | MIT"
|
||||||
LIC_FILES_CHKSUM = "file://README;beginline=41;endline=44;md5=d51b5805e2a675685e6a66ca50904cf9"
|
LIC_FILES_CHKSUM = "file://README;beginline=41;endline=44;md5=d51b5805e2a675685e6a66ca50904cf9"
|
||||||
|
|
||||||
SRC_URI = "git://github.com/axboe/liburing.git;branch=master;protocol=https"
|
SRC_URI = "git://github.com/axboe/liburing.git;branch=master;protocol=https \
|
||||||
|
file://0001-test-Use-syscall-wrappers-instead-of-using-syscall-2.patch \
|
||||||
|
"
|
||||||
SRC_URI:append:libc-musl:riscv64 = " file://0001-do-not-build-examples.patch "
|
SRC_URI:append:libc-musl:riscv64 = " file://0001-do-not-build-examples.patch "
|
||||||
SRC_URI:append:libc-musl:riscv32 = " file://0001-do-not-build-examples.patch "
|
SRC_URI:append:libc-musl:riscv32 = " file://0001-do-not-build-examples.patch "
|
||||||
SRCREV = "41a61c97c2e3df4475c93fdf5026d575ce3f1377"
|
SRCREV = "41a61c97c2e3df4475c93fdf5026d575ce3f1377"
|
||||||
|
|||||||
Reference in New Issue
Block a user