Skip to contentSkip to conversation

f2fs_io: Fix out of tree builds

PATCH In review Khem Raj 2 participants 3 messages Dec 22, 2022 – Dec 23, 2022 Library code

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 f2fs_io: Fix out of tree builds

Relative path does not work when searching for include files when srcdir != builddir

---
 tools/f2fs_io/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/f2fs_io/Makefile.am +1 -1
index 6c17db1..bc4f9d0 100644
@@ -1,7 +1,7 @@
 ## Makefile.am
 
 if LINUX
-AM_CPPFLAGS = -I../../include
+AM_CPPFLAGS = -I$(top_srcdir)/include
 AM_CFLAGS = -Wall
 sbin_PROGRAMS = f2fs_io
 f2fs_io_SOURCES = f2fs_io.c
Signature · 8 lines
2.39.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
author
#1 lore raw

PATCH 2/2 f2fs_io: Define _FILE_OFFSET_BITS=64

Remove _LARGEFILE64_SOURCE, this is redundant when _FILE_OFFSET_BITS=64 additionally it fixes build with musl because the detection logic for lseek64 fails because when using _LARGEFILE64_SOURCE musl also define's lseek64 as an alias to lseek

---
 lib/libf2fs_io.c        | 4 +++-
 tools/f2fs_io/f2fs_io.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
lib/libf2fs_io.c +3 -1
index 1a8167d..abb43a3 100644
@@ -11,7 +11,9 @@
  *
  * Dual licensed under the GPL or LGPL version 2 licenses.
  */
-#define _LARGEFILE64_SOURCE
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
tools/f2fs_io/f2fs_io.c +2 -2
index 6dcd840..cb99039 100644
@@ -12,8 +12,8 @@
 #ifndef _LARGEFILE_SOURCE
 #define _LARGEFILE_SOURCE
 #endif
-#ifndef _LARGEFILE64_SOURCE
-#define _LARGEFILE64_SOURCE
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
 #endif
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
Signature · 8 lines
2.39.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
#2 lore raw

Re: [f2fs-dev] [PATCH 2/2] f2fs_io: Define _FILE_OFFSET_BITS=64

Quoted 16 lines · Khem Raj

Remove _LARGEFILE64_SOURCE, this is redundant when _FILE_OFFSET_BITS=64 additionally it fixes build with musl because the detection logic for lseek64 fails because when using _LARGEFILE64_SOURCE musl also define's lseek64 as an alias to lseek

---
 lib/libf2fs_io.c        | 4 +++-
 tools/f2fs_io/f2fs_io.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
lib/libf2fs_io.c +0 -0
index 1a8167d..abb43a3 100644

lib/libf2fs_io.c line 16

Quoted 7 lines
lib/libf2fs_io.c +3 -1
@@ -11,7 +11,9 @@
  *
  * Dual licensed under the GPL or LGPL version 2 licenses.
  */
-#define _LARGEFILE64_SOURCE
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif

This fails to build in x86_64/gcc.

libf2fs_io.c:87:8: error: unknown type name 'off64_t'
87 | static off64_t *dcache_blk; /* which block it cached */

      |        ^~~~~~~
Quoted 27 lines
lib/libf2fs_io.c +0 -0
 #include <stdio.h>
 #include <stdlib.h>
tools/f2fs_io/f2fs_io.c +2 -2
index 6dcd840..cb99039 100644
@@ -12,8 +12,8 @@
 #ifndef _LARGEFILE_SOURCE
 #define _LARGEFILE_SOURCE
 #endif
-#ifndef _LARGEFILE64_SOURCE
-#define _LARGEFILE64_SOURCE
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
 #endif
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
Signature · 8 lines
2.39.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel