Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92694 - coreutils failed to cross-compile
Summary: coreutils failed to cross-compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on: 222797
Blocks:
  Show dependency tree
 
Reported: 2005-05-15 05:06 UTC by Radek Podgorny
Modified: 2009-03-02 00:01 UTC (History)
7 users (show)

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


Attachments
Build log showing failure (build.log,162.44 KB, text/plain)
2008-12-27 04:07 UTC, Stuart Longland (RETIRED)
Details
Build log after help2man (build.log,227.36 KB, text/plain)
2008-12-28 21:39 UTC, Tibor Vago
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Radek Podgorny 2005-05-15 05:06:20 UTC
The coreutils build failes on cross-compile if the stage of running help2man. The problem is it tries to run the target-system binaries which of course fails. The workaround is to omit the "man" dir from SUBDIRS in Makefile.am. Proper way would be to run the build-system binary to accomplism man-pages creation.
Comment 1 SpanKY gentoo-dev 2005-05-16 06:12:15 UTC
no real info here

if you read the ebuild you'll see that there's already a workaround in
place in src_unpack to prevent help2man from running when cross-compiling
Comment 2 Radek Podgorny 2005-05-16 06:54:20 UTC
I can see test on CTARGET. But your howto at http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO says:

 - CTARGET is no longer needed so don't set it !

(step 9)
Comment 3 Radek Podgorny 2005-05-16 07:08:14 UTC
Even when I set the CTARGET, if fails with:

Making all in man
make[2]: Entering directory `/var/tmp/portage/coreutils-5.2.1-r6/work/coreutils-5.2.1/man'
rm -fr basename.td;
rm -fr cat.td;
Updating man page basename.1
rm -fr chroot.td;
Updating man page cat.1
Updating man page chroot.1
rm -fr cksum.td;
Updating man page cksum.1
help2man: can't get `--help' info from cksum.td/cksum
make[2]: *** [cksum.1] Error 126
make[2]: *** Waiting for unfinished jobs....
help2man: can't get `--help' info from cat.td/cat
make[2]: *** [cat.1] Error 126
help2man: can't get `--help' info from chroot.td/chroot
make[2]: *** [chroot.1] Error 126
make[1]: *** [all-recursive] Error 1

Sorry for bothering you but what is the correct way of telling the ebuild I'm cross-compiling?
Comment 4 Radek Podgorny 2005-05-16 07:17:22 UTC
OK, got it working. I had to set CTARGET to something else than CHOST but it has to be set! Even "xyz" makes the job. Is this really correct?
Comment 5 SpanKY gentoo-dev 2005-05-16 08:03:57 UTC
no, the test is outdated, it should be checking CBUILD instead of CTARGET
Comment 6 Radek Podgorny 2005-05-16 08:17:33 UTC
Please, check it also at bug 92695.
Comment 7 SpanKY gentoo-dev 2005-05-16 15:26:09 UTC
fixed in portage

Bug 92695 is unrelated
Comment 8 Ryan Tandy 2008-04-07 09:26:44 UTC
This workaround isn't present in coreutils-6.10-r1, but the issue is still there:

Making all in man
make[1]: Entering directory `/var/tmp/portage/sys-apps/coreutils-6.10-r1/work/coreutils-6.10/man'
Updating man page arch.1
help2man: can't get `--help' info from arch.td/arch
make[1]: *** [arch.1] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-apps/coreutils-6.10-r1/work/coreutils-6.10/man'
make: *** [all-recursive] Error 1

As it doesn't appear to have been fixed upstream, it would be great if the fix could be added to the current coreutils.
Comment 9 Ryan Tandy 2008-04-07 09:29:30 UTC
And this is the part where I once again swear to never again comment on bugs at 3 in the morning.  The workaround is still there (now in src_compile instead of unpack), but for some reason it's still trying to run help2man.
Comment 10 Jochen Trumpf 2008-05-19 11:43:27 UTC
The tarball is missing some files. I have filed the new bug #222797 for that.
Comment 11 Marat Radchenko 2008-11-30 15:03:13 UTC
Please reopen. This bug occurs with both coreutils-6.10 (stable) and 6.11 (~arch).
It must not build man docs if 'noman' feature is enabled and must not run binaries when cross-compiling.
Comment 12 Stuart Longland (RETIRED) gentoo-dev 2008-12-27 04:05:29 UTC
It would seem the problem still exists in coreutils-6.12-r2... I've struck this while trying to cross-compile a new mipsel-uClibc environment.  I get the following:

make[2]: Leaving directory `/tmp/cross-mipsel-uclibc/portage/sys-apps/coreutils-6.12-r2/work/coreutils-6.12/doc'
Making all in man
make[2]: Entering directory `/tmp/cross-mipsel-uclibc/portage/sys-apps/coreutils-6.12-r2/work/coreutils-6.12/man'
Updating man page arch.1
help2man: can't get `--help' info from arch.td/arch
make[2]: *** [arch.1] Error 126
make[2]: Leaving directory `/tmp/cross-mipsel-uclibc/portage/sys-apps/coreutils-6.12-r2/work/coreutils-6.12/man'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/cross-mipsel-uclibc/portage/sys-apps/coreutils-6.12-r2/work/coreutils-6.12'
make: *** [all] Error 2

The file it complains about is of course, a MIPS-I binary in this case... not understood by the host computer, which is x86.

beast ~ # cd /tmp/cross-mipsel-uclibc/portage/sys-apps/coreutils-6.12-r2/work/coreutils-6.12/man
beast man # file arch.td/arch
arch.td/arch: symbolic link to `../../src/arch'
beast man # file ../../src/arch
../../src/arch: cannot open `../../src/arch' (No such file or directory)
beast man # file ../src/arch
../src/arch: ELF 32-bit LSB executable, MIPS, MIPS-I version 1 (SYSV), dynamically linked (uses shared libs), not stripped
beast man # uname -a
Linux beast 2.6.27.2 #1 SMP Sun Oct 26 13:08:32 EST 2008 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux
Comment 13 Stuart Longland (RETIRED) gentoo-dev 2008-12-27 04:07:36 UTC
Created attachment 176472 [details]
Build log showing failure
Comment 14 Tibor Vago 2008-12-28 21:39:36 UTC
Created attachment 176684 [details]
Build log after help2man
Comment 15 Tibor Vago 2008-12-28 21:41:18 UTC
I added a new line to coreutils-6.12-r2.ebuild:

        # Also, it's not like we changed the usage on any of these things,
        # so let's just update the timestamps and skip the help2man step.
        touch man/*.1
+       touch man/arch.1            <------- this is the new line
        # There's no reason for this crap to use the private version

it step out the help2man part, but I got #2nd build.log (attachment) at install
Comment 16 Tibor Vago 2008-12-28 22:00:46 UTC
The previous (add "touch man/arch.1" line to ebuild) workaruond is works fine in version coreutils-6.10-r3
Comment 17 Marat Radchenko 2009-01-08 20:30:44 UTC
Confirming that patch from comment #16 also works with coreutils-6.11 for amd64->arm cross-build. Please reopen bug.
Comment 18 Jacob Godserv 2009-02-07 03:47:13 UTC
This bug needs to be re-opened, as it applies to coreutils-6.12-r2.