2023-12-05 22:35:54

by Petr Vorel

[permalink] [raw]
Subject: [PATCH v2] reexport/{fsidd,reexport}.c: Re-add missing includes

Older uClibc-ng requires <unistd.h> for close(2), unlink(2) and write(2),
<sys/un.h> for struct sockaddr_un.

Fixes: 1a4edb2a ("reexport/fsidd.c: Remove unused headers")
Fixes: bdc79f02 ("support/reexport.c: Remove unused headers")
Signed-off-by: Petr Vorel <[email protected]>
---
Changes v1->v2:
* Add also <sys/un.h>

support/reexport/fsidd.c | 2 ++
support/reexport/reexport.c | 1 +
2 files changed, 3 insertions(+)

diff --git a/support/reexport/fsidd.c b/support/reexport/fsidd.c
index 8a70b78f..51750ea3 100644
--- a/support/reexport/fsidd.c
+++ b/support/reexport/fsidd.c
@@ -7,6 +7,8 @@
#include <dlfcn.h>
#endif
#include <event2/event.h>
+#include <sys/un.h>
+#include <unistd.h>

#include "conffile.h"
#include "reexport_backend.h"
diff --git a/support/reexport/reexport.c b/support/reexport/reexport.c
index 0fb49a46..c7bff6a3 100644
--- a/support/reexport/reexport.c
+++ b/support/reexport/reexport.c
@@ -7,6 +7,7 @@
#endif
#include <sys/types.h>
#include <sys/vfs.h>
+#include <unistd.h>
#include <errno.h>

#include "nfsd_path.h"
--
2.43.0



2023-12-05 22:35:54

by Petr Vorel

[permalink] [raw]
Subject: [PATCH v2] support/backend_sqlite.c: Add missing <sys/syscall.h>

From: Petr Vorel <[email protected]>

This fixes build on systems which actually needs getrandom()
(to get SYS_getrandom).

Fixes: f92fd6ca ("support/backend_sqlite.c: Add getrandom() fallback")
Fixes: http://autobuild.buildroot.net/results/c5fde6099a8b228a8bdc3154d1e47dfa192e94ed/
Reported-by: Giulio Benetti <[email protected]>
Signed-off-by: Petr Vorel <[email protected]>
---
Changes v1->v2:
* New commit

I'm sorry for these errors.

support/reexport/backend_sqlite.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/support/reexport/backend_sqlite.c b/support/reexport/backend_sqlite.c
index 0eb5ea37..54dfe447 100644
--- a/support/reexport/backend_sqlite.c
+++ b/support/reexport/backend_sqlite.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/syscall.h>
#include <unistd.h>

#ifdef HAVE_GETRANDOM
--
2.43.0


2023-12-06 18:54:15

by Giulio Benetti

[permalink] [raw]
Subject: Re: [PATCH v2] support/backend_sqlite.c: Add missing <sys/syscall.h>

Hi Petr,

On 05/12/23 23:35, Petr Vorel wrote:
> From: Petr Vorel <[email protected]>
>
> This fixes build on systems which actually needs getrandom()
> (to get SYS_getrandom).
>
> Fixes: f92fd6ca ("support/backend_sqlite.c: Add getrandom() fallback")
> Fixes: http://autobuild.buildroot.net/results/c5fde6099a8b228a8bdc3154d1e47dfa192e94ed/
> Reported-by: Giulio Benetti <[email protected]>
> Signed-off-by: Petr Vorel <[email protected]>

thank you for fixing. I've tested this and the other patch with
Buildroot's test-pkg and built fine for many toolchain/arch/libc
combinations.

Reviewed-by: Giulio Benetti <[email protected]>

Best regards
--
Giulio Benetti
CEO&CTO@Benetti Engineering sas


> ---
> Changes v1->v2:
> * New commit
>
> I'm sorry for these errors.
>
> support/reexport/backend_sqlite.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/support/reexport/backend_sqlite.c b/support/reexport/backend_sqlite.c
> index 0eb5ea37..54dfe447 100644
> --- a/support/reexport/backend_sqlite.c
> +++ b/support/reexport/backend_sqlite.c
> @@ -7,6 +7,7 @@
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> +#include <sys/syscall.h>
> #include <unistd.h>
>
> #ifdef HAVE_GETRANDOM

2023-12-06 18:54:18

by Giulio Benetti

[permalink] [raw]
Subject: Re: [PATCH v2] reexport/{fsidd,reexport}.c: Re-add missing includes

Hi Petr,

On 05/12/23 23:35, Petr Vorel wrote:
> Older uClibc-ng requires <unistd.h> for close(2), unlink(2) and write(2),
> <sys/un.h> for struct sockaddr_un.
>
> Fixes: 1a4edb2a ("reexport/fsidd.c: Remove unused headers")
> Fixes: bdc79f02 ("support/reexport.c: Remove unused headers")
> Signed-off-by: Petr Vorel <[email protected]>

Reviewed-by: Giulio Benetti <[email protected]>

Best regards
--
Giulio Benetti
CEO&CTO@Benetti Engineering sas

> ---
> Changes v1->v2:
> * Add also <sys/un.h>
>
> support/reexport/fsidd.c | 2 ++
> support/reexport/reexport.c | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/support/reexport/fsidd.c b/support/reexport/fsidd.c
> index 8a70b78f..51750ea3 100644
> --- a/support/reexport/fsidd.c
> +++ b/support/reexport/fsidd.c
> @@ -7,6 +7,8 @@
> #include <dlfcn.h>
> #endif
> #include <event2/event.h>
> +#include <sys/un.h>
> +#include <unistd.h>
>
> #include "conffile.h"
> #include "reexport_backend.h"
> diff --git a/support/reexport/reexport.c b/support/reexport/reexport.c
> index 0fb49a46..c7bff6a3 100644
> --- a/support/reexport/reexport.c
> +++ b/support/reexport/reexport.c
> @@ -7,6 +7,7 @@
> #endif
> #include <sys/types.h>
> #include <sys/vfs.h>
> +#include <unistd.h>
> #include <errno.h>
>
> #include "nfsd_path.h"


2023-12-06 19:42:31

by Petr Vorel

[permalink] [raw]
Subject: Re: [PATCH v2] support/backend_sqlite.c: Add missing <sys/syscall.h>

Hi Giulio,

> Hi Petr,

> On 05/12/23 23:35, Petr Vorel wrote:
> > From: Petr Vorel <[email protected]>

> > This fixes build on systems which actually needs getrandom()
> > (to get SYS_getrandom).

> > Fixes: f92fd6ca ("support/backend_sqlite.c: Add getrandom() fallback")
> > Fixes: http://autobuild.buildroot.net/results/c5fde6099a8b228a8bdc3154d1e47dfa192e94ed/
> > Reported-by: Giulio Benetti <[email protected]>
> > Signed-off-by: Petr Vorel <[email protected]>

> thank you for fixing. I've tested this and the other patch with
> Buildroot's test-pkg and built fine for many toolchain/arch/libc
> combinations.

Thank you for extensive testing! I test only the basic 6 tests (the default
test-pkg). I suppose you run test-pkg also with -a (these 45 arch
combinations).

> Reviewed-by: Giulio Benetti <[email protected]>
Maybe you can add your Tested-by: ?

Kind regards,
Petr


> Best regards

2023-12-06 22:25:56

by Giulio Benetti

[permalink] [raw]
Subject: Re: [PATCH v2] support/backend_sqlite.c: Add missing <sys/syscall.h>

Hi Petr,

On 06/12/23 20:42, Petr Vorel wrote:
> Hi Giulio,
>
>> Hi Petr,
>> On 05/12/23 23:35, Petr Vorel wrote:
>>> From: Petr Vorel<[email protected]>
>>> This fixes build on systems which actually needs getrandom()
>>> (to get SYS_getrandom).
>>> Fixes: f92fd6ca ("support/backend_sqlite.c: Add getrandom() fallback")
>>> Fixes:http://autobuild.buildroot.net/results/c5fde6099a8b228a8bdc3154d1e47dfa192e94ed/
>>> Reported-by: Giulio Benetti<[email protected]>
>>> Signed-off-by: Petr Vorel<[email protected]>
>> thank you for fixing. I've tested this and the other patch with
>> Buildroot's test-pkg and built fine for many toolchain/arch/libc
>> combinations.
> Thank you for extensive testing! I test only the basic 6 tests (the default
> test-pkg). I suppose you run test-pkg also with -a (these 45 arch
> combinations).

Exactly, I've only found a build failure on util-linux's libmount while
building for sh4+uclibc with bootlin toolchain. See defconfig and log here:
https://pastebin.com/8rxgxvvQ
So that's not due to nfs-utils.

>> Reviewed-by: Giulio Benetti<[email protected]>
> Maybe you can add your Tested-by: ?

Sure, good idea.

After running Buildroot utils/test-pkg under Buildroot official docker
using this and previous patch everything built fine except on sh4+uclibc
where util-linux libmount fails(see above). These are the results:
```
br-user@giulio-Ubuntu-HP:/home/giuliobenetti/git/upstream/buildroot$
./utils/test-pkg -p nfs-utils -d test-nfs-utils/ -a
arm-aarch64 [ 1/45]: OK
bootlin-aarch64-glibc [ 2/45]: OK
bootlin-arcle-hs38-uclibc [ 3/45]: OK
bootlin-armv5-uclibc [ 4/45]: OK
bootlin-armv7-glibc [ 5/45]: OK
bootlin-armv7m-uclibc [ 6/45]: SKIPPED
bootlin-armv7-musl [ 7/45]: OK
bootlin-m68k-5208-uclibc [ 8/45]: SKIPPED
bootlin-m68k-68040-uclibc [ 9/45]: OK
bootlin-microblazeel-uclibc [10/45]: OK
bootlin-mipsel32r6-glibc [11/45]: OK
bootlin-mipsel-uclibc [12/45]: OK
bootlin-nios2-glibc [13/45]: OK
bootlin-openrisc-uclibc [14/45]: OK
bootlin-powerpc64le-power8-glibc [15/45]: OK
bootlin-powerpc-e500mc-uclibc [16/45]: OK
bootlin-riscv32-glibc [17/45]: OK
bootlin-riscv64-glibc [18/45]: OK
bootlin-riscv64-musl [19/45]: OK
bootlin-s390x-z13-glibc [20/45]: OK
bootlin-sh4-uclibc [21/45]: FAILED
bootlin-sparc64-glibc [22/45]: OK
bootlin-sparc-uclibc [23/45]: OK
bootlin-x86-64-glibc [24/45]: OK
bootlin-x86-64-musl [25/45]: OK
bootlin-x86-64-uclibc [26/45]: OK
bootlin-xtensa-uclibc [27/45]: OK
br-arm-basic [28/45]: OK
br-arm-full-nothread [29/45]: SKIPPED
br-arm-full-static [30/45]: OK
br-i386-pentium4-full [31/45]: OK
br-i386-pentium-mmx-musl [32/45]: OK
br-mips64-n64-full [33/45]: OK
br-mips64r6-el-hf-glibc [34/45]: OK
br-powerpc-603e-basic-cpp [35/45]: OK
br-powerpc64-power7-glibc [36/45]: OK
linaro-aarch64-be [37/45]: OK
linaro-aarch64 [38/45]: OK
linaro-arm [39/45]: OK
sourcery-arm-armv4t [40/45]: SKIPPED
sourcery-arm [41/45]: SKIPPED
sourcery-arm-thumb2 [42/45]: SKIPPED
sourcery-mips64 [43/45]: OK
sourcery-mips [44/45]: OK
sourcery-nios2 [45/45]: OK
45 builds, 6 skipped, 1 build failed, 0 legal-info failed, 0 show-info
failed
```

So:
Tested-by: Giulio Benetti <[email protected]>

Kind regards
--
Giulio Benetti
CEO&CTO@Benetti Engineering sas

2023-12-06 22:26:00

by Giulio Benetti

[permalink] [raw]
Subject: Re: [PATCH v2] reexport/{fsidd,reexport}.c: Re-add missing includes

On 06/12/23 19:53, Giulio Benetti wrote:
> Hi Petr,
>
> On 05/12/23 23:35, Petr Vorel wrote:
>> Older uClibc-ng requires <unistd.h> for close(2), unlink(2) and write(2),
>> <sys/un.h> for struct sockaddr_un.
>>
>> Fixes: 1a4edb2a ("reexport/fsidd.c: Remove unused headers")
>> Fixes: bdc79f02 ("support/reexport.c: Remove unused headers")
>> Signed-off-by: Petr Vorel <[email protected]>
>
> Reviewed-by: Giulio Benetti <[email protected]>
Build tested along with patch "[PATCH v2] support/backend_sqlite.c: Add
missing <sys/syscall.h>"

Tested-by: Giulio Benetti <[email protected]>

Best regards
--
Giulio Benetti
CEO&CTO@Benetti Engineering sas

2024-01-04 00:39:42

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH v2] reexport/{fsidd,reexport}.c: Re-add missing includes



On 12/5/23 5:35 PM, Petr Vorel wrote:
> Older uClibc-ng requires <unistd.h> for close(2), unlink(2) and write(2),
> <sys/un.h> for struct sockaddr_un.
>
> Fixes: 1a4edb2a ("reexport/fsidd.c: Remove unused headers")
> Fixes: bdc79f02 ("support/reexport.c: Remove unused headers")
> Signed-off-by: Petr Vorel <[email protected]>
Committed... (tag: nfs-utils-2-7-1-rc3

steved.
> ---
> Changes v1->v2:
> * Add also <sys/un.h>
>
> support/reexport/fsidd.c | 2 ++
> support/reexport/reexport.c | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/support/reexport/fsidd.c b/support/reexport/fsidd.c
> index 8a70b78f..51750ea3 100644
> --- a/support/reexport/fsidd.c
> +++ b/support/reexport/fsidd.c
> @@ -7,6 +7,8 @@
> #include <dlfcn.h>
> #endif
> #include <event2/event.h>
> +#include <sys/un.h>
> +#include <unistd.h>
>
> #include "conffile.h"
> #include "reexport_backend.h"
> diff --git a/support/reexport/reexport.c b/support/reexport/reexport.c
> index 0fb49a46..c7bff6a3 100644
> --- a/support/reexport/reexport.c
> +++ b/support/reexport/reexport.c
> @@ -7,6 +7,7 @@
> #endif
> #include <sys/types.h>
> #include <sys/vfs.h>
> +#include <unistd.h>
> #include <errno.h>
>
> #include "nfsd_path.h"