From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>,
Pavel Begunkov <asml.silence@gmail.com>,
Gilang Fachrezy <gilang4321@gmail.com>,
VNLX Kernel Department <kernel@vnlx.org>,
GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>,
io-uring Mailing List <io-uring@vger.kernel.org>,
Ammar Faizi <ammarfaizi2@gnuweeb.org>
Subject: [RFC PATCH liburing v1 2/2] configure: Always enable `CONFIG_NOLIBC` if the arch is supported
Date: Fri, 6 Jan 2023 22:52:02 +0700 [thread overview]
Message-ID: <20230106155202.558533-3-ammar.faizi@intel.com> (raw)
In-Reply-To: <20230106155202.558533-1-ammar.faizi@intel.com>
From: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
Currently, the default liburing compilation uses libc as its dependency.
liburing doesn't depend on libc when it's compiled on x86-64, x86
(32-bit), and aarch64. There is no benefit to having libc.so linked to
liburing.so on those architectures. Always enable CONFIG_NOLBIC if the
arch is supported. If the architecture is not supported, fallback to
libc.
Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
Co-authored-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
configure | 40 +++++++++++++++++++++++++++++++++++-----
1 file changed, 35 insertions(+), 5 deletions(-)
diff --git a/configure b/configure
index 4d9e99c..2033e6f 100755
--- a/configure
+++ b/configure
@@ -5,6 +5,22 @@ set -e
cc=${CC:-gcc}
cxx=${CXX:-g++}
+#
+# TODO(ammarfaizi2): Remove this notice and `--nolibc` option.
+#
+nolibc_deprecated() {
+ echo "";
+ echo "=================================================================";
+ echo "";
+ echo " --nolibc option is deprecated and has no effect.";
+ echo " It will be removed in a future liburing release.";
+ echo "";
+ echo " liburing on x86-64, x86 (32-bit) and aarch64 always use CONFIG_NOLIBC.";
+ echo "";
+ echo "=================================================================";
+ echo "";
+}
+
for opt do
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)' || true)
case "$opt" in
@@ -26,7 +42,7 @@ for opt do
;;
--cxx=*) cxx="$optarg"
;;
- --nolibc) liburing_nolibc="yes"
+ --nolibc) nolibc_deprecated
;;
*)
echo "ERROR: unknown option $opt"
@@ -385,13 +401,27 @@ fi
print_config "NVMe uring command support" "$nvme_uring_cmd"
#############################################################################
+#
+# Currently, CONFIG_NOLIBC is only enabled on x86-64, x86 (32-bit) and aarch64.
+#
+cat > $TMPC << EOF
+int main(void){
+#if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__)
+ return 0;
+#else
+#error libc is needed
+#endif
+}
+EOF
+if compile_prog "" "" "nolibc support"; then
+ liburing_nolibc="yes"
+fi
+print_config "nolibc support" "$liburing_nolibc";
+#############################################################################
+
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"
fi
--
Ammar Faizi
next prev parent reply other threads:[~2023-01-06 15:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-06 15:52 [RFC PATCH liburing v1 0/2] Always enable CONFIG_NOLIBC if supported and deprecate --nolibc option Ammar Faizi
2023-01-06 15:52 ` [RFC PATCH liburing v1 1/2] github: Remove nolibc build on the GitHub CI bot Ammar Faizi
2023-01-06 15:52 ` Ammar Faizi [this message]
2023-01-06 22:39 ` [RFC PATCH liburing v1 0/2] Always enable CONFIG_NOLIBC if supported and deprecate --nolibc option Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230106155202.558533-3-ammar.faizi@intel.com \
--to=ammarfaizi2@gnuweeb.org \
--cc=alviro.iskandar@gnuweeb.org \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=gilang4321@gmail.com \
--cc=gwml@vger.gnuweeb.org \
--cc=io-uring@vger.kernel.org \
--cc=kernel@vnlx.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox