linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix cross-compilation issue with randbytes
@ 2023-09-26  7:14 Krzesimir Nowak
  2023-09-26  7:14 ` [PATCH 1/1] libfrog: " Krzesimir Nowak
  0 siblings, 1 reply; 6+ messages in thread
From: Krzesimir Nowak @ 2023-09-26  7:14 UTC (permalink / raw)
  To: linux-xfs; +Cc: Krzesimir Nowak

Hi,

I hope this is the right place to send the xfsprogs patches - the
documentation about contributing is rather scarce.

This is a patch that we carry in Flatcar in order to make xfsprogs
buildable.

I think that the issue with cross-compilation is here since
d8a19f2986c0f65c5ed02110192f3fd5f86e2b32.

Krzesimir Nowak (1):
  libfrog: Fix cross-compilation issue with randbytes

 libfrog/randbytes.c | 1 -
 libfrog/randbytes.h | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

-- 
2.25.1


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

* [PATCH 1/1] libfrog: Fix cross-compilation issue with randbytes
  2023-09-26  7:14 [PATCH 0/1] Fix cross-compilation issue with randbytes Krzesimir Nowak
@ 2023-09-26  7:14 ` Krzesimir Nowak
  2023-09-26 14:41   ` Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Krzesimir Nowak @ 2023-09-26  7:14 UTC (permalink / raw)
  To: linux-xfs; +Cc: Krzesimir Nowak

randbytes.c was mostly split off from crc32.c and, like crc32.c, is
used for selftests, which are run on the build host. As such it should
not include platform_defs.h which in turn includes urcu.h from
userspace-rcu library, because the build host might not have the
library installed.

Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
---
 libfrog/randbytes.c | 1 -
 libfrog/randbytes.h | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libfrog/randbytes.c b/libfrog/randbytes.c
index f22da0d3..2023b601 100644
--- a/libfrog/randbytes.c
+++ b/libfrog/randbytes.c
@@ -6,7 +6,6 @@
  *
  * This is the buffer of random bytes used for self tests.
  */
-#include "platform_defs.h"
 #include "libfrog/randbytes.h"
 
 /* 4096 random bytes */
diff --git a/libfrog/randbytes.h b/libfrog/randbytes.h
index 00fd7c4c..fddea9c7 100644
--- a/libfrog/randbytes.h
+++ b/libfrog/randbytes.h
@@ -6,6 +6,8 @@
 #ifndef __LIBFROG_RANDBYTES_H__
 #define __LIBFROG_RANDBYTES_H__
 
+#include <stdint.h>
+
 extern uint8_t randbytes_test_buf[];
 
 #endif /* __LIBFROG_RANDBYTES_H__ */
-- 
2.25.1


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

* Re: [PATCH 1/1] libfrog: Fix cross-compilation issue with randbytes
  2023-09-26  7:14 ` [PATCH 1/1] libfrog: " Krzesimir Nowak
@ 2023-09-26 14:41   ` Darrick J. Wong
  2023-09-26 21:28     ` Dave Chinner
  2023-10-03 11:15     ` Carlos Maiolino
  0 siblings, 2 replies; 6+ messages in thread
From: Darrick J. Wong @ 2023-09-26 14:41 UTC (permalink / raw)
  To: Krzesimir Nowak, Carlos Maiolino; +Cc: linux-xfs, Krzesimir Nowak

On Tue, Sep 26, 2023 at 09:14:32AM +0200, Krzesimir Nowak wrote:
> randbytes.c was mostly split off from crc32.c and, like crc32.c, is
> used for selftests, which are run on the build host. As such it should
> not include platform_defs.h which in turn includes urcu.h from
> userspace-rcu library, because the build host might not have the
> library installed.

Why not get rid of the build host crc32c selftest?  It's not that useful
for cross-compiling and nowadays mkfs.xfs and xfs_repair have their own
builtin selftests.  Anyone messing with xfsprogs should be running
fstests (in addition to the maintainers) so I don't really see the point
of running crc32cselftest on the *build* host.

(Carlos: any thoughts on this?)

--D

> Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
> ---
>  libfrog/randbytes.c | 1 -
>  libfrog/randbytes.h | 2 ++
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libfrog/randbytes.c b/libfrog/randbytes.c
> index f22da0d3..2023b601 100644
> --- a/libfrog/randbytes.c
> +++ b/libfrog/randbytes.c
> @@ -6,7 +6,6 @@
>   *
>   * This is the buffer of random bytes used for self tests.
>   */
> -#include "platform_defs.h"
>  #include "libfrog/randbytes.h"
>  
>  /* 4096 random bytes */
> diff --git a/libfrog/randbytes.h b/libfrog/randbytes.h
> index 00fd7c4c..fddea9c7 100644
> --- a/libfrog/randbytes.h
> +++ b/libfrog/randbytes.h
> @@ -6,6 +6,8 @@
>  #ifndef __LIBFROG_RANDBYTES_H__
>  #define __LIBFROG_RANDBYTES_H__
>  
> +#include <stdint.h>
> +
>  extern uint8_t randbytes_test_buf[];
>  
>  #endif /* __LIBFROG_RANDBYTES_H__ */
> -- 
> 2.25.1
> 

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

* Re: [PATCH 1/1] libfrog: Fix cross-compilation issue with randbytes
  2023-09-26 14:41   ` Darrick J. Wong
@ 2023-09-26 21:28     ` Dave Chinner
  2023-10-03 11:15     ` Carlos Maiolino
  1 sibling, 0 replies; 6+ messages in thread
From: Dave Chinner @ 2023-09-26 21:28 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: Krzesimir Nowak, Carlos Maiolino, linux-xfs, Krzesimir Nowak

On Tue, Sep 26, 2023 at 07:41:00AM -0700, Darrick J. Wong wrote:
> On Tue, Sep 26, 2023 at 09:14:32AM +0200, Krzesimir Nowak wrote:
> > randbytes.c was mostly split off from crc32.c and, like crc32.c, is
> > used for selftests, which are run on the build host. As such it should
> > not include platform_defs.h which in turn includes urcu.h from
> > userspace-rcu library, because the build host might not have the
> > library installed.
> 
> Why not get rid of the build host crc32c selftest?  It's not that useful
> for cross-compiling and nowadays mkfs.xfs and xfs_repair have their own
> builtin selftests.  Anyone messing with xfsprogs should be running
> fstests (in addition to the maintainers) so I don't really see the point
> of running crc32cselftest on the *build* host.

Agreed. Running the test on the build-host served a purpose a decade
ago when we first added crc support to the on-disk format. I don't
think it is necessary to do this anymore...

-Dave.
-- 
Dave Chinner
david@fromorbit.com

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

* Re: [PATCH 1/1] libfrog: Fix cross-compilation issue with randbytes
  2023-09-26 14:41   ` Darrick J. Wong
  2023-09-26 21:28     ` Dave Chinner
@ 2023-10-03 11:15     ` Carlos Maiolino
  2023-10-11 11:34       ` Krzesimir Nowak
  1 sibling, 1 reply; 6+ messages in thread
From: Carlos Maiolino @ 2023-10-03 11:15 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Krzesimir Nowak, linux-xfs, Krzesimir Nowak

On Tue, Sep 26, 2023 at 07:41:00AM -0700, Darrick J. Wong wrote:
> On Tue, Sep 26, 2023 at 09:14:32AM +0200, Krzesimir Nowak wrote:
> > randbytes.c was mostly split off from crc32.c and, like crc32.c, is
> > used for selftests, which are run on the build host. As such it should
> > not include platform_defs.h which in turn includes urcu.h from
> > userspace-rcu library, because the build host might not have the
> > library installed.
> 
> Why not get rid of the build host crc32c selftest?  It's not that useful
> for cross-compiling and nowadays mkfs.xfs and xfs_repair have their own
> builtin selftests.  Anyone messing with xfsprogs should be running
> fstests (in addition to the maintainers) so I don't really see the point
> of running crc32cselftest on the *build* host.
> 
> (Carlos: any thoughts on this?)

/me back from holidays...

Yeah, sounds reasonable, IMO crc32selftest can go.

Carlos

> 
> --D
> 
> > Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
> > ---
> >  libfrog/randbytes.c | 1 -
> >  libfrog/randbytes.h | 2 ++
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/libfrog/randbytes.c b/libfrog/randbytes.c
> > index f22da0d3..2023b601 100644
> > --- a/libfrog/randbytes.c
> > +++ b/libfrog/randbytes.c
> > @@ -6,7 +6,6 @@
> >   *
> >   * This is the buffer of random bytes used for self tests.
> >   */
> > -#include "platform_defs.h"
> >  #include "libfrog/randbytes.h"
> >
> >  /* 4096 random bytes */
> > diff --git a/libfrog/randbytes.h b/libfrog/randbytes.h
> > index 00fd7c4c..fddea9c7 100644
> > --- a/libfrog/randbytes.h
> > +++ b/libfrog/randbytes.h
> > @@ -6,6 +6,8 @@
> >  #ifndef __LIBFROG_RANDBYTES_H__
> >  #define __LIBFROG_RANDBYTES_H__
> >
> > +#include <stdint.h>
> > +
> >  extern uint8_t randbytes_test_buf[];
> >
> >  #endif /* __LIBFROG_RANDBYTES_H__ */
> > --
> > 2.25.1
> >

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

* Re: [PATCH 1/1] libfrog: Fix cross-compilation issue with randbytes
  2023-10-03 11:15     ` Carlos Maiolino
@ 2023-10-11 11:34       ` Krzesimir Nowak
  0 siblings, 0 replies; 6+ messages in thread
From: Krzesimir Nowak @ 2023-10-11 11:34 UTC (permalink / raw)
  To: Carlos Maiolino; +Cc: Darrick J. Wong, linux-xfs, Krzesimir Nowak

wt., 3 paź 2023 o 13:15 Carlos Maiolino <cem@kernel.org> napisał(a):
>
> On Tue, Sep 26, 2023 at 07:41:00AM -0700, Darrick J. Wong wrote:
> > On Tue, Sep 26, 2023 at 09:14:32AM +0200, Krzesimir Nowak wrote:
> > > randbytes.c was mostly split off from crc32.c and, like crc32.c, is
> > > used for selftests, which are run on the build host. As such it should
> > > not include platform_defs.h which in turn includes urcu.h from
> > > userspace-rcu library, because the build host might not have the
> > > library installed.
> >
> > Why not get rid of the build host crc32c selftest?  It's not that useful
> > for cross-compiling and nowadays mkfs.xfs and xfs_repair have their own
> > builtin selftests.  Anyone messing with xfsprogs should be running
> > fstests (in addition to the maintainers) so I don't really see the point
> > of running crc32cselftest on the *build* host.
> >
> > (Carlos: any thoughts on this?)
>
> /me back from holidays...
>
> Yeah, sounds reasonable, IMO crc32selftest can go.

Hi,

There's a follow-up patch that I have sent - it drops the crc32 selftest:

https://marc.info/?l=linux-xfs&m=169590021227419&w=2

Not sure if there is anything else I should do. If so, please let me
know. Thanks!

Cheers,
Krzesimir

>
> Carlos
>
> >
> > --D
> >
> > > Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
> > > ---
> > >  libfrog/randbytes.c | 1 -
> > >  libfrog/randbytes.h | 2 ++
> > >  2 files changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/libfrog/randbytes.c b/libfrog/randbytes.c
> > > index f22da0d3..2023b601 100644
> > > --- a/libfrog/randbytes.c
> > > +++ b/libfrog/randbytes.c
> > > @@ -6,7 +6,6 @@
> > >   *
> > >   * This is the buffer of random bytes used for self tests.
> > >   */
> > > -#include "platform_defs.h"
> > >  #include "libfrog/randbytes.h"
> > >
> > >  /* 4096 random bytes */
> > > diff --git a/libfrog/randbytes.h b/libfrog/randbytes.h
> > > index 00fd7c4c..fddea9c7 100644
> > > --- a/libfrog/randbytes.h
> > > +++ b/libfrog/randbytes.h
> > > @@ -6,6 +6,8 @@
> > >  #ifndef __LIBFROG_RANDBYTES_H__
> > >  #define __LIBFROG_RANDBYTES_H__
> > >
> > > +#include <stdint.h>
> > > +
> > >  extern uint8_t randbytes_test_buf[];
> > >
> > >  #endif /* __LIBFROG_RANDBYTES_H__ */
> > > --
> > > 2.25.1
> > >

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

end of thread, other threads:[~2023-10-11 11:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-26  7:14 [PATCH 0/1] Fix cross-compilation issue with randbytes Krzesimir Nowak
2023-09-26  7:14 ` [PATCH 1/1] libfrog: " Krzesimir Nowak
2023-09-26 14:41   ` Darrick J. Wong
2023-09-26 21:28     ` Dave Chinner
2023-10-03 11:15     ` Carlos Maiolino
2023-10-11 11:34       ` Krzesimir Nowak

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).