Skip to contentSkip to conversation

gcompat: Add fcntl64 wrapper

PATCH New Khem Raj 1 participant 2 messages Oct 14, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 gcompat: Add fcntl64 wrapper

Needed by pvr mesa drivers

---
 .../gcompat/0001-Add-fcntl64-wrapper.patch    | 44 +++++++++++++++++++
 meta/recipes-core/musl/gcompat_git.bb         |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta/recipes-core/musl/gcompat/0001-Add-fcntl64-wrapper.patch
meta/recipes-core/musl/gcompat/0001-Add-fcntl64-wrapper.patch new file +44 -0
new file mode 100644
index 00000000000..3f265e273a9
@@ -0,0 +1,44 @@
+From 37f70f54c74c4ceeb089cbee88311ba00638f211 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 13 Oct 2023 21:02:23 -0700
+Subject: [PATCH] Add fcntl64 wrapper
+
+fixes loadtime errors with pvr precompiled driver for visionfive2
+
+load libpvr_dri_support.so: Error relocating /usr/lib/libpvr_dri_support.so: fcntl64: symbol not found
+
+Upstream-Status: Submitted [https://git.adelielinux.org/adelie/gcompat/-/merge_requests/28]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ libgcompat/unistd.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/libgcompat/unistd.c b/libgcompat/unistd.c
+index 011fba2..400abf3 100644
+--- a/libgcompat/unistd.c
++++ b/libgcompat/unistd.c
+@@ -1,6 +1,7 @@
+ #include <assert.h> /* assert */
+ #include <fcntl.h>  /* O_CREAT */
+ #include <limits.h> /* NGROUPS_MAX */
++#include <stdarg.h> /* va_list, va_start, va_end */
+ #include <stddef.h> /* NULL, size_t */
+ #include <unistd.h> /* confstr, getcwd, getgroups, ... */
+ #include <errno.h>  /* ENOSYS, ENOMEM */
+@@ -250,3 +251,13 @@ int __close(int fd)
+ {
+ 	return close(fd);
+ }
++
++int fcntl64 (int fd, int cmd, ...)
++{
++  int ret;
++  va_list ap;
++  va_start(ap, cmd);
++  ret = fcntl(fd, cmd, ap);
++  va_end(ap);
++  return ret;
++}
+-- 
+2.42.0
+
meta/recipes-core/musl/gcompat_git.bb +1 -0
index ba802e3caaa..3e5541ba91e 100644
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=eb33ef4af05a9c7602843afb7adfe792"
 
 SRC_URI = "git://git.adelielinux.org/adelie/gcompat.git;protocol=https;branch=current \
            file://0001-auxv-new-module.patch \
+           file://0001-Add-fcntl64-wrapper.patch \
            "
 SRC_URI:append:powerpc = "\
            file://0001-make-Static-PIE-does-not-work-on-musl-ppc.patch \
Signature · 1 line
2.42.0
author
#1 lore raw

PATCH 2/2 gcompat: Upgrade to 1.1.0 release

License-Update: Updated copyright years and contibutors [1]

Brings following changes
* b7bfe0b Update documentation for 1.1 release
* f0de9c6 CHANGELOG: Add pthread section
* 36f21a6 pthread: add pthread_mutexattr_[get|set]kind_np
* f23fb58 stdio: Hook fopen(3) to intercept /proc/self/exe
* 158f2b5 Update CHANGELOG for 1.1
* 4a4c840 fix path-searching for execvp
* 9dbbddc sysctl: Add __getauxval alias
* fbdd06c misc: add __libc_single_threaded
* f727ab7 locale: also override __newlocale/__duplocale
* 244110e random_r: fix null dereference when passed uninitialized buf

[1] https://git.adelielinux.org/adelie/gcompat/-/commit/b7bfe0b08c52fdc72e0c1d9d4dcb2129f1642bd6#0398ccd0f49298b10a3d76a47800d2ebecd49859

---
 .../musl/gcompat/0001-auxv-new-module.patch   | 59 -------------------
 meta/recipes-core/musl/gcompat_git.bb         |  7 +--
 2 files changed, 3 insertions(+), 63 deletions(-)
 delete mode 100644 meta/recipes-core/musl/gcompat/0001-auxv-new-module.patch
meta/recipes-core/musl/gcompat/0001-auxv-new-module.patch deleted +0 -59
deleted file mode 100644
index ee292f38416..00000000000
@@ -1,59 +0,0 @@
-From aecd42801904462501a890d173648e4e826eda19 Mon Sep 17 00:00:00 2001
-From: "A. Wilcox" <[email protected]>
-Date: Sat, 23 Oct 2021 23:29:40 -0500
-Subject: [PATCH] auxv: new module
-
-Adds `__getauxval` wrapper, needed for Parallels Tools GUI installer.
-
-Upstream-Status: Submitted [https://git.adelielinux.org/adelie/gcompat/-/commit/e860a38a88c7ea148ee15976136a1f83ea13f8e0]
-Signed-off-by: Khem Raj <[email protected]>
----
- CHANGELOG.rst     | 5 +++++
- Makefile          | 1 +
- libgcompat/auxv.c | 6 ++++++
- 3 files changed, 12 insertions(+)
- create mode 100644 libgcompat/auxv.c
-
-diff --git a/CHANGELOG.rst b/CHANGELOG.rst
-index ce6859b..c3a9cee 100644
---- a/CHANGELOG.rst
-+++ b/CHANGELOG.rst
-@@ -11,6 +11,11 @@
- 1.1 (202?-??-??)
- ================
- 
-+auxv
-+----
-+
-+* Add __getauxval wrapper for getauxval.
-+
- locale
- ------
- 
-diff --git a/Makefile b/Makefile
-index cbb7634..1893cc1 100644
---- a/Makefile
-+++ b/Makefile
-@@ -2,6 +2,7 @@ LIBGCOMPAT_INCLUDE = \
- 	libgcompat/alias.h \
- 	libgcompat/internal.h
- LIBGCOMPAT_SRC = \
-+	libgcompat/auxv.c		\
- 	libgcompat/ctype.c		\
- 	libgcompat/cxx_thread.c		\
- 	libgcompat/dlfcn.c		\
-diff --git a/libgcompat/auxv.c b/libgcompat/auxv.c
-new file mode 100644
-index 0000000..01de376
---- /dev/null
-+++ b/libgcompat/auxv.c
-@@ -0,0 +1,6 @@
-+#include <sys/auxv.h> /* getauxval */
-+
-+unsigned long __getauxval(unsigned long value)
-+{
-+	return getauxval(value);
-+}
--- 
-2.37.3
-
meta/recipes-core/musl/gcompat_git.bb +3 -4
index 3e5541ba91e..40fe8c6a5f5 100644
@@ -5,17 +5,16 @@ SUMMARY = "A library which provides glibc-compatible APIs for use on musl libc s
 HOMEPAGE = "https://git.adelielinux.org/adelie/gcompat"
 
 LICENSE = "NCSA"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=eb33ef4af05a9c7602843afb7adfe792"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=802b1aed7330d90086be4de63a3188e3"
 
 SRC_URI = "git://git.adelielinux.org/adelie/gcompat.git;protocol=https;branch=current \
-           file://0001-auxv-new-module.patch \
            file://0001-Add-fcntl64-wrapper.patch \
            "
 SRC_URI:append:powerpc = "\
            file://0001-make-Static-PIE-does-not-work-on-musl-ppc.patch \
            "
-PV = "1.0.0+1.1+git"
-SRCREV = "c6921a1aa454bb87671f9bd1ecfe47d80d1620aa"
+PV = "1.1.0"
+SRCREV = "b7bfe0b08c52fdc72e0c1d9d4dcb2129f1642bd6"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.42.0