mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] samples: mei: Fix building on musl libc
@ 2025-07-01 16:07 Brahmajit Das
  2025-07-02  5:45 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Brahmajit Das @ 2025-07-01 16:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: alexander.usyskin, tomas.winkler, gregkh

The header bits/wordsize.h is glibc specific and on building on musl
with allyesconfig results in

samples/mei/mei-amt-version.c:77:10: fatal error: bits/wordsize.h: No such file or directory
   77 | #include <bits/wordsize.h>
      |          ^~~~~~~~~~~~~~~~~

mei-amt-version.c build file without bits/wordsize.h on musl and glibc.

However on musl we get the follwing error without sys/time.h

samples/mei/mei-amt-version.c: In function 'mei_recv_msg':
samples/mei/mei-amt-version.c:159:24: error: storage size of 'tv' isn't known
  159 |         struct timeval tv;
      |                        ^~
samples/mei/mei-amt-version.c:160:9: error: unknown type name 'fd_set'
  160 |         fd_set set;
      |         ^~~~~~
samples/mei/mei-amt-version.c:168:9: error: implicit declaration of function 'FD_ZERO' [-Wimplicit-function-declaration]
  168 |         FD_ZERO(&set);
      |         ^~~~~~~
samples/mei/mei-amt-version.c:169:9: error: implicit declaration of function 'FD_SET'; did you mean 'L_SET'? [-Wimplicit-function-declaration]
  169 |         FD_SET(me->fd, &set);
      |         ^~~~~~
      |         L_SET
samples/mei/mei-amt-version.c:170:14: error: implicit declaration of function 'select' [-Wimplicit-function-declaration]
  170 |         rc = select(me->fd + 1, &set, NULL, NULL, &tv);
      |              ^~~~~~
samples/mei/mei-amt-version.c:171:23: error: implicit declaration of function 'FD_ISSET' [-Wimplicit-function-declaration]
  171 |         if (rc > 0 && FD_ISSET(me->fd, &set)) {
      |                       ^~~~~~~~
samples/mei/mei-amt-version.c:159:24: warning: unused variable 'tv' [-Wunused-variable]
  159 |         struct timeval tv;
      |                        ^~

Hence the the file has been included.

Signed-off-by: Brahmajit Das <listout@listout.xyz>
---
 samples/mei/mei-amt-version.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/samples/mei/mei-amt-version.c b/samples/mei/mei-amt-version.c
index 867debd3b912..1d7254bcb44c 100644
--- a/samples/mei/mei-amt-version.c
+++ b/samples/mei/mei-amt-version.c
@@ -69,11 +69,11 @@
 #include <string.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#include <sys/time.h>
 #include <unistd.h>
 #include <errno.h>
 #include <stdint.h>
 #include <stdbool.h>
-#include <bits/wordsize.h>
 #include <linux/mei.h>
 
 /*****************************************************************************
-- 
2.50.0


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

* Re: [PATCH] samples: mei: Fix building on musl libc
  2025-07-01 16:07 [PATCH] samples: mei: Fix building on musl libc Brahmajit Das
@ 2025-07-02  5:45 ` Greg KH
  2025-07-02 11:47   ` Brahmajit Das
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2025-07-02  5:45 UTC (permalink / raw)
  To: Brahmajit Das; +Cc: linux-kernel, alexander.usyskin, tomas.winkler

On Tue, Jul 01, 2025 at 09:37:26PM +0530, Brahmajit Das wrote:
> The header bits/wordsize.h is glibc specific and on building on musl
> with allyesconfig results in
> 
> samples/mei/mei-amt-version.c:77:10: fatal error: bits/wordsize.h: No such file or directory
>    77 | #include <bits/wordsize.h>
>       |          ^~~~~~~~~~~~~~~~~
> 
> mei-amt-version.c build file without bits/wordsize.h on musl and glibc.
> 
> However on musl we get the follwing error without sys/time.h
> 
> samples/mei/mei-amt-version.c: In function 'mei_recv_msg':
> samples/mei/mei-amt-version.c:159:24: error: storage size of 'tv' isn't known
>   159 |         struct timeval tv;
>       |                        ^~
> samples/mei/mei-amt-version.c:160:9: error: unknown type name 'fd_set'
>   160 |         fd_set set;
>       |         ^~~~~~
> samples/mei/mei-amt-version.c:168:9: error: implicit declaration of function 'FD_ZERO' [-Wimplicit-function-declaration]
>   168 |         FD_ZERO(&set);
>       |         ^~~~~~~
> samples/mei/mei-amt-version.c:169:9: error: implicit declaration of function 'FD_SET'; did you mean 'L_SET'? [-Wimplicit-function-declaration]
>   169 |         FD_SET(me->fd, &set);
>       |         ^~~~~~
>       |         L_SET
> samples/mei/mei-amt-version.c:170:14: error: implicit declaration of function 'select' [-Wimplicit-function-declaration]
>   170 |         rc = select(me->fd + 1, &set, NULL, NULL, &tv);
>       |              ^~~~~~
> samples/mei/mei-amt-version.c:171:23: error: implicit declaration of function 'FD_ISSET' [-Wimplicit-function-declaration]
>   171 |         if (rc > 0 && FD_ISSET(me->fd, &set)) {
>       |                       ^~~~~~~~
> samples/mei/mei-amt-version.c:159:24: warning: unused variable 'tv' [-Wunused-variable]
>   159 |         struct timeval tv;
>       |                        ^~
> 
> Hence the the file has been included.
> 
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
> ---
>  samples/mei/mei-amt-version.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

What commit id does this fix?

thanks,

greg k-h

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

* Re: [PATCH] samples: mei: Fix building on musl libc
  2025-07-02  5:45 ` Greg KH
@ 2025-07-02 11:47   ` Brahmajit Das
  2025-07-02 12:15     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Brahmajit Das @ 2025-07-02 11:47 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, alexander.usyskin, tomas.winkler

On 02.07.2025 07:45, Greg KH wrote:
> On Tue, Jul 01, 2025 at 09:37:26PM +0530, Brahmajit Das wrote:
... snip ...
> > 
> > Signed-off-by: Brahmajit Das <listout@listout.xyz>
> > ---
> >  samples/mei/mei-amt-version.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> What commit id does this fix?
> 
> thanks,
> 
> greg k-h

The (both) changes were introduced by commit c52827cc4ddf3 (staging/mei:
add mei user space example).
Shall I resend the patch with a Fixes tag?
-- 
Regards,
listout

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

* Re: [PATCH] samples: mei: Fix building on musl libc
  2025-07-02 11:47   ` Brahmajit Das
@ 2025-07-02 12:15     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2025-07-02 12:15 UTC (permalink / raw)
  To: Brahmajit Das; +Cc: linux-kernel, alexander.usyskin, tomas.winkler

On Wed, Jul 02, 2025 at 05:17:33PM +0530, Brahmajit Das wrote:
> On 02.07.2025 07:45, Greg KH wrote:
> > On Tue, Jul 01, 2025 at 09:37:26PM +0530, Brahmajit Das wrote:
> ... snip ...
> > > 
> > > Signed-off-by: Brahmajit Das <listout@listout.xyz>
> > > ---
> > >  samples/mei/mei-amt-version.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > What commit id does this fix?
> > 
> > thanks,
> > 
> > greg k-h
> 
> The (both) changes were introduced by commit c52827cc4ddf3 (staging/mei:
> add mei user space example).
> Shall I resend the patch with a Fixes tag?

A fixes tag would be great, th anks.

greg k-h

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

end of thread, other threads:[~2025-07-02 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-01 16:07 [PATCH] samples: mei: Fix building on musl libc Brahmajit Das
2025-07-02  5:45 ` Greg KH
2025-07-02 11:47   ` Brahmajit Das
2025-07-02 12:15     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®