From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rolf Fiedler To: Pete Popov Cc: crossgcc@cygnus.com Subject: Re: your mail Date: Wed, 20 May 1998 06:06:00 -0000 Message-id: References: <3561BA5A.B421C781@redcreek.com> X-SW-Source: 1998-q2/msg00075.html 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-----