Okay, thanks again to Andrew and Bart, I was able to successfully build and run
the example programs in/with the Linux Synthetic target! In order to assist
others, here are the steps from start to finish:
1. CVS checkout to /opt/ecos/ecos-cvs
2. We need a working ecosconfig (command-line tool), so we do the
following:
a. ‘mkdir ~/ecosconfig-build’ and ‘cd ~/ecosconfig-build’
b. ‘/opt/ecos/ecos-cvs/host/configure –with-tcl-version=8.4
–prefix=/usr/local’. Change the Tcl version to that you have installed, and
prefix to where you want the resultant bins, includes and libs to end up in.
c. ‘make’ and ‘sudo make install’. (you should end up with
ecosconfig in /usr/local/bin and some includes and libs in /usr/local/include
and /usr/local/libs, repsectively
3. Add ‘export ECOS_REPOSITORY=/opt/ecos/ecos-cvs/packages’ to
~/.bashrc. This is used by the ecosconfig tool, so we do not have to include
the –-srcdir option all the time.
4. To build the synthetic target (library):
a. ‘mkdir ~/synth-build’ and ‘cd ~/synth-build’
b. ‘ecosconfig new linux’. This creates a new ecos.ecc
c. Edit ecos.ecc:
i. Uncomment the ‘user_value’ line in the
CYGBLD_GLOBAL_CFLAGS section
ii. Remove the ‘–finit-priority’ option
iii. add the ‘-fno-stack-protector’ option
d. ‘ecosconfig tree’
e. ‘make’
5. To build the examples:
a. ‘mkdir ~/examples-build’ and ‘cd ~/examples-build’
b. ‘cp /opt/ecos/ecos-cvs/examples/* .’
c. ‘make INSTALL_DIR=~/synth-build/install’
If this is all successful, you can then execute ‘./hello’, ‘./twothreads’or
‘./simple-alarm’ to test.
I hope this helps others out there. Note I am running on andLinux Beta 1
(basically Ubuntu 7.10) and using GCC 4.1.3, binutils 2.18 and Tcl/Tk 8.4.
As an aside, it took me a while to 'grok' the way in which eCos is designed to
be used. I think there is a need for a nice simple flow diagram of the process
to help beginners. Something like:
eCos Source -> ecosconfig|configtool -> target.ecc -> ecosconfig|configtool ->
target build tree -> make -> target library/includes
then
Application code -> make + directory of target library/includes -> Application
binary
Important to note the following:
- The original eCos source - whether from CVS or any snapshot - is
basically read-only at all times when building targets and applications
- Multiple targets can be 'extracted' and built from this one source
- An application can easily be re-targeted simply by pointing to
different target 'install' locations.
When I first looked at eCos, I was not thrilled by the naming scheme, and it
was unclear to me how the system worked. The more I work it though, the more
impressed I am in the modularity and customization ability of the system. Now,
to build some applications...
Thank you,
Tyler
> -----Original Message-----
> From: Andrew Lunn [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 04, 2008 10:11 AM
> To: Tyler Wilson
> Cc: Bart Veer; [email protected]
> Subject: Re: [ECOS] Linux Synthetic target problems
>
> On Thu, Sep 04, 2008 at 07:02:31AM -0700, Tyler Wilson wrote:
> > Thank you both for the tips. I am trying to add the additional GCC
> flag,
> > but - being new to eCos (and not an expert in Linux either) - I do
> not
> > know the optimal way to integrate it.
> >
> > My understanding from working with eCos on the Windows side was that
> I
> > modify the install/include/pkgconf/ecos.mak file; specifically, the
> > ECOS_GLOBAL_CFLAGS. Then I do a 'make' at the root of the synthetic
> > build tree. But when I build, I do not see the compiler option listed
> in
> > the compiler output - it appears to be cut off after the
> > -fno-exceptions. Perhaps just the output is being truncated?
> >
> > Am I doing this right?
>
> No. Modify CYGBLD_GLOBAL_CFLAGS in your configuration and then
>
> ecosconfig tree
> make clean
> make
>
> Andrew