This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: your mail


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