public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Redboot and builtin functions
@ 2000-10-19  1:52 Fabrice Gautier
  2000-10-19  3:31 ` Andrew Lunn
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Fabrice Gautier @ 2000-10-19  1:52 UTC (permalink / raw)
  To: Ecos-List (E-mail)

Hi,

About builtins functions, memcpy, memset ...

I've seen that memset and memcpy are defined and implemented in multiple
places.

One of this place is generic-stub.c where a comment says that the stub can't
use the same memcpy and memset than the rest (I can't see really why but why
not..) 

Another place is the libc (the string part to be more precise) where they
are implemented with a weak attribute.

Last place I saw is in redboot, but only for memset, memcpy is not implemted
here... (why almost all the strings functions but memcpy?)

And there is the builtins too.

So there are 4 implementations, but the one in redboot does not have the
same declarations than the one in  the eCos libc. I do not know for sure
what the builtins declaration is (is there an include file for the
builtins?) but I think they conform to the ISO standard, and so I guess are
the same as the eCos libc. 

So, a few questions:

1/ Do the builtins are intented to be used at all in eCos? (if not, it lacks
a -fno-builtin in the 386 target)
2/ Why RedBoot doesn't/can't use the string functions defined in the libc ?
Or the the builtins ?
3/ Which memcpy/memset the common ethernet support and ethernet drivers are
supposed to use ?
4/ When builtins are used by gcc, when does it use the user-defined version
of memcpy/memset ?

Thanks

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 







> -----Original Message-----
> From: Fabrice Gautier [ mailto:Fabrice_Gautier@sdesigns.com ]
> Sent: Wednesday, October 18, 2000 11:24 AM
> To: Ecos-List (E-mail)
> Subject: [ECOS] Redboot and builtin functions
> 
> 
> Hi,
> 
> WHen building redboot I've the followings warnings:
> 
> packages/redboot/current/src/misc_funs.c:69: warning: 
> conflicting types for
> built-in function `strcpy'
> packages/redboot/current/src/misc_funs.c:127: warning: 
> conflicting types for
> built-in function `memcmp'
> packages/redboot/current/src/misc_funs.c:138: warning: 
> conflicting types for
> built-in function `memset'
> 
> I can get rid of them if I build with -fno-builtin, but then i've some
> "implicit declaration" warnings.
> 
> Thanks,
> 
> -- 
> Fabrice Gautier
> fabrice_gautier@sdesigns.com 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: [ECOS] Redboot and builtin functions
@ 2000-10-19 11:02 Fabrice Gautier
  2000-10-19 11:28 ` Bart Veer
  0 siblings, 1 reply; 11+ messages in thread
From: Fabrice Gautier @ 2000-10-19 11:02 UTC (permalink / raw)
  To: Ecos-List (E-mail)

> -----Original Message-----
> From: Bart Veer [ mailto:bartv@redhat.com ]
> Sent: Thursday, October 19, 2000 5:01 AM
> To: Fabrice_Gautier@sdesigns.com
> Cc: ecos-discuss@sourceware.cygnus.com
> Subject: Re: [ECOS] Redboot and builtin functions
> 
> 
> >>>>> "Fabrice" == Fabrice Gautier 
> <Fabrice_Gautier@sdesigns.com> writes:

>     Fabrice> So, a few questions:
> 
>     Fabrice> 1/ Do the builtins are intented to be used at all in
>     Fabrice> eCos? (if not, it lacks a -fno-builtin in the 386 target)
> 
> Yes. However my understanding is that the compiler may not support all
> the builtins on all targets. Even when a builtin is implemented for a
> given target it will not apply in all cases. For example in the case
> of memcpy() the compiler might only generate inline code if it knows
> about source and destination alignments, otherwise it would invoke the
> function. An inlined memcpy() which can cope with all possible cases
> involves a non-trivial amount of code, so using such a builtin
> everywhere would lead to code bloat.
 
But the problem is that Redboot functions does not have the same declaration
than builtins or libc ones.
 
>     Fabrice> 3/ Which memcpy/memset the common ethernet support and
>     Fabrice> ethernet drivers are supposed to use ?
> 
> The builtins if the compiler believes that is the right choice given
> the target processor and its knowledge about e.g. data alignment.
> 
> Otherwise the RedBoot ones if the ethernet drivers are being used
> inside RedBoot (I think).
> 
> Otherwise the ones in libc - unless there is an alternative
> implementation in e.g. the architectural HAL

Same problem (not the same prototype), and that would means add a dependency
to libc for the driver. Or a dependency on a macro (like IMPLEMENT_MEMSET)
provided by libc and redboot.

What I want is to get rid of these warnings. And I'm not sure the what the
correct solution is.

Thanks
-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: [ECOS] Redboot and builtin functions
@ 2000-10-18 21:51 Fabrice Gautier
  0 siblings, 0 replies; 11+ messages in thread
From: Fabrice Gautier @ 2000-10-18 21:51 UTC (permalink / raw)
  To: Ecos-List (E-mail)

By the way, why doesn't redboot use the memset and memcpy functions
implemtend in the infra package?

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

> -----Original Message-----
> From: Fabrice Gautier [ mailto:Fabrice_Gautier@sdesigns.com ]
> Sent: Wednesday, October 18, 2000 11:24 AM
> To: Ecos-List (E-mail)
> Subject: [ECOS] Redboot and builtin functions
> 
> 
> Hi,
> 
> WHen building redboot I've the followings warnings:
> 
> packages/redboot/current/src/misc_funs.c:69: warning: 
> conflicting types for
> built-in function `strcpy'
> packages/redboot/current/src/misc_funs.c:127: warning: 
> conflicting types for
> built-in function `memcmp'
> packages/redboot/current/src/misc_funs.c:138: warning: 
> conflicting types for
> built-in function `memset'
> 
> I can get rid of them if I build with -fno-builtin, but then i've some
> "implicit declaration" warnings.
> 
> Thanks,
> 
> -- 
> Fabrice Gautier
> fabrice_gautier@sdesigns.com 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [ECOS] Redboot and builtin functions
@ 2000-10-18 11:25 Fabrice Gautier
  0 siblings, 0 replies; 11+ messages in thread
From: Fabrice Gautier @ 2000-10-18 11:25 UTC (permalink / raw)
  To: Ecos-List (E-mail)

Hi,

WHen building redboot I've the followings warnings:

packages/redboot/current/src/misc_funs.c:69: warning: conflicting types for
built-in function `strcpy'
packages/redboot/current/src/misc_funs.c:127: warning: conflicting types for
built-in function `memcmp'
packages/redboot/current/src/misc_funs.c:138: warning: conflicting types for
built-in function `memset'

I can get rid of them if I build with -fno-builtin, but then i've some
"implicit declaration" warnings.

Thanks,

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

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

end of thread, other threads:[~2000-10-19 11:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-19  1:52 [ECOS] Redboot and builtin functions Fabrice Gautier
2000-10-19  3:31 ` Andrew Lunn
2000-10-19  4:02 ` Jesper Skov
2000-10-19  6:13   ` Jonathan Larmour
2000-10-19  5:01 ` Bart Veer
2000-10-19  6:24 ` Gary Thomas
2000-10-19  6:48   ` Bart Veer
  -- strict thread matches above, loose matches on Subject: below --
2000-10-19 11:02 Fabrice Gautier
2000-10-19 11:28 ` Bart Veer
2000-10-18 21:51 Fabrice Gautier
2000-10-18 11:25 Fabrice Gautier

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