public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] compile errors with gcc-4.5.1 on OXC and RMU boards
Date: Sun, 12 Dec 2010 22:49:36 +0100	[thread overview]
Message-ID: <20101212214936.82A6CD4D673@gemini.denx.de> (raw)
In-Reply-To: <20101210122714.24b2cbef@udp111988uds.am.freescale.net>

Dear Scott Wood,

In message <20101210122714.24b2cbef@udp111988uds.am.freescale.net> you wrote:
> On Fri, 10 Dec 2010 12:14:43 -0600
> Kumar Gala <galak@kernel.crashing.org> wrote:
> 
> > On the OXC & RMU boards I'm seeing the following build error:
> > 
> > powerpc-linux-gnu-gcc  -g  -Os   -mrelocatable -ffunction-sections -fdata-sections -fPIC -meabi -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0xFFF00000 -I/local/home/galak/git/u-boot-85xx/include -fno-builtin -ffreestanding -nostdinc -isystem /local/opt/freesc
> ale/usr/local/gcc-4.5.55-eglibc-2.11.55/powerpc-linux-gnu/bin/../lib/gcc/powerpc-linux-gnu/4.5.1/include -pipe  -DCONFIG_PPC -D__powerpc__ -DCONFIG_MPC824X -ffixed-r2 -mstring -mcpu=603e -msoft-float -Wall -Wstrict-prototypes -fno-stack-protector   \
> > 		-o board.o board.c -c
> > board.c: In function 'board_init_r':
> > board.c:761:35: error: token "[" is not valid in preprocessor expressions
> > make[1]: *** [board.o] Error 1
> > 
> > Not sure what to be done about it, since OXC.h defines:
> > 
> > #define CONFIG_SYS_FLASH_BASE           (0-flash_info[0].size)
> 
> This:
> 
> # elif CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
> 
> requires that CONFIG_SYS_FLASH_BASE be a preprocessor-evaluatable
> constant.  flash_info[0].size isn't any sort of constant.  I don't see
> how it ever worked -- probably just got evaluated as zero, or a string
> compare, or something.
> 
> As for what's to be done, I'll start by getting the attention of anyone
> who cares about these boards by putting the board names in the
> subject. :-)
> 
> Maybe convert the #elif into a regular if-statement?

No, I think this is a bug in the tool chain.

The "#elif" above should never be evaluated because the corresponding

	# if defined(CONFIG_OXC) || defined(CONFIG_RMU)

already catches the case for the OXC & RMU boards.


Or has the rule officially been dropped that the "#if" in the C
prepro use the same shortcut logic as the "if" in C?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"And it should be the law: If you use  the  word  `paradigm'  without
knowing  what  the  dictionary  says  it  means,  you  go to jail. No
exceptions."                     - David Jones @ Megatest Corporation

  reply	other threads:[~2010-12-12 21:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10 18:14 [U-Boot] compile errors with gcc-4.5.1 Kumar Gala
2010-12-10 18:27 ` [U-Boot] compile errors with gcc-4.5.1 on OXC and RMU boards Scott Wood
2010-12-12 21:49   ` Wolfgang Denk [this message]
2010-12-13 14:51     ` Kumar Gala
2010-12-13 16:15       ` Wolfgang Denk
2010-12-13 18:47         ` Kumar Gala
2010-12-13 19:03           ` Nathan Sidwell
2010-12-13 21:26             ` Wolfgang Denk
2010-12-14  7:12               ` Nathan Sidwell
2010-12-14 11:14                 ` Wolfgang Denk
2010-12-12 21:20 ` [U-Boot] compile errors with gcc-4.5.1 Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101212214936.82A6CD4D673@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox