This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: What happens during optimization
- From: Scott Dattalo <scott at dattalo dot com>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: Fri, 15 Nov 2002 09:52:33 -0800 (PST)
- Subject: Re: [ECOS] What happens during optimization
On 15 Nov 2002, Gary Thomas wrote:
> On Fri, 2002-11-15 at 08:40, Grant Edwards wrote:
> > On Fri, Nov 15, 2002 at 07:53:20AM -0700, Gary Thomas wrote:
> >
> > > Did you rebuild everything after you added the optimization option?
> >
> > Is it required that eCos and the app be compiled with the same
> > level of optimization?
>
I was going to ask a very similar question.
> It all depends, but in general I would go for that.
>
> The quoted example was apt; the guy built his program and the
> eCos kernel with no optimization. Thus Cyg_Thread::self was a
> real function. When he rebuilt the kernel with optimization,
> all of the uses of Cyg_Thread::self were inlined, thus there
> was no copy for his code to link against.
>
> Mixed optimized/not-optimized code can run into these sort
> of problems where inline functions simply disappear.
In my case, I compiled my app with -O3. I didn't explicitly change the
eCos opitimization (so it's presumably the default). My code linked just
fine but didn't run properly. I did not investigate this in detail, but I
suspect it's due to some inline assembly code (that I wrote).
Scott
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss