Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 232931 - 32 bit builds fail with icecream on amd64 machines
Summary: 32 bit builds fail with icecream on amd64 machines
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-25 15:25 UTC by John M. Drescher
Modified: 2010-09-10 19:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log for wine-1.1.0 on an amd64 machine using icecream (build.log.gz,8.07 KB, text/plain)
2008-08-04 20:15 UTC, John M. Drescher
Details
This one should work. Sorry about selecting text for the last one. (build.log.gz,8.07 KB, application/octet-stream)
2008-08-04 20:17 UTC, John M. Drescher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John M. Drescher 2008-07-25 15:25:57 UTC
I have installed sys-devel/icecream on my home and work networks and in both cases under amd64 ebuilds that build x86 versions under amd64 will fail because it appears the remote icecream servers build 64 bit versions in this case. If the remote servers are off the build will succeed. I have tested this mainly with glibc and wine. Some test results were posted in the forums here: http://forums.gentoo.org/viewtopic-t-698173-highlight-.html

Also x86 builds on x86 machines connecting to the same amd64 icecream build hosts work without problems.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-07-25 15:33:55 UTC
Did you emerge the appropriate cross compilers to build x86 binaries on x86_64 hosts? Maybe [1] can help you, otherwise perhaps the documentation needs to be extended to include icecream besides distcc.


[1] http://www.gentoo.org/doc/en/cross-compiling-distcc.xml
Comment 2 John M. Drescher 2008-07-25 15:46:54 UTC
No, I did not do this. However building x86 packages from x86 hosts on the amd64 icecream hosts works without any problems. I believe the reason why this works is the client sends the a small build environment to each compile host and uses that for the compile. This build environment ends up in /var/cache/icecream


Here is that folder from 1 amd64 build host:
 
icecream # ls -al
total 0
drwxr-xr-x  5 root     root     136 Jul  2 11:10 .
drwxr-xr-x 15 root     root     416 Jun 25 12:14 ..
drwxr-xr-x  2 icecream icecream 104 Jul  2 11:10 native
drwxr-xr-x  5 root     root     192 Jul 23 19:07 target=i686
drwxr-xr-x  5 root     root     192 Jul 23 19:08 target=x86_64

John
Comment 3 Friedrich Oslage (RETIRED) gentoo-dev 2008-08-04 19:11:53 UTC
(In reply to comment #2)
Cross-compiling with icecream works differently, I started writing some documentation(bug 230989) but it didn't make it to the official space yet.
However the AMD64 profile he's using has a biarch compiler, so there's no need for a separate (x86) cross-compiler.

(In reply to comment #3)
You believe correctly :)

Can you attach the complete build.log, please?
To create 32 bit code on AMD64 you need to pass -m32 to the compiler(and sometimes set the LDEMULATION environment variable) but when looking at the forums thread it looks as if you are not using -m32 at all...which is strange, cause afaik the default is -m64 on AMD64.
Comment 4 John M. Drescher 2008-08-04 20:15:25 UTC
Created attachment 162215 [details]
Build log for wine-1.1.0 on an amd64 machine using icecream

I thought that -m32 needed to be used and I was a little confused how wine was compiled when I did not see the -m32 in the building process.

Attached is the  build.log.
Comment 5 John M. Drescher 2008-08-04 20:17:11 UTC
Created attachment 162217 [details]
This one should work. Sorry about selecting text for the last one.
Comment 6 Friedrich Oslage (RETIRED) gentoo-dev 2008-08-04 22:18:56 UTC
Adding toolchain because I think this is a bug in multilib_toolchain_setup from multilib.eclass.

Wine uses "multilib_toolchain_setup x86" which sets CC to "x86_64-pc-linux-gnu-gcc". That makes wine's configure script end up with CC="x86_64-pc-linux-gnu-gcc" CXX="g++ -m32" LD="ld -m elf_i386" and AS="as --32". Therefore it works if it's compiled lokally but not when using icecream.

Wine's default value for CC is "gcc -m32", shouldn't multilib_toolchain_setup set something like "gcc $(get_abi_CFLAGS $1)"? Multilib_toolchain_setup checks for app-admin/eselect-compiler which has been removed from the tree 8 months ago.
Comment 7 John M. Drescher 2008-08-04 22:42:36 UTC
BTW, This also fails for the x86 part of glibc build on the same 64 bit machine. And the machine builds both versions fine if icecream is disabled.
Comment 8 Friedrich Oslage (RETIRED) gentoo-dev 2008-08-07 18:54:38 UTC
It's not a toolchain bug, it's just me not knowing about a secret Gentoo-gcc feature, sorry for the spam ;)

The bug is that icecream ignored the ${CFLAGS_${ABI}} environment variable.

Gentoo's gcc has a special features to make doing multilib stuff easier(sort of a workaround for broken Makefiles), with it you can do this:

touch empty.c
export ABI="x86"
export CFLAGS_x86="-m32"
x86_64-pc-unknown-linux-gnu-gcc -c empty.c
file empty.o

It's the same as executing "86_64-pc-unknown-linux-gnu-gcc -m32 -c empty.c" but icecream didn't know about this environment variable and therefore didn't pass it to the helper boxes.

Fixed in sys-devel/icecream-0.9.1-r2.
Comment 9 John M. Drescher 2008-08-07 18:59:38 UTC
Thanks for fixing this so quickly! I will test ASAP.