Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-12 Thread Volker Armin Hemmann
On Tuesday 09 November 2010, meino.cra...@gmx.de wrote:
 Hi,
 
 it is possible to run a 32-bit binary executable on a 64-bit system
 (AMD64).

yes, if you use the multilib profile.



 But: Is it possible to compile source code on a 64-bit system and get
 an 32-bit executable a the result ??? And if 'yes'...how???

cross compiling



Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-11 Thread Coert Waagmeester

Enrico Weigelt wrote:

* Coert Waagmeester lgro...@waagmeester.co.za wrote:


My setup is one 32bit pc with gentoo and another 64bit pc with gentoo

I managed to get this going on the 64bit with a 32-bit chroot, distcc, 
and crosstools


Why do you need an 32bit chroot if you're going to use an
crosscompiler anyways ?

You are right, I only have distcc in the 32bit chroot, it ofcourse 
already has the 32bit gcc et al.


I have a 64bit crossdev setup on my 32 bit machine. that is where the 
confusion came in.
Just make sure you compiled your kernel with IA32 binary support (should 
be default)


The _target_ kernel has to support the IA32 ABI. The host (building)
might be better off w/o it (better detection of build errors).

How would this work exactly?
64 bit only installation with a 32 bit crossdev installation?



cu





Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-10 Thread meino . cramer
Coert Waagmeester lgro...@waagmeester.co.za [10-11-10 18:40]:
 meino.cra...@gmx.de wrote:
 Hi,
 it is possible to run a 32-bit binary executable on a 64-bit system
 (AMD64).
 But: Is it possible to compile source code on a 64-bit system and get
 an 32-bit executable a the result ??? And if 'yes'...how???
 Thank you very much for any help in advance!
 Best regards,
 mcc
 
 Hello Meino,
 
 My setup is one 32bit pc with gentoo and another 64bit pc with gentoo
 
 I managed to get this going on the 64bit with a 32-bit chroot, distcc, 
 and crosstools
 
 Just make sure you compiled your kernel with IA32 binary support 
 (should be default)
 
 Here are some links:
 http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1chap=2
 http://www.gentoo.org/doc/en/cross-compiling-distcc.xml
 http://www.gentoo.org/doc/en/distcc.xml
 http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1chap=2
 
 Regards,
 Coert Waagmeester
 

Hi Coert,

thanks a lot for your informations and the links! :)

I will see, how I will proceed...

Best regards
mcc





Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-10 Thread Enrico Weigelt
* meino.cra...@gmx.de meino.cra...@gmx.de wrote:

 Is there a toolchain already setup for cross-compiling 32-bit
 executables on a AMD64 system, or do I have to do all that cross-
 compiling magic by myself ?

crosstool-ng

If you want a build system for crosscompiling, you might like
to look at Briegel.


cu
-- 
--
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weig...@metux.de
 mobile: +49 151 27565287  icq:   210169427 skype: nekrad666
--
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
--



Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-10 Thread Enrico Weigelt
* meino.cra...@gmx.de meino.cra...@gmx.de wrote:

  gr...@kraken ~ $ gcc -o a.out.64 test.c
  gr...@kraken ~ $ gcc -m32 -o a.out.32 test.c
  gr...@kraken ~ $ file a.out.*
  a.out.32: ELF 32-bit LSB executable, Intel 80386, version 1
  (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux
  2.6.9, not stripped
  a.out.64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux),
  dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not
  stripped
  gr...@kraken ~ $
  
  Br,
  Maciej Grela
  
 
 Oh YEAH! That's a definition of straight forward I do like very much!
 Thanks a lot, Maciej! You saved me a lot of half defunct bits ! ;)

Only for the specific case that your target system has the same
system libraries (and you have a *full* multilib installation)
as the building system.

If you want to crosscompile, you *most likely* want sysroot too.


cu
-- 
--
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weig...@metux.de
 mobile: +49 151 27565287  icq:   210169427 skype: nekrad666
--
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
--



Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-10 Thread Enrico Weigelt
* Coert Waagmeester lgro...@waagmeester.co.za wrote:

 My setup is one 32bit pc with gentoo and another 64bit pc with gentoo
 
 I managed to get this going on the 64bit with a 32-bit chroot, distcc, 
 and crosstools

Why do you need an 32bit chroot if you're going to use an
crosscompiler anyways ?

 Just make sure you compiled your kernel with IA32 binary support (should 
 be default)

The _target_ kernel has to support the IA32 ABI. The host (building)
might be better off w/o it (better detection of build errors).


cu
-- 
--
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weig...@metux.de
 mobile: +49 151 27565287  icq:   210169427 skype: nekrad666
--
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
--



[gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-09 Thread meino . cramer
Hi,

it is possible to run a 32-bit binary executable on a 64-bit system
(AMD64).


But: Is it possible to compile source code on a 64-bit system and get
an 32-bit executable a the result ??? And if 'yes'...how???

Thank you very much for any help in advance!

Best regards,
mcc




Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-09 Thread Jarry

On 9. 11. 2010 18:25, meino.cra...@gmx.de wrote:


But: Is it possible to compile source code on a 64-bit system and get
an 32-bit executable a the result ??? And if 'yes'...how???


I think that is what cross-compilation is good for...

Jarry

--
___
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.



Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-09 Thread Maciej Grela
2010/11/9  meino.cra...@gmx.de:
 Hi,

 it is possible to run a 32-bit binary executable on a 64-bit system
 (AMD64).


 But: Is it possible to compile source code on a 64-bit system and get
 an 32-bit executable a the result ??? And if 'yes'...how???


gr...@kraken ~ $ cat test.c
void main() {}
gr...@kraken ~ $ gcc -o a.out.64 test.c
gr...@kraken ~ $ gcc -m32 -o a.out.32 test.c
gr...@kraken ~ $ file a.out.*
a.out.32: ELF 32-bit LSB executable, Intel 80386, version 1
(GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux
2.6.9, not stripped
a.out.64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux),
dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not
stripped
gr...@kraken ~ $

Br,
Maciej Grela



Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-09 Thread meino . cramer
Jarry mr.ja...@gmail.com [10-11-09 18:36]:
 On 9. 11. 2010 18:25, meino.cra...@gmx.de wrote:
 
 But: Is it possible to compile source code on a 64-bit system and get
 an 32-bit executable a the result ??? And if 'yes'...how???
 
 I think that is what cross-compilation is good for...
 
 Jarry
 
 -- 
 ___
 This mailbox accepts e-mails only from selected mailing-lists!
 Everything else is considered to be spam and therefore deleted.
 

Is there a toolchain already setup for cross-compiling 32-bit
executables on a AMD64 system, or do I have to do all that cross-
compiling magic by myself ?

Best regards,
mcc




Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-09 Thread meino . cramer
Maciej Grela maciej.gr...@gmail.com [10-11-09 18:40]:
 2010/11/9  meino.cra...@gmx.de:
  Hi,
 
  it is possible to run a 32-bit binary executable on a 64-bit system
  (AMD64).
 
 
  But: Is it possible to compile source code on a 64-bit system and get
  an 32-bit executable a the result ??? And if 'yes'...how???
 
 
 gr...@kraken ~ $ cat test.c
 void main() {}
 gr...@kraken ~ $ gcc -o a.out.64 test.c
 gr...@kraken ~ $ gcc -m32 -o a.out.32 test.c
 gr...@kraken ~ $ file a.out.*
 a.out.32: ELF 32-bit LSB executable, Intel 80386, version 1
 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux
 2.6.9, not stripped
 a.out.64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux),
 dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not
 stripped
 gr...@kraken ~ $
 
 Br,
 Maciej Grela
 

Oh YEAH! That's a definition of straight forward I do like very much!
Thanks a lot, Maciej! You saved me a lot of half defunct bits ! ;)

Best regards,
mcc




Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-09 Thread meino . cramer
Maciej Grela maciej.gr...@gmail.com [10-11-09 18:40]:
 2010/11/9  meino.cra...@gmx.de:
  Hi,
 
  it is possible to run a 32-bit binary executable on a 64-bit system
  (AMD64).
 
 
  But: Is it possible to compile source code on a 64-bit system and get
  an 32-bit executable a the result ??? And if 'yes'...how???
 
 
 gr...@kraken ~ $ cat test.c
 void main() {}
 gr...@kraken ~ $ gcc -o a.out.64 test.c
 gr...@kraken ~ $ gcc -m32 -o a.out.32 test.c
 gr...@kraken ~ $ file a.out.*
 a.out.32: ELF 32-bit LSB executable, Intel 80386, version 1
 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux
 2.6.9, not stripped
 a.out.64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux),
 dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not
 stripped
 gr...@kraken ~ $
 
 Br,
 Maciej Grela
 

Sorry a little offtopic, but: There is kinda nonsense-humor of 
gcc in you lines. To call a program, which only consists of void main() {},
to be non stripped is - at least - british understatement (no
punt intended!) :) ;) X-}

Best regards,
mcc





Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-09 Thread Jacob Todd
Crosstools
On Nov 9, 2010 12:39 PM, meino.cra...@gmx.de wrote:
 Jarry mr.ja...@gmail.com [10-11-09 18:36]:
 On 9. 11. 2010 18:25, meino.cra...@gmx.de wrote:

 But: Is it possible to compile source code on a 64-bit system and get
 an 32-bit executable a the result ??? And if 'yes'...how???

 I think that is what cross-compilation is good for...

 Jarry

 --
 ___
 This mailbox accepts e-mails only from selected mailing-lists!
 Everything else is considered to be spam and therefore deleted.


 Is there a toolchain already setup for cross-compiling 32-bit
 executables on a AMD64 system, or do I have to do all that cross-
 compiling magic by myself ?

 Best regards,
 mcc




Re: [gentoo-user] 32bit-Executables on a AMD64 system...

2010-11-09 Thread Coert Waagmeester

meino.cra...@gmx.de wrote:

Hi,

it is possible to run a 32-bit binary executable on a 64-bit system
(AMD64).


But: Is it possible to compile source code on a 64-bit system and get
an 32-bit executable a the result ??? And if 'yes'...how???

Thank you very much for any help in advance!

Best regards,
mcc





Hello Meino,

My setup is one 32bit pc with gentoo and another 64bit pc with gentoo

I managed to get this going on the 64bit with a 32-bit chroot, distcc, 
and crosstools


Just make sure you compiled your kernel with IA32 binary support (should 
be default)


Here are some links:
http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1chap=2
http://www.gentoo.org/doc/en/cross-compiling-distcc.xml
http://www.gentoo.org/doc/en/distcc.xml
http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1chap=2

Regards,
Coert Waagmeester