37 Commits

Author SHA1 Message Date
ohci1 4b8f3098a5 update configure info for 2.14
Co-authored-by: Pavel Begunkov<asml.silence@gmail.com>
Co-authored-by: Guillem Jover<guillem@hadrons.org>
Co-authored-by: Jens Axboe<axboe@kernel.dk>
Co-authored-by: Khem Raj<raj.khem@gmail.com>
Co-authored-by: Michael de Lang<kingoipo@gmail.com>
Co-authored-by: David Disseldorp<ddiss@suse.de>
Co-authored-by: Ming Lei<ming.lei@redhat.com>
2026-04-24 09:24:13 +08:00
fangzhiyi18 0ae77b95ef 升级2.7
Signed-off-by: fangzhiyi18 <fangzhiyi1@huawei.com>
2024-10-21 02:53:20 +00:00
Ankit Kumar 7ce8baedab configure: check for nvme uring command support
Modify configure to check availability of nvme_uring_cmd.
The follow up patch will have uring passthrough tests.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Link: https://lore.kernel.org/r/20220728093327.32580-2-ankit.kumar@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-07-28 07:06:59 -06:00
Jens Axboe 38b9a2eb7b test/io_uring_register: kill old memfd test
It's not a useful test case and it's causing issues on weird setups,
let's just get rid of it and then we can drop the memfd_create()
configure bits as well.

Link: https://github.com/axboe/liburing/issues/620
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-06-26 14:37:32 -06:00
Simon A. F. Lund 8dc6db4e5f configure: fix compile-checks for statx
This is related to the the issue reported here:

https://github.com/axboe/liburing/issues/578

A fix for the reported issue changed ``linux/stat.h`` to ``sys/stat.h``
in ``test/statx.c``, however, it did not change the compile-check in
``configure``.

This change is needed on Alpine Linux / muslc, where 'statx' is detected
by ``configure/compile-check`` but ``sys/stat.h`` does not provide what
is needed by ``test/statx.c``. Resulting in a build-error.

This changes the compiler-check to match the usage in `tests/statx.c`,
thereby fixing the build-error on Alpine Linux / muslc.

Signed-off-by: Simon A. F. Lund <os@safl.dk>
2022-05-17 17:07:17 +02:00
Ammar Faizi 5e88672cfc configure: Allow the configure script to fail with a non-zero exit code
For poorly configured environments, configure may fail but will still
exit with code 0. This, in turn, causes cryptic build errors later.

Fix this by adding "set -e". Also, append "|| true" to prevent the
`expr` command breaks because it will return a non-zero exit code if
the regex doesn't match.

Closes: https://github.com/axboe/liburing/pull/553
Co-authored-by: Roman Gershman <romange@gmail.com>
Signed-off-by: Roman Gershman <romange@gmail.com>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
2022-04-01 23:23:02 +07:00
Alviro Iskandar Setiawan c7aff36748 configure: Fix clang-12 warning -Wdeprecated
```
clang-12: warning: treating 'c' input as 'c++' when in C++ mode, this \
behvior is deprecated [-Wdeprecated]
```

The target compile is C++ but the file extension is ".c". Got the
above warning from clang. Fix it by creating a temporary file with
".cpp" extension and use it.

Introduced by commit e2ed0ec0d7 ("configure: test for presence of
C++ compiler").

Fixes: e2ed0ec0d7 ("configure: test for presence of C++ compiler")
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
2022-02-23 11:46:05 +07:00
Alviro Iskandar Setiawan 4da92f9a20 configure: Fix _GNU_SOURCE redefinition warning
```
gcc -D_GNU_SOURCE -include config-host.h -Werror=implicit-function-declaration \
-o /tmp/tmp.UrAfu1BQqA/liburing-conf.exe /tmp/tmp.UrAfu1BQqA/liburing-conf.c

/tmp/tmp.UrAfu1BQqA/liburing-conf.c:1: warning: "_GNU_SOURCE" redefined
    1 | #define _GNU_SOURCE
      |
<command-line>: note: this is the location of the previous definition
```

Introduced by commit ef0679172f ("test/io_uring_register: fix
-Wimplicit-function-declaration of memfd_create").

Fixes: ef0679172f ("test/io_uring_register: fix -Wimplicit-function-declaration of memfd_create")
Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
2022-02-23 11:46:05 +07:00
Nugra ba2d5f6fca configure: Support busybox mktemp
Busybox mktemp does not support `--tmpdir`, it says:
    mktemp: unrecognized option: tmpdir

It can be fixed with:
1. Create a temporary directory.
2. Use touch to create the temporary files inside the directory.
3. Clean up by deleting the temporary directory.

[ammarfaizi2: s/fio/liburing/]

Signed-off-by: Nugra <richiisei@gmail.com>
Link: https://t.me/GNUWeeb/530154
[ammarfaizi2: Rephrase the commit message and add touch command]
Co-authored-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Link: https://lore.kernel.org/r/20220215153651.181319-2-ammarfaizi2@gnuweeb.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-15 14:42:40 -07:00
Jon Kohler ec0f4c1a71 fix statx configure and build on !CONFIG_HAVE_STATX toolchains
Update configure and test/Makefile, such that if !CONFIG_HAVE_STATX will
not generate statx.c test. Without this patch, liburing fails to compile
on an older toolchain that does not have statx available.

Fixes: #516

Signed-off-by: Jon Kohler <jon@nutanix.com>
2022-01-28 09:36:15 -08:00
Bikal Lem 213ae0071d fix 'make' when using glibc >= 2.28
glibc >= 2.28 supports `statx` out of the box. This means we get an
error when attempting to build `liburing` when glibc is >= 2.28, for
e.g. in my glibc version 2.33 I get the following errors

```
:26:8: error: redefinition of ‘struct statx_timestamp’
   26 | struct statx_timestamp
      |        ^~~~~~~~~~~~~~~
In file included from statx.c:14:
```
or
```
error: redefinition of ‘struct statx’
   30 | struct statx
      |        ^~~~~
In file included from statx.c:14:
```
This commit fixes 'make' error by choosing to use the glibc version
of `statx` if available.

glibc 2.28 release notes:
https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=154ab22d7ca065af5233406927302bb7f6a66890;hb=3c03baca37fdcb52c3881e653ca392bba7a99c2b#l84

Signed-off-by: Bikal Lem <gbikal+git@gmail.com>
2021-11-12 18:20:11 +00:00
Ammar Faizi 56dcfd13f7 configure: Add CONFIG_NOLIBC variable and macro
It's for conditonal variable and macro to enable nolibc build.
Also add `--nolibc` option to `configure` to enable it.

Link: https://github.com/axboe/liburing/issues/443
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ammar Faizi <ammar.faizi@students.amikom.ac.id>
Link: https://lore.kernel.org/r/20211010135338.397115-4-ammar.faizi@students.amikom.ac.id
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-10-10 09:09:56 -06:00
Jens Axboe fa1838fd0e configure: add openat2.h for open_how and RESOLVE_* flags
struct open_how and friends reside in the openat2.h header, so include
that for the test case.

Fixes: https://github.com/axboe/liburing/issues/360
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-10-06 12:08:45 -06:00
Ammar Faizi ef0679172f test/io_uring_register: fix -Wimplicit-function-declaration of memfd_create
On some systems, there is no `memfd_create` function. This commit
fixes this:
```
       CC io_uring_register
  io_uring_register.c: In function 'test_shmem':
  io_uring_register.c:514:10: warning: implicit declaration of function 'memfd_create' [-Wimplicit-function-declaration]
    memfd = memfd_create("uring-shmem-test", 0);
            ^
```

Fix for this is based on an answer on Stack Overflow [1].

On Jun 16 '19 at 5:12, mosvy wrote:
> On older systems, you'll have to include linux/memfd.h for the MFD_
> defines, and call memfd_create() via the the syscall(2) wrapper
> (and include unistd.h and sys/syscall.h for it work).
>

Link: https://stackoverflow.com/a/56616264/7275114 [1]
Reported-by: Louvian Lyndal <louvianlyndal@gmail.com>
Tested-by: Louvian Lyndal <louvianlyndal@gmail.com>
Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
2021-09-11 14:07:34 +07:00
Jens Axboe c6bb0f8497 configure: document --cc and --cxx options
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-08-27 08:27:24 -06:00
pechenkin 61b8ba6ef4 examples: disable ucontext-cp for elbrus (e2k) architecture
Elbrus 2000 (aka e2k) is a 64-bit little-endian architecture.
For several reasons it use makecontext_e2k(ctx, ...)
with different semantic instead of makecontext(ctx, ...).

Signed-off-by: Nikita Pechenkin <n.pechenkin@relex.ru>
2021-08-20 17:07:57 +03:00
Jens Axboe 39966995e6 test/Makefile: silence string/array overflow for tests
These are false positives, and they are annoying when trying to see
if new warnings have been added. Silence them.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-07-28 17:52:27 -06:00
Simon Zeni 14540a9618 examples: disable ucontext-cp if ucontext.h is not available
The header file `ucontext.h` is not available on musl based distros. The
example `ucontext-cp` is not built if `configure` fails to locate the
header.

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-10-28 16:32:16 -06:00
Guillem Jover 698e734e91 configure: Fix unsafe temporary file creation
The RANDOM variable is a bashism, but we are using a /bin/sh as a
shebang, which means the temporary files created when /bin/sh is not
bash will be using unsafe and predictable names.

Switch to use mktemp(1) and its built-in temporary directory handling
instead of open-coding it.
2020-10-23 15:17:01 +02:00
Tobias Klauser 328c529997 configure: fix typos in help/error messages
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-07-08 15:27:57 -06:00
Bart Van Assche f8acf19c7f configure: Use $CC and $CXX as default compilers if set
This change causes .travis.yml to use the compilers configured in the $CC
and $CXX variables. Additionally, make the configure script show the
compiler names.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-28 14:03:56 -06:00
Jens Axboe e2ed0ec0d7 configure: test for presence of C++ compiler
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-06-28 07:33:31 -06:00
Milan P. Stanić 9b65f5d90f fix build on musl libc
Trying to build liburing on musl yields an error:

make[1]: Entering directory '/work/devel/liburing/src'
     CC setup.ol
     CC queue.ol
     CC syscall.ol
In file included from syscall.c:9:
include/liburing/compat.h:6:2: error: unknown type name 'int64_t'
    6 |  int64_t  tv_sec;
      |  ^~~~~~~
make[1]: *** [Makefile:43: syscall.ol] Error 1
make[1]: Leaving directory '/work/devel/liburing/src'
make: *** [Makefile:12: all] Error 2

Ensure that compat.h includes stdint.h.

Signed-off-by: Milan P. Stanić <mps@arvanta.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-29 14:42:38 -06:00
Jens Axboe 8259505e96 configure: check for struct statx
If not there, don't build the test program test/statx

Fixes: https://github.com/axboe/liburing/issues/101
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-04-09 09:58:59 -06:00
Jens Axboe ab77833396 configure: sync struct open_how with kernel API
This got changed and I missed it, now corrected...

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-24 16:43:08 -07:00
Jens Axboe 401f8affa0 configure: fix mis-generation of compat.h for no __kernel_rwf_t
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-20 21:49:13 -07:00
Jens Axboe 71690566b9 Auto-generate compat.h
The previous fix for __kernel_timespec only works within the liburing
repo, as that's the only place we have the defines we need. Instead of
relying on that, auto-generate compat.h so it suits the given build
environment.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-12 22:03:13 -07:00
Jens Axboe d0a15ca057 Correctly handle if __kernel_timespec is defined
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-12 21:16:21 -07:00
Stefan Metzmacher 3e63af4f25 Fix liburing.so symlink source if libdir != libdevdir
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-07 09:24:28 -07:00
Stefan Metzmacher b57dbc2d30 configure/Makefile: introduce libdevdir defaults to $(libdir)
This makes it possible to install runtime libraries to
/lib/* and developement libraries to /usr/lib/*

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-06 12:11:08 -07:00
Jens Axboe 0ed392ec02 Add support for IORING_OP_OPENAT2
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-01-08 18:52:39 -07:00
Jens Axboe 4332433754 configure: allow to set host CC
Use ./configure --cc=whatever to set the compiler.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-12-23 21:34:03 -07:00
Johannes Thumshirn 6e3f6f3a35 liburing: create an installation target for tests
Create an installation target for liburing's regression test suite.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-11-28 08:00:55 -07:00
Jens Axboe e2934e1444 Switch to 32/64-bit agnostic timeout format
We made a kernel change to support timeouts properly on 32-bit
archs, update liburing to use __kernel_timespec instead of the
differently sized timespec.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-10-01 10:19:54 -06:00
Kevin Vigor 413ee338d4 liburing: specifying --prefix to configure script was ineffective, fix.
The configure script used the default value of the prefix variable
(/usr) to determine the includedir etc. *before* parsing the command
line to determine if the user specified a prefix. This made configure
--prefix ineffective.

Fix.

Tested with configure --help, configure --prefix, configure --prefix
--includedir

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-08-28 11:41:39 -06:00
Stefan Hajnoczi fd26c1a2f0 configure: move directory options to ./configure
libdir is hardcoded to ${prefix}/lib in Makefile.  Fedora x86_64 uses
/usr/lib64 and this means libaries will be installed in the wrong place.

This patch moves prefix, includedir, libdir, and mandir into ./configure
for easier customization.  To build and install on Fedora x86_64:

  # ./configure --libdir=/usr/lib64
  # make && make install

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-05-25 06:36:33 -06:00
Jens Axboe f16b83b293 Add configure script
Some older installs don't have __kernel_rwf_t in linux/fs.h, so
add a check for that.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-01-15 11:19:16 -07:00