From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id B3BAC3858433 for ; Tue, 13 Feb 2024 12:13:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B3BAC3858433 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B3BAC3858433 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707826393; cv=none; b=ctAUjOA7Eo5eXgq+DwLSdtFWjLFpeciylPrGor3agaITtgZj6JFouTLMZnb+/fGnOGf5pwImuiSwPTA5MzWsf6i3H3Ethw1DSsNTIpJN8NRMwTqJ+Zd/+BLOQJiy+3IzL2p92JL/m2Nv7FSq5oaRV+JFlvV/o4I0/9vKdhfYmFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707826393; c=relaxed/simple; bh=PSqYK0UcCZZlRd5rSVW6Qos8+4VCQHPJ30vceJTmSFQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=MeEQnlu882kmtMRG9Nsxjg4KRMt4tZwHovrQ6wzSpnuxew0Fd5qYpx5ywwWiRbSO1M8Bl/RUfuVq1RorMcklhWOzJLPHUHpJQuTj+p0sBHPci1mxLdWO2AZU8a+n0Vn3ps7DWk7+BdhrqnS2jCAYY9Q74X3m8ryoQMBqOzecGPg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707826389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5gsPS3lUVREFBnSDy9+ic+lQJptTWa77xSg3S2fLFss=; b=jK07KyYIAdIrpOS0k6pH1xEyZZskV9N2s4Gi3C7vbeR0q5v60ZN3AXaiHCQioJJltsTnuk 3VpKyAeIHPeSKMAkIcYNy6foNUPM5sUssuo12IX3ZMNveiqSmqYzakLn51/yOHzXMIsVby npMnTwsCxp8wSdhu9S3QYJxvuMNk6NY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-UikSvqYcNGaJ4C1t1Pn5VQ-1; Tue, 13 Feb 2024 07:13:08 -0500 X-MC-Unique: UikSvqYcNGaJ4C1t1Pn5VQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 879331005055; Tue, 13 Feb 2024 12:13:07 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE2542022AAC; Tue, 13 Feb 2024 12:13:06 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Netto Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 03/11] libio: Add fortify wrapper for internal __snprintf References: <45d399f3e70726984705466772370ba33ce3aa8a.1707491940.git.fweimer@redhat.com> Date: Tue, 13 Feb 2024 13:13:05 +0100 In-Reply-To: (Adhemerval Zanella Netto's message of "Mon, 12 Feb 2024 14:34:02 -0300") Message-ID: <87eddgimum.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: * Adhemerval Zanella Netto: > On 09/02/24 12:25, Florian Weimer wrote: >> --- >> debug/snprintf_chk.c | 1 + >> include/bits/stdio2.h | 9 +++++++++ >> include/stdio.h | 1 + >> 3 files changed, 11 insertions(+) >>=20 >> diff --git a/debug/snprintf_chk.c b/debug/snprintf_chk.c >> index 995d805f5d..ea02efec3e 100644 >> --- a/debug/snprintf_chk.c >> +++ b/debug/snprintf_chk.c >> @@ -40,4 +40,5 @@ ___snprintf_chk (char *s, size_t maxlen, int flag, siz= e_t slen, >> =20 >> return ret; >> } >> +ldbl_hidden_def (___snprintf_chk, __snprintf_chk) >> ldbl_strong_alias (___snprintf_chk, __snprintf_chk) > > I am seeing a build failure on powerpc64le with config options=20 > --enable-stack-protector=3Dall --enable-tunables=3Dyes --enable-bind-now= =3Dyes=20 > --enable-profile=3Dyes --enable-fortify-source=3D2 --enable-hardcoded-pat= h-in-tests: > > powerpc64le-glibc-linux-gnu-gcc gconv_conf.c -c -std=3Dgnu11 -fgnu89-inli= ne -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -fro= unding-math -fstack-protector-all -fno-common -Wp,-U_FORTIFY_SOURCE,-D_FORT= IFY_SOURCE=3D2 -Wstrict-prototypes -Wold-style-definition -fmath-errno -ma= bi=3Dieeelongdouble -Wno-psabi -mno-gnu-attribute -mlong-double-128 -fPIE = [....] > In file included from gconv_conf.c:26: > ../include/stdio.h:65:1: error: =E2=80=98asm=E2=80=99 declaration ignored= due to conflict with previous rename [-Werror=3Dpragmas] > 65 | stdio_hidden_ldbl_proto (__, snprintf_chk) > | ^~~~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > > All other ABIs build fine. The issue seems to be that libio/bits/stdio-ldbl.h wants to alias __snprintf_chk to __snprintf_chkieee128, and stdio_hidden_ldbl_proto wants to create an alias to ___ieee128_snprintf_chk. I don't know how to solve this properly. It seems that so far, few of the fortified variants in the printf function family have hidden aliases for PLT avoidance. Thanks, Florian