From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta011.uswest2.a.cloudfilter.net (omta011.uswest2.a.cloudfilter.net [35.164.127.234]) by sourceware.org (Postfix) with ESMTPS id 9335A3857004 for ; Wed, 2 Sep 2020 18:26:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9335A3857004 Received: from cxr.smtp.a.cloudfilter.net ([10.0.17.148]) by cmsmtp with ESMTP id DQzFkBnvAmUuyDXSSkcHXU; Wed, 02 Sep 2020 18:26:08 +0000 Received: from thunder.sweets ([68.100.138.62]) by cmsmtp with ESMTPSA id DXSQkqxOH1Bp4DXSRkkJYV; Wed, 02 Sep 2020 18:26:08 +0000 X-Authority-Analysis: v=2.4 cv=fOCHYbWe c=1 sm=1 tr=0 ts=5f4fe3c0 a=3mkzfl4ircflX6G+lDqBYw==:117 a=3mkzfl4ircflX6G+lDqBYw==:17 a=IkcTkHD0fZMA:10 a=reM5J-MqmosA:10 a=XXB7eEQrXNfuv4D3gb8A:9 a=QEXdDO2ut3YA:10 Received: by thunder.sweets (Postfix, from userid 116) id AD28811ABE; Wed, 2 Sep 2020 14:26:05 -0400 (EDT) Received: from [10.10.10.15] (thunder.sweets [10.10.10.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by thunder.sweets (Postfix) with ESMTPS id 04F8311AB5; Wed, 2 Sep 2020 14:26:04 -0400 (EDT) Message-ID: <5F4FE3BB.6020208@cox.net> Date: Wed, 02 Sep 2020 14:26:03 -0400 From: Joe Buehler User-Agent: Thunderbird 1.5.0.12 (X11/20120201) MIME-Version: 1.0 To: Andrew Haley CC: gcc-help@gcc.gnu.org Subject: Re: aarch64 inline asm / -fPIC problem References: <5F48246C.6040402@cox.net> <8dff32c6-4e2c-2a1a-4216-98951f52b552@redhat.com> In-Reply-To: <8dff32c6-4e2c-2a1a-4216-98951f52b552@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfKn+MZRFeux2QW4UDb96rEDIzErb09+Z+z7c4Nmw/q9RH9v9LYJuy+uxaiY8Ev90KEt0pdtRPHvvKGGUlONSa1wTM+RxxNIhk7KxPCL/qD++ya1hqQHH cf4f9gtfPEXIwhXZuGU+l4RGsaIVSK3zq+ztq1IyntO4OF9e3jsK0k4MF/fqibkb/XPZ2k+bRggFJqy0h6Wss+mzZYGbVQ7zExw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2020 18:26:10 -0000 Andrew Haley wrote: > On 27/08/2020 22:23, Joe Buehler via Gcc-help wrote: > > temp.c: In function main : > temp.c:4:2: warning: asm operand 0 probably doesn t match constraints > __asm__ volatile(".8byte %0\n\t" : : "i" ("message %s\n")); > ^~~~~~~ > temp.c:4:2: error: impossible constraint in asm > > I'd use the "S" constraint. Thanks that worked. > >> I am unable to code something similar manually using inline asm because >> the string is a format string containing % characters, which inline asm >> will of course try to interpret. (Does gcc provide anything to escape % >> chars in a literal string?) > > "%%" > The problem is that I have literal printf format strings in a multiplatform code base. I need something like a gcc builtin to do the % doubling. #define X(fmt) asm ("lines " __builtin_escape(fmt) " more lines") Joe Buehler