From patchwork Fri Jan 6 15:52:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13091487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC283C4708D for ; Fri, 6 Jan 2023 15:52:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232218AbjAFPwX (ORCPT ); Fri, 6 Jan 2023 10:52:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234720AbjAFPwU (ORCPT ); Fri, 6 Jan 2023 10:52:20 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7705911A27 for ; Fri, 6 Jan 2023 07:52:19 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id A65F97E51F; Fri, 6 Jan 2023 15:52:16 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1673020339; bh=QaFA/PFZVrWHpLbUPPChboMLcuyCxW3JGVxmlBUo5uU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BQHhEyhaeaxincCwJeezghgRhnDKuk1E8d1Ui1A9XfQHiJRqINfTBXCMbfE3A2+9J BGduiMmwKCGMMcEtAvxBmWVjqbZYEBUhOnqUwbK295CGFcPzXmQCg+DDpji4aRw/wU 84xu45DCESifJ81CW5fRuRsEKAORpMZveXzP4tuAiGpsmwQp64Xj9X8Zemf5VcF1mF GiflpNiDVZvzI3z5nEQsxCCnbxJe2uYZ3JkF39D4DTLbix0RnDKcV31OBDjQj+Tbdl I2V9bQabHy1viS12uc4FVv81cjB4GclovYecSS8m+iQJ5ZrWXH7NT4J6ZOcJx5BKLH xngZarPV+AP1Q== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , Gilang Fachrezy , VNLX Kernel Department , Alviro Iskandar Setiawan , GNU/Weeb Mailing List , io-uring Mailing List Subject: [RFC PATCH liburing v1 1/2] github: Remove nolibc build on the GitHub CI bot Date: Fri, 6 Jan 2023 22:52:01 +0700 Message-Id: <20230106155202.558533-2-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106155202.558533-1-ammar.faizi@intel.com> References: <20230106155202.558533-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi This is a preparation patch to deprecate `--nolibc` configure option. Signed-off-by: Ammar Faizi --- .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; From patchwork Fri Jan 6 15:52:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13091489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D6BAC54EBE for ; Fri, 6 Jan 2023 15:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233380AbjAFPwY (ORCPT ); Fri, 6 Jan 2023 10:52:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233287AbjAFPwX (ORCPT ); Fri, 6 Jan 2023 10:52:23 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 978A911A27 for ; Fri, 6 Jan 2023 07:52:22 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.184]) by gnuweeb.org (Postfix) with ESMTPSA id C7B9E7E41C; Fri, 6 Jan 2023 15:52:19 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1673020342; bh=P9xWc8JRTwJuvDZNiI0hkbuuk8tWAvyw91Blr0so0Ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fXetpVTr4HM7ejH/C4xU0Ceh4dhGCIvORP5qWXSxfo10ihD6hrnjlTp9ycso3mTfV /V4mLEwjVahPJ/Cp8GxmptRFTq5DM2MqsShxAw8Bx0WQNSuzWKgGZAAyLaorbUpl8p czvty4VeAFzaA7FZDCXVLFD5g0Qvc8ZueFlddwj87rPnnhg6azHCPCW2JXZnfftBV1 5glIzHETGRK905WfBkWvSKpGbn5LNLf22JQ8yzEO9Zp58DSybBqIGyrLK2I3KB0Xnv oVJ0tWAukaPV58x7F2J38pw+SHNCdz7uQi0A9nSNlOWZ+0RNB9Invw9WGvk5OmDykZ 32BDxejID3P3A== From: Ammar Faizi To: Jens Axboe Cc: Alviro Iskandar Setiawan , Pavel Begunkov , Gilang Fachrezy , VNLX Kernel Department , GNU/Weeb Mailing List , io-uring Mailing List , Ammar Faizi 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 Message-Id: <20230106155202.558533-3-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230106155202.558533-1-ammar.faizi@intel.com> References: <20230106155202.558533-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Alviro Iskandar Setiawan 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 Co-authored-by: Ammar Faizi Signed-off-by: Ammar Faizi --- 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