public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: David Fernandez <dfernandez@cct.co.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: eCos Disuss <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Problems building ecos sources
Date: Mon, 27 Feb 2006 10:09:00 -0000	[thread overview]
Message-ID: <1141031570.2878.11.camel@software.cct.co.uk> (raw)
In-Reply-To: <20060224171412.GA18806@lunn.ch>

On Fri, 2006-02-24 at 18:14 +0100, Andrew Lunn wrote:
> > [dfernandez@software RB]$ ecosconfig new pc_i82559 redboot U
> > CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0
> > U CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK, new inferred value 0
> > [dfernandez@software RB]$ ecosconfig
> > import /opt/ecos/packages/hal/i386/pc/cu..rrent/misc/redboot_FLOPPY_SMP.ecm
> > ...change prefix to i586-elf...
> > [dfernandez@software RB]$ ecosconfig check
> > Target: pc_i82559
> > Template: redboot
> > Added:
> >  CYGPKG_IO_ETH_DRIVERS
> > No conflicts
> > [dfernandez@software RB]$ ecosconfig tree
> > [dfernandez@software RB]$ make
> > ...
> > make[1]: Leaving directory
> > `/home/dfernandez/Projects/eCos/RB/infra/current'
> > make -r -C redboot/current build
> > make[1]: Entering directory
> > `/home/dfernandez/Projects/eCos/RB/redboot/current'
> > i586-elf-gcc -c  -I/home/dfernandez/Projects/eCos/RB/install/include
> > -I/opt/ecos/packages/redboot/current
> > -I/opt/ecos/packages/redboot/current/src
> > -I/opt/ecos/packages/redboot/current/tests -I.
> > -I/opt/ecos/packages/redboot/current/src/ -finline-limit=7000 -Wall
> > -Wpointer-arith -Wstrict-prototypes -Winline -Wundef  -g -O2
> > -ffunction-sections -fdata-sections  -fno-exceptions
> > -Wp,-MD,src/main.tmp -o
> > src/redboot_main.o /opt/ecos/packages/redboot/current/src/main.c
> > /opt/ecos/packages/redboot/current/src/main.c: In function ???cyg_start???:
> > /opt/ecos/packages/redboot/current/src/main.c:397: error: invalid lvalue
> > in assignment
> > /opt/ecos/packages/redboot/current/src/main.c: In function ???do_go???:
> > /opt/ecos/packages/redboot/current/src/main.c:597: error: invalid lvalue
> > in assignment
> > make[1]: *** [src/main.o.d] Error 1
> > make[1]: Leaving directory
> > `/home/dfernandez/Projects/eCos/RB/redboot/current'
> > make: *** [build] Error 2
> > 
> > 	May be that there's something wrong with this ecos version?
> 
> I'm guessing you have a very new gcc. gcc has slowly been becoming
> more strict about lvalues, ie the left hand side of an assignment. For
> quite a while casts on the left hand side have caused warnings. I'm
> guessing the gcc folks have gone a stage further and turned something
> else into an error. My gcc 4.0.4 compiles this part of the code fine,
> but gives warnings in other places. 
> 
> The problem we have is that the lines with errors are actually
> macros. And the macros are quite big:
> 
> It is defined in cyg/hal/hal_arch.h
> 
> #define HAL_THREAD_INIT_CONTEXT( _sparg_, _thread_, _entry_, _id_ )     \
> CYG_MACRO_START                                                         \
>     register CYG_WORD* _sp_ = ((CYG_WORD*)((_sparg_) &~15));            \
>     register CYG_WORD *_fpspace_ = NULL;                                \
>     register HAL_SavedRegisters *_regs_;                                \
>                                                                         \
>     HAL_THREAD_INIT_FPU_CONTEXT_SPACE( _sp_, _fpspace_ );               \
>     *(--_sp_) = (CYG_WORD)(0);                                          \
>     *(--_sp_) = (CYG_WORD)(0);                                          \
>     *(--_sp_) = (CYG_WORD)(_thread_);                                   \
>     *(--_sp_) = (CYG_WORD)(0);                                          \
>                                                                         \
>     _regs_ = (HAL_SavedRegisters *)                                     \
>                ((unsigned long)_sp_ - sizeof(HAL_SavedRegisters));      \
>     HAL_THREAD_INIT_FPU_CONTEXT( _regs_, _fpspace_ );                   \
>     _regs_->eflags = (CYG_WORD)(0x00000200);                            \
>     _regs_->cs     = (CYG_WORD)(CYG_HAL_DEFAULT_CS);                    \
>     _regs_->pc     = (CYG_WORD)(_entry_);                               \
>     _regs_->vector = (CYG_WORD)(_id_);                                  \
>     _regs_->esp    = (CYG_WORD) _sp_-4;                                 \
>     _regs_->ebp    = (CYG_WORD)(_id_);                                  \
>     _regs_->esi    = (CYG_WORD)(_id_);                                  \
>     _regs_->edi    = (CYG_WORD)(_id_);                                  \
>     _regs_->eax    = (CYG_WORD)(_id_);                                  \
>     _regs_->ebx    = (CYG_WORD)(_id_);                                  \
>     _regs_->ecx    = (CYG_WORD)(_id_);                                  \
>     _regs_->edx    = (CYG_WORD)(_id_);                                  \
>     (_sparg_)      = (CYG_ADDRESS) _regs_;                              \
> CYG_MACRO_END
> 
> Could you try to work out which specific line is causing problems.
> Comment half of the macro out and see if it compiles. The binary chop
> depending on if it compiles or does not compile...
> 
> I would also be interested in knowing what version of gcc you have.
> 
>         Thanks
>                 Andrew
> 
> 
	The problem seems to be in the last line:

    (_sparg_)      = (CYG_ADDRESS) _regs_;                              \

	My gcc version is 4.0.2:


[dfernandez@software RB]$ i586-elf-gcc -v
Using built-in specs.
Target: i586-elf
Configured with: /usr/src/redhat/BUILD/gcc-4.0.2/configure --prefix=/usr/local/ecos --target=i586-elf --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-gxx-include-dir=/usr/local/ecos/i586-elf/include -v
Thread model: single
gcc version 4.0.2

David.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2006-02-27  9:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-22 16:49 David Fernandez
2006-02-22 16:54 ` Andrew Lunn
     [not found]   ` <1140627369.2878.18.camel@software.cct.co.uk>
2006-02-22 21:39     ` Andrew Lunn
2006-02-23 11:33       ` David Fernandez
2006-02-23 15:02         ` Andrew Lunn
2006-02-23 15:37           ` David Fernandez
2006-02-23 15:51             ` Andrew Lunn
2006-02-23 16:48             ` [ECOS] " John Dallaway
     [not found]               ` <1140716284.2885.45.camel@software.cct.co.uk>
2006-02-24  6:11                 ` Andrew Lunn
2006-02-24 16:38                   ` David Fernandez
2006-02-24 17:14                     ` Andrew Lunn
2006-02-24 22:00                     ` [ECOS] " David Fernandez
2006-02-26  5:19                       ` Andrew Lunn
2006-02-27 10:09                         ` David Fernandez [this message]
2006-02-27 11:25                           ` Andrew Lunn
2006-02-27 15:35                             ` David Fernandez
     [not found]                             ` <1141032779.2878.13.camel@software.cct.co.uk>
2006-02-27 18:14                               ` Andrew Lunn
2006-02-27 22:48                                 ` David Fernandez
2006-05-14  2:51                                   ` Frank Pagliughi
2006-02-26 23:13                       ` Chuck McManis
2006-02-27  9:33                         ` David Fernandez
2006-02-23 17:30         ` Andrew Lunn

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=1141031570.2878.11.camel@software.cct.co.uk \
    --to=dfernandez@cct.co.uk \
    --cc=andrew@lunn.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).