Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: AMD64

corss compile 64bit on 32bit os

 

 

Gentoo amd64 RSS feed   Index | Next | Previous | View Threaded


davidshen84 at googlemail

Sep 16, 2009, 2:41 AM

Post #1 of 9 (1543 views)
Permalink
corss compile 64bit on 32bit os

Hi,

i want to use discc to speed my emerge compilation. but the problem is
that i have 32bit and 64bit mixed environment, and some of the cpus do
not support amd64 mode. so i just wonder if i could do cross compile.

has anyone done this before? any suggestions/comments are welcomed.


--
Best Regards,
David Shen

http://twitter.com/davidshen84/
http://meme.yahoo.com/davidshen84/


mlashley at gmail

Sep 16, 2009, 5:08 AM

Post #2 of 9 (1502 views)
Permalink
Re: corss compile 64bit on 32bit os [In reply to]

On Wed, Sep 16, 2009 at 9:41 AM, Xi Shen <davidshen84 [at] googlemail> wrote:
>
> i want to use discc to speed my emerge compilation. but the problem is
> that i have 32bit and 64bit mixed environment, and some of the cpus do
> not support amd64 mode. so i just wonder if i could do cross compile.
>
> has anyone done this before? any suggestions/comments are welcomed.

Did you try - http://www.gentoo.org/doc/en/cross-compiling-distcc.xml ?

Cheers,
malc.


davidshen84 at googlemail

Sep 16, 2009, 6:14 AM

Post #3 of 9 (1494 views)
Permalink
Re: corss compile 64bit on 32bit os [In reply to]

great! thanks a lot. why i did not find this out, haha ;)


On Wed, Sep 16, 2009 at 8:08 PM, malc <mlashley [at] gmail> wrote:
> On Wed, Sep 16, 2009 at 9:41 AM, Xi Shen <davidshen84 [at] googlemail> wrote:
>>
>> i want to use discc to speed my emerge compilation. but the problem is
>> that i have 32bit and 64bit mixed environment, and some of the cpus do
>> not support amd64 mode. so i just wonder if i could do cross compile.
>>
>> has anyone done this before? any suggestions/comments are welcomed.
>
> Did you try - http://www.gentoo.org/doc/en/cross-compiling-distcc.xml ?
>
> Cheers,
> malc.
>
>



--
Best Regards,
David Shen

http://twitter.com/davidshen84/
http://meme.yahoo.com/davidshen84/


davidshen84 at googlemail

Sep 16, 2009, 6:36 AM

Post #4 of 9 (1495 views)
Permalink
Re: corss compile 64bit on 32bit os [In reply to]

when reading that doc, i cannot understand the following script

#!/bin/bash
exec /usr/lib/distcc/bin/sparc-unknown-linux-gnu-g${0:$[-2]} "$@"

what does the ":" do here?


On Wed, Sep 16, 2009 at 9:14 PM, Xi Shen <davidshen84 [at] googlemail> wrote:
> great! thanks a lot. why i did not find this out, haha ;)
>
>
> On Wed, Sep 16, 2009 at 8:08 PM, malc <mlashley [at] gmail> wrote:
>> On Wed, Sep 16, 2009 at 9:41 AM, Xi Shen <davidshen84 [at] googlemail> wrote:
>>>
>>> i want to use discc to speed my emerge compilation. but the problem is
>>> that i have 32bit and 64bit mixed environment, and some of the cpus do
>>> not support amd64 mode. so i just wonder if i could do cross compile.
>>>
>>> has anyone done this before? any suggestions/comments are welcomed.
>>
>> Did you try - http://www.gentoo.org/doc/en/cross-compiling-distcc.xml ?
>>
>> Cheers,
>> malc.
>>
>>
>
>
>
> --
> Best Regards,
> David Shen
>
> http://twitter.com/davidshen84/
> http://meme.yahoo.com/davidshen84/
>



--
Best Regards,
David Shen

http://twitter.com/davidshen84/
http://meme.yahoo.com/davidshen84/


frank.peters at comcast

Sep 16, 2009, 9:27 AM

Post #5 of 9 (1483 views)
Permalink
Re: corss compile 64bit on 32bit os [In reply to]

On Wed, 16 Sep 2009 21:36:37 +0800
Xi Shen <davidshen84 [at] googlemail> wrote:

> when reading that doc, i cannot understand the following script
>
> #!/bin/bash
> exec /usr/lib/distcc/bin/sparc-unknown-linux-gnu-g${0:$[-2]} "$@"
>
> what does the ":" do here?
>
>

The construction "${0:$[-2]}" will return the last two characters of
the $0 string, with the $0 string being the name of the called script.
These last two characters are appended to the string "sparc-unknown-linux-gnu-g".

After glancing at the section in cross-compiling-distcc.xml, it seems
that this particular script will be called via a symlink, which will
be one of gcc, g++, c++. The last two chars of the link name are thus
appended to "sparc-unknown-linux-gnu-g" to form the name of an execuatable,
e.g. /usr/lib/distcc/bin/sparc-unknown-linux-gnu-gcc.

Frank Peters


davidshen84 at googlemail

Sep 16, 2009, 6:04 PM

Post #6 of 9 (1482 views)
Permalink
Re: corss compile 64bit on 32bit os [In reply to]

i searched for a while, but cannot find the reference of that syntax.
thanks a lot.


On Thu, Sep 17, 2009 at 12:27 AM, Frank Peters <frank.peters [at] comcast> wrote:
> On Wed, 16 Sep 2009 21:36:37 +0800
> Xi Shen <davidshen84 [at] googlemail> wrote:
>
>> when reading that doc, i cannot understand the following script
>>
>> #!/bin/bash
>> exec /usr/lib/distcc/bin/sparc-unknown-linux-gnu-g${0:$[-2]} "$@"
>>
>> what does the ":" do here?
>>
>>
>
> The construction "${0:$[-2]}" will return the last two characters of
> the $0 string, with the $0 string being the name of the called script.
> These last two characters are appended to the string "sparc-unknown-linux-gnu-g".
>
> After glancing at the section in cross-compiling-distcc.xml, it seems
> that this particular script will be called via a symlink, which will
> be one of gcc, g++, c++.  The last two chars of the link name are thus
> appended to "sparc-unknown-linux-gnu-g" to form the name of an execuatable,
> e.g. /usr/lib/distcc/bin/sparc-unknown-linux-gnu-gcc.
>
> Frank Peters
>
>
>



--
Best Regards,
David Shen

http://twitter.com/davidshen84/
http://meme.yahoo.com/davidshen84/


allistar.m at gmail

Sep 16, 2009, 6:20 PM

Post #7 of 9 (1480 views)
Permalink
Re: corss compile 64bit on 32bit os [In reply to]

Xi Shen wrote:

> Hi,
>
> i want to use discc to speed my emerge compilation. but the problem is
> that i have 32bit and 64bit mixed environment, and some of the cpus do
> not support amd64 mode. so i just wonder if i could do cross compile.
>
> has anyone done this before? any suggestions/comments are welcomed.

I have an amd64 system which is used with distcc to help speed up compiling
of an x86 system and cross compiling works without any issues. I followed
the cross compiling instructions on gentoo.org.

Note that this is compiling 32bit on a 64bit box, not the other way around.


frank.peters at comcast

Sep 16, 2009, 7:26 PM

Post #8 of 9 (1479 views)
Permalink
Re: corss compile 64bit on 32bit os [In reply to]

On Thu, 17 Sep 2009 09:04:22 +0800
Xi Shen <davidshen84 [at] googlemail> wrote:

> i searched for a while, but cannot find the reference of that syntax.
> thanks a lot.
>

The ordinary syntax is ${string:position:length}, but in the ordinary case
the position is referenced from the LEFT end of the string. To reference
from the RIGHT end of the string, as in the Gentoo script, a negative value
must be specified, but the negative value has to the result of an EXPRESSION,
hence the apparently unusual syntax.

Why? See question E12 at this link:
http://www.faqs.org/faqs/unix-faq/shell/bash/

Just try it out. Copy the following two lines to a file, give the file
executable permission, and create different symbolic links to it.
Then invoke the file using any of the symlinks.

#! /bin/bash
echo ${0:$[-2]}


Frank Peters


davidshen84 at googlemail

Sep 17, 2009, 3:25 AM

Post #9 of 9 (1475 views)
Permalink
Re: corss compile 64bit on 32bit os [In reply to]

thanks, very helpful.


On Thu, Sep 17, 2009 at 10:26 AM, Frank Peters <frank.peters [at] comcast> wrote:
> On Thu, 17 Sep 2009 09:04:22 +0800
> Xi Shen <davidshen84 [at] googlemail> wrote:
>
>> i searched for a while, but cannot find the reference of that syntax.
>> thanks a lot.
>>
>
> The ordinary syntax is ${string:position:length}, but in the ordinary case
> the position is referenced from the LEFT end of the string.  To reference
> from the RIGHT end of the string, as in the Gentoo script, a negative value
> must be specified, but the negative value has to the result of an EXPRESSION,
> hence the apparently unusual syntax.
>
> Why?  See question E12 at this link:
> http://www.faqs.org/faqs/unix-faq/shell/bash/
>
> Just try it out.  Copy the following two lines to a file, give the file
> executable permission, and create different symbolic links to it.
> Then invoke the file using any of the symlinks.
>
> #! /bin/bash
> echo ${0:$[-2]}
>
>
> Frank Peters
>
>
>



--
Best Regards,
David Shen

http://twitter.com/davidshen84/
http://meme.yahoo.com/davidshen84/

Gentoo amd64 RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.