From patchwork Tue Jan 4 18:47:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 49537 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 66BCD385842C for ; Tue, 4 Jan 2022 18:49:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66BCD385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1641322184; bh=I9T63rwJsKSlC7ClzeUr7aOQHwhT5mX8c7q1rtTQS9A=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=a1YJfAalNCfhBjqTO2jMSR/+yztuRaLXPtPeG6WRMqm1h38ENZ4F6rwqTi2OvG/FT kX6IqG8/70aYdN5dakwVw5zjXYREHP9+c1QiI6nDTXGHqoC1XoXuWWMr/nrlN2ABbj MjA1QI9oUCnIHd+Iyvh44HAGo3EQnvYdOhQSwQHM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 11A01385842D for ; Tue, 4 Jan 2022 18:48:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 11A01385842D Received: by mail-pf1-x430.google.com with SMTP id t187so19452730pfb.11 for ; Tue, 04 Jan 2022 10:48:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I9T63rwJsKSlC7ClzeUr7aOQHwhT5mX8c7q1rtTQS9A=; b=Rhr3xjSL3NaWDTb5pcmL+moEFqvI/EQm7XFx2p5ctT91IRzPHHraC0SIZ6SvrUVlgU +CopvFfR6lkK+HlQqh5K+WMmIbvX5JQ4vAU0c/Ld0sYBj/f/2+h2TRuPJiXW+cxbhrb2 AnHYjTwdpmDUh1Lagwft2PnMsA2dyVCNttKQz/ysGWcj5ROmYrvsPwgyVYsse0BORmFH PKkkx6RbtbuDRu7TEpOxGAxpHWXd3U7KmEkxLV/2IY7lrz64wY8XEhKVmp4i9YaKYjXk psaohtpVuzUElw4XgqSX5u4rItO9b4aHZTBLmYi0SqWTCVYtlGkaBA6gGG5bRWtcr6BM ZIog== X-Gm-Message-State: AOAM533BmTKjD3rPXvst//JFdR+0d1uWgpCPQ+lbfwv1Qc03LoHaCdlT fqY7V4JWAL0ZYWBJSAHBgxUm6CEE4DHCyNW0N8Q= X-Google-Smtp-Source: ABdhPJyMkxN1+7PWUUMkpahYjp0owkYS5rHwSpGvUUf99mwufjxsq3AOR410hXRNhcC/j0DnFSGVjHNH0CLB8HcKlHk= X-Received: by 2002:a05:6a00:2410:b0:4bc:dda9:2e92 with SMTP id z16-20020a056a00241000b004bcdda92e92mr76618pfh.76.1641322079104; Tue, 04 Jan 2022 10:47:59 -0800 (PST) MIME-Version: 1.0 References: <20220102141623.589517-1-hjl.tools@gmail.com> In-Reply-To: Date: Tue, 4 Jan 2022 10:47:23 -0800 Message-ID: Subject: [PATCH] Set LC_ALL=C for LIBC_LINKER_FEATURE [BZ #28738] To: Joseph Myers X-Spam-Status: No, score=-3028.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: GNU C Library Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" On Tue, Jan 4, 2022 at 10:37 AM Joseph Myers wrote: > > On Sun, 2 Jan 2022, H.J. Lu via Libc-alpha wrote: > > > + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp $2 -nostdlib \ > > + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ > > + | grep "warning: $1 ignored" > /dev/null 2>&1; then > > If you check for specific English language text like that (which may not > be a good idea, since binutils maintainers may expect to be able to True. Different linkers can have different behavior on unknown options. We need to update the linker feature check for it. > rephrase messages without breaking glibc), you need to run the linker (and > thus the compiler) with LC_ALL=C to avoid getting a translated message. > Here is a patch to set LC_ALL=C for LIBC_LINKER_FEATURE. Thanks. From 8f3266ac512e2182c49a42f065bbe97451044ebc Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 4 Jan 2022 10:40:56 -0800 Subject: [PATCH] Set LC_ALL=C for LIBC_LINKER_FEATURE [BZ #28738] Set LC_ALL=C when compiling the LIBC_LINKER_FEATURE to avoid linker warning message translation. This updates the fix for BZ #28738. --- aclocal.m4 | 2 +- configure | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 3e0bcdd12b..7ee9c53ee8 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -236,7 +236,7 @@ EOF -fPIC -shared -o conftest.so conftest.c 1>&AS_MESSAGE_LOG_FD]) then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp $2 -nostdlib \ + if LC_ALL=C ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp $2 -nostdlib \ -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ | grep "warning: $1 ignored" > /dev/null 2>&1; then true diff --git a/configure b/configure index 3f956cf777..a71360abd9 100755 --- a/configure +++ b/configure @@ -6009,7 +6009,7 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,execstack -nostdlib \ + if LC_ALL=C ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,execstack -nostdlib \ -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ | grep "warning: -z execstack ignored" > /dev/null 2>&1; then true @@ -6045,7 +6045,7 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,start-stop-gc -nostdlib \ + if LC_ALL=C ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,start-stop-gc -nostdlib \ -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ | grep "warning: -z start-stop-gc ignored" > /dev/null 2>&1; then true @@ -6082,7 +6082,7 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--depaudit,x -nostdlib \ + if LC_ALL=C ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--depaudit,x -nostdlib \ -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ | grep "warning: --depaudit ignored" > /dev/null 2>&1; then true @@ -6119,7 +6119,7 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--no-dynamic-linker -nostdlib \ + if LC_ALL=C ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--no-dynamic-linker -nostdlib \ -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ | grep "warning: --no-dynamic-linker ignored" > /dev/null 2>&1; then true -- 2.33.1