diff mbox series

[6/9] lttng-tools: Fix build with largefile support

Message ID 20221221175551.1940464-6-raj.khem@gmail.com
State Accepted, archived
Commit ec0bfa21e2bae82b0218f75c0010be64dcdd99d4
Headers show
Series [1/9] libbsd: Fix build with largefile support | expand

Commit Message

Khem Raj Dec. 21, 2022, 5:55 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...pat-Define-off64_t-as-off_t-on-linux.patch | 35 +++++++++++++++++++
 .../lttng/lttng-tools_2.13.8.bb               |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch
diff mbox series

Patch

diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch
new file mode 100644
index 0000000000..e3d421f730
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/0001-compat-Define-off64_t-as-off_t-on-linux.patch
@@ -0,0 +1,35 @@ 
+From cc3e1abaa1e7ad85c6a299fe30a36e0cb732e1c8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 15 Dec 2022 14:51:20 -0800
+Subject: [PATCH] compat: Define off64_t as off_t on linux
+
+This helps compile with latest musl, where off64_t is not defined
+unless _LARGEFILE64_SOURCE is defined, on glibc _LARGEFILE64_SOURCE is
+defined if _GNU_SOURCE is defined, so the problem is only seen with musl
+
+Upstream-Status: Submitted [https://github.com/lttng/lttng-tools/pull/164]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/common/compat/fcntl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/common/compat/fcntl.h b/src/common/compat/fcntl.h
+index 5e566e50..d19a6ece 100644
+--- a/src/common/compat/fcntl.h
++++ b/src/common/compat/fcntl.h
+@@ -7,7 +7,6 @@
+ 
+ #ifndef _COMPAT_FCNTL_H
+ #define _COMPAT_FCNTL_H
+-
+ #include <fcntl.h>
+ #include <sys/types.h>
+ 
+@@ -22,6 +21,7 @@ typedef off64_t loff_t;
+ #endif
+ 
+ #ifdef __linux__
++typedef off_t off64_t;
+ extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes,
+ 		unsigned int flags);
+ #define lttng_sync_file_range(fd, offset, nbytes, flags) \
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb b/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb
index a814eb79f9..e64eeba635 100644
--- a/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.13.8.bb
@@ -37,6 +37,7 @@  SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
            file://lttng-sessiond.service \
            file://determinism.patch \
            file://disable-tests.patch \
+           file://0001-compat-Define-off64_t-as-off_t-on-linux.patch \
            "
 
 SRC_URI[sha256sum] = "b1e959579b260790930b20f3c7aa7cefb8a40e0de80d4a777c2bf78c6b353dc1"