From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by sourceware.org (Postfix) with ESMTPS id AE27C3858D1E for ; Wed, 4 May 2022 18:34:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE27C3858D1E Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-e5e433d66dso2060152fac.5 for ; Wed, 04 May 2022 11:34:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=C8Yz3PFsmcdhU7H747NSkaQ7nltpceweWD8sEPUJyrY=; b=hkbjmkW46sVrM3ydwFF2D0gx2iL0juEE6WSH9YPDkZEqPGESPNyL7L+iRW48kSR623 56QbR4FKjTyumRtbDsRcyyjZ2p74+5d53dM9FDK6R9qkLamJAzmxew1OU0ymf6I4ffL4 dspocjzrFXIYcHosQafaN+BnEnh5wkug+b+k4KwITdktyFGdWjPfKyTIw7X7k/L3NCVu kLGn8X0/iDj3URKaOJO5ueYjOng1smvoSpwbn3LQet/YyY2v2m1OaOzvQEAbdAZMtfQF xOtSviZzLhxj4pUT7W5GGHD8TCHdcQtsonGXmgC6iI72bM2/4KZqr+qlyAkt07BSGEea XF7w== X-Gm-Message-State: AOAM533o1/J4qVzdIvUv2ZGETCaN+wXFh8BS+6RO+q4nx5jsYogDZOkI 0Xf8JQG/7GZGCRn264WmAExC9PhL7uGdaQ== X-Google-Smtp-Source: ABdhPJxLNljxhUAwES6fJuVraRCzqG0PDgZw6ARk89wKQMESbZr5c9dZDthfo6hsmcfqvM9EvisX7g== X-Received: by 2002:a05:6870:4203:b0:ed:debe:b18c with SMTP id u3-20020a056870420300b000eddebeb18cmr431470oac.53.1651689274020; Wed, 04 May 2022 11:34:34 -0700 (PDT) Received: from ?IPV6:2804:431:c7cb:726:3ae8:3076:1dad:37? ([2804:431:c7cb:726:3ae8:3076:1dad:37]) by smtp.gmail.com with ESMTPSA id g2-20020a4ad842000000b0035f068e16aasm2767705oov.5.2022.05.04.11.34.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 May 2022 11:34:33 -0700 (PDT) Message-ID: <4f7a5107-837b-7518-f8d3-15a6c7777322@linaro.org> Date: Wed, 4 May 2022 15:34:30 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] Change fno-unit-at-a-time to fno-toplevel-reorder Content-Language: en-US To: Fangrui Song , libc-alpha@sourceware.org References: <20220416183628.3522663-1-maskray@google.com> From: Adhemerval Zanella In-Reply-To: <20220416183628.3522663-1-maskray@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2022 18:34:40 -0000 On 16/04/2022 15:36, Fangrui Song wrote: > -fno-toplevel-reorder is a rough replacement for the legacy option > -fno-unit-at-a-time > (https://sourceware.org/pipermail/gcc-patches/2006-January/186801.html). > glibc currently requires GCC>=6.2 which assuredly has > -fno-toplevel-reorder -fno-section-anchors. Clang will use the else > branch as it does not implement -fno-toplevel-reorder. I don't see much improvement here, it just trades one option by another. Maybe a better approach would to reorganize the code to avoid requiring special compiler options. I did it for the gcc clang work [1], so check-abi is clean. [1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/fno-unit-at-fime-removal > --- > config.make.in | 2 +- > configure | 6 +++--- > configure.ac | 6 +++--- > stdio-common/Makefile | 4 ++-- > 4 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/config.make.in b/config.make.in > index bf728c71c0..65e1f46da4 100644 > --- a/config.make.in > +++ b/config.make.in > @@ -68,7 +68,7 @@ have-selinux = @have_selinux@ > have-libaudit = @have_libaudit@ > have-libcap = @have_libcap@ > have-cc-with-libunwind = @libc_cv_cc_with_libunwind@ > -fno-unit-at-a-time = @fno_unit_at_a_time@ > +fno-toplevel-reorder = @fno_toplevel_reorder@ > bind-now = @bindnow@ > have-hash-style = @libc_cv_hashstyle@ > use-default-link = @use_default_link@ > diff --git a/configure b/configure > index d2f413d05d..4c7b159b13 100755 > --- a/configure > +++ b/configure > @@ -620,7 +620,7 @@ libc_cv_cc_loop_to_function > libc_cv_cc_submachine > libc_cv_cc_nofma > libc_cv_mtls_dialect_gnu2 > -fno_unit_at_a_time > +fno_toplevel_reorder > libc_cv_has_glob_dat > libc_cv_hashstyle > libc_cv_fpie > @@ -6305,9 +6305,9 @@ fi > { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_fno_toplevel_reorder" >&5 > $as_echo "$libc_cv_fno_toplevel_reorder" >&6; } > if test $libc_cv_fno_toplevel_reorder = yes; then > - fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors" > + fno_toplevel_reorder="-fno-toplevel-reorder -fno-section-anchors" > else > - fno_unit_at_a_time=-fno-unit-at-a-time > + fno_toplevel_reorder= > fi > > > diff --git a/configure.ac b/configure.ac > index b6a747dece..bdff5981c1 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1460,11 +1460,11 @@ else > fi > rm -f conftest*]) > if test $libc_cv_fno_toplevel_reorder = yes; then > - fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors" > + fno_toplevel_reorder="-fno-toplevel-reorder -fno-section-anchors" > else > - fno_unit_at_a_time=-fno-unit-at-a-time > + fno_toplevel_reorder= > fi > -AC_SUBST(fno_unit_at_a_time) > +AC_SUBST(fno_toplevel_reorder) > > AC_CACHE_CHECK([for -mtls-dialect=gnu2], libc_cv_mtls_dialect_gnu2, > [dnl > diff --git a/stdio-common/Makefile b/stdio-common/Makefile > index 435cd8904f..6de2dd84ce 100644 > --- a/stdio-common/Makefile > +++ b/stdio-common/Makefile > @@ -333,8 +333,8 @@ CFLAGS-isoc99_vfscanf.c += -fexceptions > CFLAGS-isoc99_vscanf.c += -fexceptions > CFLAGS-isoc99_fscanf.c += -fexceptions > CFLAGS-isoc99_scanf.c += -fexceptions > -CFLAGS-errlist.c += $(fno-unit-at-a-time) > -CFLAGS-siglist.c += $(fno-unit-at-a-time) > +CFLAGS-errlist.c += $(fno-toplevel-reorder) > +CFLAGS-siglist.c += $(fno-toplevel-reorder) > > # scanf14a.c and scanf16a.c test a deprecated extension which is no > # longer visible under most conformance levels; see the source files