There's a difference in behavior between the Solaris GNU assembler and the GNU assembler on GNU/Linux systems which is not well documented. I'm hoping that someone will be able to tell me if it is OpenSolaris policy to maintain this behavior indefinitely, or whether there is an intent to eventually make the Solaris version of the GNU assembler behave like the assembler behaves in the Linux world. The reason this is an issue is that if there are no plans to remove this inconsistency, then the sources for various FOSS programs need to be patched by their maintainers, to make them compile under OpenSolaris.
Apparently to maintain consistency with the Sun assembler, the Solaris GNU assembler treats '/' as starting a comment. (According to Solaris x86 assembly language syntax, comments start with slashes: [url=http://docs.sun.com/app/docs/doc/817-5477/ennab?a=view ]x86 Assembly Language Reference Manual[/url].) Consider the following test program: av at diotima:~$ cat test.s cmpl $(100/4), %eax av at diotima:~$ gas test.s test.s: Assembler messages: test.s:1: Error: unbalanced parenthesis in operand 1. av at diotima:~$ gas --divide test.s av at diotima:~$ On a GNU/Linux system, "as test.s" does not produce an error, because the GNU assembler in the Linux world does not treat '/' as starting a comment. Thus, to get GAS to behave under Solaris the way it does under Linux, one needs to supply it with the "--divide" option (if a source file contains slashes used to indicate division). I found out about this option from "gas --help": av at diotima:~$ gas --help | grep divide --divide do not treat `/' as a comment character The man page for GAS does not mention this option. So my question is this: has Sun decided on the policy that this will be the behavior of GAS under Solaris? Or is there a goal to make the Solaris GAS behave like the GNU/Linux AS in this respect, thus giving up compatibility between Solaris GAS and Solaris AS? If the current behavior of the Solaris GAS is to be maintained, then the man page should be amended to indicate this behavior. -- This message posted from opensolaris.org