* gcc for ppc/predefined macros
@ 2004-02-02 9:49 Stefan Nickl
2004-02-02 18:49 ` Tom Rini
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Nickl @ 2004-02-02 9:49 UTC (permalink / raw)
To: linuxppc-embedded
I just had to find out very painfully that
my cross-gcc-3.3.2 doesn't have __powerpc__
as a predefined macro anymore:
(SuSE-built-) gcc 2.95.3:
.../powerpc-linux-cpp -dM ~/foo.h |grep -i pc
#define powerpc 1
#define __PPC__ 1
#define PPC 1
#define _ARCH_PPC 1
#define __PPC 1
#define __powerpc__ 1
#define __powerpc 1
(gentoo-crossdev-build-) gcc 3.3.2:
.../powerpc-unknown-eabi-cpp -dM ~/foo.h |grep -i pc
#define _ARCH_PPC 1
#define __PPC 1
#define PPC 1
#define __PPC__ 1
The kernel relies on __powerpc__ in some places,
in fact, the serial console won't work anymore
since the LCR gets setup incorrectly in
serial_console_setup located in serial.c.
The workaround is easy,
just added -D__powerpc__ to CFLAGS_KERNEL.
--
Stefan Nickl
Project Engineering
Kontron Modular Computers
Sudetenstr. 7
D-87600 Kaufbeuren
Phone ++49/8341/803-294
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: gcc for ppc/predefined macros
2004-02-02 9:49 gcc for ppc/predefined macros Stefan Nickl
@ 2004-02-02 18:49 ` Tom Rini
2004-02-05 9:22 ` Stefan Nickl
0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2004-02-02 18:49 UTC (permalink / raw)
To: Stefan Nickl; +Cc: linuxppc-embedded
On Mon, Feb 02, 2004 at 10:49:01AM +0100, Stefan Nickl wrote:
>
> I just had to find out very painfully that
> my cross-gcc-3.3.2 doesn't have __powerpc__
> as a predefined macro anymore:
>
> (SuSE-built-) gcc 2.95.3:
> .../powerpc-linux-cpp -dM ~/foo.h |grep -i pc
>
> #define powerpc 1
> #define __PPC__ 1
> #define PPC 1
> #define _ARCH_PPC 1
> #define __PPC 1
> #define __powerpc__ 1
> #define __powerpc 1
>
>
> (gentoo-crossdev-build-) gcc 3.3.2:
> .../powerpc-unknown-eabi-cpp -dM ~/foo.h |grep -i pc
>
> #define _ARCH_PPC 1
> #define __PPC 1
> #define PPC 1
> #define __PPC__ 1
>
> The kernel relies on __powerpc__ in some places,
> in fact, the serial console won't work anymore
> since the LCR gets setup incorrectly in
> serial_console_setup located in serial.c.
I belive the problem is that you did not compile your cross-compiler
correctly:
$ ppc_7xx-cpp -dM /tmp/foo.h | grep pc
#define __powerpc__ 1
#define __powerpc 1
#define powerpc 1
Make sure you do --target=powerpc-foo-linux when configuring gcc.
--
Tom Rini
http://gate.crashing.org/~trini/
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: gcc for ppc/predefined macros
2004-02-02 18:49 ` Tom Rini
@ 2004-02-05 9:22 ` Stefan Nickl
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Nickl @ 2004-02-05 9:22 UTC (permalink / raw)
To: trini; +Cc: linuxppc-embedded
> I belive the problem is that you did not compile your cross-compiler
> correctly:
> $ ppc_7xx-cpp -dM /tmp/foo.h | grep pc
> #define __powerpc__ 1
> #define __powerpc 1
> #define powerpc 1
>
> Make sure you do --target=powerpc-foo-linux when configuring gcc.
Well, I have --target=powerpc-unknown-eabi, because I thought
-linux is only needed for a full compiler with libc and all that.
But you are probably right, the process for a cross-compiler
described on penguinppc.org also has --target=powerpc-linux.
Anyhow, except for this #define, the kernel compiled with the
--target=powerpc-unknown-eabi gcc seems to work fine...
--
Stefan Nickl
Project Engineering
Kontron Modular Computers
Sudetenstr. 7
D-87600 Kaufbeuren
Phone ++49/8341/803-294
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-02-05 9:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-02 9:49 gcc for ppc/predefined macros Stefan Nickl
2004-02-02 18:49 ` Tom Rini
2004-02-05 9:22 ` Stefan Nickl
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.