public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] What happens during optimization
@ 2002-11-15  6:47 Daniel Lidsten
  2002-11-15  6:53 ` Gary Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Lidsten @ 2002-11-15  6:47 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I have run my system on a debug version of eCos but now i want to try some optimization. I removed all debug info (-gdwarf) and added the flag -O2.

When i link my application to the new eCos then i get some "undefined reference" regarding some thread functions like Cyg_Thread::self.

The above function are probably removed due to the optimization and i was wondering if there are any way of forcing it to be a part of the final library?

Regards, Daniel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] What happens during optimization
  2002-11-15  6:47 [ECOS] What happens during optimization Daniel Lidsten
@ 2002-11-15  6:53 ` Gary Thomas
  2002-11-15  7:41   ` Grant Edwards
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Thomas @ 2002-11-15  6:53 UTC (permalink / raw)
  To: Daniel Lidsten; +Cc: eCos Discussion

On Fri, 2002-11-15 at 07:47, Daniel Lidsten wrote:
> Hi,
> 
> I have run my system on a debug version of eCos but now i want to try some optimization. I removed all debug info (-gdwarf) and added the flag -O2.
> 
> When i link my application to the new eCos then i get some "undefined reference" regarding some thread functions like Cyg_Thread::self.
> 
> The above function are probably removed due to the optimization and i was wondering if there are any way of forcing it to be a part of the final library?

Did you rebuild everything after you added the optimization option?

Note: optimization and debugging info (-gdwarf) can both be present
although debugging may be more difficult.

Note2: our default builds always use optimization.

-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] What happens during optimization
  2002-11-15  6:53 ` Gary Thomas
@ 2002-11-15  7:41   ` Grant Edwards
  2002-11-15  9:04     ` Gary Thomas
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Edwards @ 2002-11-15  7:41 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Daniel Lidsten, eCos Discussion

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?

-- 
Grant Edwards
grante@visi.com

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] What happens during optimization
  2002-11-15  7:41   ` Grant Edwards
@ 2002-11-15  9:04     ` Gary Thomas
  2002-11-15  9:52       ` Scott Dattalo
  0 siblings, 1 reply; 5+ messages in thread
From: Gary Thomas @ 2002-11-15  9:04 UTC (permalink / raw)
  To: Grant Edwards; +Cc: Daniel Lidsten, eCos Discussion

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?

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.

-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] What happens during optimization
  2002-11-15  9:04     ` Gary Thomas
@ 2002-11-15  9:52       ` Scott Dattalo
  0 siblings, 0 replies; 5+ messages in thread
From: Scott Dattalo @ 2002-11-15  9:52 UTC (permalink / raw)
  Cc: eCos Discussion

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-11-15 17:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-15  6:47 [ECOS] What happens during optimization Daniel Lidsten
2002-11-15  6:53 ` Gary Thomas
2002-11-15  7:41   ` Grant Edwards
2002-11-15  9:04     ` Gary Thomas
2002-11-15  9:52       ` Scott Dattalo

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).