Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 159037 - net-misc/dropbear cross compile issues
Summary: net-misc/dropbear cross compile issues
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-24 15:00 UTC by Stefan de Konink
Modified: 2006-12-25 06:59 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan de Konink 2006-12-24 15:00:51 UTC
I'm crosscompiling dropbear. 

CHOST="arm-softfloat-linux-uclibc" CFLAGS="-march=armv4 -mtune=strongarm1100 -msoft-float" CXXFLAGS=${CFLAGS} ROOT=/mnt/yopi INSTALL_MASK="*.h" emerge -O cross-arm-softfloat-linux-uclibc/dropbear

Everything went ok so far. So my yopi is actually already running some gentoo stuff. But dropbear is a little bugger. The configuration script of dropbear checks if the programs can be executed. Needless to say... amd64 ain't going to run arm code ;)

As I see in here --host it is amd64. What am I doing wrong here :)


configure:1647: arm-softfloat-linux-uclibc-gcc -V </dev/null >&5
arm-softfloat-linux-uclibc-gcc: `-V' option must have argument
configure:1650: $? = 1
configure:1673: checking for C compiler default output file name
configure:1676: arm-softfloat-linux-uclibc-gcc -march=armv4 -mtune=strongarm1100 -msoft-float   conftest.c  >&5
configure:1679: $? = 0
configure:1725: result: a.out
configure:1730: checking whether the C compiler works
configure:1736: ./a.out
./configure: line 1737: ./a.out: cannot execute binary file
configure:1739: $? = 126
configure:1748: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Comment 1 Stefan de Konink 2006-12-24 15:02:50 UTC
configure:1640: $? = 0
configure:1642: arm-softfloat-linux-uclibc-gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc/arm-softfloat-linux-uclibc/3.4.6/specs
Configured with: /var/tmp/cross/arm-softfloat-linux-uclibc/portage/cross-arm-softfloat-linux-uclibc/gcc-3.4.6-r2/work/gcc-3.4.6/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/arm-softfloat-linux-uclibc/gcc-bin/3.4.6 --includedir=/usr/lib/gcc/arm-softfloat-linux-uclibc/3.4.6/include --datadir=/usr/share/gcc-data/arm-softfloat-linux-uclibc/3.4.6 --mandir=/usr/share/gcc-data/arm-softfloat-linux-uclibc/3.4.6/man --infodir=/usr/share/gcc-data/arm-softfloat-linux-uclibc/3.4.6/info --with-gxx-include-dir=/usr/lib/gcc/arm-softfloat-linux-uclibc/3.4.6/include/g++-v3 --host=x86_64-pc-linux-gnu --target=arm-softfloat-linux-uclibc --build=x86_64-pc-linux-gnu --disable-altivec --with-float=soft --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,f77 --with-sysroot=/usr/arm-softfloat-linux-uclibc --disable-__cxa_atexit --enable-target-optspace --enable-clocale=uclibc
Thread model: posix
gcc version 3.4.6 (Gentoo 3.4.6-r2, ssp-3.4.6-1.0, pie-8.7.9)
configure:1645: $? = 0

And a Merry Christmas from The Netherlands.
Comment 2 SpanKY gentoo-dev 2006-12-24 19:00:39 UTC
you didnt set CBUILD nor did you post `emerge info` or the output of `emerge dropbear`
Comment 3 Stefan de Konink 2006-12-25 06:23:47 UTC
http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO
- you should also set CBUILD to your building machine for 
   completeness sake ... most of the time you won't need it, 
   but sometimes you will :)

That line is quite important for every configure based program.


 ACCEPT_KEYWORDS="arm ~arm" ARCH="arm" CBUILD="x86_64-pc-linux-gnu" CHOST="arm-softfloat-linux-uclibc" CFLAGS="-march=armv4 -mtune=strongarm1100 -msoft-float" CXXFLAGS=${CFLAGS} ROOT=/mnt/yopi emerge -O binutils


Then I have some few inconsistences:

when I merge zlib on amd64 for arm. Why is the package going to /mnt/yopi/usr/lib64 ? (the uclibc profile in my root dir was ignored as expected)


ACCEPT_KEYWORDS="arm ~arm" ARCH="arm" CBUILD="x86_64-pc-linux-gnu" CHOST="arm-softfloat-linux-uclibc" CFLAGS="-march=armv4 -mtune=strongarm1100 -msoft-float" CXXFLAGS=${CFLAGS} ROOT=/mnt/yopi USE="-pam" FEATURES="-buildpkg" UCLIBC_CPU="ARM_SA1100" USE="-minimal -userlocales" emerge -O sys-devel/binutils

make[2]: Entering directory `/var/tmp/portage/sys-devel/binutils-2.17/work/build/bfd'
Making info in doc
make[3]: Entering directory `/var/tmp/portage/sys-devel/binutils-2.17/work/build/bfd/doc'
make chew
make chew
make chew
make[4]: Entering directory `/var/tmp/portage/sys-devel/binutils-2.17/work/build/bfd/doc'
gcc -o chew.$$ /var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/chew.c \
          -march=armv4 -mtune=strongarm1100 -msoft-float    \
          -I.. -I/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/.. -I/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/../../include -I/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/../../intl -I../../intl; \
        /bin/sh /var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/../../move-if-change chew.$$ chew
make[4]: Entering directory `/var/tmp/portage/sys-devel/binutils-2.17/work/build/bfd/doc'
gcc -o chew.$$ /var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/chew.c \
          -march=armv4 -mtune=strongarm1100 -msoft-float    \
          -I.. -I/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/.. -I/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/../../include -I/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/../../intl -I../../intl; \
        /bin/sh /var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/../../move-if-change chew.$$ chew
make[4]: Entering directory `/var/tmp/portage/sys-devel/binutils-2.17/work/build/bfd/doc'
gcc -o chew.$$ /var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/chew.c \
          -march=armv4 -mtune=strongarm1100 -msoft-float    \
          -I.. -I/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/.. -I/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/../../include -I/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/../../intl -I../../intl; \
        /bin/sh /var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/../../move-if-change chew.$$ chew
/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/chew.c:1: error: bad value (armv4) for -march= switch
/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/chew.c:1: error: bad value (strongarm1100) for -mtune= switch
/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/chew.c:1: error: bad value (armv4) for -march= switch
/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/chew.c:1: error: bad value (strongarm1100) for -mtune= switch
/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/chew.c:1: error: bad value (armv4) for -march= switch
/var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/bfd/doc/chew.c:1: error: bad value (strongarm1100) for -mtune= switch
mv: cannot stat `chew.31435': No such file or directory
make[4]: *** [chew] Error 1
make[4]: Leaving directory `/var/tmp/portage/sys-devel/binutils-2.17/work/build/bfd/doc'
make[3]: *** [opncls.texi] Error 2
make[3]: *** Waiting for unfinished jobs....
mv: cannot stat `chew.31439': No such file or directory
Comment 4 Stefan de Konink 2006-12-25 06:24:01 UTC
ACCEPT_KEYWORDS="arm ~arm" ARCH="arm" CBUILD="x86_64-pc-linux-gnu" CHOST="arm-softfloat-linux-uclibc" CFLAGS="-march=armv4 -mtune=strongarm1100 -msoft-float" CXXFLAGS=${CFLAGS} ROOT=/mnt/yopi emerge --info                                      
Portage 2.1.2_rc4 (default-linux/amd64/2006.1, gcc-3.4.6, unavailable, 2.6.19-gentoo x86_64)
=================================================================
System uname: 2.6.19-gentoo x86_64 AMD Opteron(tm) Processor 240
Gentoo Base System version 1.12.8
Last Sync: Sat, 23 Dec 2006 13:50:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="amd64 arm ~amd64 ~arm"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=armv4 -mtune=strongarm1100 -msoft-float"
CHOST="arm-softfloat-linux-uclibc"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=armv4 -mtune=strongarm1100 -msoft-float"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig buildpkg cvs distlocks metadata-transfer sandbox sfperms strict userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LINGUAS="nl"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.nl.gentoo.org/gentoo-portage"
USE="amd64 X a52 alsa alsa_cards_ca0106 alsa_pcm_plugins_adpcm alsa_pcm_plugins_alaw alsa_pcm_plugins_asym alsa_pcm_plugins_copy alsa_pcm_plugins_dmix alsa_pcm_plugins_dshare alsa_pcm_plugins_dsnoop alsa_pcm_plugins_empty alsa_pcm_plugins_extplug alsa_pcm_plugins_file alsa_pcm_plugins_hooks alsa_pcm_plugins_iec958 alsa_pcm_plugins_ioplug alsa_pcm_plugins_ladspa alsa_pcm_plugins_lfloat alsa_pcm_plugins_linear alsa_pcm_plugins_meter alsa_pcm_plugins_mulaw alsa_pcm_plugins_multi alsa_pcm_plugins_null alsa_pcm_plugins_plug alsa_pcm_plugins_rate alsa_pcm_plugins_route alsa_pcm_plugins_share alsa_pcm_plugins_shm alsa_pcm_plugins_softvol apache2 bitmap-fonts blas bzip2 cli cracklib crypt curl dlloader dri dts dv elibc_glibc esd ffmpeg fftw flac font-server fortran gdbm ginac graphviz gs gtk2 hdf5 howl iconv input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kernel_linux lcms libg++ linguas_nl minimal ncurses network nls nptl nptlonly ogg pam pcre pdf pic png postgres ppds pppd qhull quicktime readline reflection sdl session sndfile sox speex spl sqlite ssl tcpd tetex theora threads tiff truetype truetype-fonts type1-fonts udev unicode userland_GNU userlocales v4l video_cards_mach64 vorbis wmf xml xml2 xorg xprint xv xvid yv12 zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS


So my basic question should be... is there a way to really cross compile into a working stage1 without renaming directories and such?


Dropbear won't compile because its configure script gets stuck on the deflate test.
checking for deflate in -lz... no
configure: error: *** zlib missing - install first or check config.log ***
(I fixed the /lib64 madness with a symlink... so libz is in /mnt/yopi/usr/lib)


Second should be a totally different bug... uclibc doesn't work with the useflag minimal because the locales seems not be generated.


ACCEPT_KEYWORDS="arm ~arm" ARCH="arm" CBUILD="x86_64-pc-linux-gnu" CHOST="arm-softfloat-linux-uclibc" CFLAGS="-march=armv4 -mtune=strongarm1100 -msoft-float" CXXFLAGS=${CFLAGS} ROOT=/mnt/yopi USE="-pam" FEATURES="-buildpkg" UCLIBC_CPU="ARM_SA1100" USE="minimal" emerge -O sys-libs/uclibc

/var/tmp/portage/sys-libs/uclibc-0.9.28-r1/work/uClibc-0.9.28/extra/locale
gcc -O2 -Wall  -DCTYPE_PACKED=1 -DDO_WIDE_CHAR=1 -D__UCLIBC_GEN_LOCALE gen_wc8bit.c -o gen_wc8bit
 
You do not have a codesets.txt file.  Please create this 
file in the extra/locale directory by running something like: 
  find /var/tmp/portage/sys-libs/uclibc-0.9.28-r1/work/uClibc-0.9.28/extra/locale/charmaps -name "*.pairs" > \
        /var/tmp/portage/sys-libs/uclibc-0.9.28-r1/work/uClibc-0.9.28/extra/locale/codesets.txt
and then edit that file to disable/enable the codesets you wish to support. 
 
make: *** [codesets.txt] Error 1
make: *** Waiting for unfinished jobs....
Comment 5 SpanKY gentoo-dev 2006-12-25 06:40:56 UTC
you're really way beyond the scope of bugzilla here

if you have cross-compiling questions, seek help on the embedded mailing list and/or irc channel
Comment 6 Stefan de Konink 2006-12-25 06:59:37 UTC
(In reply to comment #5)
> you're really way beyond the scope of bugzilla here
> 
> if you have cross-compiling questions, seek help on the embedded mailing list
> and/or irc channel

The issues is not that I can't fix it in a LFS way. But I can't fix it in a Gentoo way. The primary reason I moved away from LFS was maintainability, the abstraction portage provides.


The configure script of binutils must be not getting the arguments from the first script. And the ebuild of uclibc must be untested with minimal.

I think these two issues are well inside the scope of bugzilla, and could be filled serperately but I don't want to bug people any more than you want to answer them.