Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Chris Dearman <chris@mips.com>
To: Roman Mashak <mrv@tusur.ru>
Cc: linux-mips@linux-mips.org
Subject: Re: YAMON compiling
Date: Wed, 21 Jul 2004 11:52:30 +0100	[thread overview]
Message-ID: <40FE4AEE.7090109@mips.com> (raw)
In-Reply-To: <002601c46edc$809fe700$cc20bdd3@roman>

[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]

Roman Mashak wrote:
> Hello!
> 
> After installing  SDE toolkit onto Linux box I tried to compile the 
> YAMON bootloader source code (version of YAMON is 2.00). Few errors
> arised:
...
> The lines in mips.h that arise these warnings are the following:
> 
> // #define AU1000 0x00030100
> //#define AU1000 0x01030200
> //#define AU1000_2_1 0x00030200
> 

   The original MIPS assembler used '#' as a comment character.  Using 
an ANSI style C preprocessor where preprocessor directives do not need 
to be at the beginning of the line can can cause problems with files 
using this type of comment.  For this reason sde-gcc tells the 
preprocessor to run in "traditional" mode which disables various ANSI 
features.  In particular, the preprocessor in traditional mode does not 
accept '//' style comments.

> #define t1 $9
> #define mem_sdconfiga  0x0840
> #define MEM_SDCONFIGA_DDR   0x9030060A
> #define MEM_SDREFCFG_D_DDR  MEM_SDCONFIGA_DDR
>
> li      t1, MEM_SDREFCFG_D_DDR
> sw      t1, mem_sdconfiga(t0)
> sync
> 
> Compiler thinks  'li t1, MEM_SDREFCFG_D_DDR'  is 'bad expression',  may be
> it guesses MEM_SDREFCFG_D_DDR is not defined correctly?


   If the '#define' was not at the beginning of the line the 
preprocessor in traditional mode will ignore them and the assembler 
would end up treating these lines as comments which would cause this error.

   I've attached a patch that works on a MIPS release of the YAMON-2.00 
sources to override the preprocessor mode for assembler files. See if it 
helps...

	Chris

-- 
Chris Dearman          The Fruit Farm, Ely Road    voice +44 1223 706206
MIPS Technologies (UK) Chittering, Cambs, CB5 9PH  fax   +44 1223 706250

[-- Attachment #2: yamon-makefile.patch --]
[-- Type: text/plain, Size: 392 bytes --]

--- bin/makefile.orig	Tue Jul 20 19:49:19 2004
+++ bin/makefile	Tue Jul 20 19:49:49 2004
@@ -288,7 +288,7 @@
 # SDE toolchain does not allow a construct like ".bss", it requires
 # .section bss instead.
 ifeq ($(TOOLCHAIN),sde)
-CC_OPTS_A = $(CC_OPTS) -D_ASSEMBLER_ -D_SDE_
+CC_OPTS_A = $(CC_OPTS) -D_ASSEMBLER_ -D_SDE_ -fno-traditional-cpp
 else
 CC_OPTS_A = $(CC_OPTS) -D_ASSEMBLER_
 endif

      parent reply	other threads:[~2004-07-21 10:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-21  4:37 YAMON compiling Roman Mashak
2004-07-21  4:37 ` Roman Mashak
2004-07-21 10:52 ` Chris Dearman [this message]

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=40FE4AEE.7090109@mips.com \
    --to=chris@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=mrv@tusur.ru \
    /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