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