* [gentoo-amd64]corss compile 64bit on 32bit os
@ 2009-09-16 9:41 Xi Shen
2009-09-16 12:08 ` malc
2009-09-17 0:46 ` [gentoo-amd64] Re: corss " Allistar
0 siblings, 2 replies; 9+ messages in thread
From: Xi Shen @ 2009-09-16 9:41 UTC (permalink / raw
To: gentoo-china, gentoo-user, gentoo-amd64
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/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-amd64]corss compile 64bit on 32bit os
2009-09-16 9:41 [gentoo-amd64]corss compile 64bit on 32bit os Xi Shen
@ 2009-09-16 12:08 ` malc
2009-09-16 13:14 ` Xi Shen
2009-09-17 0:46 ` [gentoo-amd64] Re: corss " Allistar
1 sibling, 1 reply; 9+ messages in thread
From: malc @ 2009-09-16 12:08 UTC (permalink / raw
To: gentoo-amd64
On Wed, Sep 16, 2009 at 9:41 AM, Xi Shen <davidshen84@googlemail.com> 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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-amd64]corss compile 64bit on 32bit os
2009-09-16 12:08 ` malc
@ 2009-09-16 13:14 ` Xi Shen
2009-09-16 13:36 ` Xi Shen
0 siblings, 1 reply; 9+ messages in thread
From: Xi Shen @ 2009-09-16 13:14 UTC (permalink / raw
To: gentoo-amd64
great! thanks a lot. why i did not find this out, haha ;)
On Wed, Sep 16, 2009 at 8:08 PM, malc <mlashley@gmail.com> wrote:
> On Wed, Sep 16, 2009 at 9:41 AM, Xi Shen <davidshen84@googlemail.com> 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/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-amd64]corss compile 64bit on 32bit os
2009-09-16 13:14 ` Xi Shen
@ 2009-09-16 13:36 ` Xi Shen
2009-09-16 16:27 ` Frank Peters
0 siblings, 1 reply; 9+ messages in thread
From: Xi Shen @ 2009-09-16 13:36 UTC (permalink / raw
To: gentoo-amd64
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@googlemail.com> wrote:
> great! thanks a lot. why i did not find this out, haha ;)
>
>
> On Wed, Sep 16, 2009 at 8:08 PM, malc <mlashley@gmail.com> wrote:
>> On Wed, Sep 16, 2009 at 9:41 AM, Xi Shen <davidshen84@googlemail.com> 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/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-amd64]corss compile 64bit on 32bit os
2009-09-16 13:36 ` Xi Shen
@ 2009-09-16 16:27 ` Frank Peters
2009-09-17 1:04 ` Xi Shen
0 siblings, 1 reply; 9+ messages in thread
From: Frank Peters @ 2009-09-16 16:27 UTC (permalink / raw
To: gentoo-amd64
On Wed, 16 Sep 2009 21:36:37 +0800
Xi Shen <davidshen84@googlemail.com> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-amd64]corss compile 64bit on 32bit os
2009-09-16 16:27 ` Frank Peters
@ 2009-09-17 1:04 ` Xi Shen
2009-09-17 2:26 ` Frank Peters
0 siblings, 1 reply; 9+ messages in thread
From: Xi Shen @ 2009-09-17 1:04 UTC (permalink / raw
To: gentoo-amd64
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@comcast.net> wrote:
> On Wed, 16 Sep 2009 21:36:37 +0800
> Xi Shen <davidshen84@googlemail.com> 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/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-amd64]corss compile 64bit on 32bit os
2009-09-17 1:04 ` Xi Shen
@ 2009-09-17 2:26 ` Frank Peters
2009-09-17 10:25 ` Xi Shen
0 siblings, 1 reply; 9+ messages in thread
From: Frank Peters @ 2009-09-17 2:26 UTC (permalink / raw
To: gentoo-amd64
On Thu, 17 Sep 2009 09:04:22 +0800
Xi Shen <davidshen84@googlemail.com> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-amd64]corss compile 64bit on 32bit os
2009-09-17 2:26 ` Frank Peters
@ 2009-09-17 10:25 ` Xi Shen
0 siblings, 0 replies; 9+ messages in thread
From: Xi Shen @ 2009-09-17 10:25 UTC (permalink / raw
To: gentoo-amd64
thanks, very helpful.
On Thu, Sep 17, 2009 at 10:26 AM, Frank Peters <frank.peters@comcast.net> wrote:
> On Thu, 17 Sep 2009 09:04:22 +0800
> Xi Shen <davidshen84@googlemail.com> 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/
^ permalink raw reply [flat|nested] 9+ messages in thread
* [gentoo-amd64] Re: corss compile 64bit on 32bit os
2009-09-16 9:41 [gentoo-amd64]corss compile 64bit on 32bit os Xi Shen
2009-09-16 12:08 ` malc
@ 2009-09-17 0:46 ` Allistar
1 sibling, 0 replies; 9+ messages in thread
From: Allistar @ 2009-09-17 0:46 UTC (permalink / raw
To: gentoo-amd64; +Cc: gentoo-user
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-09-17 10:25 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-16 9:41 [gentoo-amd64]corss compile 64bit on 32bit os Xi Shen
2009-09-16 12:08 ` malc
2009-09-16 13:14 ` Xi Shen
2009-09-16 13:36 ` Xi Shen
2009-09-16 16:27 ` Frank Peters
2009-09-17 1:04 ` Xi Shen
2009-09-17 2:26 ` Frank Peters
2009-09-17 10:25 ` Xi Shen
2009-09-17 0:46 ` [gentoo-amd64] Re: corss " Allistar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox