|
From: Nicholas N. <n.n...@gm...> - 2009-02-25 03:15:07
|
Hi, x86/Linux assembly code and x86/Darwin assembly code appear to be different dialects. Some of the tests in none/tests/x86/ and memcheck/tests/x86/ compile on x86/Darwin, eg. memcheck/tests/bug152022. But some don't, eg. pushfpopf, because x86/Darwin assembler doesn't accept the .type and .size options. The easiest thing to do is move the ones that don't compile on Darwin into an x86-linux/ directory. Anyone have any strong opinons about this, or other insights? Nick |
|
From: Bart V. A. <bar...@gm...> - 2009-02-25 06:57:03
|
On Wed, Feb 25, 2009 at 3:50 AM, Nicholas Nethercote <n.n...@gm...> wrote: > x86/Linux assembly code and x86/Darwin assembly code appear to be > different dialects. Some of the tests in none/tests/x86/ and > memcheck/tests/x86/ compile on x86/Darwin, eg. > memcheck/tests/bug152022. But some don't, eg. pushfpopf, because > x86/Darwin assembler doesn't accept the .type and .size options. > > The easiest thing to do is move the ones that don't compile on Darwin > into an x86-linux/ directory. Anyone have any strong opinons about > this, or other insights? Which standards apply to x86 assembler syntax ? Bart. |
|
From: Nicholas N. <n.n...@gm...> - 2009-02-26 02:47:57
|
On Wed, Feb 25, 2009 at 5:56 PM, Bart Van Assche <bar...@gm...> wrote: > On Wed, Feb 25, 2009 at 3:50 AM, Nicholas Nethercote > <n.n...@gm...> wrote: >> x86/Linux assembly code and x86/Darwin assembly code appear to be >> different dialects. Some of the tests in none/tests/x86/ and >> memcheck/tests/x86/ compile on x86/Darwin, eg. >> memcheck/tests/bug152022. But some don't, eg. pushfpopf, because >> x86/Darwin assembler doesn't accept the .type and .size options. >> >> The easiest thing to do is move the ones that don't compile on Darwin >> into an x86-linux/ directory. Anyone have any strong opinons about >> this, or other insights? > > Which standards apply to x86 assembler syntax ? I'm not sure that there are any. This seems to be the definitive documentation on Mac/x86 assembly: http://developer.apple.com/DOCUMENTATION/DeveloperTools/Reference/Assembler/index.html Nick |
|
From: Bart V. A. <bar...@gm...> - 2009-02-26 18:06:51
|
On Thu, Feb 26, 2009 at 3:47 AM, Nicholas Nethercote <n.n...@gm...> wrote: > On Wed, Feb 25, 2009 at 5:56 PM, Bart Van Assche > <bar...@gm...> wrote: >> On Wed, Feb 25, 2009 at 3:50 AM, Nicholas Nethercote >> <n.n...@gm...> wrote: >>> x86/Linux assembly code and x86/Darwin assembly code appear to be >>> different dialects. Some of the tests in none/tests/x86/ and >>> memcheck/tests/x86/ compile on x86/Darwin, eg. >>> memcheck/tests/bug152022. But some don't, eg. pushfpopf, because >>> x86/Darwin assembler doesn't accept the .type and .size options. >>> >>> The easiest thing to do is move the ones that don't compile on Darwin >>> into an x86-linux/ directory. Anyone have any strong opinons about >>> this, or other insights? >> >> Which standards apply to x86 assembler syntax ? > > I'm not sure that there are any. This seems to be the definitive > documentation on Mac/x86 assembly: > > http://developer.apple.com/DOCUMENTATION/DeveloperTools/Reference/Assembler/index.html Does this mean that gcc on Darwin does not use gas but another assembler ? Is the gcc command-line option -mgas supported by gcc on Darwin ? Bart. |
|
From: Greg P. <gp...@ap...> - 2009-02-26 19:41:26
|
On Feb 26, 2009, at 9:54 AM, Bart Van Assche wrote: > On Thu, Feb 26, 2009 at 3:47 AM, Nicholas Nethercote > <n.n...@gm...> wrote: >> On Wed, Feb 25, 2009 at 5:56 PM, Bart Van Assche >> <bar...@gm...> wrote: >>> On Wed, Feb 25, 2009 at 3:50 AM, Nicholas Nethercote >>> <n.n...@gm...> wrote: >>>> x86/Linux assembly code and x86/Darwin assembly code appear to be >>>> different dialects. Some of the tests in none/tests/x86/ and >>>> memcheck/tests/x86/ compile on x86/Darwin, eg. >>>> memcheck/tests/bug152022. But some don't, eg. pushfpopf, because >>>> x86/Darwin assembler doesn't accept the .type and .size options. >>>> >>>> The easiest thing to do is move the ones that don't compile on >>>> Darwin >>>> into an x86-linux/ directory. Anyone have any strong opinons about >>>> this, or other insights? >>> >>> Which standards apply to x86 assembler syntax ? >> >> I'm not sure that there are any. This seems to be the definitive >> documentation on Mac/x86 assembly: >> >> http://developer.apple.com/DOCUMENTATION/DeveloperTools/Reference/Assembler/index.html > > Does this mean that gcc on Darwin does not use gas but another > assembler ? Is the gcc command-line option -mgas supported by gcc on > Darwin ? That's correct, Darwin uses its own home-grown assembler. I don't know of any GAS support for Mach-O, and -mgas is not supported. -- Greg Parker gp...@ap... Runtime Wrangler |
|
From: Nicholas N. <n.n...@gm...> - 2009-02-26 21:15:28
|
On Fri, Feb 27, 2009 at 6:41 AM, Greg Parker <gp...@ap...> wrote: > > That's correct, Darwin uses its own home-grown assembler. I don't know of > any GAS support for Mach-O, and -mgas is not supported. Greg, do you have any opinion if it's worth trying to use a common subset of the two dialects, or should we just shove all the current failing asm tests into x86-linux/ directories? N |
|
From: Greg P. <gp...@ap...> - 2009-02-26 21:26:00
|
On Feb 26, 2009, at 1:15 PM, Nicholas Nethercote wrote: > On Fri, Feb 27, 2009 at 6:41 AM, Greg Parker <gp...@ap...> > wrote: >> >> That's correct, Darwin uses its own home-grown assembler. I don't >> know of >> any GAS support for Mach-O, and -mgas is not supported. > > Greg, do you have any opinion if it's worth trying to use a common > subset of the two dialects, or should we just shove all the current > failing asm tests into x86-linux/ directories? The instructions themselves are easy enough. Symbols and most other compiler directives need to be handled differently, and there are some ABI differences like stack alignment. There may be a way to macro-ize the most common constructs (like a basic main() with only ordinary instructions and no external code or data references), but I wouldn't try too hard to make it work everywhere. -- Greg Parker gp...@ap... Runtime Wrangler |