public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Alpha assembler problem (macro requires $at register)
@ 2001-07-16 16:13 mf
  2001-07-16 19:35 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: mf @ 2001-07-16 16:13 UTC (permalink / raw)
  To: gcc, binutils

Hi all!

I'm very sorry about this cross posting, but I don't know where my problem is exactly (gcc or binutils or something else ?) 
and how to solve it.

I'm just trying to compile alsa on my alpha linux box.

Some of the C source files of alsa produce the following error messages:

{standard input}: Assembler messages:
{standard input}:24: Error: macro requires $at register while noat in effect

and many more of the same messages with other linenumbers...

I generated the assembler file from one of the c source files and saw that the first 10 errors occur at an assembler  
statement
like the following:

   stb $2,10($1)

the numbers are different in most of the statements ($1,$2,$3 and
10, 12, 11, 135, ...).

I have an Alpha PC164SX, the processor is a 21164PC, Linux said the cpu model is PCA56 variation 7 revision 0 and 
system
type EB164 variation SX164.

I have this problem since I use kernel 2.4.x and I used gcc 2.95.2 until this weekend, now i use gcc 3.0 and binutils 
2.11 (I compiled them this weekend, gcc first, then binutils).

The full compile statement is:

gcc -DALSA_BUILD -D__KERNEL__ -O2 -fno-strength-reduce -mno-fp-regs -ffixed-8 -mcpu=ev5 -DLINUX -Wall 
.Wstrict-prototypes -fomit-frame-pointer -I/usr/src/linux/inlude -I.. -pipe -c isadma.c

The first function in this file uses some functions declared in a headerfile of the linux kernel. These functions look like 
this:

static __inline_ ...()
{
  ...code....
}

If I remove the -O flag when compiling it works until I want to load the module into kernel, then I get some unresolved 
externals (these functions).
So I tried with changing the cpu (-mcpu) but when I was able to compile everything and load the module the kernel 
crashed (think this was a bad idea ;-)

What surpirses me is that I can compile the linux kernel and it works.

What am I doing wrong ?

Martin

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

* Re: Alpha assembler problem (macro requires $at register)
  2001-07-16 16:13 Alpha assembler problem (macro requires $at register) mf
@ 2001-07-16 19:35 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2001-07-16 19:35 UTC (permalink / raw)
  To: mf; +Cc: gcc, binutils

On Tue, Jul 17, 2001 at 01:11:02AM +0200, mf@swissmail.com wrote:
> {standard input}: Assembler messages:
> {standard input}:24: Error: macro requires $at register while noat in effect
[...]
>    stb $2,10($1)

You have to tell the assembler that the architecture that you're
building for implements this as an instruction, and that it needn't
expand this as a macro.

If this instruction was emitted by gcc, then this should have 
automatically been done.  If it was done by inline assembly, then
you should use the -mcpu=ev56 gcc option.

> So I tried with changing the cpu (-mcpu) but when I was able to compile
> everything and load the module the kernel crashed (think this was a bad
> idea ;-)

Um, there are a number of options that you must use when
building alpha kernel modules, including -mno-fp-regs and
-ffixed-8.  You _did_ include those, right?

In general, see how CFLAGS is defined in linux/arch/foo/Makefile.


r~

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

end of thread, other threads:[~2001-07-16 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-16 16:13 Alpha assembler problem (macro requires $at register) mf
2001-07-16 19:35 ` Richard Henderson

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