From patchwork Thu May 12 12:59:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 53868 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 E0821384B0CC for ; Thu, 12 May 2022 13:14:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0821384B0CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652361292; bh=aBrO61I2MBsIk23tJxTRk14eVbt2yNamYRRLUw6KmKg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=LLAcq/4Fb7e/lSh6QdCNYmBJMF3ij3+vd4gv//xYt8YIWxeeYZQtFwtyN5gjDTwZe dUx5cG76q/LzSrUBe9RT0/mL/mFaRqoHJgrIICjwcs/GDwxGnsuUgGCzjNwdpNngBI lt+7Ar/8TQSvUipB1x6zSeeK3vNRA2XeJXtRsGzY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 49EB83836409 for ; Thu, 12 May 2022 12:59:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 49EB83836409 Received: by mail-oi1-x232.google.com with SMTP id i66so6261094oia.11 for ; Thu, 12 May 2022 05:59:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aBrO61I2MBsIk23tJxTRk14eVbt2yNamYRRLUw6KmKg=; b=5AdtdRAM2b9Te+E4jY33BLGPGiKotVSh9w0iX5CBrOCTTOvu69LasYrbuwW+GNNTcU hP8jx2ZFnPC7b+uFnqJXwIfDmvl+FElUIVWXbIHXM8TTiXVG2jT8r8zlK/sBdXHa0G5c CEHw09LpizlQOyDzC7mT1qcj5CnuRYVP8bcy4Shzdf8KdOS0AUh79s3GtndNuDaaMIuc GvXBQVx/dYIwUatdvCKVZpOSq6UF/HdOkyGzpAai42yDuQDsaNAEjXb3LdgnSPF8f2Rx cSOU+zUSu5wBVfRnSAlYiV6fmureCCSd1aWFiyq63TadDGMpNCfB47es2weabHtyV678 fXew== X-Gm-Message-State: AOAM533UUGP52Si8v/buBGwW4PkFZHhovI3vd8DhHEV89myL1g1+qLtz jBZMwqmQmZT7XyM36/Vc6kppN0yUWRbyqw== X-Google-Smtp-Source: ABdhPJx41GSjt/FAH3NEr1xOBDJtMNPHBow/Vrqod/kScOMb1AVfjOvGJbQOtkDdbaCkWXNrgdCRMw== X-Received: by 2002:a05:6808:23d2:b0:326:979a:46f3 with SMTP id bq18-20020a05680823d200b00326979a46f3mr5356711oib.207.1652360381347; Thu, 12 May 2022 05:59:41 -0700 (PDT) Received: from birita.. ([2804:431:c7ca:5fbd:6a01:8849:5cb:128b]) by smtp.gmail.com with ESMTPSA id a11-20020a056870d18b00b000edf5a12baasm1527144oac.46.2022.05.12.05.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 05:59:40 -0700 (PDT) To: libc-alpha@sourceware.org, Fangrui Song Subject: [PATCH v2 1/4] Add declare_object_symbol_alias for assembly codes (BZ #28128) Date: Thu, 12 May 2022 09:59:28 -0300 Message-Id: <20220512125931.523712-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220512125931.523712-1-adhemerval.zanella@linaro.org> References: <20220512125931.523712-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" From: "H.J. Lu" There are 2 problems in: #define declare_symbol_alias(symbol, original, type, size) \ declare_symbol_alias_1 (symbol, original, type, size) #ifdef __ASSEMBLER__ # define declare_symbol_alias_1(symbol, original, type, size) \ strong_alias (original, symbol); \ .type C_SYMBOL_NAME (symbol), %##type; \ .size C_SYMBOL_NAME (symbol), size 1. .type and .size are substituted by arguments. 2. %##type is expanded to "% type" due to the GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101613 But assembler doesn't support "% type". Workaround BZ #28128 by 1. Don't define declare_symbol_alias for assembly codes. 2. Define declare_object_symbol_alias for assembly codes. Reviewed-by: Fangrui Song --- include/libc-symbols.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 662bd118b1..4bb3d8c7ba 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -324,14 +324,16 @@ for linking") This is only necessary when defining something in assembly, or playing funny alias games where the size should be other than what the compiler thinks it is. */ -#define declare_symbol_alias(symbol, original, type, size) \ - declare_symbol_alias_1 (symbol, original, type, size) #ifdef __ASSEMBLER__ -# define declare_symbol_alias_1(symbol, original, type, size) \ - strong_alias (original, symbol); \ - .type C_SYMBOL_NAME (symbol), %##type; \ - .size C_SYMBOL_NAME (symbol), size +# define declare_object_symbol_alias(symbol, original, size) \ + declare_object_symbol_alias_1 (symbol, original, size) +# define declare_object_symbol_alias_1(symbol, original, s_size) \ + strong_alias (original, symbol) ASM_LINE_SEP \ + .type C_SYMBOL_NAME (symbol), %object ASM_LINE_SEP \ + .size C_SYMBOL_NAME (symbol), s_size ASM_LINE_SEP #else /* Not __ASSEMBLER__. */ +# define declare_symbol_alias(symbol, original, type, size) \ + declare_symbol_alias_1 (symbol, original, type, size) # define declare_symbol_alias_1(symbol, original, type, size) \ asm (".globl " __SYMBOL_PREFIX #symbol \ "\n\t" declare_symbol_alias_1_alias (symbol, original) \ From patchwork Thu May 12 12:59:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 53869 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 BF0C23839C6C for ; Thu, 12 May 2022 13:15:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF0C23839C6C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652361335; bh=oqV/yc6XqbQvXOYiSQqFnE5C/1d7X5bI2ewmOfA+yBM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ddSM/vemIHyD+bXVRe3P85YUd7MUmMH6uYoa77HH3crYMF58oVtc78r88zQFMowYS l4deTgXEkyLpCvSO/7pUL9dyMrk7HFFCJNZ6YU/PAbQYv5lx0rboc/3wyqnmZaPly1 H9yqlPgsznrpm+zEP7ET+ZaO9KBQtvHbzyahsB8A= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id 833F13839430 for ; Thu, 12 May 2022 12:59:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 833F13839430 Received: by mail-oi1-x22f.google.com with SMTP id m25so6309309oih.2 for ; Thu, 12 May 2022 05:59:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oqV/yc6XqbQvXOYiSQqFnE5C/1d7X5bI2ewmOfA+yBM=; b=CVZ+TzVA0tQpn5UeFUAaOgLsunC57+iTxJe3jh7EOonjs2oArq56f2Q5oo+DsXUGeG ln4UNAe1qMTUCASHAvIjanjphCU72RyepDwFLPuFobx6VedTUgx83a8L1CY+wrhMBzdI lucYuESxzVrkeaQz6GFC8GoULNq+7tRogpiig3RA+rYtw3/vE0/hNNXrPvluTCRoO0UE A2unGDLXeP2aYgmc9PNlUQp8/LWbOeBuqkegvJPX0CFZVADoiXM5KJY+oHGNzAfFxijm EfrsDEhHmisLZnKzIRwUOjz4jUGMe7BcajvQubFZLdX44Zj34H0IWi3o6rSjYJXhnUrn +qkA== X-Gm-Message-State: AOAM532/nWs6RRMFeXqta07TgCHkDqLidE0LJEi3nP9LaG4+A7Q/kmjj aKZLg0il6FKLaT6s7byT+cApxVYLFQ/XbQ== X-Google-Smtp-Source: ABdhPJzIAw8UfvD0PDFkQZ13pBxYjEx5mniYPi1JYqopp1tEqx2XT0DhaAch24Ua51Ayu346mbNyTg== X-Received: by 2002:aca:4385:0:b0:326:bf61:67ee with SMTP id q127-20020aca4385000000b00326bf6167eemr5270356oia.55.1652360383399; Thu, 12 May 2022 05:59:43 -0700 (PDT) Received: from birita.. ([2804:431:c7ca:5fbd:6a01:8849:5cb:128b]) by smtp.gmail.com with ESMTPSA id a11-20020a056870d18b00b000edf5a12baasm1527144oac.46.2022.05.12.05.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 05:59:42 -0700 (PDT) To: libc-alpha@sourceware.org, Fangrui Song Subject: [PATCH v2 2/4] stdio: Remove the usage of $(fno-unit-at-a-time) for errlist.c Date: Thu, 12 May 2022 09:59:29 -0300 Message-Id: <20220512125931.523712-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220512125931.523712-1-adhemerval.zanella@linaro.org> References: <20220512125931.523712-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The errlist.c is build with -fno-toplevel-reorder to avoid compiler to reorder the compat assembly directives due a static linker issue [1] (fixed on 2.39). This patch removes the compiler flags by split the compat symbol generation in two phases. First the _sys_errlist_internal internal without any compat symbol directive is preprocessed to generate an assembly source code. This generate assembly is then used as input on a platform agnostic errlist-data.S which then creates the compat definitions. This prevents compiler to move any compat directive prior the _sys_errlist_internal definition itself. Checked on a make check run-built-tests=no on all affected ABIs. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=29012 Reviewed-by: Fangrui Song --- Makeconfig | 3 +- include/stdio.h | 1 + stdio-common/Makefile | 20 ++++++++++- stdio-common/err_map.h | 24 +++++++++++++ stdio-common/errlist-compat-data.h | 1 + stdio-common/errlist-compat.c | 1 - stdio-common/errlist-data-gen.c | 34 +++++++++++++++++++ stdio-common/errlist-data.S | 7 ++++ stdio-common/errlist.c | 20 +++-------- sysdeps/mach/hurd/{errlist.c => err_map.h} | 9 +++-- ...errlist-compat.c => errlist-compat-data.h} | 0 ...errlist-compat.c => errlist-compat-data.h} | 0 sysdeps/unix/sysv/linux/errlist-compat.h | 33 +++++++++++------- ...errlist-compat.c => errlist-compat-data.h} | 0 ...errlist-compat.c => errlist-compat-data.h} | 0 ...errlist-compat.c => errlist-compat-data.h} | 0 16 files changed, 120 insertions(+), 33 deletions(-) create mode 100644 stdio-common/err_map.h create mode 100644 stdio-common/errlist-compat-data.h delete mode 100644 stdio-common/errlist-compat.c create mode 100644 stdio-common/errlist-data-gen.c create mode 100644 stdio-common/errlist-data.S rename sysdeps/mach/hurd/{errlist.c => err_map.h} (83%) rename sysdeps/unix/sysv/linux/alpha/{errlist-compat.c => errlist-compat-data.h} (100%) rename sysdeps/unix/sysv/linux/{errlist-compat.c => errlist-compat-data.h} (100%) rename sysdeps/unix/sysv/linux/hppa/{errlist-compat.c => errlist-compat-data.h} (100%) rename sysdeps/unix/sysv/linux/mips/{errlist-compat.c => errlist-compat-data.h} (100%) rename sysdeps/unix/sysv/linux/sparc/{errlist-compat.c => errlist-compat-data.h} (100%) diff --git a/Makeconfig b/Makeconfig index 760f14e92f..b5aa07c4f4 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1030,7 +1030,8 @@ ifeq (yes,$(build-shared)) # Under --enable-shared, we will build a shared library of PIC objects. # The PIC object files are named foo.os. object-suffixes += .os -CPPFLAGS-.os = -DPIC -DSHARED +pic-cppflags = -DPIC -DSHARED +CPPFLAGS-.os = $(pic-cppflags) CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag) libtype.os := lib%_pic.a # This can be changed by a sysdep makefile diff --git a/include/stdio.h b/include/stdio.h index 23b7fd288c..a6f7fd43cb 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -180,6 +180,7 @@ int __vfxprintf (FILE *__fp, const char *__fmt, __gnuc_va_list, attribute_hidden; extern const char *const _sys_errlist_internal[] attribute_hidden; +extern const size_t _sys_errlist_internal_len attribute_hidden; extern const char *__get_errlist (int) attribute_hidden; extern const char *__get_errname (int) attribute_hidden; diff --git a/stdio-common/Makefile b/stdio-common/Makefile index a1603e82fe..08bc998436 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -88,6 +88,7 @@ routines := \ aux := \ errlist \ + errlist-data \ errname \ fxprintf \ printf-parsemb \ @@ -211,6 +212,10 @@ tests := \ xbug \ # tests +generated += \ + errlist-data-aux-shared.S \ + errlist-data-aux.S \ + # generated test-srcs = tst-unbputc tst-printf tst-printfsz-islongdouble @@ -246,6 +251,20 @@ tests-special += $(objpfx)tst-errno-manual.out include ../Rules +# The errlist.c is built in two phases because compiler might reorder the +# compat_symbol directive prior the object itself and on binutils older +# than 2.29 it might generate object sizes different than the expected ones. +$(objpfx)errlist-data-aux-shared.S: errlist-data-gen.c + $(make-target-directory) + $(compile-command.c) $(pic-cppflags) $(pic-ccflag) $(no-stack-protector) -S + +$(objpfx)errlist-data-aux.S: errlist-data-gen.c + $(make-target-directory) + $(compile-command.c) $(pie-default) $(no-stack-protector) -S + +$(objpfx)errlist-data.os: $(objpfx)errlist-data-aux-shared.S +$(objpfx)errlist-data.o: $(objpfx)errlist-data-aux.S + ifeq ($(run-built-tests),yes) LOCALES := \ de_DE.ISO-8859-1 \ @@ -334,7 +353,6 @@ 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) # scanf14a.c and scanf16a.c test a deprecated extension which is no diff --git a/stdio-common/err_map.h b/stdio-common/err_map.h new file mode 100644 index 0000000000..6cc3aa3375 --- /dev/null +++ b/stdio-common/err_map.h @@ -0,0 +1,24 @@ +/* Internal errno names mapping definition. + Copyright (C) 2022 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _ERR_MAP_H +#define _ERR_MAP_H + +#define ERR_MAP(n) (n) + +#endif diff --git a/stdio-common/errlist-compat-data.h b/stdio-common/errlist-compat-data.h new file mode 100644 index 0000000000..7c89c9a5a4 --- /dev/null +++ b/stdio-common/errlist-compat-data.h @@ -0,0 +1 @@ +/* Empty */ diff --git a/stdio-common/errlist-compat.c b/stdio-common/errlist-compat.c deleted file mode 100644 index 6e25b021ab..0000000000 --- a/stdio-common/errlist-compat.c +++ /dev/null @@ -1 +0,0 @@ -/* Empty. */ diff --git a/stdio-common/errlist-data-gen.c b/stdio-common/errlist-data-gen.c new file mode 100644 index 0000000000..db4f50e6db --- /dev/null +++ b/stdio-common/errlist-data-gen.c @@ -0,0 +1,34 @@ +/* Internal errno names mapping definition. + Copyright (C) 2022 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include + +const char *const _sys_errlist_internal[] = + { +#define _S(n, str) [ERR_MAP(n)] = str, +#include +#undef _S + }; +const size_t _sys_errlist_internal_len = array_length (_sys_errlist_internal); + +/* Include to get the definitions for sys_nerr/_sys_nerr. */ +#include diff --git a/stdio-common/errlist-data.S b/stdio-common/errlist-data.S new file mode 100644 index 0000000000..870b3f40c9 --- /dev/null +++ b/stdio-common/errlist-data.S @@ -0,0 +1,7 @@ +#ifdef SHARED +# include "errlist-data-aux-shared.S" +#else +# include "errlist-data-aux.S" +#endif + +#include diff --git a/stdio-common/errlist.c b/stdio-common/errlist.c index 1c09a31a7a..4c0a0a218d 100644 --- a/stdio-common/errlist.c +++ b/stdio-common/errlist.c @@ -16,29 +16,17 @@ License along with the GNU C Library; if not, see . */ -#include +#include +#include #include #include -#include - -#ifndef ERR_MAP -# define ERR_MAP(n) n -#endif - -const char *const _sys_errlist_internal[] = - { -#define _S(n, str) [ERR_MAP(n)] = str, -#include -#undef _S - }; +#include const char * __get_errlist (int errnum) { int mapped = ERR_MAP (errnum); - if (mapped >= 0 && mapped < array_length (_sys_errlist_internal)) + if (mapped >= 0 && mapped < _sys_errlist_internal_len) return _sys_errlist_internal[mapped]; return NULL; } - -#include diff --git a/sysdeps/mach/hurd/errlist.c b/sysdeps/mach/hurd/err_map.h similarity index 83% rename from sysdeps/mach/hurd/errlist.c rename to sysdeps/mach/hurd/err_map.h index 2d782ffc67..22d21ca9f1 100644 --- a/sysdeps/mach/hurd/errlist.c +++ b/sysdeps/mach/hurd/err_map.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1998-2022 Free Software Foundation, Inc. +/* Internal errno names mapping definition. Hurd version. + Copyright (C) 2022 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,7 +16,11 @@ License along with the GNU C Library; if not, see . */ +#ifndef _ERR_MAP_H +#define _ERR_MAP_H + #include #define ERR_MAP(value) err_get_code (value) -#include + +#endif diff --git a/sysdeps/unix/sysv/linux/alpha/errlist-compat.c b/sysdeps/unix/sysv/linux/alpha/errlist-compat-data.h similarity index 100% rename from sysdeps/unix/sysv/linux/alpha/errlist-compat.c rename to sysdeps/unix/sysv/linux/alpha/errlist-compat-data.h diff --git a/sysdeps/unix/sysv/linux/errlist-compat.c b/sysdeps/unix/sysv/linux/errlist-compat-data.h similarity index 100% rename from sysdeps/unix/sysv/linux/errlist-compat.c rename to sysdeps/unix/sysv/linux/errlist-compat-data.h diff --git a/sysdeps/unix/sysv/linux/errlist-compat.h b/sysdeps/unix/sysv/linux/errlist-compat.h index a09b38f243..33008863f8 100644 --- a/sysdeps/unix/sysv/linux/errlist-compat.h +++ b/sysdeps/unix/sysv/linux/errlist-compat.h @@ -20,6 +20,7 @@ #define _ERRLIST_COMPAT_H #include +#include /* Define new compat symbols for symbols _sys_errlist, sys_errlist, _sys_nerr, and sys_nerr for version VERSION with NUMBERERR times number of @@ -27,17 +28,25 @@ Both _sys_errlist and sys_errlist alias to _sys_errlist_internal symbol (defined on errlist.c) while _sys_nerr and sys_nerr created new variable with the expected size. */ -#define DEFINE_COMPAT_ERRLIST(NUMBERERR, VERSION) \ - const int __##VERSION##_sys_nerr = NUMBERERR; \ - strong_alias (__##VERSION##_sys_nerr, __##VERSION##__sys_nerr); \ - declare_symbol_alias (__ ## VERSION ## _sys_errlist, _sys_errlist_internal,\ - object, NUMBERERR * (ULONG_WIDTH / UCHAR_WIDTH)); \ - declare_symbol_alias (__ ## VERSION ## __sys_errlist, \ - _sys_errlist_internal, object, \ - NUMBERERR * (ULONG_WIDTH / UCHAR_WIDTH)); \ - compat_symbol (libc, __## VERSION ## _sys_nerr, sys_nerr, VERSION); \ - compat_symbol (libc, __## VERSION ## __sys_nerr, _sys_nerr, VERSION); \ - compat_symbol (libc, __## VERSION ## _sys_errlist, sys_errlist, VERSION); \ - compat_symbol (libc, __## VERSION ## __sys_errlist, _sys_errlist, VERSION);\ +#ifdef __ASSEMBLER__ +# define DEFINE_COMPAT_ERRLIST(NUMBERERR, VERSION) \ + declare_object_symbol_alias (__ ## VERSION ## _sys_errlist, \ + _sys_errlist_internal, \ + NUMBERERR * (ULONG_WIDTH / UCHAR_WIDTH)) \ + ASM_LINE_SEP \ + declare_object_symbol_alias (__ ## VERSION ## __sys_errlist, \ + _sys_errlist_internal, \ + NUMBERERR * (ULONG_WIDTH / UCHAR_WIDTH)) \ + ASM_LINE_SEP \ + compat_symbol (libc, __## VERSION ## _sys_errlist, sys_errlist, VERSION) \ + ASM_LINE_SEP \ + compat_symbol (libc, __## VERSION ## __sys_errlist, _sys_errlist, VERSION) +#else +# define DEFINE_COMPAT_ERRLIST(NUMBERERR, VERSION) \ + const int __##VERSION##_sys_nerr = NUMBERERR; \ + strong_alias (__##VERSION##_sys_nerr, __##VERSION##__sys_nerr); \ + compat_symbol (libc, __## VERSION ## _sys_nerr, sys_nerr, VERSION); \ + compat_symbol (libc, __## VERSION ## __sys_nerr, _sys_nerr, VERSION); +#endif #endif diff --git a/sysdeps/unix/sysv/linux/hppa/errlist-compat.c b/sysdeps/unix/sysv/linux/hppa/errlist-compat-data.h similarity index 100% rename from sysdeps/unix/sysv/linux/hppa/errlist-compat.c rename to sysdeps/unix/sysv/linux/hppa/errlist-compat-data.h diff --git a/sysdeps/unix/sysv/linux/mips/errlist-compat.c b/sysdeps/unix/sysv/linux/mips/errlist-compat-data.h similarity index 100% rename from sysdeps/unix/sysv/linux/mips/errlist-compat.c rename to sysdeps/unix/sysv/linux/mips/errlist-compat-data.h diff --git a/sysdeps/unix/sysv/linux/sparc/errlist-compat.c b/sysdeps/unix/sysv/linux/sparc/errlist-compat-data.h similarity index 100% rename from sysdeps/unix/sysv/linux/sparc/errlist-compat.c rename to sysdeps/unix/sysv/linux/sparc/errlist-compat-data.h From patchwork Thu May 12 12:59:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 53870 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 2D4433839C69 for ; Thu, 12 May 2022 13:16:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D4433839C69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652361383; bh=26iGXrOpfHdiV8QP4QUW67XYPizjx+gI5YoGi5pFmFA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ksjeMk1b0Bg7EtbpWXQsh2u/xP2bRjry6yIk037rUEzka2+eKFrReNNW6g05EsX1P oXd08ylWchL/28IHbo+ebDSNp7M7D50BtQzevIsZ07MArFc7lExFTE/UAbitjFE6++ HaBKf5Gz5Z+5Leg1Y3OYWpezL+obC8lj8FtNxRwo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 8163A383801E for ; Thu, 12 May 2022 12:59:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8163A383801E Received: by mail-ot1-x336.google.com with SMTP id m15-20020a9d608f000000b00606a788887aso2612386otj.0 for ; Thu, 12 May 2022 05:59:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=26iGXrOpfHdiV8QP4QUW67XYPizjx+gI5YoGi5pFmFA=; b=VUUr3wL3Hgq4Gw9VAeNzxtOXsecZOBJQm5vUg9ahxJFuhvZDYy+SjMeRumpMd0eoRH hfPvAJhHZNDreSj+aGf1e5n21jKbatKyQbp0zP9m/joWd0T14oSiYBd5l/ybZkNqMYtQ bwZ+fjybDQj+ynH2avvHt/H/N5CKRjPYuHeiyZVYSc7YMTOtSYxcZCGoYOJrlXmG6g2u 5VW2UqpvN9StD366kOrq2iacKLHFOPMlxSM/qmrvySD2tuGYg6Qfl+XJJTAzWLEEKH7s NXR+I/SqsS1P1vzwPwlZMAEhgPeq9zLXx7lGu8Xp/ktPGPmVURBG99nncSmyzQI1jzF/ zIig== X-Gm-Message-State: AOAM530AXN1abTX9I/Ld4NNc4GT8qrt5Zbyvuv5hFhFWukDoprnOAL+3 Ba8Nn9CW4ynULt2zt94SwLZ10Eaabn/3CQ== X-Google-Smtp-Source: ABdhPJzQaAsEn/mY1Er2viJSs2/GGuXf9TPkCDFpT+4u4ubhRI55Rdcc+ZhcGeLD8/ZrjoMPyFYGPw== X-Received: by 2002:a9d:2928:0:b0:605:f305:b80c with SMTP id d37-20020a9d2928000000b00605f305b80cmr11468613otb.290.1652360385421; Thu, 12 May 2022 05:59:45 -0700 (PDT) Received: from birita.. ([2804:431:c7ca:5fbd:6a01:8849:5cb:128b]) by smtp.gmail.com with ESMTPSA id a11-20020a056870d18b00b000edf5a12baasm1527144oac.46.2022.05.12.05.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 05:59:44 -0700 (PDT) To: libc-alpha@sourceware.org, Fangrui Song Subject: [PATCH v2 3/4] stdio: Remove the usage of $(fno-unit-at-a-time) for siglist.c Date: Thu, 12 May 2022 09:59:30 -0300 Message-Id: <20220512125931.523712-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220512125931.523712-1-adhemerval.zanella@linaro.org> References: <20220512125931.523712-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The siglist.c is build with -fno-toplevel-reorder to avoid compiler to reorder the compat assembly directives due a static linker issue [1] (fixed on 2.39). This patch removes the compiler flags by split the compat symbol generation in two phases. First the __sys_siglist and __sys_sigabbrev without any compat symbol directive is preprocessed to generate an assembly source code. This generate assembly is then used as input on a platform agnostic siglist.S which then creates the compat definitions. This prevents compiler to move any compat directive prior the _sys_errlist_internal definition itself. Checked on a make check run-built-tests=no on all affected ABIs. Reviewed-by: Fangrui Song --- include/signal.h | 6 ++--- stdio-common/Makefile | 14 +++++++++- stdio-common/{siglist.c => siglist-gen.c} | 4 --- stdio-common/siglist.S | 7 +++++ ...{siglist-compat.h => siglist-compat-def.h} | 27 ++++++++++--------- sysdeps/generic/siglist-compat.c | 1 - .../{siglist-compat.c => siglist-compat.h} | 7 +++-- .../{siglist-compat.c => siglist-compat.h} | 7 +++-- 8 files changed, 47 insertions(+), 26 deletions(-) rename stdio-common/{siglist.c => siglist-gen.c} (92%) create mode 100644 stdio-common/siglist.S rename sysdeps/generic/{siglist-compat.h => siglist-compat-def.h} (69%) delete mode 100644 sysdeps/generic/siglist-compat.c rename sysdeps/mach/hurd/{siglist-compat.c => siglist-compat.h} (86%) rename sysdeps/unix/sysv/linux/{siglist-compat.c => siglist-compat.h} (87%) diff --git a/include/signal.h b/include/signal.h index 2a278697c1..73f18dddd7 100644 --- a/include/signal.h +++ b/include/signal.h @@ -14,10 +14,8 @@ libc_hidden_proto (__sigpause) libc_hidden_proto (raise) libc_hidden_proto (__libc_current_sigrtmin) libc_hidden_proto (__libc_current_sigrtmax) -extern const char * const __sys_siglist[_NSIG]; -libc_hidden_proto (__sys_siglist) -extern const char * const __sys_sigabbrev[_NSIG]; -libc_hidden_proto (__sys_sigabbrev) +extern const char * const __sys_siglist[_NSIG] attribute_hidden; +extern const char * const __sys_sigabbrev[_NSIG] attribute_hidden; /* Now define the internal interfaces. */ extern __sighandler_t __bsd_signal (int __sig, __sighandler_t __handler); diff --git a/stdio-common/Makefile b/stdio-common/Makefile index 08bc998436..cb85e949c0 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -215,6 +215,8 @@ tests := \ generated += \ errlist-data-aux-shared.S \ errlist-data-aux.S \ + siglist-aux-shared.S \ + siglist-aux.S \ # generated test-srcs = tst-unbputc tst-printf tst-printfsz-islongdouble @@ -265,6 +267,17 @@ $(objpfx)errlist-data-aux.S: errlist-data-gen.c $(objpfx)errlist-data.os: $(objpfx)errlist-data-aux-shared.S $(objpfx)errlist-data.o: $(objpfx)errlist-data-aux.S +$(objpfx)siglist-aux-shared.S: siglist-gen.c + $(make-target-directory) + $(compile-command.c) $(pic-cppflags) $(pic-ccflag) $(no-stack-protector) -S + +$(objpfx)siglist-aux.S: siglist-gen.c + $(make-target-directory) + $(compile-command.c) $(pie-default) $(no-stack-protector) -S + +$(objpfx)siglist.os: $(objpfx)siglist-aux-shared.S +$(objpfx)siglist.o: $(objpfx)siglist-aux.S + ifeq ($(run-built-tests),yes) LOCALES := \ de_DE.ISO-8859-1 \ @@ -353,7 +366,6 @@ CFLAGS-isoc99_vfscanf.c += -fexceptions CFLAGS-isoc99_vscanf.c += -fexceptions CFLAGS-isoc99_fscanf.c += -fexceptions CFLAGS-isoc99_scanf.c += -fexceptions -CFLAGS-siglist.c += $(fno-unit-at-a-time) # scanf14a.c and scanf16a.c test a deprecated extension which is no # longer visible under most conformance levels; see the source files diff --git a/stdio-common/siglist.c b/stdio-common/siglist-gen.c similarity index 92% rename from stdio-common/siglist.c rename to stdio-common/siglist-gen.c index bb88d5300f..95441b707d 100644 --- a/stdio-common/siglist.c +++ b/stdio-common/siglist-gen.c @@ -26,7 +26,6 @@ const char *const __sys_siglist[NSIG] = #include #undef init_sig }; -libc_hidden_def (__sys_siglist) const char *const __sys_sigabbrev[NSIG] = { @@ -34,6 +33,3 @@ const char *const __sys_sigabbrev[NSIG] = #include #undef init_sig }; -libc_hidden_def (__sys_sigabbrev) - -#include diff --git a/stdio-common/siglist.S b/stdio-common/siglist.S new file mode 100644 index 0000000000..f84cdac976 --- /dev/null +++ b/stdio-common/siglist.S @@ -0,0 +1,7 @@ +#ifdef SHARED +# include "siglist-aux-shared.S" +#else +# include "siglist-aux.S" +#endif + +#include diff --git a/sysdeps/generic/siglist-compat.h b/sysdeps/generic/siglist-compat-def.h similarity index 69% rename from sysdeps/generic/siglist-compat.h rename to sysdeps/generic/siglist-compat-def.h index 05a0d63855..f5a1840dc3 100644 --- a/sysdeps/generic/siglist-compat.h +++ b/sysdeps/generic/siglist-compat-def.h @@ -28,20 +28,23 @@ sys_sigabbrev alias to __sys_sigabbrev. Both target alias are define in siglist.c. */ #define DEFINE_COMPAT_SIGLIST(NUMBERSIG, VERSION) \ - declare_symbol_alias (__ ## VERSION ## _sys_siglist, \ - __sys_siglist, \ - object, NUMBERSIG * (ULONG_WIDTH / UCHAR_WIDTH)); \ - declare_symbol_alias (__ ## VERSION ## sys_siglist, \ - __sys_siglist, \ - object, NUMBERSIG * (ULONG_WIDTH / UCHAR_WIDTH)); \ - declare_symbol_alias (__ ## VERSION ## _sys_sigabbrev, \ - __sys_sigabbrev, \ - object, NUMBERSIG * (ULONG_WIDTH / UCHAR_WIDTH)); \ + declare_object_symbol_alias (__ ## VERSION ## _sys_siglist, \ + __sys_siglist, \ + NUMBERSIG * (ULONG_WIDTH / UCHAR_WIDTH)) \ + ASM_LINE_SEP \ + declare_object_symbol_alias (__ ## VERSION ## sys_siglist, \ + __sys_siglist, \ + NUMBERSIG * (ULONG_WIDTH / UCHAR_WIDTH)) \ + ASM_LINE_SEP \ + declare_object_symbol_alias (__ ## VERSION ## _sys_sigabbrev, \ + __sys_sigabbrev, \ + NUMBERSIG * (ULONG_WIDTH / UCHAR_WIDTH)) \ + ASM_LINE_SEP \ compat_symbol (libc, __## VERSION ## _sys_siglist, _sys_siglist, \ - VERSION); \ + VERSION) ASM_LINE_SEP \ compat_symbol (libc, __## VERSION ## sys_siglist, sys_siglist, \ - VERSION); \ + VERSION) ASM_LINE_SEP \ compat_symbol (libc, __## VERSION ## _sys_sigabbrev, sys_sigabbrev, \ - VERSION); \ + VERSION) #endif diff --git a/sysdeps/generic/siglist-compat.c b/sysdeps/generic/siglist-compat.c deleted file mode 100644 index 6e25b021ab..0000000000 --- a/sysdeps/generic/siglist-compat.c +++ /dev/null @@ -1 +0,0 @@ -/* Empty. */ diff --git a/sysdeps/mach/hurd/siglist-compat.c b/sysdeps/mach/hurd/siglist-compat.h similarity index 86% rename from sysdeps/mach/hurd/siglist-compat.c rename to sysdeps/mach/hurd/siglist-compat.h index 5334b0885b..17bb0401aa 100644 --- a/sysdeps/mach/hurd/siglist-compat.c +++ b/sysdeps/mach/hurd/siglist-compat.h @@ -16,12 +16,15 @@ License along with the GNU C Library; if not, see . */ -#include +#include +/* To get _NSIG definition. */ +#define _SIGNAL_H +#include #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) DEFINE_COMPAT_SIGLIST (33, GLIBC_2_0) #endif #if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_32) -DEFINE_COMPAT_SIGLIST (NSIG, GLIBC_2_1) +DEFINE_COMPAT_SIGLIST (_NSIG, GLIBC_2_1) #endif diff --git a/sysdeps/unix/sysv/linux/siglist-compat.c b/sysdeps/unix/sysv/linux/siglist-compat.h similarity index 87% rename from sysdeps/unix/sysv/linux/siglist-compat.c rename to sysdeps/unix/sysv/linux/siglist-compat.h index cbc77289c0..2a9801276d 100644 --- a/sysdeps/unix/sysv/linux/siglist-compat.c +++ b/sysdeps/unix/sysv/linux/siglist-compat.h @@ -16,7 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include +#include +/* To get _NSIG definition. */ +#define _SIGNAL_H +#include #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) DEFINE_COMPAT_SIGLIST (32, GLIBC_2_0) @@ -27,5 +30,5 @@ DEFINE_COMPAT_SIGLIST (64, GLIBC_2_1) #endif #if SHLIB_COMPAT (libc, GLIBC_2_3_3, GLIBC_2_32) -DEFINE_COMPAT_SIGLIST (NSIG, GLIBC_2_3_3) +DEFINE_COMPAT_SIGLIST (_NSIG, GLIBC_2_3_3) #endif From patchwork Thu May 12 12:59:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 53871 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 736703839C6E for ; Thu, 12 May 2022 13:17:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 736703839C6E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652361425; bh=bnA6YvgBx5P1WNGG7r+HMNDuy1BIDFMdrOsEhmxyM24=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=fmZ3XEoRP35/Ko+XfQMZk9fh4bC5gwl0dLg0qq2A2gKAZ8m0b/XtW3g2Wt8TcINLO kFCUQ5hJbL0taFy9jMR04qXSu2nhLQ1vrZ/FfVOuvyOUS7C82sLyg8I4qKDgr5xFze JlMx27tLUex+F17bt8V/Y+FzGfcnNcVHGG9Z1MBg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 3E3253839C71 for ; Thu, 12 May 2022 12:59:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3E3253839C71 Received: by mail-ot1-x32d.google.com with SMTP id s18-20020a056830149200b006063fef3e17so2616933otq.12 for ; Thu, 12 May 2022 05:59:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bnA6YvgBx5P1WNGG7r+HMNDuy1BIDFMdrOsEhmxyM24=; b=REVUFUoBrb6QI04noylVmuCTjUax/bwd/rJyNXSFXF9onrPmk2N1xvlSU9RML0BStK gTSUIU1TgfrHXGd42kS1umspUbyaLSTGxIEWygvjw+x4YrznxTk8e26MZIdfCQiOOd24 hjW93H8NM3qs9i1nOmtEVtoGn/bj0kfml67s7D33qJMGnzVXSin7mH4w2csfhQNCd3FE VqlGc+yZM3Pg5zzcakrnnWPfkoFoYy20sTWtv9dD2YB7ZxttYS2cxkZ28ivR3Hkofva4 RJvzbc75R3+ohRFj+XRentMi/g/WTfybFjvvY6EbHa8bFq1XK5xMdA28diNxJsGvVLqK zcOg== X-Gm-Message-State: AOAM533lBB7o/ULHwH7YplEwjQCopWFa1D1xvRIIRvVuaJumd/WPB6O0 rlNOr1gxaHfxy8YzF2L2XNHVJ/TwkFKneg== X-Google-Smtp-Source: ABdhPJxpp/5oIIFhNenEQjwOR5lACjE1HwV3yLNkDR9eBDp+CVme7y45Bt8h65qHl6Dakq1B6pnS5g== X-Received: by 2002:a05:6830:14c6:b0:605:f9fc:44d8 with SMTP id t6-20020a05683014c600b00605f9fc44d8mr11686056otq.59.1652360387308; Thu, 12 May 2022 05:59:47 -0700 (PDT) Received: from birita.. ([2804:431:c7ca:5fbd:6a01:8849:5cb:128b]) by smtp.gmail.com with ESMTPSA id a11-20020a056870d18b00b000edf5a12baasm1527144oac.46.2022.05.12.05.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 05:59:46 -0700 (PDT) To: libc-alpha@sourceware.org, Fangrui Song Subject: [PATCH v2 4/4] Remove configure fno_unit_at_a_time Date: Thu, 12 May 2022 09:59:31 -0300 Message-Id: <20220512125931.523712-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220512125931.523712-1-adhemerval.zanella@linaro.org> References: <20220512125931.523712-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Since it is not used any longer. Reviewed-by: Fangrui Song --- config.make.in | 1 - configure | 32 -------------------------------- configure.ac | 19 ------------------- 3 files changed, 52 deletions(-) diff --git a/config.make.in b/config.make.in index fff4c78dd0..d7c416cbea 100644 --- a/config.make.in +++ b/config.make.in @@ -68,7 +68,6 @@ 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@ bind-now = @bindnow@ use-default-link = @use_default_link@ have-cxx-thread_local = @libc_cv_cxx_thread_local@ diff --git a/configure b/configure index 716dc041b6..ff2c406b3b 100755 --- a/configure +++ b/configure @@ -620,7 +620,6 @@ libc_cv_cc_loop_to_function libc_cv_cc_submachine libc_cv_cc_nofma libc_cv_mtls_dialect_gnu2 -fno_unit_at_a_time libc_cv_has_glob_dat libc_cv_fpie libc_cv_z_execstack @@ -6226,37 +6225,6 @@ fi $as_echo "$libc_cv_has_glob_dat" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fno-toplevel-reorder -fno-section-anchors" >&5 -$as_echo_n "checking for -fno-toplevel-reorder -fno-section-anchors... " >&6; } -if ${libc_cv_fno_toplevel_reorder+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.c <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then - libc_cv_fno_toplevel_reorder=yes -else - libc_cv_fno_toplevel_reorder=no -fi -rm -f conftest* -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" -else - fno_unit_at_a_time=-fno-unit-at-a-time -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mtls-dialect=gnu2" >&5 $as_echo_n "checking for -mtls-dialect=gnu2... " >&6; } if ${libc_cv_mtls_dialect_gnu2+:} false; then : diff --git a/configure.ac b/configure.ac index d08ad4d64e..eb5bc6a131 100644 --- a/configure.ac +++ b/configure.ac @@ -1383,25 +1383,6 @@ fi rm -f conftest*]) AC_SUBST(libc_cv_has_glob_dat) -AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl -cat > conftest.c <&AS_MESSAGE_LOG_FD]) -then - libc_cv_fno_toplevel_reorder=yes -else - libc_cv_fno_toplevel_reorder=no -fi -rm -f conftest*]) -if test $libc_cv_fno_toplevel_reorder = yes; then - fno_unit_at_a_time="-fno-toplevel-reorder -fno-section-anchors" -else - fno_unit_at_a_time=-fno-unit-at-a-time -fi -AC_SUBST(fno_unit_at_a_time) - AC_CACHE_CHECK([for -mtls-dialect=gnu2], libc_cv_mtls_dialect_gnu2, [dnl cat > conftest.c <