public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] extern __inline__ and optimisation problems
@ 2009-10-21  9:57 Øyvind Harboe
  2009-10-21 13:59 ` Sergei Gavrikov
  0 siblings, 1 reply; 9+ messages in thread
From: Øyvind Harboe @ 2009-10-21  9:57 UTC (permalink / raw)
  To: eCos Disuss

What does "extern __inline__" mean?

When I build w/linux synthetic target I get lots of linker
errors:


./.libs/libopenocd.a(non_cfi.o): In function `difftime':
/tmp/ecosboard/synth/install/include/cyg/libc/time/time.inl:583:
multiple definition of `difftime'
ecosboard.o:/tmp/ecosboard/synth/install/include/cyg/libc/time/time.inl:583:
first defined here


Also when I tried to upgrade from an older arm-elf to arm-eabi, I ran
into the same problem.


-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

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

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

* Re: [ECOS] extern __inline__ and optimisation problems
  2009-10-21  9:57 [ECOS] extern __inline__ and optimisation problems Øyvind Harboe
@ 2009-10-21 13:59 ` Sergei Gavrikov
  2009-10-21 15:16   ` Øyvind Harboe
  0 siblings, 1 reply; 9+ messages in thread
From: Sergei Gavrikov @ 2009-10-21 13:59 UTC (permalink / raw)
  To: Øyvind Harboe; +Cc: eCos Disuss

On Wed, Oct 21, 2009 at 11:57:40AM +0200, Øyvind Harboe wrote:
> What does "extern __inline__" mean?
> 
> When I build w/linux synthetic target I get lots of linker
> errors:
> 
> 
> ./.libs/libopenocd.a(non_cfi.o): In function `difftime':
> /tmp/ecosboard/synth/install/include/cyg/libc/time/time.inl:583:
> multiple definition of `difftime'
> ecosboard.o:/tmp/ecosboard/synth/install/include/cyg/libc/time/time.inl:583:
> first defined here

Hi,

Nobody knows what your optimization does means, -Os, -O3, or CDLs,
e.g.

cdl_option CYGIMP_LIBC_TIME_DIFFTIME_INLINE {
    user_value 0
}

...

etc.

I just tried

ecosconfig new linux all
vi ecos.ecc ;# tweak the _guessed_ optim CDLs
...

make -C language/c/libc/time/current tests

and I could not reproduce the issue. eCos LIBC time tests were built
sucessfully even with CYGIMP_LIBC_TIME_DIFFTIME_INLINE == {0,1} &&
-Os.

But, I noticed .libs/libopenocd.a the above (it seems for me that is
the gnu's autotools imprint), may be that build used the host's
<sys/time.h>, e.g., if HAVE_SYS_TIME_H defined, or host's <time.h>.
May be you use a mixture of headers in the builds libopenocd.a and
libtarget.a (i.e. host's & eCos'es) ?

> Also when I tried to upgrade from an older arm-elf to arm-eabi, I ran
> into the same problem.

I'm sorry, but, you do not provide enough of details to reproduce the
issue with any toolchain.

Sergei


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

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

* Re: [ECOS] extern __inline__ and optimisation problems
  2009-10-21 13:59 ` Sergei Gavrikov
@ 2009-10-21 15:16   ` Øyvind Harboe
  2009-10-21 15:40     ` Sergei Gavrikov
  0 siblings, 1 reply; 9+ messages in thread
From: Øyvind Harboe @ 2009-10-21 15:16 UTC (permalink / raw)
  To: Øyvind Harboe, eCos Disuss

>> Also when I tried to upgrade from an older arm-elf to arm-eabi, I ran
>> into the same problem.
>
> I'm sorry, but, you do not provide enough of details to reproduce the
> issue with any toolchain.

I know... I was hoping for some clues so I could
put together a complete reproducible example.

I ran into this problem when trying to build an app using autotools
(openocd, in case you're interested).





-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

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

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

* Re: [ECOS] extern __inline__ and optimisation problems
  2009-10-21 15:16   ` Øyvind Harboe
@ 2009-10-21 15:40     ` Sergei Gavrikov
  2009-10-21 16:05       ` Øyvind Harboe
  0 siblings, 1 reply; 9+ messages in thread
From: Sergei Gavrikov @ 2009-10-21 15:40 UTC (permalink / raw)
  To: Øyvind Harboe; +Cc: eCos Disuss

On Wed, Oct 21, 2009 at 05:16:38PM +0200, Øyvind Harboe wrote:
> >> Also when I tried to upgrade from an older arm-elf to arm-eabi, I ran
> >> into the same problem.
> >
> > I'm sorry, but, you do not provide enough of details to reproduce the
> > issue with any toolchain.
> 
> I know... I was hoping for some clues so I could
> put together a complete reproducible example.
> 
> I ran into this problem when trying to build an app using autotools
> (openocd, in case you're interested).

Hm, I do not expect that it's possible to mix native host archive
(libopenocd.a) is built using host headers/glibc and eCos archives
(libtarget.a, libextras.a) are built with eCos headers/libc even for
Linux synthetic target together. GNU autotools (=configure) make
compiler to use host's resources, eCos CT (ecosconfig) make compiler
to use eCos resources (even for linux synthetic target).

Sergei

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

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

* Re: [ECOS] extern __inline__ and optimisation problems
  2009-10-21 15:40     ` Sergei Gavrikov
@ 2009-10-21 16:05       ` Øyvind Harboe
  2009-10-21 16:15         ` Sergei Gavrikov
  0 siblings, 1 reply; 9+ messages in thread
From: Øyvind Harboe @ 2009-10-21 16:05 UTC (permalink / raw)
  To: Øyvind Harboe, eCos Disuss

> Hm, I do not expect that it's possible to mix native host archive
> (libopenocd.a) is built using host headers/glibc and eCos archives
> (libtarget.a, libextras.a) are built with eCos headers/libc even for
> Linux synthetic target together.

I'm not (willingly) mixing host and eCos stuff. I'm crossbuilding
using autotools to eCos binaries.

This works fine for my arm-elf target, but something goes
haywire with arm-eabi and gcc. I suspect that it might be
a gcc 3 vs. gcc 4 problem. My suspicion is that I've got one
option too many or too little...




-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

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

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

* Re: [ECOS] extern __inline__ and optimisation problems
  2009-10-21 16:05       ` Øyvind Harboe
@ 2009-10-21 16:15         ` Sergei Gavrikov
  2009-10-21 16:50           ` Øyvind Harboe
  0 siblings, 1 reply; 9+ messages in thread
From: Sergei Gavrikov @ 2009-10-21 16:15 UTC (permalink / raw)
  To: Øyvind Harboe; +Cc: eCos Disuss

On Wed, Oct 21, 2009 at 06:04:48PM +0200, Øyvind Harboe wrote:
> > Hm, I do not expect that it's possible to mix native host archive
> > (libopenocd.a) is built using host headers/glibc and eCos archives
> > (libtarget.a, libextras.a) are built with eCos headers/libc even for
> > Linux synthetic target together.
> 
> I'm not (willingly) mixing host and eCos stuff. I'm crossbuilding
> using autotools to eCos binaries.
> 
> This works fine for my arm-elf target, but something goes
> haywire with arm-eabi and gcc. I suspect that it might be
> a gcc 3 vs. gcc 4 problem. My suspicion is that I've got one
> option too many or too little...

Search: gcc 4 extern inline
http://gcc.gnu.org/gcc-4.3/porting_to.html

May be that's it.

Sergei

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

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

* Re: [ECOS] extern __inline__ and optimisation problems
  2009-10-21 16:15         ` Sergei Gavrikov
@ 2009-10-21 16:50           ` Øyvind Harboe
  2009-10-21 18:41             ` Sergei Gavrikov
  0 siblings, 1 reply; 9+ messages in thread
From: Øyvind Harboe @ 2009-10-21 16:50 UTC (permalink / raw)
  To: Øyvind Harboe, eCos Disuss

On Wed, Oct 21, 2009 at 6:15 PM, Sergei Gavrikov
<sergei.gavrikov@gmail.com> wrote:
> On Wed, Oct 21, 2009 at 06:04:48PM +0200, Ųyvind Harboe wrote:
>> > Hm, I do not expect that it's possible to mix native host archive
>> > (libopenocd.a) is built using host headers/glibc and eCos archives
>> > (libtarget.a, libextras.a) are built with eCos headers/libc even for
>> > Linux synthetic target together.
>>
>> I'm not (willingly) mixing host and eCos stuff. I'm crossbuilding
>> using autotools to eCos binaries.
>>
>> This works fine for my arm-elf target, but something goes
>> haywire with arm-eabi and gcc. I suspect that it might be
>> a gcc 3 vs. gcc 4 problem. My suspicion is that I've got one
>> option too many or too little...
>
> Search: gcc 4 extern inline
> http://gcc.gnu.org/gcc-4.3/porting_to.html
>
> May be that's it.

It almost certainly is... Thanks for the tip!

Does this really mean that *all* those places in eCos have to
be touched to become compatible with the -std=c99 or -std=gnu99
options?

Ouch.

-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

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

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

* Re: [ECOS] extern __inline__ and optimisation problems
  2009-10-21 16:50           ` Øyvind Harboe
@ 2009-10-21 18:41             ` Sergei Gavrikov
  2009-10-22  7:43               ` Øyvind Harboe
  0 siblings, 1 reply; 9+ messages in thread
From: Sergei Gavrikov @ 2009-10-21 18:41 UTC (permalink / raw)
  To: Øyvind Harboe; +Cc: eCos Disuss

On Wed, Oct 21, 2009 at 06:50:26PM +0200, Øyvind Harboe wrote:
> On Wed, Oct 21, 2009 at 6:15 PM, Sergei Gavrikov
> <sergei.gavrikov@gmail.com> wrote:

[snip]

> > Search: gcc 4 extern inline
> > http://gcc.gnu.org/gcc-4.3/porting_to.html
> >
> > May be that's it.
> 
> It almost certainly is... Thanks for the tip!
> 
> Does this really mean that *all* those places in eCos have to
> be touched to become compatible with the -std=c99 or -std=gnu99
> options?
> 
> Ouch.

Greping the list on C99, I can repeat following you, Ouch :-) As I
could understand eCos LIBC is not ready to be C99 compliant. Recent
bird was Uwe's cdl_option CYGIMP_LIBC_STDIO_C99_SNPRINTF, but, it
seems your dreams about eCos modularity via DVCS is near future to
have some "C99" branch of the eCos language/c/libc. Ouch! But, may be
it won't be _too_ hard to play with these CDLs for start

grep ^cdl.*INLINE ecos.ecc | wc -l
22

Certainly, if I did not miss something in your message.

Yet another what I found from man gcc-4.3 is -fgnu89-inline. Well, you
have a full control on your own CFLAGS and I hope you have a time for a
digging and let us to know a solution, please.

Sergei

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

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

* Re: [ECOS] extern __inline__ and optimisation problems
  2009-10-21 18:41             ` Sergei Gavrikov
@ 2009-10-22  7:43               ` Øyvind Harboe
  0 siblings, 0 replies; 9+ messages in thread
From: Øyvind Harboe @ 2009-10-22  7:43 UTC (permalink / raw)
  To: eCos Disuss

Adding the -fgnu89-inline solves the problem.

eCos should probably be updated eventually though...


Thanks!

-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

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

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

end of thread, other threads:[~2009-10-22  7:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-21  9:57 [ECOS] extern __inline__ and optimisation problems Øyvind Harboe
2009-10-21 13:59 ` Sergei Gavrikov
2009-10-21 15:16   ` Øyvind Harboe
2009-10-21 15:40     ` Sergei Gavrikov
2009-10-21 16:05       ` Øyvind Harboe
2009-10-21 16:15         ` Sergei Gavrikov
2009-10-21 16:50           ` Øyvind Harboe
2009-10-21 18:41             ` Sergei Gavrikov
2009-10-22  7:43               ` Øyvind Harboe

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