public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* No Subject
@ 1998-05-19  9:59 Pete Popov
  1998-05-20  6:06 ` memcpy Jonathan Larmour
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Pete Popov @ 1998-05-19  9:59 UTC (permalink / raw)
  To: crossgcc

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] 10+ messages in thread

* Re: memcpy
  1998-05-19  9:59 No Subject Pete Popov
@ 1998-05-20  6:06 ` Jonathan Larmour
  1998-05-20  6:06 ` your mail Rolf Fiedler
  1998-05-22  9:56 ` Pete Popov
  2 siblings, 0 replies; 10+ 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] 10+ messages in thread

* Re: your mail
  1998-05-19  9:59 No Subject Pete Popov
  1998-05-20  6:06 ` memcpy Jonathan Larmour
@ 1998-05-20  6:06 ` Rolf Fiedler
  1998-05-22  9:56 ` Pete Popov
  2 siblings, 0 replies; 10+ 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] 10+ messages in thread

* Re:
  1998-05-19  9:59 No Subject Pete Popov
  1998-05-20  6:06 ` memcpy Jonathan Larmour
  1998-05-20  6:06 ` your mail Rolf Fiedler
@ 1998-05-22  9:56 ` Pete Popov
  2 siblings, 0 replies; 10+ 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] 10+ messages in thread

* Re: your mail
       [not found] ` <20040316180134.GG14683@qworks.ca>
@ 2004-03-16 18:29   ` Chris Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Jones @ 2004-03-16 18:29 UTC (permalink / raw)
  To: crossgcc

subscribe

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

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

* Re: your mail
       [not found] <20040223154755.23916.qmail@web41606.mail.yahoo.com>
@ 2004-02-23 16:57 ` Michael Matz
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Matz @ 2004-02-23 16:57 UTC (permalink / raw)
  To: kripa shankar; +Cc: gcc, gcc-help, crossgcc

Hi,

On Mon, 23 Feb 2004, kripa shankar wrote:

> ;; Start of basic block 2, registers live: 11 [fp] 13 [sp]
> (note 62 41 45 [bb 2] NOTE_INSN_BASIC_BLOCK)
> (insn 45 62 46 (set (reg/i:SI 0 r0)        (const_int 0 [0x0])) 176 {*movsi_insn} (nil)    (expr_list:REG_EQUAL (const_int 0 [0x0])        (nil)))
> (insn 46 45 76 (use (reg/i:SI 0 r0)) -1 (insn_list 45 (nil))    (nil))
> (insn 76 46 77 (set (reg:SI 7 r7)        (plus:SI (reg:SI 5 r5)            (const_int 2 [0x2]))) -1 (nil)    (nil))
> (insn 77 76 50 (set (reg:SI 6 r6)        (plus:SI (reg:SI 4 r4)            (const_int 2 [0x2]))) -1 (nil)    (nil))
> ;; End of basic block 2
> (note 50 77 63 0 NOTE_INSN_BLOCK_END)
> (note 63 50 0 "" NOTE_INSN_DELETED)
> 
> The instructions inserted are r7 = r5 + 2;r6 = r4 + 2; But the problem
> is that the inserted instructions are not present in both asm file
> (fourth.s) and the output binary file (fourth.o).. I have inserted these
> instructions right after all the optimization passess and before the
> final pass (final.c) where RTL gets converted into Assembly. Kindly help
> me.

There is not enough information.  Where exactly have you added the code to
add those insns?  About which compiler version do you speak?  Produce all 
dump files (-da) and look which dump misses them first.  The problem is, 
that you include those instructions without updating lifeness (i.e. the 
compiler doesn't see, that r6 and r7 really are required after you've set 
them.  So, if there is any pass deleting useless insns after you inserted 
them, they will get deleted.


Ciao,
Michael.

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

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

* Re: your mail
  1998-09-07 21:04 ` Harry G. Clayton
@ 1998-09-08  8:39   ` joel
  0 siblings, 0 replies; 10+ messages in thread
From: joel @ 1998-09-08  8:39 UTC (permalink / raw)
  To: Harry G. Clayton; +Cc: cduan, crossgcc

On Tue, 8 Sep 1998, Harry G. Clayton wrote:

> If I remember correctly, you can configure binutils --with-targets=ALL
> (or something similar, see the various README/INSTALLs in binutils)
> and then objcopy can convert anything to anything.  (except that you
> won't benifit from converting binary or S-records to ELF for obvious
> reasons.  Rule of thumb, always convert from the most verbose object
> format to the least verbose.)

There are limits to what the object format conversion can do particularly
with debug information BUT it does work amazingly well on lots of cases.

I think Srecords are always included in the list of supported formats.

--joel
Joel Sherrill                    Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (205) 722-9985




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

* Re: your mail
  1998-09-07  2:33 No Subject Duan, Chenggang (Chenggang)
  1998-09-07 15:22 ` your mail joel
@ 1998-09-07 21:04 ` Harry G. Clayton
  1998-09-08  8:39   ` joel
  1 sibling, 1 reply; 10+ messages in thread
From: Harry G. Clayton @ 1998-09-07 21:04 UTC (permalink / raw)
  To: cduan; +Cc: crossgcc

> 
> Does someone have ddump to convert m68k-coff
>  format into Motorola S_records?
>  Thanx in advance.
> 
>  sincerely yours
>  chenggang Duan
> 

See the man page or info for 'objcopy' from the binutils package.  It
can convert m68k-coff to S-records.

If I remember correctly, you can configure binutils --with-targets=ALL
(or something similar, see the various README/INSTALLs in binutils)
and then objcopy can convert anything to anything.  (except that you
won't benifit from converting binary or S-records to ELF for obvious
reasons.  Rule of thumb, always convert from the most verbose object
format to the least verbose.)

-- 
-hgc
  Harry G. Clayton     hgc@symuli.com      HClayton@SaharaNet.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support the anti-Spam amendment ---> Join at http://www.cauce.org/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Most widely published lie: 'Installation is the reverse of disassembly'

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

* Re: your mail
  1998-09-07  2:33 No Subject Duan, Chenggang (Chenggang)
@ 1998-09-07 15:22 ` joel
  1998-09-07 21:04 ` Harry G. Clayton
  1 sibling, 0 replies; 10+ messages in thread
From: joel @ 1998-09-07 15:22 UTC (permalink / raw)
  To: Duan, Chenggang (Chenggang); +Cc: 'crossgcc@cygnus.com'

On Mon, 7 Sep 1998, Duan, Chenggang (Chenggang) wrote:

> Does someone have ddump to convert m68k-coff
>  format into Motorola S_records?

You should have everything already to do this.  Try this command:

m68k-coff-objdump -O srec FILE.coff -o FILE.srec

Good Luck.

--joel
Joel Sherrill                    Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (205) 722-9985




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

* Re: your mail
  1998-04-27 20:39 No Subject Tan Pinghui
@ 1998-04-28  7:12 ` Hans Zuidam
  0 siblings, 0 replies; 10+ messages in thread
From: Hans Zuidam @ 1998-04-28  7:12 UTC (permalink / raw)
  To: tanph; +Cc: crossgcc

> Tan Pinghui wrote:
> Some strange behaviors occur with the following simple program, I
> can't figure out why and how.
Although I don't know your hardware setup it looks like gets() is
returning EOF on the second call to it, gets() should return a
nil-string.  The subtle difference is that gets() should return a
nil-string (i.e. "") if you only type a newline and it should return
a NULL pointer to signal EOF or a read error.  Try the same program
on any UNIX box and type ^D (EOF) on the second gets().  Hope this
helps,
					Hans

-- 
H. Zuidam                        E-Mail: hans@brandinnovators.com
Brand Innovators B.V.            P-Mail: P.O. Box 1377
de Pinckart 54                   5602 BJ Eindhoven, The Netherlands
5674 CC Nuenen                   Tel. +31 40 2631134, Fax. +31 40 2831138

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

end of thread, other threads:[~2004-03-16 18:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-19  9:59 No Subject Pete Popov
1998-05-20  6:06 ` memcpy Jonathan Larmour
1998-05-20  6:06 ` your mail Rolf Fiedler
1998-05-22  9:56 ` Pete Popov
     [not found] <20040316175922.GF14683@qworks.ca>
     [not found] ` <20040316180134.GG14683@qworks.ca>
2004-03-16 18:29   ` your mail Chris Jones
     [not found] <20040223154755.23916.qmail@web41606.mail.yahoo.com>
2004-02-23 16:57 ` Michael Matz
  -- strict thread matches above, loose matches on Subject: below --
1998-09-07  2:33 No Subject Duan, Chenggang (Chenggang)
1998-09-07 15:22 ` your mail joel
1998-09-07 21:04 ` Harry G. Clayton
1998-09-08  8:39   ` joel
1998-04-27 20:39 No Subject Tan Pinghui
1998-04-28  7:12 ` your mail Hans Zuidam

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