question about 'r2' !!!

8 messages, 6 authors, 2000-09-07 · open the first message on its own page

question about 'r2' !!!

From: Rolf Liu <hidden>
Date: 2000-09-06 02:24:22

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/

Re: question about 'r2' !!!

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2000-09-06 11:00:48

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/

Re: question about 'r2' !!!

From: Michael Schmitz <hidden>
Date: 2000-09-06 16:46:31

quoted
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/

Re: question about 'r2' !!!

From: Frank Rowand <hidden>
Date: 2000-09-06 20:23:01

Michael Schmitz wrote:
quoted
quoted
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 [off-list ref]
MontaVista Software, Inc

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

Re: question about 'r2' !!!

From: Michael Schmitz <hidden>
Date: 2000-09-06 20:41:09

quoted
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/

Re: question about 'r2' !!!

From: Dan Malek <hidden>
Date: 2000-09-06 21:07:40

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/

Re: question about 'r2' !!!

From: Paul Mackerras <hidden>
Date: 2000-09-07 00:53:07

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/

Re: question about 'r2' !!!

From: Michael Schmitz <hidden>
Date: 2000-09-07 11:16:52

quoted
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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help