DPRG
DPRG List  



[DPRG] Off Topic: gcc help

Subject: [DPRG] Off Topic: gcc help
From: Tom Brusehaver cozytom at gmail.com
Date: Thu Jul 15 17:36:28 CDT 2010

Cygwin can load the GCC compiler. With that, and the GCC source you want to use
you can build a cross compiler.

   http://gcc.gnu.org/install/build.html

About halfway down it gives an overview of the instructions for
building a cross compiler
including the steps to bootstrap it. There are command line args
--host and --target
to tell it what the compiler will be running on (windows) and what the
results will be
output to (new chip).

Anyone who has used the winavr gcc compiler has used the cross
compiler built that
way.

I agree, though, Linux might be a bit easier to get things boot
strapped. Cygwin,
while good, is still a unix environment emulator, and it doesn't
always do what is
expected. (even running a liveCD/usb key would be ok) Once you are happy with
the world, then compile it hosted on windows, with your new system as a target.

Good luck.


On Thu, Jul 15, 2010 at 4:15 PM,  <warm38 at juno.com> wrote:
> What about cygwin/bash?  I never saw much diff between that and SuSE and
> ubuntu syntax on a terminal window.
> As much as I dont like windoze, my work environment forces me to "the
> dark side".
>
>
> On Thu, 15 Jul 2010 15:58:24 -0500 (CDT) ed at okerson.com writes:
>> Sorry, I don't do windows......
>>
>> Ed
>>
>> >
>> > On Thu, 15 Jul 2010 14:19:53 -0500 Steve Rainwater
>> <srainwater at ncc.com>
>> > writes:
>> >> On Thu, 2010-07-15 at 14:45 -0400, warm38 at juno.com wrote:
>> >> > My Linux  bash scripting is old, and I've never built gcc, but
>> now
>> >> I
>> >> > gotta test a compiler.
>> >> >
>> >> > I know that "runtest" is involved, but no clue how to set it up
>> to
>> >> run.,
>> >> >
>> >> > Anyone out there willing to help me get started?  Or at least
>> give
>> >> me a
>> >> > pointer where I can get help?
>> >> > (gcc.org answer is RTFM and I have read it but I'm not speaking
>> >> the same
>> >> > language and there are a LOT of assumptions they make that
>> leave
>> >> me
>> >> > clueless).
>> >
>> > I am using Cygwin under winXP.  I have this directory.
>> > /opt/gcc-4.4.3/gcc/testsuite
>> > It has these directories that are full of .c files that test the
>> > compiler.
>> > ./c-c++-common
>> > ./gcc.db        (some subdirectories will be invalid for 8bit
>> processor
>> > -- think a processor like the avr tiny22, as in tiny as in 32 regi
>> 32
>> > bytes RAM 2K program)
>> > ./gcc.c-torture        (some subdirectories ... ditto above)
>> >
>> > gcc/testsuite does not have a Makefile -- that looks bad to me.
>> > gcc has Makefile.in but no plain Makefile.
>> >
>> > This will be for a cross-comiler to build the files under cygwin.
>> The
>> > processor has NOT yet been released and they are trying to get the
>> C
>> > compiler OK and be able to do REGRESSION (DejaGnu/runtest) testing
>> as
>> > they make changes to the compiler.  (this is their first try)
>> >
>> > So, here is a gcc compiler running under cygwin.  I can
>> disassemble it, I
>> > can load/run it on the simulator.  Now, how do I test the compiler
>> for
>> > all the little C issues like loops, add, sub (too small for
>> mult/div and
>> > there is not mult/div instruction), call, branch (max is 2K
>> instructions)
>> > switch/case, if/else, arrays (small) structs (small).  Only char,
>> and
>> > 16-bit int and no long, float, double.
>> >
>> > Someone ran the "runtest" program (I dont have source loaded for
>> runtest,
>> > so I'm not too swift on the setup) and sent the results:
>> > ---------------------
>> > We had run through some of the GCC standard test suite before here
>> is a
>> > summary of the results -
>> > Total tests run: 39440
>> > Total tests passed: 29895
>> >         - Compilation: 11318
>> >         - Execution: 0
>> >         - Other: 18577
>> > Total tests failed:
>> >         - Compilation: 9545
>> >                 ` No math library: 7489
>> >                 ` Internal compiler error: 27
>> >                 ` Indirect calls/branches: 594
>> >                 ` Size of `int' too small: 133
>> >                 ` Required headers not available: 693
>> >                 ` Branch targets too short: 501
>> >                 ` Other: 164
>> >         - Execution: 0
>> > ---------------------
>> > The "Execution: 0" is because the generated -elf file must run
>> against a
>> > perl script and the two files are run into a simulator to actually
>> run.
>> > Whoever the folks are that ran the test sent nothing along
>> (runtest
>> > --parameter1 --parameter2 ...) and nothing on which tests failed.
>> So
>> > that is what got dumped on me and I'm feeling plum ignorant the
>> more I
>> > look into a pile of C files with no Makefile... groan.
>> >
>> > I haven't written bash scripts for 15 years and me an Makefiles
>> dont get
>> > along too really good.  Know what I mean?
>> >
>> > If I can get just one successful [full or partial] run then I can
>> figure
>> > out individual crashes.  And I can eventually get a bash script (I
>> think)
>> > to take a compiled file to the simulator.
>> >
>> > If someone feels sorry for the poor point-and-click XP user and
>> wants to
>> > help, I'm very appreciative.
>> > If you wanna go offline, that's fine too.  I'm at the "whatever"
>> point.
>> >
>> > I hope this isn't "TOO MUCH INFO".  If it is, just consider it a
>> good
>> > sleep aid for tonight.  8-)
>> >
>> > wade
>> >
>> >> What sort of help do you need? More info would about what you're
>> >> trying
>> >> to do would help. I'm assuming you're trying to build a
>> >> cross-compiler?
>> >> What's host and target?
>> >>
>> >> If you're on a mainstream GNU/Linux distro like Fedora, you can
>> >> install
>> >> ready-made cross compilers for popular targets like AVR.
>> >>
>> >> Building a full cross tool chain can be challenging but there are
>> >> some
>> >> documents out there to help. Here's a general one:
>> >>
>> >>  http://wiki.osdev.org/GCC_Cross-Compiler
>> >>
>> >> You can often find documents with more specific instructions for
>> a
>> >> particular host and target.
>> >>
>> >> -Steve
>> >>
>> >> _______________________________________________
>> >> DPRGlist mailing list
>> >> DPRGlist at dprg.org
>> >> http://list.dprg.org/mailman/listinfo/dprglist
>> >>
>> >
>> > ____________________________________________________________
>> > Penny Stock Jumping 2000%
>> > Sign up to the #1 voted penny stock newsletter for free today!
>> >
>> http://thirdpartyoffers.juno.com/TGL3141/4c3f7335531d3291d99st06vuc
>> > _______________________________________________
>> > DPRGlist mailing list
>> > DPRGlist at dprg.org
>> > http://list.dprg.org/mailman/listinfo/dprglist
>> >
>>
>>
>> _______________________________________________
>> DPRGlist mailing list
>> DPRGlist at dprg.org
>> http://list.dprg.org/mailman/listinfo/dprglist
>>
> _______________________________________________
> DPRGlist mailing list
> DPRGlist at dprg.org
> http://list.dprg.org/mailman/listinfo/dprglist
>

More information about the DPRG mailing list