pmaports/cross/gcc-armv7/0017-dlang-fix-fcntl-on-mips-add-libucontext-dep.patch
Newbyte 5024719ca9
cross/gcc-*: upgrade to 11.2.1_git20211125 (MR 2706)
Upstream commit: c29fc97653

[ci:skip-build]: already built successfully in CI
2021-11-25 22:01:17 +01:00

51 lines
1.6 KiB
Diff

From 1c64f83b19fce8cf0bacff9e1ee3232513d2ef9e Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Fri, 21 Aug 2020 06:58:22 +0000
Subject: [PATCH] dlang: fix fcntl on mips, add libucontext dep
---
libphobos/configure.tgt | 1 +
libphobos/libdruntime/core/sys/posix/fcntl.d | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt
index 88c027d0c28..48ef12aaa5e 100644
--- a/libphobos/configure.tgt
+++ b/libphobos/configure.tgt
@@ -38,6 +38,7 @@ case "${target}" in
;;
mips*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
+ LIBDRUNTIME_NEEDS_UCONTEXT=yes
;;
power*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
diff --git a/libphobos/libdruntime/core/sys/posix/fcntl.d b/libphobos/libdruntime/core/sys/posix/fcntl.d
index 59df921ba41..9ee9f943948 100644
--- a/libphobos/libdruntime/core/sys/posix/fcntl.d
+++ b/libphobos/libdruntime/core/sys/posix/fcntl.d
@@ -871,6 +871,21 @@ else version (CRuntime_Musl)
F_SETLKW = 7,
}
}
+ else version (MIPS_Any)
+ {
+ enum
+ {
+ O_DIRECTORY = 0x010000, // octal 0200000
+ O_NOFOLLOW = 0x020000, // octal 0400000
+ O_DIRECT = 0x008000, // octal 0100000
+ O_LARGEFILE = 0x002000, // octal 0020000
+ O_TMPFILE = 0x410000, // octal 020200000
+
+ F_GETLK = 33,
+ F_SETLK = 34,
+ F_SETLKW = 35,
+ }
+ }
else
static assert(0, "Platform not supported");
--
2.33.1