* Re: your mail
1998-05-19 9:59 No Subject Pete Popov
@ 1998-05-20 6:06 ` Rolf Fiedler
1998-05-20 6:06 ` memcpy Jonathan Larmour
1998-05-22 9:56 ` Pete Popov
2 siblings, 0 replies; 4+ messages in thread
From: Rolf Fiedler @ 1998-05-20 6:06 UTC (permalink / raw)
To: Pete Popov; +Cc: crossgcc
On Tue, 19 May 1998, Pete Popov wrote:
>
> Hi,
>
> I'm using a mips64 dos-hosted cross
> compiler which I built on my Linux box.
> The compiler has been working fine and
> we haven't ran into any problems, but
> there's something I don't understand and
> it really frustrates me.
>
> I'm compiling all files with "-nostdinc"
> switch; the files are later linked with
> "-nostdlib". I've got my own version
> of "memcpy" and a few other routines;
> however, for some reason, the compiler
> chooses to insert the standard libc
> memcpy in some of the files. Thus, some
> files get my version of memcpy, and
> other get the libc version. There's is
> no apparent difference in those files;
> they include the same .h files, they are
> compiled with the same switches, etc.
> Any suggestions?
the compiler is not linking in anything from the libc, but it has builtin
functions for some very common functions. when you initialize an
array (or any other datastructure) the compiler needs to have a bcopy or
memcopy. So if the
compiler already has a target-optimized memcpy, why not use it for
libc memcpy calls as well?
if you do not like this behaviour, turn it off using -fno-builtin
-fno-builtin
Don't recognize built-in functions that do not be-
gin with two leading underscores. Currently, the
functions affected include _exit, abort, abs, allo-
ca, cos, exit, fabs, labs, memcmp, memcpy, sin,
sqrt, strcmp, strcpy, and strlen.
The `-ansi' option prevents alloca and _exit from
being builtin functions.
>
> Thanks,
>
> Pete
>
you're welcome
rolf
+-----------------+-----------------------------------------+
| _____ | Rolf Fiedler |
| / ___/ | Electronic Design Engineer |
| / _/ | Ferrari electronic GmbH |
| /_/e/r/r/a/r/i/ | phone: +49 3328 4559 0 |
| electronic | E-Mail: Rolf.Fiedler@Ferrari.DE |
| | fax : +49 3328 4559 60 |
+-----------------+-----------------------------------------+
"Where do you want to go tomorrow?"
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: GaA0Lt9cAkyY3fgatYUx2tjteW8lyG8I
iQA/AwUANWKTuYCk3bE/FtS8EQL4NQCggaptQ5tuhxpc1+U1KfFTwVGCQxgAoMHQ
hX9QONTl3J1hhlfRX6LjID58
=a2W/
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: memcpy
1998-05-19 9:59 No Subject Pete Popov
1998-05-20 6:06 ` your mail Rolf Fiedler
@ 1998-05-20 6:06 ` Jonathan Larmour
1998-05-22 9:56 ` Pete Popov
2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Larmour @ 1998-05-20 6:06 UTC (permalink / raw)
To: Pete Popov; +Cc: crossgcc
Pete Popov wrote:
[snip 8< ]
> I've got my own version
> of "memcpy" and a few other routines;
> however, for some reason, the compiler
> chooses to insert the standard libc
> memcpy in some of the files. Thus, some
> files get my version of memcpy, and
> other get the libc version.
I don't think its actually the libc version that's being included. If you
look at the man page for gcc you will find that gcc itself provides builtin
versions of _exit, abort, abs, alloca, cos, exit, fabs, labs, memcmp,
memcpy, sin, sqrt, strcmp, strcpy, and strlen.
To avoid this behaviour try either -fno-builtins or -mmemcpy (I haven't
tried these though so YMMV).
Jonathan L.
--
Cygnus Solutions, 35 Cambridge Place, Cambridge, UK. Tel: +44 (1223) 728762
"It is impossible to enjoy idling thoroughly unless||Home e-mail: jifl @
one has plenty of work to do - Jerome K. Jerome" || jifvik.demon.co.uk
Help fight spam! http://spam.abuse.net/ These opinions are all my own fault
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re:
1998-05-19 9:59 No Subject Pete Popov
1998-05-20 6:06 ` your mail Rolf Fiedler
1998-05-20 6:06 ` memcpy Jonathan Larmour
@ 1998-05-22 9:56 ` Pete Popov
2 siblings, 0 replies; 4+ messages in thread
From: Pete Popov @ 1998-05-22 9:56 UTC (permalink / raw)
To: crossgcc
Thanks to everyone who responded to my
mail. I now understand the "problem" and
know how to fix it.
Thanks again,
Pete
Pete Popov wrote:
> Hi,
>
> I'm using a mips64 dos-hosted cross
> compiler which I built on my Linux box.
> The compiler has been working fine and
> we haven't ran into any problems, but
> there's something I don't understand and
> it really frustrates me.
>
> I'm compiling all files with "-nostdinc"
> switch; the files are later linked with
> "-nostdlib". I've got my own version
> of "memcpy" and a few other routines;
> however, for some reason, the compiler
> chooses to insert the standard libc
> memcpy in some of the files. Thus, some
> files get my version of memcpy, and
> other get the libc version. There's is
> no apparent difference in those files;
> they include the same .h files, they are
> compiled with the same switches, etc.
> Any suggestions?
>
> Thanks,
>
> Pete
^ permalink raw reply [flat|nested] 4+ messages in thread