GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
* [RFC PATCH liburing v1 0/2] Always enable CONFIG_NOLIBC if supported and deprecate --nolibc option
@ 2023-01-06 15:52 Ammar Faizi
  2023-01-06 15:52 ` [RFC PATCH liburing v1 1/2] github: Remove nolibc build on the GitHub CI bot Ammar Faizi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ammar Faizi @ 2023-01-06 15:52 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Ammar Faizi, Pavel Begunkov, Gilang Fachrezy,
	VNLX Kernel Department, Alviro Iskandar Setiawan,
	GNU/Weeb Mailing List, io-uring Mailing List

From: Ammar Faizi <[email protected]>

Hi Jens,

This is an RFC patchset. It's already build-tested.

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.

There are 2 patches in this series:

   - A preparation patch, remove --nolibc from the GitHub CI.

   - Always enable CONFIG_NOLIBC if supported and deprecate --nolibc.

After this series, --nolibc option is deprecated and has no effect.
I plan to remove this option in a future liburing release.

Comments welcome...

Signed-off-by: Alviro Iskandar Setiawan <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---

Alviro Iskandar Setiawan (1):
  configure: Always enable `CONFIG_NOLIBC` if the arch is supported

Ammar Faizi (1):
  github: Remove nolibc build on the GitHub CI bot

 .github/workflows/build.yml | 10 ----------
 configure                   | 40 ++++++++++++++++++++++++++++++++-----
 2 files changed, 35 insertions(+), 15 deletions(-)


base-commit: c76d392035fd271980faa297334268f2cd77d774
-- 
Ammar Faizi


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

* [RFC PATCH liburing v1 1/2] github: Remove nolibc build on the GitHub CI bot
  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 ` Ammar Faizi
  2023-01-06 15:52 ` [RFC PATCH liburing v1 2/2] configure: Always enable `CONFIG_NOLIBC` if the arch is supported Ammar Faizi
  2023-01-06 22:39 ` [RFC PATCH liburing v1 0/2] Always enable CONFIG_NOLIBC if supported and deprecate --nolibc option Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Ammar Faizi @ 2023-01-06 15:52 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Ammar Faizi, Pavel Begunkov, Gilang Fachrezy,
	VNLX Kernel Department, Alviro Iskandar Setiawan,
	GNU/Weeb Mailing List, io-uring Mailing List

From: Ammar Faizi <[email protected]>

This is a preparation patch to deprecate `--nolibc` configure option.

Signed-off-by: Ammar Faizi <[email protected]>
---
 .github/workflows/build.yml | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c2aa3e6..f18f069 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -117,16 +117,6 @@ jobs:
         ./configure --cc=${{matrix.cc}} --cxx=${{matrix.cxx}};
         make -j$(nproc) V=1 CPPFLAGS="-Werror" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS";
 
-    - name: Build nolibc
-      run: |
-        if [[ "${{matrix.arch}}" == "x86_64" || "${{matrix.arch}}" == "i686" || "${{matrix.arch}}" == "aarch64" ]]; then \
-            make clean; \
-            ./configure --cc=${{matrix.cc}} --cxx=${{matrix.cxx}} --nolibc; \
-            make -j$(nproc) V=1 CPPFLAGS="-Werror" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS"; \
-        else \
-            echo "Skipping nolibc build, this arch doesn't support building liburing without libc"; \
-        fi;
-
     - name: Test install command
       run: |
         sudo make install;
-- 
Ammar Faizi


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

* [RFC PATCH liburing v1 2/2] configure: Always enable `CONFIG_NOLIBC` if the arch is supported
  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
  2023-01-06 22:39 ` [RFC PATCH liburing v1 0/2] Always enable CONFIG_NOLIBC if supported and deprecate --nolibc option Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Ammar Faizi @ 2023-01-06 15:52 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Alviro Iskandar Setiawan, Pavel Begunkov, Gilang Fachrezy,
	VNLX Kernel Department, GNU/Weeb Mailing List,
	io-uring Mailing List, Ammar Faizi

From: Alviro Iskandar Setiawan <[email protected]>

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 <[email protected]>
Co-authored-by: Ammar Faizi <[email protected]>
Signed-off-by: Ammar Faizi <[email protected]>
---
 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


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

* Re: [RFC PATCH liburing v1 0/2] Always enable CONFIG_NOLIBC if supported and deprecate --nolibc option
  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 ` [RFC PATCH liburing v1 2/2] configure: Always enable `CONFIG_NOLIBC` if the arch is supported Ammar Faizi
@ 2023-01-06 22:39 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2023-01-06 22:39 UTC (permalink / raw)
  To: Ammar Faizi
  Cc: Pavel Begunkov, Gilang Fachrezy, VNLX Kernel Department,
	Alviro Iskandar Setiawan, GNU/Weeb Mailing List,
	io-uring Mailing List


On Fri, 06 Jan 2023 22:52:00 +0700, Ammar Faizi wrote:
> This is an RFC patchset. It's already build-tested.
> 
> 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.
> 
> [...]

Applied, thanks!

[1/2] github: Remove nolibc build on the GitHub CI bot
      commit: 439cff00aa9a3b8bc6b88787ffca90d32655ce2f
[2/2] configure: Always enable `CONFIG_NOLIBC` if the arch is supported
      commit: bfb432f4cce52cb3e3bd9c1823e94ff29bd4fb80

Best regards,
-- 
Jens Axboe



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

end of thread, other threads:[~2023-01-06 22:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [RFC PATCH liburing v1 2/2] configure: Always enable `CONFIG_NOLIBC` if the arch is supported Ammar Faizi
2023-01-06 22:39 ` [RFC PATCH liburing v1 0/2] Always enable CONFIG_NOLIBC if supported and deprecate --nolibc option Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox