diff options
author | Gil Cukierman <cukie@google.com> | 2022-10-31 15:25:16 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-10-31 15:25:16 +0000 |
commit | 1d27ff1934c5c4292dc00fba7f7f8ae411ed42f5 (patch) | |
tree | ebe9c872e416346e4b333e5062da32401c8e0a73 /configure | |
parent | d53db6851ea17b2d219d084e1afc683b8b62b105 (diff) | |
parent | 7ba7e81400b122a5e3b9dd1ec938fbeda8215899 (diff) | |
download | liburing-master.tar.gz |
Update liburing to version 2.2 am: d0a2042580 am: dae12c7b40 am: 7ba7e81400HEADandroid-14.0.0_r50android-14.0.0_r45android-14.0.0_r44android-14.0.0_r43android-14.0.0_r42android-14.0.0_r41android-14.0.0_r40android-14.0.0_r39android-14.0.0_r38android-14.0.0_r37android-14.0.0_r36android-14.0.0_r35android-14.0.0_r34android-14.0.0_r33android-14.0.0_r32android-14.0.0_r31android-14.0.0_r30android-14.0.0_r29android-14.0.0_r27android-14.0.0_r26android-14.0.0_r25android-14.0.0_r24android-14.0.0_r23android-14.0.0_r22android-14.0.0_r21android-14.0.0_r20android-14.0.0_r19android-14.0.0_r18android-14.0.0_r17android-14.0.0_r16aml_rkp_341510000aml_rkp_341311000aml_rkp_341114000aml_rkp_341015010aml_rkp_341012000aml_hef_341717050aml_hef_341613000aml_hef_341512030aml_hef_341415040aml_hef_341311010aml_hef_341114030aml_cfg_341510000mastermainandroid14-qpr3-releaseandroid14-qpr2-s5-releaseandroid14-qpr2-s4-releaseandroid14-qpr2-s3-releaseandroid14-qpr2-s2-releaseandroid14-qpr2-s1-releaseandroid14-qpr2-releaseandroid14-qpr1-s2-releaseandroid14-qpr1-releaseandroid14-mainline-healthfitness-releaseandroid14-devandroid14-d2-s5-releaseandroid14-d2-s4-releaseandroid14-d2-s3-releaseandroid14-d2-s2-releaseandroid14-d2-s1-releaseandroid14-d2-release
Original change: https://android-review.googlesource.com/c/platform/external/liburing/+/2276974
Change-Id: I2a7ecac6e769b82bba38ebfbce3301259a663146
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 127 |
1 files changed, 117 insertions, 10 deletions
@@ -1,10 +1,12 @@ #!/bin/sh +set -e + cc=${CC:-gcc} cxx=${CXX:-g++} for opt do - optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') + optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)' || true) case "$opt" in --help|-h) show_help=yes ;; @@ -24,6 +26,8 @@ for opt do ;; --cxx=*) cxx="$optarg" ;; + --nolibc) liburing_nolibc="yes" + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -69,18 +73,25 @@ Options: [defaults in brackets after descriptions] --libdevdir=PATH install development libraries in PATH [$libdevdir] --mandir=PATH install man pages in PATH [$mandir] --datadir=PATH install shared data in PATH [$datadir] + --cc=CMD use CMD as the C compiler + --cxx=CMD use CMD as the C++ compiler + --nolibc build liburing without libc EOF exit 0 fi -TMPC="$(mktemp --tmpdir fio-conf-XXXXXXXXXX.c)" -TMPC2="$(mktemp --tmpdir fio-conf-XXXXXXXXXX-2.c)" -TMPO="$(mktemp --tmpdir fio-conf-XXXXXXXXXX.o)" -TMPE="$(mktemp --tmpdir fio-conf-XXXXXXXXXX.exe)" +TMP_DIRECTORY="$(mktemp -d)" +TMPC="$TMP_DIRECTORY/liburing-conf.c" +TMPC2="$TMP_DIRECTORY/liburing-conf-2.c" +TMPCXX="$TMP_DIRECTORY/liburing-conf-2.cpp" +TMPO="$TMP_DIRECTORY/liburing-conf.o" +TMPE="$TMP_DIRECTORY/liburing-conf.exe" + +touch $TMPC $TMPC2 $TMPCXX $TMPO $TMPE # NB: do not call "exit" in the trap handler; this is buggy with some shells; # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org> -trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM +trap "rm -rf $TMP_DIRECTORY" EXIT INT QUIT TERM rm -rf config.log @@ -163,7 +174,7 @@ compile_prog_cxx() { local_cflags="$1" local_ldflags="$2 $LIBS" echo "Compiling test case $3" >> config.log - do_cxx $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags + do_cxx $CFLAGS $local_cflags -o $TMPE $TMPCXX $LDFLAGS $local_ldflags } has() { @@ -192,6 +203,37 @@ print_and_output_mak "mandir" "$mandir" print_and_output_mak "datadir" "$datadir" ########################################## +# check for compiler -Wstringop-overflow +stringop_overflow="no" +cat > $TMPC << EOF +#include <linux/fs.h> +int main(int argc, char **argv) +{ + return 0; +} +EOF +if compile_prog "-Werror -Wstringop-overflow=0" "" "stringop_overflow"; then + stringop_overflow="yes" +fi +print_config "stringop_overflow" "$stringop_overflow" + +########################################## +# check for compiler -Warryr-bounds +array_bounds="no" +cat > $TMPC << EOF +#include <linux/fs.h> +int main(int argc, char **argv) +{ + return 0; +} +EOF +if compile_prog "-Werror -Warray-bounds=0" "" "array_bounds"; then + array_bounds="yes" +fi +print_config "array_bounds" "$array_bounds" + + +########################################## # check for __kernel_rwf_t __kernel_rwf_t="no" cat > $TMPC << EOF @@ -232,9 +274,9 @@ print_config "__kernel_timespec" "$__kernel_timespec" open_how="no" cat > $TMPC << EOF #include <sys/types.h> -#include <sys/stat.h> #include <fcntl.h> #include <string.h> +#include <linux/openat2.h> int main(int argc, char **argv) { struct open_how how; @@ -258,7 +300,6 @@ cat > $TMPC << EOF #include <unistd.h> #include <fcntl.h> #include <string.h> -#include <linux/stat.h> int main(int argc, char **argv) { struct statx x; @@ -272,9 +313,30 @@ fi print_config "statx" "$statx" ########################################## +# check for glibc statx +glibc_statx="no" +cat > $TMPC << EOF +#include <sys/types.h> +#include <unistd.h> +#include <fcntl.h> +#include <string.h> +#include <sys/stat.h> +int main(int argc, char **argv) +{ + struct statx x; + + return memset(&x, 0, sizeof(x)) != NULL; +} +EOF +if compile_prog "" "" "glibc_statx"; then + glibc_statx="yes" +fi +print_config "glibc_statx" "$glibc_statx" + +########################################## # check for C++ has_cxx="no" -cat > $TMPC << EOF +cat > $TMPCXX << EOF #include <iostream> int main(int argc, char **argv) { @@ -296,6 +358,7 @@ int main(int argc, char **argv) { ucontext_t ctx; getcontext(&ctx); + makecontext(&ctx, 0, 0); return 0; } EOF @@ -304,8 +367,30 @@ if compile_prog "" "" "has_ucontext"; then fi print_config "has_ucontext" "$has_ucontext" +########################################## +# check for memfd_create(2) +has_memfd_create="no" +cat > $TMPC << EOF +#include <sys/mman.h> +int main(int argc, char **argv) +{ + int memfd = memfd_create("test", 0); + return 0; +} +EOF +if compile_prog "-Werror=implicit-function-declaration" "" "has_memfd_create"; then + has_memfd_create="yes" +fi +print_config "has_memfd_create" "$has_memfd_create" + ############################################################################# +if test "$liburing_nolibc" = "yes"; then + output_sym "CONFIG_NOLIBC" +else + liburing_nolibc="no" +fi +print_config "liburing_nolibc" "$liburing_nolibc" if test "$__kernel_rwf_t" = "yes"; then output_sym "CONFIG_HAVE_KERNEL_RWF_T" @@ -319,12 +404,24 @@ fi if test "$statx" = "yes"; then output_sym "CONFIG_HAVE_STATX" fi +if test "$glibc_statx" = "yes"; then + output_sym "CONFIG_HAVE_GLIBC_STATX" +fi if test "$has_cxx" = "yes"; then output_sym "CONFIG_HAVE_CXX" fi if test "$has_ucontext" = "yes"; then output_sym "CONFIG_HAVE_UCONTEXT" fi +if test "$stringop_overflow" = "yes"; then + output_sym "CONFIG_HAVE_STRINGOP_OVERFLOW" +fi +if test "$array_bounds" = "yes"; then + output_sym "CONFIG_HAVE_ARRAY_BOUNDS" +fi +if test "$has_memfd_create" = "yes"; then + output_sym "CONFIG_HAVE_MEMFD_CREATE" +fi echo "CC=$cc" >> $config_host_mak print_config "CC" "$cc" @@ -373,6 +470,16 @@ struct open_how { }; EOF +else cat >> $compat_h << EOF +#include <linux/openat2.h> + +EOF +fi +if [ "$glibc_statx" = "no" ] && [ "$statx" = "yes" ]; then +cat >> $compat_h << EOF +#include <sys/stat.h> + +EOF fi cat >> $compat_h << EOF |