From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1147) id A58FC3858416; Mon, 15 Nov 2021 09:30:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A58FC3858416 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Rainer Orth To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5262] libffi: Use #define instead of .macro in src/x86/win64.S [PR102874] X-Act-Checkin: gcc X-Git-Author: Rainer Orth X-Git-Refname: refs/heads/master X-Git-Oldrev: a68933da01440d83d08f9dedd335589f7b19002d X-Git-Newrev: a91f844ef449d0dd1cf2e0e47b0ade0d8a6304e1 Message-Id: <20211115093012.A58FC3858416@sourceware.org> Date: Mon, 15 Nov 2021 09:30:12 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2021 09:30:12 -0000 https://gcc.gnu.org/g:a91f844ef449d0dd1cf2e0e47b0ade0d8a6304e1 commit r12-5262-ga91f844ef449d0dd1cf2e0e47b0ade0d8a6304e1 Author: Rainer Orth Date: Mon Nov 15 10:24:27 2021 +0100 libffi: Use #define instead of .macro in src/x86/win64.S [PR102874] 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). 2021-10-21 Rainer Orth libffi: PR libffi/102874 * src/x86/win64.S (epilogue): Use #define instead of .macro. Diff: --- libffi/src/x86/win64.S | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libffi/src/x86/win64.S b/libffi/src/x86/win64.S index f3ace8d0773..58ec6a155e3 100644 --- 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: