From patchwork Sat Apr 16 18:36:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 52996 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A3EAF3857C42 for ; Sat, 16 Apr 2022 18:37:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3EAF3857C42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1650134222; bh=dG3ZAde9q12w/cYcotNF2vmSi4IVg6KaErBX44FJdq4=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CjCdoIagR8p+I5K0JmM7NV7MAoW0+4yT0ONBflodOFqELNaWJ8ByrvZ64zOrCtCeZ EeL4wgGh5w6aTDqBpD3oMbd6zBDbtg3cc/1KQDV647uzBxxBF63GUTTMgVHRL3nx8Y jP7YbfEu/PPLghE4gZT9a0+TUtnVijFOzA7A/Q0k= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by sourceware.org (Postfix) with ESMTPS id BB9743858C2C for ; Sat, 16 Apr 2022 18:36:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB9743858C2C Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2ec13b4bd42so88531727b3.16 for ; Sat, 16 Apr 2022 11:36:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=dG3ZAde9q12w/cYcotNF2vmSi4IVg6KaErBX44FJdq4=; b=FxkGBL8jGNCTr3kxRsbYLyTKgNsAUN67vTqcSh9wgK+N0uAC3Mt4FG+XprIF4Gye0D m6KPrqM+r/ks1yII8w+8sV61WrupGbiemHLw1C1KFwBdw7EVugkenc4hNO+NgyZ8HIUw Bjk77HKNdQhin0Y7d0fy1ADq252fU06ty0BVVrPihBzMUWCpfXibhwPMWukyS13EoDes CyhUDSM28GVAcyoBDnPlrsxY0QfR/03ux/m/UuDDyGt4GfejGPHVzI3bZzezU41cV0II HTfhIBUN06cjliS+jxqgS5sPDL2r3ObiPJcfXu6yxfBO2o4RSCxQbiatDO4ZEOOjjX3x ZCWg== X-Gm-Message-State: AOAM532tQmgvlo6yzFhZnPOtP3uRr8Jm019tCV6/kcJRrQMrH22gj/g/ xlQ9qWW7fooWjrPwPszluj+nqOjJfguo+fdsBLlds3K+C03XDaIxVvgsmpAemW176G5cnPOun2z Ir7EG66i52s1CcsCuicFF7/GtpiGIumsTspnroVs4ZOlg1s60fkaDhMIDW6RVYKvR5ax/ X-Google-Smtp-Source: ABdhPJzV7GvKheBRs+KZx3YNLSsOFk7iaDEgMG0VSM0oatF0diyTenuQPo5XE3pdi1MrDESj+UfSOxeNkjGz X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:9fda:6505:7d5c:5046]) (user=maskray job=sendgmr) by 2002:a81:c703:0:b0:2d0:cc6b:3092 with SMTP id m3-20020a81c703000000b002d0cc6b3092mr3946731ywi.449.1650134195086; Sat, 16 Apr 2022 11:36:35 -0700 (PDT) Date: Sat, 16 Apr 2022 11:36:28 -0700 Message-Id: <20220416183628.3522663-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH] Change fno-unit-at-a-time to fno-toplevel-reorder To: libc-alpha@sourceware.org, Adhemerval Zanella X-Spam-Status: No, score=-19.4 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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-Patchwork-Original-From: Fangrui Song via Libc-alpha From: Fangrui Song Reply-To: Fangrui Song Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" -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. --- 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