[gentoo-user] Re: How to compile for less bits :)

2010-09-30 Thread James
Jacob Todd jaketodd422 at gmail.com writes:


 Cross compiling on unix is confusing because the compiler sucks.
(hmmm, nope you are wrong, and statements like that will get
you little helpimho

http://www.gentoo.org/proj/en/base/embedded/handbook/

Some wizards of cross_compiling hang out on gentoo-embedded
Display excellent manners and you may get help, real help..

hth,
James







Re: [gentoo-user] Re: How to compile for less bits :)

2010-09-30 Thread Hazen Valliant-Saunders
Although we understand your frustration we do not sympathyse becasue we've
all had to learn it.

No it's not a checkbox it's a complie time option; and should be passed when
you compile your code.

like ls -alh

GCC only looks difficult because you are new and have not used many other
compilers; you will find and grow to love it if you use gentoo for a while;
it's the most portable, widely used and cheapest compiler out there, we are
lucky the GNU exists, othewise you'd have a crappy compiler from IBM to deal
with. Also it doesn't come with an IDE, but Bluefish works mighty fine for
me.

Some light reading:
http://en.wikipedia.org/wiki/Compiler

You'll soon realize why every gentoo installation is as unique as the person
running it.

If you have not read this already:
http://www.gentoo.org/proj/en/base/embedded/cross-development.xml

Start there, if you are confused or have questions, ask nicely.

Please check the ego and attitude elsewhere.

Regards,
Hazen.

On Thu, Sep 30, 2010 at 10:01 AM, James wirel...@tampabay.rr.com wrote:

 Jacob Todd jaketodd422 at gmail.com writes:


  Cross compiling on unix is confusing because the compiler sucks.
 (hmmm, nope you are wrong, and statements like that will get
 you little helpimho

 http://www.gentoo.org/proj/en/base/embedded/handbook/

 Some wizards of cross_compiling hang out on gentoo-embedded
 Display excellent manners and you may get help, real help..

 hth,
 James








-- 
Hazen Valliant-Saunders
IT/IS Consultant
(613) 355-5977


Re: [gentoo-user] Re: How to compile for less bits :)

2010-09-29 Thread meino . cramer
Grant Edwards grant.b.edwa...@gmail.com [10-09-27 21:16]:
 On 2010-09-27, meino.cra...@gmx.de meino.cra...@gmx.de wrote:
 
   For my microcontroller board (ATMEL AT81RM920, linux based)
 
 Do you mean AT91RM9200?
 
   I want to crosscompile kernels and applications on my 64bit Gentoo
   linux.
 
 That's easy enough.
 
   The source of a gcc (prepared on a 32bit system I fear) for
   the purpose of crosscompiling from a 32bit system-- target is the
   above mentioned processor -- is available.
 
   Is it possible to compile this gcc as a 32bit-application on my 64bit
   system to ensure the same behaviour as it would if to was built on a
   original 32bit Gentoo Linux?
 
 You want to compile gcc on an AMD64 machine and end up with a
 cross-compiler that runs as an IA32 app and generates code for an ARM9
 target?
 
 That's called a Canadian Cross, and is rather tricky, since it
 involves three different architectures: building a compiler on
 architecture A (AMD64) to be run on architecture B (IA32) and generate
 code for architecture C (ARM9).
 
 Can you explain why you want that rather than a normal cross compiler?
 
 IOW, why do you want to build a gcc cross compiler that runs as a
 32-bit application?  It's _way_ simpler to build a normal cross
 compiler: building a compiler one architecture (AMD64) to be run on
 that same architecture (AMD64) and generate code for a second
 architecture (ARM9).
 
   (And in this context: The audio application chuck is only as 32bit
   application available currently. How is it possible to compile this
   on a 64bit system?)
 
 You use a compiler that generates code for a the desired 32-bit
 architecture.  The width of the host is immaterial.
 
 The easiest way to build such a compiler is using crosstool-ng
 
   http://ymorin.is-a-geek.org/projects/crosstool
 
 Crosstool-NG does have some support for doing a Canadian-cross, but I
 don't see why you would want to do that.
 
 -- 
 Grant Edwards   grant.b.edwardsYow! Gibble, Gobble, we
   at   ACCEPT YOU ...
   gmail.com
 
 

Hi Grant,

Thank you very much for your offered help!

Sorry, sorry I think my English confused a lot of infos...

I'll try it again.

Setup BEFORE I switched to 64bit Gentoo Linux.
* a normal system gcc as installed by emerge usually on many (all?) gentoo
  systems...
* a crosscompiling gcc in source form. Compiled with the normal
  gcc to an executable which runs on the 32bit Gentoo system and
  produces executables/kernel to run on the ATMEL AT91RM9200 (yes,
  you're right - this typo was mine ;) ) .
* Additional chuck audio application only available for 32bit
  Linux, also compiled with the normal gcc

Wanted setup on my shiny new 64bit Gentoo Linux:
* a normal system gcc as installed by emerge usually on many (all?) gentoo
  systems... (== already there and living quite well)
* a crosscompiling gcc in source form. To be Compiled with the normal
  gcc to an executable which runs on the 64bit Gentoo system and
  produces executables/kernel to run on the ATMEL AT91RM9200 (yes,
  you're right - this typo was mine ;) ) .
  OR: compiled to be an 32bit gcc-executable which generate executable
  binaries for my ATMEL cookie.
  As long a 64bit-executable of gcc can do the job I would prefer that
  solution of course.
* Additional chuck audio application only available for 32bit
  Linux, to be compiled with the normal gcc to be a 32 bit
  executable since not 64bit-ready.

I hope not to have made too much knots into that above...

Best regards
mcc




[gentoo-user] Re: How to compile for less bits :)

2010-09-29 Thread Grant Edwards
On 2010-09-29, meino.cra...@gmx.de meino.cra...@gmx.de wrote:

   (And in this context: The audio application chuck is only as 32bit
   application available currently. How is it possible to compile this
   on a 64bit system?)
 
 You use a compiler that generates code for a the desired 32-bit
 architecture.  The width of the host is immaterial.

 Thank you very much for your offered help!

 Sorry, sorry I think my English confused a lot of infos...

Cross-building stuff is just plain confusing.

 I'll try it again.

 Setup BEFORE I switched to 64bit Gentoo Linux.
 * a normal system gcc as installed by emerge usually on many (all?) gentoo
   systems...
 * a crosscompiling gcc in source form. Compiled with the normal
   gcc to an executable which runs on the 32bit Gentoo system and
   produces executables/kernel to run on the ATMEL AT91RM9200 (yes,
   you're right - this typo was mine ;) ).
 * Additional chuck audio application only available for 32bit
   Linux, also compiled with the normal gcc

 Wanted setup on my shiny new 64bit Gentoo Linux:
 * a normal system gcc as installed by emerge usually on many (all?) gentoo
   systems... (== already there and living quite well)
 * a crosscompiling gcc in source form. To be Compiled with the normal
   gcc to an executable which runs on the 64bit Gentoo system and
   produces executables/kernel to run on the ATMEL AT91RM9200 (yes,
   you're right - this typo was mine ;) ) .

All you need to do is build a cross compiler for the ARM9 target the
same way you did before.  The width of the host where you're building
things doesn't matter (if it does, that's a bug in gcc or binutils).

I've had excellent results using the crosstool-ng makefile:

   http://ymorin.is-a-geek.org/projects/crosstool
   
Crosstool is used by a lot of embedded developers. If there were
problems building an ARM comiler on an AMD64 host, Yann Morin et al.
are your best bet for a solution.  You may want to take a look at the
crossgcc mailing list:

   http://news.gmane.org/gmane.comp.gcc.cross-compiling
   http://sourceware.org/ml/crossgcc/

From a brief search of the mailing list, it appears that building an
ARM compiler on an AMD64 machines works just fine.   

or,

It's quite likely that you can install IA32 libraries on your AMD64
host OS and then use the exact same compiler executable you used
before.  

   OR: compiled to be an 32bit gcc-executable which generate
   executable binaries for my ATMEL cookie. As long a 64bit-executable
   of gcc can do the job I would prefer that solution of course.

You really don't want to do that.  It's rather tricky, and it
shouldn't be required.

 * Additional chuck audio application only available for 32bit
   Linux, to be compiled with the normal gcc to be a 32 bit
   executable since not 64bit-ready.

Just use the arm-linux-gcc compiler and you should be fine regardless
of the width of the host on which you built the arm-linux-gcc
compiler.

-- 
Grant Edwards   grant.b.edwardsYow! It's the RINSE CYCLE!!
  at   They've ALL IGNORED the
  gmail.comRINSE CYCLE!!




Re: [gentoo-user] Re: How to compile for less bits :)

2010-09-29 Thread meino . cramer
Grant Edwards grant.b.edwa...@gmail.com [10-09-30 00:32]:
 On 2010-09-29, meino.cra...@gmx.de meino.cra...@gmx.de wrote:
 
(And in this context: The audio application chuck is only as 32bit
application available currently. How is it possible to compile this
on a 64bit system?)
  
  You use a compiler that generates code for a the desired 32-bit
  architecture.  The width of the host is immaterial.
 
  Thank you very much for your offered help!
 
  Sorry, sorry I think my English confused a lot of infos...
 
 Cross-building stuff is just plain confusing.
 
  I'll try it again.
 
  Setup BEFORE I switched to 64bit Gentoo Linux.
  * a normal system gcc as installed by emerge usually on many (all?) gentoo
systems...
  * a crosscompiling gcc in source form. Compiled with the normal
gcc to an executable which runs on the 32bit Gentoo system and
produces executables/kernel to run on the ATMEL AT91RM9200 (yes,
you're right - this typo was mine ;) ).
  * Additional chuck audio application only available for 32bit
Linux, also compiled with the normal gcc
 
  Wanted setup on my shiny new 64bit Gentoo Linux:
  * a normal system gcc as installed by emerge usually on many (all?) gentoo
systems... (== already there and living quite well)
  * a crosscompiling gcc in source form. To be Compiled with the normal
gcc to an executable which runs on the 64bit Gentoo system and
produces executables/kernel to run on the ATMEL AT91RM9200 (yes,
you're right - this typo was mine ;) ) .
 
 All you need to do is build a cross compiler for the ARM9 target the
 same way you did before.  The width of the host where you're building
 things doesn't matter (if it does, that's a bug in gcc or binutils).
 
 I've had excellent results using the crosstool-ng makefile:
 
http://ymorin.is-a-geek.org/projects/crosstool

 Crosstool is used by a lot of embedded developers. If there were
 problems building an ARM comiler on an AMD64 host, Yann Morin et al.
 are your best bet for a solution.  You may want to take a look at the
 crossgcc mailing list:
 
http://news.gmane.org/gmane.comp.gcc.cross-compiling
http://sourceware.org/ml/crossgcc/
 
 From a brief search of the mailing list, it appears that building an
 ARM compiler on an AMD64 machines works just fine.   
 
 or,
 
 It's quite likely that you can install IA32 libraries on your AMD64
 host OS and then use the exact same compiler executable you used
 before.  
 
OR: compiled to be an 32bit gcc-executable which generate
executable binaries for my ATMEL cookie. As long a 64bit-executable
of gcc can do the job I would prefer that solution of course.
 
 You really don't want to do that.  It's rather tricky, and it
 shouldn't be required.
 
  * Additional chuck audio application only available for 32bit
Linux, to be compiled with the normal gcc to be a 32 bit
executable since not 64bit-ready.
 
 Just use the arm-linux-gcc compiler and you should be fine regardless
 of the width of the host on which you built the arm-linux-gcc
 compiler.
 
 -- 
 Grant Edwards   grant.b.edwardsYow! It's the RINSE CYCLE!!
   at   They've ALL IGNORED the
   gmail.comRINSE CYCLE!!
 


Hi Grant,

thank you very much for your help again ! :)
Life on planet AMD64 becomes easier ;)

One question remains open to me:
* How can I build 32bit applicationa to run on a 64bit Gentoo Linux
  (I have both /lib32 and /lib64 and /usr/lib32 and /usr/lib64)
  with the normal gcc (64 bit executable) on the 64bit Gentoo Linux.
  Is this trick possible?
  (Chuck is not 64bit ready...)

Thank you very much for your help in advance!
Best regards,
mcc




Re: [gentoo-user] Re: How to compile for less bits :)

2010-09-29 Thread Jacob Todd
Cross compiling on unix is confusing because the compiler sucks.

On Sep 29, 2010 3:50 PM, Grant Edwards grant.b.edwa...@gmail.com wrote:

On 2010-09-29, meino.cra...@gmx.de meino.cra...@gmx.de wrote:

  (And in this context: The aud...

 Thank you very much for your offered help!

 Sorry, sorry I think my English confused a lot of i...
Cross-building stuff is just plain confusing.


 I'll try it again.

 Setup BEFORE I switched to 64bit Gentoo Linux.
 * a normal system gcc a...
All you need to do is build a cross compiler for the ARM9 target the
same way you did before.  The width of the host where you're building
things doesn't matter (if it does, that's a bug in gcc or binutils).

I've had excellent results using the crosstool-ng makefile:


http://ymorin.is-a-geek.org/projects/crosstool
Crosstool is used by a lot of embedded developers. If there were
problems building an ARM comiler on an AMD64 host, Yann Morin et al.
are your best bet for a solution.  You may want to take a look at the
crossgcc mailing list:

  http://news.gmane.org/gmane.comp.gcc.cross-compiling
  http://sourceware.org/ml/crossgcc/

From a brief search of the mailing list, it appears that building an
ARM compiler on an AMD64 machines works just fine.

or,

It's quite likely that you can install IA32 libraries on your AMD64
host OS and then use the exact same compiler executable you used
before.


 OR: compiled to be an 32bit gcc-executable which generate
 executable binaries for my ATMEL ...
You really don't want to do that.  It's rather tricky, and it
shouldn't be required.


 * Additional chuck audio application only available for 32bit
 Linux, to be compiled with th...
Just use the arm-linux-gcc compiler and you should be fine regardless
of the width of the host on which you built the arm-linux-gcc
compiler.

--
Grant Edwards   grant.b.edwardsYow! It's the RINSE
CYCLE!!
 at   They've ALL IGNORED the
 gmail.comRINSE CYCLE!!


[gentoo-user] Re: How to compile for less bits :)

2010-09-29 Thread Grant Edwards
On 2010-09-29, meino.cra...@gmx.de meino.cra...@gmx.de wrote:

 One question remains open to me:
 * How can I build 32bit applicationa to run on a 64bit Gentoo Linux
   (I have both /lib32 and /lib64 and /usr/lib32 and /usr/lib64)
   with the normal gcc (64 bit executable) on the 64bit Gentoo Linux.
   Is this trick possible?
   (Chuck is not 64bit ready...)

That I don't know.

I thought you wanted to build chuck for the ARM target.

-- 
Grant




[gentoo-user] Re: How to compile for less bits :)

2010-09-29 Thread Grant Edwards
On 2010-09-29, Jacob Todd jaketodd...@gmail.com wrote:

 Cross compiling on unix is confusing because the compiler sucks.

We're all looking forward to the better one that you're writing. ;)

[I admine that gcc has its warts, but you evidently haven't dealt with
some of the compilers I have.]

-- 
Grant







Re: [gentoo-user] Re: How to compile for less bits :)

2010-09-29 Thread Jacob Todd
There's already great cross compilers on plan 9. No need to write a new one.

On Sep 29, 2010 8:15 PM, Grant Edwards grant.b.edwa...@gmail.com wrote:
 On 2010-09-29, Jacob Todd jaketodd...@gmail.com wrote:

 Cross compiling on unix is confusing because the compiler sucks.

 We're all looking forward to the better one that you're writing. ;)

 [I admine that gcc has its warts, but you evidently haven't dealt with
 some of the compilers I have.]

 --
 Grant







[gentoo-user] Re: How to compile for less bits :)

2010-09-27 Thread Grant Edwards
On 2010-09-27, meino.cra...@gmx.de meino.cra...@gmx.de wrote:

  For my microcontroller board (ATMEL AT81RM920, linux based)

Do you mean AT91RM9200?

  I want to crosscompile kernels and applications on my 64bit Gentoo
  linux.

That's easy enough.

  The source of a gcc (prepared on a 32bit system I fear) for
  the purpose of crosscompiling from a 32bit system-- target is the
  above mentioned processor -- is available.

  Is it possible to compile this gcc as a 32bit-application on my 64bit
  system to ensure the same behaviour as it would if to was built on a
  original 32bit Gentoo Linux?

You want to compile gcc on an AMD64 machine and end up with a
cross-compiler that runs as an IA32 app and generates code for an ARM9
target?

That's called a Canadian Cross, and is rather tricky, since it
involves three different architectures: building a compiler on
architecture A (AMD64) to be run on architecture B (IA32) and generate
code for architecture C (ARM9).

Can you explain why you want that rather than a normal cross compiler?

IOW, why do you want to build a gcc cross compiler that runs as a
32-bit application?  It's _way_ simpler to build a normal cross
compiler: building a compiler one architecture (AMD64) to be run on
that same architecture (AMD64) and generate code for a second
architecture (ARM9).

  (And in this context: The audio application chuck is only as 32bit
  application available currently. How is it possible to compile this
  on a 64bit system?)

You use a compiler that generates code for a the desired 32-bit
architecture.  The width of the host is immaterial.

The easiest way to build such a compiler is using crosstool-ng

  http://ymorin.is-a-geek.org/projects/crosstool

Crosstool-NG does have some support for doing a Canadian-cross, but I
don't see why you would want to do that.

-- 
Grant Edwards   grant.b.edwardsYow! Gibble, Gobble, we
  at   ACCEPT YOU ...
  gmail.com