linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* question about 'r2' !!!
@ 2000-09-06  2:24 Rolf Liu
  2000-09-06 11:00 ` Geert Uytterhoeven
  2000-09-07  0:53 ` Paul Mackerras
  0 siblings, 2 replies; 8+ messages in thread
From: Rolf Liu @ 2000-09-06  2:24 UTC (permalink / raw)
  To: linuxppc-dev


Hi, all,
As everyone konws, Linux use register 'r2' as a reference of 'current',which
is realized by
GCC. Also, the exeception handling of Linux do some work about 'r2'.

I am currently engaged in compiling Linux-ppc source tree using a CC other
than GCC.
The CC can only produce the executable format of 'EABI', a convention made
by Motorola.
And 'EABI' use 'r2' as a base address register for reference of const data,
which can't
be changed. So I want to use a general global varialbe as 'current', leaving
'r2' to 'EABI'.

Anyone has some experence in such issue?
what consideration I must take?
I am pleased to get any comments from you .
Thanks a lot

Rolf


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: question about 'r2' !!!
  2000-09-06  2:24 question about 'r2' !!! Rolf Liu
@ 2000-09-06 11:00 ` Geert Uytterhoeven
  2000-09-06 16:46   ` Michael Schmitz
  2000-09-07  0:53 ` Paul Mackerras
  1 sibling, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2000-09-06 11:00 UTC (permalink / raw)
  To: Rolf Liu; +Cc: linuxppc-dev


On Wed, 6 Sep 2000, Rolf Liu wrote:
> I am currently engaged in compiling Linux-ppc source tree using a CC other
> than GCC.

May I ask you _why_ you want to do that?!?

I think the same rule applies to compilers as to makefiles (`Don't write
portable Makefiles, use a portable make').

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: question about 'r2' !!!
  2000-09-06 11:00 ` Geert Uytterhoeven
@ 2000-09-06 16:46   ` Michael Schmitz
  2000-09-06 20:23     ` Frank Rowand
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Schmitz @ 2000-09-06 16:46 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Rolf Liu, linuxppc-dev


> > I am currently engaged in compiling Linux-ppc source tree using a CC other
> > than GCC.
>
> May I ask you _why_ you want to do that?!?

The mind fairly boggles. Anyway, once upon a time, current wasn't kept in
a register but in memory. And if r2 won't do, just pick another register
and tell the compiler not to touch it. Hope your compiler of choice has
such a thing as --fixed-r2 ...

	Michael


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: question about 'r2' !!!
  2000-09-06 16:46   ` Michael Schmitz
@ 2000-09-06 20:23     ` Frank Rowand
  2000-09-06 20:41       ` Michael Schmitz
  0 siblings, 1 reply; 8+ messages in thread
From: Frank Rowand @ 2000-09-06 20:23 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Geert Uytterhoeven, Rolf Liu, linuxppc-dev


Michael Schmitz wrote:
>
> > > I am currently engaged in compiling Linux-ppc source tree using a CC other
> > > than GCC.
> >
> > May I ask you _why_ you want to do that?!?
>
> The mind fairly boggles. Anyway, once upon a time, current wasn't kept in
> a register but in memory. And if r2 won't do, just pick another register
> and tell the compiler not to touch it. Hope your compiler of choice has
> such a thing as --fixed-r2 ...
>
>         Michael
>

And if you want to use kgdb to debug your kernel, gdb knows that current is r2...

-Frank
--
Frank Rowand <frank_rowand@mvista.com>
MontaVista Software, Inc

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: question about 'r2' !!!
  2000-09-06 20:23     ` Frank Rowand
@ 2000-09-06 20:41       ` Michael Schmitz
  2000-09-06 21:07         ` Dan Malek
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Schmitz @ 2000-09-06 20:41 UTC (permalink / raw)
  To: frowand; +Cc: Geert Uytterhoeven, Rolf Liu, linuxppc-dev


> > The mind fairly boggles. Anyway, once upon a time, current wasn't kept in
> > a register but in memory. And if r2 won't do, just pick another register
> > and tell the compiler not to touch it. Hope your compiler of choice has
> > such a thing as --fixed-r2 ...
> >
>
> And if you want to use kgdb to debug your kernel, gdb knows that current is r2...

If you're unable to use gcc for building your kernels, chances are there
won't be a gdb around either. I fully expect to see yet another kernel
debugger option in the kernel if that sort of 'build a Linux kernel using
the compiler of your choice' game does catch on. If you can get the kernel
to build without relying on gcc, adding a new remote debug stub should not
pose a major problem.

For the rest of us, let's stick to gcc and friends.

	Michael


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: question about 'r2' !!!
  2000-09-06 20:41       ` Michael Schmitz
@ 2000-09-06 21:07         ` Dan Malek
  2000-09-07 11:16           ` Michael Schmitz
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Malek @ 2000-09-06 21:07 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: frowand, Geert Uytterhoeven, Rolf Liu, linuxppc-dev


Michael Schmitz wrote:

> If you're unable to use gcc for building your kernels, ....

With the gcc/gas specific syntax, and the reliance on gcc inline
assembler, there is lots of work to do to make something else
compile this software in any case.

Then, all you have done is the easy part, which is getting a kernel
to boot.  What about applications, libraries and other tools that
actually make a system do something?


	-- Dan

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: question about 'r2' !!!
  2000-09-06  2:24 question about 'r2' !!! Rolf Liu
  2000-09-06 11:00 ` Geert Uytterhoeven
@ 2000-09-07  0:53 ` Paul Mackerras
  1 sibling, 0 replies; 8+ messages in thread
From: Paul Mackerras @ 2000-09-07  0:53 UTC (permalink / raw)
  To: Rolf Liu; +Cc: linuxppc-dev


Rolf Liu writes:

> I am currently engaged in compiling Linux-ppc source tree using a CC other
> than GCC.

This is going to be fraught with difficulty.  The Linux kernel source
uses quite a lot of the extensions to the C language which gcc
provides.  Basically the kernel is not designed to be compiled by
anything other than gcc.

--
Paul Mackerras, Senior Open Source Researcher, Linuxcare, Inc.
+61 2 6262 8990 tel, +61 2 6262 8991 fax
paulus@linuxcare.com.au, http://www.linuxcare.com.au/
Linuxcare.  Support for the revolution.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: question about 'r2' !!!
  2000-09-06 21:07         ` Dan Malek
@ 2000-09-07 11:16           ` Michael Schmitz
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Schmitz @ 2000-09-07 11:16 UTC (permalink / raw)
  To: Dan Malek; +Cc: frowand, Geert Uytterhoeven, Rolf Liu, linuxppc-dev


> > If you're unable to use gcc for building your kernels, ....
>
> With the gcc/gas specific syntax, and the reliance on gcc inline
> assembler, there is lots of work to do to make something else
> compile this software in any case.

I know. He's been advised to forget compiling the kernel with that other
compiler numerous times on this list. He happily seems to ignore that
advice and try it anyway, so who am I to dissuade someone from a great
learning experience?

> Then, all you have done is the easy part, which is getting a kernel
> to boot.  What about applications, libraries and other tools that
> actually make a system do something?

I'd assume that you can just use any old distribution (unless you broke
binary compatibility).

	Michael


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2000-09-07 11:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-09-06  2:24 question about 'r2' !!! Rolf Liu
2000-09-06 11:00 ` Geert Uytterhoeven
2000-09-06 16:46   ` Michael Schmitz
2000-09-06 20:23     ` Frank Rowand
2000-09-06 20:41       ` Michael Schmitz
2000-09-06 21:07         ` Dan Malek
2000-09-07 11:16           ` Michael Schmitz
2000-09-07  0:53 ` Paul Mackerras

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 NNTP newsgroup(s).