public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* cross compiling to m68k
@ 1997-08-20 12:10 Jon McGugan
  0 siblings, 0 replies; 7+ messages in thread
From: Jon McGugan @ 1997-08-20 12:10 UTC (permalink / raw)
  To: egcs

I have tried to cross compile the snapshot to target M68K. 
This works for the standard gcc package.
With egcs I get errors from the gnu assembler when the make gets to libgcc2 and 
module bb
The errors relates to constructions of form:
#APP
        movem.l  d0-d3,sp@-
#NO APP

being inserted into the assembler file.
Does anyone know why:
1)  these are put in
2) In wrong syntax for GAS - should be movem.l %d0-%d3,%sp@-

The rest of the assembler code produced is correct

And, of course, more importantly how to overcome the problem.

Regards

Jon

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

* Re: cross compiling to m68k
@ 1997-08-22  7:09 Jon McGugan
  0 siblings, 0 replies; 7+ messages in thread
From: Jon McGugan @ 1997-08-22  7:09 UTC (permalink / raw)
  To: egcs

configuration I used was:
configure --target=delta --with-gnu-as --with-gnu-ld

> 
> 
> On Thu, 21 Aug 1997, Niklas Hallqvist wrote:
> 
> > > Message-Id: <16063846900569@DOMAIN_H>
> > > 
> > > Thanks Joel.
> > > The fault was with the MACHINE_STATE_SAVE etc functions pulling in an asm (as 
> > > you said). So I've got rid of that the hard way by editing config/m68k/m68k.h .
> > > But I don't think that was the way to cure it as I now get an assembler error 
> > > when __main is extracted from libgcc2.c because the compiler makes the label 
> > > p_%2: which the assembler rejects. It looks like there is a define missing or 
> > > set wrrong which is causing inbuilt bits to think it's driving a different 
> > > assembler. 
> > > 
> > > Clues appreciated. 
> > 
> > Well there are three different assembler syntaxes to choose from if I
> > recall correctly (it was quite some time ago I had to deal with
> > anything but MIT syntax) MOTO, MIT & SGS.
> 
> What actual target configuration are you using?
> 
> --joel
> 
> 

Regards

Jon

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

* Re: cross compiling to m68k
  1997-08-21 15:20 egcs repository Joel Sherrill
@ 1997-08-21 15:47 ` Joel Sherrill
  0 siblings, 0 replies; 7+ messages in thread
From: Joel Sherrill @ 1997-08-21 15:47 UTC (permalink / raw)
  To: egcs

On Thu, 21 Aug 1997, Niklas Hallqvist wrote:

> > Message-Id: <16063846900569@DOMAIN_H>
> > 
> > Thanks Joel.
> > The fault was with the MACHINE_STATE_SAVE etc functions pulling in an asm (as 
> > you said). So I've got rid of that the hard way by editing config/m68k/m68k.h .
> > But I don't think that was the way to cure it as I now get an assembler error 
> > when __main is extracted from libgcc2.c because the compiler makes the label 
> > p_%2: which the assembler rejects. It looks like there is a define missing or 
> > set wrrong which is causing inbuilt bits to think it's driving a different 
> > assembler. 
> > 
> > Clues appreciated. 
> 
> Well there are three different assembler syntaxes to choose from if I
> recall correctly (it was quite some time ago I had to deal with
> anything but MIT syntax) MOTO, MIT & SGS.

What actual target configuration are you using?

--joel

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

* Re: cross compiling to m68k
@ 1997-08-21  8:51 Niklas Hallqvist
  0 siblings, 0 replies; 7+ messages in thread
From: Niklas Hallqvist @ 1997-08-21  8:51 UTC (permalink / raw)
  To: egcs

> Message-Id: <16063846900569@DOMAIN_H>
> 
> Thanks Joel.
> The fault was with the MACHINE_STATE_SAVE etc functions pulling in an asm (as 
> you said). So I've got rid of that the hard way by editing config/m68k/m68k.h .
> But I don't think that was the way to cure it as I now get an assembler error 
> when __main is extracted from libgcc2.c because the compiler makes the label 
> p_%2: which the assembler rejects. It looks like there is a define missing or 
> set wrrong which is causing inbuilt bits to think it's driving a different 
> assembler. 
> 
> Clues appreciated. 

Well there are three different assembler syntaxes to choose from if I
recall correctly (it was quite some time ago I had to deal with
anything but MIT syntax) MOTO, MIT & SGS.

It looks like you might have your assembler setup for SGS syntax or
something, and are generating MIT.  Well, grep for SGS in
config/m68k/* and I think you will get some hints.  I also recall SGS
had another argument ordering on cmp instructions.  Anyway, watch your
compiler and assembler config closely so you get them to speak the
same syntax.

This is all from memory left from a long time ago, save your flames if
I have got it wrong.

Niklas

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

* Re: cross compiling to m68k
@ 1997-08-21  8:00 Jon McGugan
  0 siblings, 0 replies; 7+ messages in thread
From: Jon McGugan @ 1997-08-21  8:00 UTC (permalink / raw)
  To: egcs

Thanks Joel.
The fault was with the MACHINE_STATE_SAVE etc functions pulling in an asm (as 
you said). So I've got rid of that the hard way by editing config/m68k/m68k.h .
But I don't think that was the way to cure it as I now get an assembler error 
when __main is extracted from libgcc2.c because the compiler makes the label 
p_%2: which the assembler rejects. It looks like there is a define missing or 
set wrrong which is causing inbuilt bits to think it's driving a different 
assembler. 

Clues appreciated. 
> 
> 
> On Wed, 20 Aug 1997, Jon McGugan wrote:
> 
> > I have tried to cross compile the snapshot to target M68K. 
> > This works for the standard gcc package.
> > With egcs I get errors from the gnu assembler when the make gets to libgcc2 and 
> > module bb
> > The errors relates to constructions of form:
> > #APP
> >         movem.l  d0-d3,sp@-
> > #NO APP
> > 
> > being inserted into the assembler file.
> > Does anyone know why:
> > 1)  these are put in
> > 2) In wrong syntax for GAS - should be movem.l %d0-%d3,%sp@-
> > 
> > The rest of the assembler code produced is correct
> > 
> > And, of course, more importantly how to overcome the problem.
> 
> This looks like it came from an embedded assembly statement in a C file. 
> I do not know which target configuration you are using but it appears to
> require the % in front of register names.  You need to identify the C
> file.  Then you will find something like "asm ("movem...")" or "asm
> volatile( "movem...")".   Once you find this statement, you will need to
> change it to include % in front of the register names.  You will probably
> have to put %% since % is a special character in the embedded asm format.
> Here is an example from RTEMS which shows how we disable interrupts:
> 
> #define m68k_disable_interrupts( _level ) \
>   asm volatile ( "movew   %%sr,%0\n\t" \
>                  "orw     #0x0700,%%sr" \
>                     : "=d" (_level))
> 
> I think this has enough in it to help you out. I hope this helps you find
> the problem.
> 
> --joel
> Joel Sherrill                    Director of Research & Development
> joel@OARcorp.com                 On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>    Support Available             (205) 722-9985
> 
> 
> 
> 
> 

Regards

Jon

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

* Re: cross compiling to m68k
@ 1997-08-20 15:32 Ian Lance Taylor
  0 siblings, 0 replies; 7+ messages in thread
From: Ian Lance Taylor @ 1997-08-20 15:32 UTC (permalink / raw)
  To: egcs

   Date: Wed, 20 Aug 1997 10:25:06 -0500 (CDT)
   From: Joel Sherrill <joel@OARcorp.com>

   > I have tried to cross compile the snapshot to target M68K. 
   > This works for the standard gcc package.
   > With egcs I get errors from the gnu assembler when the make gets to libgcc2 and 
   > module bb
   > The errors relates to constructions of form:
   > #APP
   >         movem.l  d0-d3,sp@-
   > #NO APP
   > 
   > being inserted into the assembler file.

   This looks like it came from an embedded assembly statement in a C file. 

Actually, in this case, I believe it's from the definition of
MACHINE_STATE_SAVE in config/m68k/m68k.h.  That macro requires %/
before the register names, as in longlong.h.  The same is true of
MACHINE_STATE_RESTORE, and perhaps others.

Ian

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

* Re: cross compiling to m68k
@ 1997-08-20 15:03 Joel Sherrill
  0 siblings, 0 replies; 7+ messages in thread
From: Joel Sherrill @ 1997-08-20 15:03 UTC (permalink / raw)
  To: egcs

On Wed, 20 Aug 1997, Jon McGugan wrote:

> I have tried to cross compile the snapshot to target M68K. 
> This works for the standard gcc package.
> With egcs I get errors from the gnu assembler when the make gets to libgcc2 and 
> module bb
> The errors relates to constructions of form:
> #APP
>         movem.l  d0-d3,sp@-
> #NO APP
> 
> being inserted into the assembler file.
> Does anyone know why:
> 1)  these are put in
> 2) In wrong syntax for GAS - should be movem.l %d0-%d3,%sp@-
> 
> The rest of the assembler code produced is correct
> 
> And, of course, more importantly how to overcome the problem.

This looks like it came from an embedded assembly statement in a C file. 
I do not know which target configuration you are using but it appears to
require the % in front of register names.  You need to identify the C
file.  Then you will find something like "asm ("movem...")" or "asm
volatile( "movem...")".   Once you find this statement, you will need to
change it to include % in front of the register names.  You will probably
have to put %% since % is a special character in the embedded asm format.
Here is an example from RTEMS which shows how we disable interrupts:

#define m68k_disable_interrupts( _level ) \
  asm volatile ( "movew   %%sr,%0\n\t" \
                 "orw     #0x0700,%%sr" \
                    : "=d" (_level))

I think this has enough in it to help you out. I hope this helps you find
the problem.

--joel
Joel Sherrill                    Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (205) 722-9985

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

end of thread, other threads:[~1997-08-22  7:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-20 12:10 cross compiling to m68k Jon McGugan
1997-08-20 15:03 Joel Sherrill
1997-08-20 15:32 Ian Lance Taylor
1997-08-21  8:00 Jon McGugan
1997-08-21  8:51 Niklas Hallqvist
1997-08-21 15:20 egcs repository Joel Sherrill
1997-08-21 15:47 ` cross compiling to m68k Joel Sherrill
1997-08-22  7:09 Jon McGugan

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