From: "Walter Dnes" <waltdnes@waltdnes.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Will a 64-bit-no-multilib machine cross-compile 32-bit code?
Date: Tue, 24 Mar 2015 03:17:55 -0400 [thread overview]
Message-ID: <20150324071754.GB8371@waltdnes.org> (raw)
In-Reply-To: <CAJ0EP43qFSgO5ZDG1Oc-_7eGUgN_egp3Pp1j=j74E5b0h-wCYQ@mail.gmail.com>
On Mon, Mar 23, 2015 at 06:18:46PM -0400, Mike Gilbert wrote
> You will probably need to add -m32 to CFLAGS to avoid building 64-bit
> objects on the 64-bit machine.
How could i686-pc-linux-gnu-gcc build 64-bit stuff in the first place?
I followed the instructions, and ran the following on the host 64-bit
machine...
[d531][root][~] crossdev -t -S i686-pc-linux-gnu
[d531][root][~] i686-pc-linux-gnu-gcc --version
i686-pc-linux-gnu-gcc (Gentoo 4.9.2 p1.2, pie-0.6.2) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[d531][root][~] echo 'int main(){return 0;}' > ctest.c
[d531][root][~] i686-pc-linux-gnu-gcc -Wall ctest.c -o ctest
[d531][root][~] file ctest
ctest: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux
2.6.32, not stripped
Here's how far I've gotten with the setup. Let me know if I'm missing
anything...
=========================================================================
On the host; 64-bit Gentoo on Core2; IP address 192.168.123.251
# emerge crossdev
# crossdev -t -S i686-pc-linux-gnu
# emerge distcc
edit /etc/conf.d/distccd to indicate allowed client(s). Change the
DISTCCD_OPTS line to...
DISTCCD_OPTS="--port 3632 --log-level notice --log-file /var/log/distccd.log -N 15 --allow 192.168.123.253
get distccd service running now and every boot up (OpenRC)...
# rc-update add distccd default
# rc-service distccd start
I believe it's OK to leave "-march=native" in the host's make.conf
=========================================================================
On the client; underpowered ancient 32-bit Atom netbook; 192.168.123.253
# emerge distcc
specify host(s)
# /usr/bin/distcc-config --set-hosts "192.168.123.251"
This modifies /etc/distcc/hosts
In make.conf make the following changes
MAKEOPTS="-j1 -l2"
add "distcc distcc-pump" to FEATURES variable
Replace "-march=native" in CFLAGS with output of...
# gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+//g; s/^.* - //g;'
Note that the distcc wiki page gives different instructions here than
the crossdev wiki page. The command goes out of its way to remove the
"-mno-<whatever>" compiler flags. This results in (one long line)...
CFLAGS="-O2 -march=atom -msahf -mmovbe -mfxsr --param l1-cache-size=24
--param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=atom
-fstack-protector -mfpmath=sse -fomit-frame-pointer -pipe
-fno-unwind-tables -fno-asynchronous-unwind-tables"
Note that I include "-mfpmath=sse -fomit-frame-pointer -pipe
-fno-unwind-tables -fno-asynchronous-unwind-tables" myself.
=========================================================================
Now for the questions...
1) https://wiki.gentoo.org/wiki/Distcc#Using_distcc_with_automake
mentions adding...
export PATH="/usr/lib/ccache/bin:/usr/lib/distcc/bin:${PATH}"
...to /etc/env.d/ Is this necessary for Portage/emerge/etc, or is
"automake" something separate? (You can tell I'm not a programmer, let
alone a developer.)
2) The docs mention running emerge on the client with the command...
# pump emerge -u world
Is that all there is, or am I missing something? Does it
"automagically" install properly? Can I assume that...
a) The "pump" command does the lookup in /etc/distcc/hosts for the
appropriate server
b) The line...
CHOST="i686-pc-linux-gnu"
...in the client's make.conf is sufficient to tell emerge to use
"/usr/bin/i686-pc-linux-gnu-gcc" on the host and not "/usr/bin/gcc"?
3) Is this supposed to happen on the host...
=====================================================
[d531][waltdnes][~] gcc-config -l
[1] i686-pc-linux-gnu-4.9.2 *
[2] x86_64-pc-linux-gnu-4.8.3 *
=====================================================
Note that the asterisk after "x86_64-pc-linux-gnu-4.8.3" is green.
4) Is the command...
# DISTCC_DIR="" distccmon-text 5
Or:
# DISTCC_DIR="" distccmon-gnome
...supposed to be run from a seprate terminal?
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
next prev parent reply other threads:[~2015-03-24 14:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 1:56 [gentoo-user] Will a 64-bit-no-multilib machine cross-compile 32-bit code? Walter Dnes
2015-03-19 2:27 ` Fernando Rodriguez
2015-03-19 4:20 ` Walter Dnes
2015-03-19 5:12 ` Fernando Rodriguez
2015-03-21 12:46 ` Mike Gilbert
2015-03-21 19:52 ` Fernando Rodriguez
2015-03-22 14:03 ` Mike Gilbert
2015-03-22 14:05 ` Mike Gilbert
2015-03-23 0:56 ` Fernando Rodriguez
2015-03-23 1:25 ` Fernando Rodriguez
2015-03-24 1:51 ` Walter Dnes
2015-03-23 22:18 ` Mike Gilbert
2015-03-23 22:41 ` Fernando Rodriguez
2015-03-23 22:48 ` Mike Gilbert
2015-03-24 0:37 ` Fernando Rodriguez
2015-03-24 6:06 ` Walter Dnes
2015-03-24 7:17 ` Walter Dnes [this message]
2015-03-24 17:18 ` Mike Gilbert
2015-03-24 19:01 ` Fernando Rodriguez
2015-03-25 2:01 ` Walter Dnes
2015-03-25 5:20 ` Walter Dnes
2015-03-25 6:44 ` Walter Dnes
2015-03-24 0:26 ` Peter Humphrey
2015-03-22 11:32 ` Walter Dnes
2015-03-28 11:13 ` Frank Steinmetzger
2015-03-28 13:03 ` Walter Dnes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150324071754.GB8371@waltdnes.org \
--to=waltdnes@waltdnes.org \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox