From patchwork Mon Nov 15 09:15:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 47656 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 A77FE3857C44 for ; Mon, 15 Nov 2021 09:16:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 957643858416 for ; Mon, 15 Nov 2021 09:15:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 957643858416 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cebitec.uni-bielefeld.de Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 810CDAF079 for ; Mon, 15 Nov 2021 10:15:53 +0100 (CET) X-Virus-Scanned: amavisd-new at CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bz5WK6L1YkWV for ; Mon, 15 Nov 2021 10:15:53 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p50855d38.dip0.t-ipconnect.de [80.133.93.56]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 19B9EAF154 for ; Mon, 15 Nov 2021 10:15:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=CeBiTec.Uni-Bielefeld.DE; s=20200306; t=1636967753; bh=XMmuRw5NZTjde6AjOdcV+aicm3ZJ/ryN9XrqyNVqLfs=; h=From:To:Subject:Date:From; b=fFY8fzGmPVrUyWegMEVypiq3b84L+cyF75oBR3jfdvJeS6NfCTdO7JaSCu1pEGjX1 GZCxtsz0ypG9iAqpYSNbIvEgz6bDKcCAmJWFrUBAXhUT38gA6AVEne3W9AnqVbGVSi kVyBIJpf1zHSizlpaitz56aHstL4gZQUHhEiI4H42mWfu1C8T1UznMbH/7xth7xNKE XgOOd35bVqnu2+ORSiw71vZQkMFtEDJmPe4zK5lVVW2LRkRkHpU+V7vMLwmZ5HlzuQ FnEc1keFfki20NQmQ7CDE1ec9WvRPMrae/8PrABoZ6gmRBqthjrYnh6u3YkZatAYsi s1GHqWh+nAjLA== From: Rainer Orth To: gcc-patches@gcc.gnu.org Subject: [PATCH] libffi: Use #define instead of .macro in src/x86/win64.S [PR102874] Date: Mon, 15 Nov 2021 10:15:52 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 X-Spam-Status: No, score=-3795.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The libffi 3.4.2 import badly broke Solaris/x86 bootstrap with the native assembler: Assembler: "/vol/gcc/src/hg/master/local/libffi/src/x86/win64.S", line 88 : Illegal mnemonic Near line: ".macro epilogue" "/vol/gcc/src/hg/master/local/libffi/src/x86/win64.S", line 88 : Syntax error Near line: ".macro epilogue" "/vol/gcc/src/hg/master/local/libffi/src/x86/win64.S", line 95 : Illegal mnemonic Near line: ".endm" "/vol/gcc/src/hg/master/local/libffi/src/x86/win64.S", line 95 : Syntax error Near line: ".endm" "/vol/gcc/src/hg/master/local/libffi/src/x86/win64.S", line 100 : Illegal mnemonic Near line: " epilogue" "/vol/gcc/src/hg/master/local/libffi/src/x86/win64.S", line 100 : Syntax error Near line: "epilogue" Solaris as doesn't support .macro/.endm. Fixed by using #define instead of the unportable .macro. Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu. The bug has been reported upstream (https://github.com/libffi/libffi/issues/665); a corresponding pull request is also pending (https://github.com/libffi/libffi/pull/669). Both have been ignored so far. Ok for master? Rainer # HG changeset patch # Parent 06c4a3d577374c5e9261ef4c11eed65d2fa40a7a libffi: Use #define instead of .macro in src/x86/win64.S [PR??????] diff --git a/libffi/src/x86/win64.S b/libffi/src/x86/win64.S --- a/libffi/src/x86/win64.S +++ b/libffi/src/x86/win64.S @@ -85,14 +85,13 @@ C(ffi_call_win64): /* Below, we're space constrained most of the time. Thus we eschew the modern "mov, pop, ret" sequence (5 bytes) for "leave, ret" (2 bytes). */ -.macro epilogue - leaveq - cfi_remember_state - cfi_def_cfa(%rsp, 8) - cfi_restore(%rbp) - ret +#define epilogue \ + leaveq; \ + cfi_remember_state; \ + cfi_def_cfa(%rsp, 8); \ + cfi_restore(%rbp); \ + ret; \ cfi_restore_state -.endm .align 8 0: