diff mbox series

[7/9] strace: Add knob to enable largefile support

Message ID 20221221175551.1940464-7-raj.khem@gmail.com
State Accepted, archived
Commit 353e773ab8a072546ae236d1611bb6906b59486a
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>
---
 ...toconf-macro-to-detect-largefile-sup.patch | 27 ++++++++++++
 ...002-tests-Replace-off64_t-with-off_t.patch | 43 +++++++++++++++++++
 meta/recipes-devtools/strace/strace_6.0.bb    |  2 +
 3 files changed, 72 insertions(+)
 create mode 100644 meta/recipes-devtools/strace/strace/0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch
 create mode 100644 meta/recipes-devtools/strace/strace/0002-tests-Replace-off64_t-with-off_t.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/strace/strace/0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch b/meta/recipes-devtools/strace/strace/0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch
new file mode 100644
index 0000000000..76ca7a76a8
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch
@@ -0,0 +1,27 @@ 
+From 470399f3636c412b74f9daf6ae430b13c3126f02 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 15 Dec 2022 15:54:27 -0800
+Subject: [PATCH] configure: Use autoconf macro to detect largefile support
+
+Adds --enable-largefile/--disable-largefile configure knobs
+where default is to detect the support
+
+Upstream-Status: Submitted [https://github.com/strace/strace/pull/230]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 4797b42dd..7d57fb254 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -43,6 +43,8 @@ AC_PROG_INSTALL
+ AC_PROG_RANLIB
+ AC_PROG_LN_S
+ 
++AC_SYS_LARGEFILE
++
+ AC_USE_SYSTEM_EXTENSIONS
+ AX_CODE_COVERAGE
+ 
diff --git a/meta/recipes-devtools/strace/strace/0002-tests-Replace-off64_t-with-off_t.patch b/meta/recipes-devtools/strace/strace/0002-tests-Replace-off64_t-with-off_t.patch
new file mode 100644
index 0000000000..ce0428e977
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/0002-tests-Replace-off64_t-with-off_t.patch
@@ -0,0 +1,43 @@ 
+From 579b2ebe52d4b97f954e6188df2d07e137820075 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 15 Dec 2022 15:56:13 -0800
+Subject: [PATCH] tests: Replace off64_t with off_t
+
+when _FILE_OFFSET_BITS=64 then off_t is 64bit wide, this also fixes
+build on musl where off64_t is not available without _LARGEFILE64_SOURCE
+
+Upstream-Status: Submitted [https://github.com/strace/strace/pull/230]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/readahead.c        | 2 +-
+ tests/sync_file_range2.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/readahead.c b/tests/readahead.c
+index 10723785c..b9597e697 100644
+--- a/tests/readahead.c
++++ b/tests/readahead.c
+@@ -42,7 +42,7 @@ static const int fds[] = {
+ 	0x7fffffff,
+ };
+ 
+-static const off64_t offsets[] = {
++static const off_t offsets[] = {
+ 	-0x8000000000000000LL,
+ 	-0x5060708090a0b0c0LL,
+ 	-1LL,
+diff --git a/tests/sync_file_range2.c b/tests/sync_file_range2.c
+index 0f7c9e428..15a5fec71 100644
+--- a/tests/sync_file_range2.c
++++ b/tests/sync_file_range2.c
+@@ -20,8 +20,8 @@ int
+ main(void)
+ {
+ 	const int fd = -1;
+-	const off64_t offset = 0xdeadbeefbadc0ded;
+-	const off64_t nbytes = 0xfacefeedcafef00d;
++	const off_t offset = 0xdeadbeefbadc0ded;
++	const off_t nbytes = 0xfacefeedcafef00d;
+ 	const unsigned int flags = -1;
+ 
+ 	int rc = sync_file_range(fd, offset, nbytes, flags);
diff --git a/meta/recipes-devtools/strace/strace_6.0.bb b/meta/recipes-devtools/strace/strace_6.0.bb
index 4fa3589d15..7679235b01 100644
--- a/meta/recipes-devtools/strace/strace_6.0.bb
+++ b/meta/recipes-devtools/strace/strace_6.0.bb
@@ -13,6 +13,8 @@  SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
            file://ptest-spacesave.patch \
            file://0001-strace-fix-reproducibilty-issues.patch \
            file://skip-load.patch \
+           file://0001-configure-Use-autoconf-macro-to-detect-largefile-sup.patch \
+           file://0002-tests-Replace-off64_t-with-off_t.patch \
            "
 SRC_URI[sha256sum] = "92d720a666855e9f1c6a11512fd6e99674a82bbfe1442557815f2ce8e1293338"