All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Milan P. Stanić" <mps@arvanta.net>
To: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@infradead.org>, io-uring@vger.kernel.org
Subject: Re: Build 0.6 version fail on musl libc
Date: Wed, 29 Apr 2020 21:33:15 +0200	[thread overview]
Message-ID: <20200429193315.GA31807@arya.arvanta.net> (raw)
In-Reply-To: <6528f839-274d-9d46-dea6-b20a90ac8cf8@kernel.dk>

[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]

On Wed, 2020-04-29 at 10:14, Jens Axboe wrote:
> On 4/29/20 9:29 AM, Jens Axboe wrote:
> > On 4/29/20 9:26 AM, Christoph Hellwig wrote:
> >> On Wed, Apr 29, 2020 at 09:24:40AM -0600, Jens Axboe wrote:
> >>>
> >>> Not sure what the best fix is there, for 32-bit, your change will truncate
> >>> the offset to 32-bit as off_t is only 4 bytes there. At least that's the
> >>> case for me, maybe musl is different if it just has a nasty define for
> >>> them.
> >>>
> >>> Maybe best to just make them uint64_t or something like that.
> >>
> >> The proper LFS type would be off64_t.
> > 
> > Is it available anywhere? Because I don't have it.
> 
> There seems to be better luck with __off64_t, but I don't even know
> how widespread that is... Going to give it a go, we'll see.

AFAIK, __off64_t is glibc specific, defined in /usr/include/fcntl.h:
------
# ifndef __USE_FILE_OFFSET64
typedef __off_t off_t;
# else
typedef __off64_t off_t;
# endif
------

So, this will not work on musl based Linux system, git commit id
b5096098c62adb19dbf4a39b480909766c9026e7 should be reverted. But you
know better what to do.

I come with another quick and dirty patch attached to this mail but
again  I think it is not proper solution, just playing to find (maybe)
'good enough' workaround.

Thanks
-- 
regards

[-- Attachment #2: liburing-offt-fix.diff --]
[-- Type: text/x-diff, Size: 675 bytes --]

diff --git a/configure b/configure
index 30b0a5a..8299597 100755
--- a/configure
+++ b/configure
@@ -301,6 +301,9 @@ EOF
 fi
 if test "$__kernel_timespec" != "yes"; then
 cat >> $compat_h << EOF
+#include <stdint.h>
+#define int64_t uint64_t
+
 struct __kernel_timespec {
 	int64_t		tv_sec;
 	long long	tv_nsec;
diff --git a/src/include/liburing.h b/src/include/liburing.h
index ae5542c..24c24a2 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -14,7 +14,9 @@ extern "C" {
 #include "liburing/compat.h"
 #include "liburing/io_uring.h"
 #include "liburing/barrier.h"
+#include <sys/stat.h>
 
+#define loff_t off_t
 /*
  * Library interface to io_uring
  */

  reply	other threads:[~2020-04-29 19:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 19:29 Build 0.6 version fail on musl libc Milan P. Stanić
2020-04-29 15:24 ` Jens Axboe
2020-04-29 15:26   ` Christoph Hellwig
2020-04-29 15:29     ` Jens Axboe
2020-04-29 16:14       ` Jens Axboe
2020-04-29 19:33         ` Milan P. Stanić [this message]
2020-04-29 19:38           ` Jens Axboe
2020-04-29 20:01             ` Milan P. Stanić
2020-04-29 20:08               ` Jens Axboe
2020-04-29 20:38                 ` Milan P. Stanić
2020-04-29 20:43                   ` Jens Axboe
2020-04-29 20:48                     ` Milan P. Stanić
2020-04-30 14:38                     ` Milan P. Stanić
2020-04-30 14:47                       ` Jens Axboe
2020-04-30 15:56                         ` Milan P. Stanić
2020-04-29 19:36         ` Jann Horn
2020-04-29 19:38           ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200429193315.GA31807@arya.arvanta.net \
    --to=mps@arvanta.net \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.