Bug 658236 - RFE: cross-arch build for i686 on x86_64
Summary: RFE: cross-arch build for i686 on x86_64
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Andreas Schwab
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-29 18:47 UTC by John Reiser
Modified: 2016-11-24 15:40 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-12-02 13:44:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description John Reiser 2010-11-29 18:47:09 UTC
Description of problem: It should be simple, obvious, and successful to build .rpms for i686 using a x86_64 system.  Please make it so.

Currently it fails in three ways.
1. The "-m32" is not set when defining GCC in glibc.spec, leading to a failure in the .config step: "LD/glibc-2.12-216-g3540d66/build-i686-linuxnptl':
configure: error: cannot compute suffix of object files: cannot compile
". 
2. After supplying -m32 under "%ifarch {%ix86}", then after some time there is a mysterious failure "sed: can't read {%_topdir}/rpmbuild/BUILDROOT/glibc-2.12.90-19.i386/usr/bin/memusage: No such file or directory".
3. The mystery of case 2) persists even when using "setarch i686 rpmbuild -ba ..."



Version-Release number of selected component (if applicable):
glibc-2.12.90-19.src.rpm


How reproducible: every time


Steps to Reproduce:
1. "rpmbuild -ba --target i686 glibc.spec" using a x86_64 system
2.
3.
  
Actual results:
As in Description above.

Expected results: successful build


Additional info:

Comment 1 Andreas Schwab 2010-12-02 13:44:45 UTC
You need to install all build requirements.

Comment 2 John Reiser 2010-12-03 15:46:19 UTC
At least in theory for "-bc" it should work in the other direction, too: compile for x86_64 using a i686 system.  That fails:
-----rpmbuild -bc --target x86_64 glibc.spec    # on i686
gawk -f ../scripts/gen-as-const.awk ../sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym \
| gcc -S  <<snipped>>  BUILD/glibc-2.12-216-g3540d66/build-x86_64-linuxnptl/ucontext_i.h

<stdin>: In function 'dummy':
<stdin>:11:61: error: 'REG_RBP' undeclared (first use in this function)
<stdin>:11:61: note: each undeclared identifier is reported only once for each function it appears in
<stdin>:12:61: error: 'REG_RSP' undeclared (first use in this function)
   ...
-----
and the first required fix is adding "-m64" to the .spec:
-----
%build
%ifarch %{ix86}
GCC="gcc -m32"
GXX="g++ -m32"
%else
GCC="gcc -m64"
GXX="g++ -m64"
%endif
-----
but that goes almost nowhere because typical gcc for i686 does not support 64-bit mode:
-----
configure:2775: gcc -m64 -c -mtune=generic -fasynchronous-unwind-tables -g -O3  -fno-asynchronous-unwind-tables  conftest.c >&5
conftest.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
-----
So that infelicity is not due to glibc.spec.

Yet the  GCC="gcc -m32"  does belong in the .spec for producing i686 using x86_64.


Note You need to log in before you can comment on or make changes to this bug.