linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/2] f2fs_io: Fix out of tree builds
@ 2022-12-22  2:28 Khem Raj
  2022-12-22  2:28 ` [f2fs-dev] [PATCH 2/2] f2fs_io: Define _FILE_OFFSET_BITS=64 Khem Raj
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2022-12-22  2:28 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Khem Raj

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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 tools/f2fs_io/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/f2fs_io/Makefile.am b/tools/f2fs_io/Makefile.am
index 6c17db1..bc4f9d0 100644
--- a/tools/f2fs_io/Makefile.am
+++ b/tools/f2fs_io/Makefile.am
@@ -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
-- 
2.39.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [f2fs-dev] [PATCH 2/2] f2fs_io: Define _FILE_OFFSET_BITS=64
  2022-12-22  2:28 [f2fs-dev] [PATCH 1/2] f2fs_io: Fix out of tree builds Khem Raj
@ 2022-12-22  2:28 ` Khem Raj
  2022-12-23  0:14   ` Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2022-12-22  2:28 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: 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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 lib/libf2fs_io.c        | 4 +++-
 tools/f2fs_io/f2fs_io.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
index 1a8167d..abb43a3 100644
--- a/lib/libf2fs_io.c
+++ b/lib/libf2fs_io.c
@@ -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>
diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
index 6dcd840..cb99039 100644
--- a/tools/f2fs_io/f2fs_io.c
+++ b/tools/f2fs_io/f2fs_io.c
@@ -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
-- 
2.39.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH 2/2] f2fs_io: Define _FILE_OFFSET_BITS=64
  2022-12-22  2:28 ` [f2fs-dev] [PATCH 2/2] f2fs_io: Define _FILE_OFFSET_BITS=64 Khem Raj
@ 2022-12-23  0:14   ` Jaegeuk Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2022-12-23  0:14 UTC (permalink / raw)
  To: Khem Raj; +Cc: linux-f2fs-devel

On 12/21, Khem Raj wrote:
> 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
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  lib/libf2fs_io.c        | 4 +++-
>  tools/f2fs_io/f2fs_io.c | 4 ++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
> index 1a8167d..abb43a3 100644
> --- a/lib/libf2fs_io.c
> +++ b/lib/libf2fs_io.c
> @@ -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 */
      |        ^~~~~~~


>  
>  #include <stdio.h>
>  #include <stdlib.h>
> diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c
> index 6dcd840..cb99039 100644
> --- a/tools/f2fs_io/f2fs_io.c
> +++ b/tools/f2fs_io/f2fs_io.c
> @@ -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
> -- 
> 2.39.0
> 
> 
> 
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-23  0:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22  2:28 [f2fs-dev] [PATCH 1/2] f2fs_io: Fix out of tree builds Khem Raj
2022-12-22  2:28 ` [f2fs-dev] [PATCH 2/2] f2fs_io: Define _FILE_OFFSET_BITS=64 Khem Raj
2022-12-23  0:14   ` Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).