linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH liburing 0/3] Bring back `CONFIG_HAVE_MEMFD_CREATE` to fix Android build error
@ 2025-07-15  5:06 Alviro Iskandar Setiawan
  2025-07-15  5:06 ` [PATCH liburing 1/3] Revert "test/io_uring_register: kill old memfd test" Alviro Iskandar Setiawan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alviro Iskandar Setiawan @ 2025-07-15  5:06 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Alviro Iskandar Setiawan, Linux Kernel Mailing List,
	io-uring Mailing List, GNU/Weeb Mailing List, Ammar Faizi

Hello,

There are three patches in this series to address Android build
error related to `memfd_create()`. The changes are as follows:

1) Bring back `CONFIG_HAVE_MEMFD_CREATE` and the associated memfd test
to resolve Android build failures caused by:

  93d3a7a70b4a ("examples/zcrx: udmabuf backed areas")

It added a call to `memfd_create()`, which is unavailable on some
Android toolchains, leading to the following build error:
```
  zcrx.c:111:10: error: call to undeclared function 'memfd_create'; ISO C99 and \
  later do not support implicit function declarations \
  [-Wimplicit-function-declaration]
    111 |         memfd = memfd_create("udmabuf-test", MFD_ALLOW_SEALING);
        |                 ^
```
This reversion is a preparation step for a proper fix by ensuring
`memfd_create()` usage is guarded and portable. Issue #620 was
initially unclear, but we now suspect it stemmed from improper
compiler/linker flag combinations.

2) In test dir, relocate `memfd_create()` to helpers.c for broader
test access. Previously, the static definition of `memfd_create()` was
limited to io_uring_register.c. Now, promote it to a shared location
accessible to all test cases, ensuring that future tests using
`memfd_create()` do not trigger build failures on Android targets where
the syscall is undefined in the standard headers. It improves
portability and prevents regressions across test builds.

3) Last, in example dir, add `memfd_create()` helper to fix the
build error in zcrx example.

Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
---

Alviro Iskandar Setiawan (3):
  Revert "test/io_uring_register: kill old memfd test"
  test: Move `memfd_create()` to helpers.c, make it accessible for all tests
  examples: Add `memfd_create()` helper

 configure                |  19 +++++++
 examples/helpers.c       |   8 +++
 examples/helpers.h       |   5 ++
 test/helpers.c           |   8 +++
 test/helpers.h           |   5 ++
 test/io_uring_register.c | 108 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 153 insertions(+)


base-commit: 0272bfa96f02cc47c024ec510a764ef7e37b76bf
-- 
Alviro Iskandar Setiawan

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

end of thread, other threads:[~2025-07-16  0:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15  5:06 [PATCH liburing 0/3] Bring back `CONFIG_HAVE_MEMFD_CREATE` to fix Android build error Alviro Iskandar Setiawan
2025-07-15  5:06 ` [PATCH liburing 1/3] Revert "test/io_uring_register: kill old memfd test" Alviro Iskandar Setiawan
2025-07-15 14:10   ` Jens Axboe
2025-07-16  0:03     ` Alviro Iskandar Setiawan
2025-07-15  5:06 ` [PATCH liburing 2/3] test: Move `memfd_create()` to helpers.c, make it accessible for all tests Alviro Iskandar Setiawan
2025-07-15  5:06 ` [PATCH liburing 3/3] examples: Add `memfd_create()` helper Alviro Iskandar Setiawan

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