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

See the CrossGCC FAQ for lots more information.


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

Re: gcc compile


Helmut Kolb wrote:
> 
> es klopfte Hua Ji in seine tastatur:
> > For testing, you can use gcc -msim...., so that you will no problem for
> > creating an executable and can be run with the powerpc-arm-elf-run, which
> > should be located in your ./bin directory.
>
> ... i have read a few times about the "-msim" switch of gcc.
> 
> I am unable to find such a think (which sounds nice) in my version of
> gcc, which i compiled for i960 about a year ago:
> ,----------------------------- [ gcc -v ] -----------------------------
> | Reading specs from
> | /usr/local/i960/compiler/lib/gcc-lib/i960-unknown-coff/2.95.2/specs
> | gcc version 2.95.2 19991024 (release)
> `----------------------------------------------------------------------
> 2.92.2 shoudn't be sooo old - right?
> 
> Is the "sim" option a new feature, a special patch, or something enabled
> for some special cpus?

 The option is available probably only for PowerPC, I don't remember it used
elsewhere.

 The 'i960-coff' target uses the 'mon960' as the only available target (in newlib)
and the i960-simulator in GDB seems to simulate it. Ok, here is a clip from my
'specs' for 'i960-coff':

------------------------ clip ------------------------------------------
*endfile:


*link:
%{mka:-AKA}%{mkb:-AKB}%{msa:-ASA}%{msb:-ASB} %{mmc:-AMC}%{mca:-ACA}%{mcc:-ACC}%{mcf:-ACF}
%{mja:-AJX}%{mjd:-AJX}%{mjf:-AJX}%{mrp:-AJX} %{mbout:-Fbout}%{mcoff:-Fcoff} %{mlink-relax:-relax} -T mon960.ld%s

*lib:
-lc -lmon960 -lgcc -lc

*libgcc:


*startfile:
crt0%O%s
------------------------ clip ------------------------------------------

 If I compile the C program for the default 'mon960' and use the '-mka'
(I remember the KA being the only supported model in the simulator) :

e:\usr\local\samples>gcc-i960-coff -mka -g -o tst_i960ka.gx tprintf.c

and then try it with the standalone simulator (from GDB), it runs without
any problems (even under Win32...) :

e:\usr\local\samples>run-i960-coff-mw tst_i960ka.gx
%.4x:   `0012'
%04x:   `0012'
%4.4x:  `0012'
%04.4x: `0012'
%4.3x:  ` 012'
%04.3x: ` 012'
%.*x:   `0012'
%0*x:   `0012'
%*.*x:  `0012'
%0*.*x: `0012'
bad format:     "z"
nil pointer (padded):   "       0x0"
decimal negative:       "-2345"
octal negative: "37777773327"
hex negative:   "fffff6d7"
long decimal number:    "-123456"
long octal negative:    "37777773327"
long unsigned decimal number:   "4294843840"
zero-padded LDN:        "-000123456"
< snip >

 Hopefully this was your problem and can help you to solve it...

Cheers, Kai



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


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