* [PATCH] libffi: Use #define instead of .macro in src/x86/win64.S [PR102874]
@ 2021-11-15 9:15 Rainer Orth
2021-11-15 9:21 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Rainer Orth @ 2021-11-15 9:15 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]
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
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2021-10-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
libffi:
PR libffi/102874
* src/x86/win64.S (epilogue): Use #define instead of .macro.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: solx86-libffi-win64.patch --]
[-- Type: text/x-patch, Size: 712 bytes --]
# 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:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libffi: Use #define instead of .macro in src/x86/win64.S [PR102874]
2021-11-15 9:15 [PATCH] libffi: Use #define instead of .macro in src/x86/win64.S [PR102874] Rainer Orth
@ 2021-11-15 9:21 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2021-11-15 9:21 UTC (permalink / raw)
To: Rainer Orth; +Cc: GCC Patches
On Mon, Nov 15, 2021 at 10:16 AM Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
>
> 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?
OK.
> Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
>
>
> 2021-10-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>
> libffi:
> PR libffi/102874
> * src/x86/win64.S (epilogue): Use #define instead of .macro.
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-15 9:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 9:15 [PATCH] libffi: Use #define instead of .macro in src/x86/win64.S [PR102874] Rainer Orth
2021-11-15 9:21 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).