public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* CVS/SVN binutils and gcc on MacOS X?
@ 2009-09-04 21:06 Stefan Dösinger
  2009-09-04 21:37 ` Andreas Tobler
  2009-09-07  7:55 ` Tristan Gingold
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Dösinger @ 2009-09-04 21:06 UTC (permalink / raw)
  To: gcc

Hi,
I tried to install binutils from CVS and the gcc SVN code on my mac to test my 
msvc_prologue work there, but I ran into an interesting problem:

When using the SVN gcc with my own as, I cannot compile any files:
Assembler messages:
Fatal error: Invalid listing option `r'

This can happen when compiling something manually, or during gcc bootstrap. 
The build type is i386-apple-darwin9.8.0.

Using my own gcc with the system assembler works. Using the system gcc with my 
as build works as well. But my own as and gcc together fail. Google wasn't 
much help unfortunately.

Is this a known problem? Am I doing something wrong here? Do I need any 
special Darwin patches for as or gcc?

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: CVS/SVN binutils and gcc on MacOS X?
  2009-09-04 21:06 CVS/SVN binutils and gcc on MacOS X? Stefan Dösinger
@ 2009-09-04 21:37 ` Andreas Tobler
  2009-09-04 21:50   ` Stefan Dösinger
  2009-09-05 14:24   ` Eric Botcazou
  2009-09-07  7:55 ` Tristan Gingold
  1 sibling, 2 replies; 7+ messages in thread
From: Andreas Tobler @ 2009-09-04 21:37 UTC (permalink / raw)
  To: Stefan Dösinger; +Cc: gcc

Stefan Dösinger wrote:

> I tried to install binutils from CVS and the gcc SVN code on my mac to test my 
> msvc_prologue work there, but I ran into an interesting problem:

binutils for MacOSX is a no-go.

> When using the SVN gcc with my own as, I cannot compile any files:
> Assembler messages:
> Fatal error: Invalid listing option `r'
> 
> This can happen when compiling something manually, or during gcc bootstrap. 
> The build type is i386-apple-darwin9.8.0.
> 
> Using my own gcc with the system assembler works. Using the system gcc with my 
> as build works as well. But my own as and gcc together fail. Google wasn't 
> much help unfortunately.

binutils 'as' does not know the magic of mach-o.

> Is this a known problem? Am I doing something wrong here? Do I need any 
> special Darwin patches for as or gcc?

No, you don't do anything wrong. It is simply not supported, the 
binutils from gnu.

You can rely on gcc being able to work with the MacOS-X 'binutils' aka: 
ld, as. But don't try to build it for yourself. It's somehow like sparc 
solaris, rely on the systems as/ld.

Regards,
Andreas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: CVS/SVN binutils and gcc on MacOS X?
  2009-09-04 21:37 ` Andreas Tobler
@ 2009-09-04 21:50   ` Stefan Dösinger
  2009-09-04 23:36     ` Stefan Dösinger
  2009-09-05 14:24   ` Eric Botcazou
  1 sibling, 1 reply; 7+ messages in thread
From: Stefan Dösinger @ 2009-09-04 21:50 UTC (permalink / raw)
  To: Andreas Tobler; +Cc: gcc

Am Friday 04 September 2009 23:35:55 schrieb Andreas Tobler:
> No, you don't do anything wrong. It is simply not supported, the
> binutils from gnu.
>
> You can rely on gcc being able to work with the MacOS-X 'binutils' aka:
> ld, as. But don't try to build it for yourself. It's somehow like sparc
> solaris, rely on the systems as/ld.
Drats, that's what I was afraid of :-(

Unfortunately I need support for the swap suffix in as, so using the system 
binaries is not an option. Is the only thing I can do to find the source of 
the as version, backport the swap suffix and hope for the best?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: CVS/SVN binutils and gcc on MacOS X?
  2009-09-04 21:50   ` Stefan Dösinger
@ 2009-09-04 23:36     ` Stefan Dösinger
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Dösinger @ 2009-09-04 23:36 UTC (permalink / raw)
  To: gcc; +Cc: Andreas Tobler

Am Friday 04 September 2009 23:50:11 schrieb Stefan Dösinger:
> Unfortunately I need support for the swap suffix in as, so using the system
> binaries is not an option. Is the only thing I can do to find the source of
> the as version, backport the swap suffix and hope for the best?
Ok, I grabbed the cctools source and hacked in .s suffix support. Now the 
bootstrap process got beyond the initial configure run. Lets see what happens 
once the compilation is finished...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: CVS/SVN binutils and gcc on MacOS X?
  2009-09-04 21:37 ` Andreas Tobler
  2009-09-04 21:50   ` Stefan Dösinger
@ 2009-09-05 14:24   ` Eric Botcazou
  1 sibling, 0 replies; 7+ messages in thread
From: Eric Botcazou @ 2009-09-05 14:24 UTC (permalink / raw)
  To: Andreas Tobler; +Cc: gcc, Stefan Dösinger

> You can rely on gcc being able to work with the MacOS-X 'binutils' aka:
> ld, as. But don't try to build it for yourself. It's somehow like sparc
> solaris, rely on the systems as/ld.

Not quite, GNU as works very well on SPARC/Solaris (and probably better than 
the system assembler); GNU ld works too, although it lacks some features and 
using the system linker might indeed be the Right Thing To Do on Solaris.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: CVS/SVN binutils and gcc on MacOS X?
  2009-09-04 21:06 CVS/SVN binutils and gcc on MacOS X? Stefan Dösinger
  2009-09-04 21:37 ` Andreas Tobler
@ 2009-09-07  7:55 ` Tristan Gingold
  1 sibling, 0 replies; 7+ messages in thread
From: Tristan Gingold @ 2009-09-07  7:55 UTC (permalink / raw)
  To: Stefan Dösinger; +Cc: gcc


On Sep 4, 2009, at 11:06 PM, Stefan Dösinger wrote:

> Hi,
> I tried to install binutils from CVS and the gcc SVN code on my mac  
> to test my
> msvc_prologue work there, but I ran into an interesting problem:
>
> When using the SVN gcc with my own as, I cannot compile any files:
> Assembler messages:
> Fatal error: Invalid listing option `r'

The support in FSF binutils for Darwin is very preliminary: although  
the assembler passes all the gas tests,
it lacks many Mach-O features.  I am working on that in a low priority  
mode.

But contributions are welcome!

Tristan.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: CVS/SVN binutils and gcc on MacOS X?
@ 2009-09-05 18:11 Ross Ridge
  0 siblings, 0 replies; 7+ messages in thread
From: Ross Ridge @ 2009-09-05 18:11 UTC (permalink / raw)
  To: gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

Stefan Dösinger writes:
>Unfortunately I need support for the swap suffix in as, so using the system 
>binaries is not an option. Is the only thing I can do to find the source of 
>the as version, backport the swap suffix and hope for the best?

Another option might be a hack like this:

	(define_insn "vswapmov"
	  [(set (match_operand:SI 0 "register_operand" "=r")
	        (match_operand:SI 1 "register_operand" "r"))
	   (unspec_volatile [(const_int 0)] UNSPECV_VSWAPMOV)]
	  ""
        {
	#ifdef HAVE_AS_IX86_SWAP
	  return "movl.s\t{%1, %0|%0, %1}";
	#else
	  if (true_regnum(operand[0]) == DI_REG
	      && true_regnum(operand[1]) == DI_REG)
		return ASM_BYTE "0x8B, 0xFF";
	  if (true_regnum(operand[0]) == BP_REG
	      && true_regnum(operand[1]) == SP_REG)
		return ASM_BYTE "0x8B, 0xEC";
	  gcc_unreachable();
	#endif
	}
	  [(set_attr "length" "2")
	   (set_attr "length_immediate" "0")
	   (set_attr "modrm" "0")])

It's not pretty but you won't be dependent on binutils.

				Ross Ridge

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-07  7:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-04 21:06 CVS/SVN binutils and gcc on MacOS X? Stefan Dösinger
2009-09-04 21:37 ` Andreas Tobler
2009-09-04 21:50   ` Stefan Dösinger
2009-09-04 23:36     ` Stefan Dösinger
2009-09-05 14:24   ` Eric Botcazou
2009-09-07  7:55 ` Tristan Gingold
2009-09-05 18:11 Ross Ridge

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).