Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/x86/win64.S doesn't assemble with Solaris/x86 as #665

Open
rorth opened this issue Oct 21, 2021 · 0 comments
Open

src/x86/win64.S doesn't assemble with Solaris/x86 as #665

rorth opened this issue Oct 21, 2021 · 0 comments

Comments

@rorth
Copy link
Contributor

rorth commented Oct 21, 2021

gcc master recently imported libffi 3.4.2, which broke bootstrap when gcc was configured to use
Solaris/x86 /bin/as: src/x86/win64.S doesn't compile. Originall reported as gcc PR libffi/102874.

System Details

Solaris 11/x86, i386-pc-solaris2.11 resp. amd64-pc-solaris2.11

Seen with gcc master, but exact version doesn't matter. gcc has been configured with --without-gnu-as --with-as=/usr/bin/as

Problems Description

src/x86/win64.S doesn't compile with gcc -m64:

Assembler:
        "/vol/gcc/src/libffi/libffi/local/src/x86/win64.S", line 88 : Illegal mnemonic
        Near line: ".macro epilogue"
        "/vol/gcc/src/libffi/libffi/local/src/x86/win64.S", line 88 : Syntax error
        Near line: ".macro epilogue"
        "/vol/gcc/src/libffi/libffi/local/src/x86/win64.S", line 95 : Illegal mnemonic
        Near line: ".endm"
        "/vol/gcc/src/libffi/libffi/local/src/x86/win64.S", line 95 : Syntax error
        Near line: ".endm"
        "/vol/gcc/src/libffi/libffi/local/src/x86/win64.S", line 100 : Illegal mnemonic
        Near line: " epilogue"
        "/vol/gcc/src/libffi/libffi/local/src/x86/win64.S", line 100 : Syntax error
        Near line: " epilogue"

and many more instances.

The issue is that /bin/as doesn't support .macro/.endm.

An easy and portable way out is to use #define instead: win64.S is passed through cpp after all. I've successfully tested the attached patch to fix the gcc builds.
solx86-libffi-win64.patch.txt

rorth added a commit to rorth/libffi that referenced this issue Oct 27, 2021
The Solaris/x86 assembler doesn't support .macro/.endm, so use #define since
win64.S is passed through cpp anyway.
nstester pushed a commit to nstester/gcc that referenced this issue Nov 15, 2021
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
(libffi/libffi#665); a corresponding pull
request is also pending (libffi/libffi#669).


2021-10-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libffi:
	PR libffi/102874
	* src/x86/win64.S (epilogue): Use #define instead of .macro.
atgreen pushed a commit that referenced this issue Dec 23, 2021
The Solaris/x86 assembler doesn't support .macro/.endm, so use #define since
win64.S is passed through cpp anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant