https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102874

            Bug ID: 102874
           Summary: [12 regression] src/x86/win64.S doesn't assemble with
                    Solaris as
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libffi
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: hjl.tools at gmail dot com
  Target Milestone: ---
            Target: i?86-pc-solaris2.11, x86_64-pc-solaris2.11

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"
config.status: creating Makefile
        "/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"

/bin/as doesn't support .macro/.endm.

I initially tried to exclude ffiw64.c and win64.S from SOURCES in
configure.host.
While this fixed the build, it made all 64-bit libffi and libgo link tests
FAIL with unresolved references to *_efi64 functions.

While I wonder why libffi on a Unix system needs win64 support, the fix seems
simple: just use #define instead of .macro/.endm to define epilogue.  The
attached patch does that and brings things back to normal.

Reply via email to