Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Crossdev error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
uuhan
n00b
n00b


Joined: 26 Aug 2012
Posts: 20

PostPosted: Fri Jan 04, 2013 3:03 am    Post subject: Crossdev error Reply with quote

I want to set up a compile tool-chain for my Raspberry pi B and follow the guide :
http://wiki.gentoo.org/wiki/Raspberry_Pi_Quick_Install_Guide
But,when I run :
# crossdev -S -v -t armv6j-hardfloat-linux-gnueabi, it failed in the stage2 of glibc's compiling:
Error info:
* Building glibc for ABIs: default

* ABI: default
* CBUILD: i686-pc-linux-gnu
* CHOST: i686-pc-linux-gnu
* CTARGET: armv6j-hardfloat-linux-gnueabi
* CBUILD_OPT:
* CTARGET_OPT:
* CC: armv6j-hardfloat-linux-gnueabi-gcc
* ASFLAGS:
* CFLAGS: -march=native -pipe -O2 -fno-strict-aliasing
* CPPFLAGS: -U_FORTIFY_SOURCE -U_FORTIFY_SOURCE -U_FORTIFY_SOURCE
* CXXFLAGS: -march=native -pipe -O2 -fno-strict-aliasing
* LDFLAGS: -Wl,-O1 -Wl,--as-needed
* Manual CC: armv6j-hardfloat-linux-gnueabi-gcc

* Configuring GLIBC for nptl
/var/tmp/portage/cross-armv6j-hardfloat-linux-gnueabi/glibc-2.15-r3/work/glibc-2.15/configure --disable-stackguard-randomization --enable-add-ons=nptl,c_stubs,libidn,ports --enable-kernel=2.6.9 --without-selinux --without-cvs --enable-bind-now --build=i686-pc-linux-gnu --host=armv6j-hardfloat-linux-gnueabi --disable-profile --without-gd --with-headers=/usr/armv6j-hardfloat-linux-gnueabi/usr/include --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --libexecdir=/usr/lib/misc/glibc --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion=Gentoo 2.15-r3 p23 --disable-multi-arch --enable-obsolete-rpc
configure: loading site script /usr/share/config.site
checking build system type... i686-pc-linux-gnu
checking host system type... armv6j-hardfloat-linux-gnueabi
checking for armv6j-hardfloat-linux-gnueabi-gcc... armv6j-hardfloat-linux-gnueabi-gcc
checking for suffix of object files... configure: error: in `/var/tmp/portage/cross-armv6j-hardfloat-linux-gnueabi/glibc-2.15-r3/work/build-default-armv6j-hardfloat-linux-gnueabi-nptl':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
* ERROR: cross-armv6j-hardfloat-linux-gnueabi/glibc-2.15-r3 failed (compile phase):
* failed to configure glibc

==============
emerge --info file :
Portage 2.1.11.38 (default/linux/x86/10.0, gcc-4.6.3, glibc-2.16.0, 3.6.8-gentoo i686)
=================================================================
System Settings
=================================================================
System uname: Linux-3.6.8-gentoo-i686-Intel-R-_Core-TM-_i3_CPU_530_@_2.93GHz-with-gentoo-2.2
Timestamp of tree: Fri, 04 Jan 2013 01:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash: 4.2_p42
dev-lang/python: 2.7.3-r2, 3.2.3-r2, 3.3.0
dev-util/cmake: 2.8.10.2-r1
dev-util/pkgconfig: 0.27.1
sys-apps/baselayout: 2.2
sys-apps/openrc: 0.11.8
sys-apps/sandbox: 2.6
sys-devel/autoconf: 2.13, 2.69
sys-devel/automake: 1.9.6-r3, 1.11.6, 1.12.6
sys-devel/binutils: 2.23.1
sys-devel/gcc: 4.6.3
sys-devel/gcc-config: 1.8
sys-devel/libtool: 2.4.2
sys-devel/make: 3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc: 2.16.0
Repositories: gentoo gentoo-china
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://mirrors.163.com/gentoo/ ftp://mirrors.sohu.com/gentoo/ http://mirrors.sohu.com/gentoo/ ftp://mirrors.stuhome.net/gentoo/ rsync://mirrors.stuhome.net/gentoo/ http://mirrors.stuhome.net/gentoo/ rsync://mirrors.xmu.edu.cn/gentoo/ http://mirrors.xmu.edu.cn/gentoo ftp://mirrors.xmu.edu.cn/gentoo http://mirror.datapipe.net/gentoo ftp://mirror.datapipe.net/gentoo http://gentoo.mirrors.easynews.com/linux/gentoo/ http://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/ ftp://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/"
LANG="zh_CN.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/gentoo-china"
SYNC="rsync://rsync.cn.gentoo.org/gentoo-portage"
USE="X aac aacplus aalib acl alsa berkdb bzip2 cdda chardet cjk cli cracklib crypt cscope cups curl cxx dbus dri epspdf exif faac ffmpeg flac fontconfig fortran gdbm gpm gtk gudev humanities iconv icu id3tag ipv6 jack jpeg jpeg2k lcms lzma mad mmx mng modules mp3 mudflap ncurses nls nptl ogg openal opengl openmp openrc openssl pam pcre pdf png postscript pppd pulseaudio python raw readline science sdl session smp sndfile sse sse2 ssl svg tcpd tiff tools truetype unicode vorbis vtk x86 xetex xft xml xpm zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en zh zh_CN" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
Package Settings
=================================================================

cross-armv6j-hardfloat-linux-gnueabi/glibc-2.15-r3 was built with the following:
USE="-debug -gd -hardened -multilib -profile (-selinux) -vanilla"
CFLAGS="-march=native -pipe -O2 -fno-strict-aliasing"
CXXFLAGS="-march=native -pipe -O2 -fno-strict-aliasing"


I searched the google for a long time,but nothing hlep(or I missed) . Need help ! :oops:
Back to top
View user's profile Send private message
uuhan
n00b
n00b


Joined: 26 Aug 2012
Posts: 20

PostPosted: Sat Jan 05, 2013 4:16 am    Post subject: Reply with quote

I installed several new gentoos in my vbox .Do the same installation,but ALL FAILED . Quite annoying :oops:
Back to top
View user's profile Send private message
mainhattan
n00b
n00b


Joined: 07 Jan 2013
Posts: 2

PostPosted: Mon Jan 07, 2013 8:13 am    Post subject: workaround Reply with quote

There is an error in the CFLAGS handling when crossdev compiles for the target. binutils and gcc are compiled for the host and configure uses the CFLAGS from make.conf, in your case -march=native -pipe -O2 -fno-strict-aliasing. configure of the glibc's ebuild uses the same CFLAGS when it tries to find out which object file suffix armv6j-hardfloat-linux-gnueabi-gcc generates. So the error occurs during the execution of armv6j-hardfloat-linux-gnueabi-gcc -march=native -pipe -O2 -fno-strict-aliasing. -march=native does not work for cross-compilers because the compiler on the host cannot check the target CPU.

Here is the workaround. In the second step enter the CFLAGS value of the target.
  1. crossdev --stage2 -S -v -t armv6j-hardfloat-linux-gnueabi
  2. CFLAGS="-O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard" crossdev --stage3 -S -v -t armv6j-hardfloat-linux-gnueabi
  3. crossdev --stage4 -S -v -t armv6j-hardfloat-linux-gnueabi
These three steps worked for my Dockstar (armv5) and Cubox (armv7).
Back to top
View user's profile Send private message
Ottre
Tux's lil' helper
Tux's lil' helper


Joined: 23 Dec 2012
Posts: 129

PostPosted: Mon Jan 07, 2013 8:47 am    Post subject: Reply with quote

This worked for me when I was creating an armv6 toolchain for my Raspberry Pi:

Code:

USE="-* nocxx" crossdev -S --target armv6j-hardfloat-linux-gnueabi


gcc version:

Code:

armv6j-hardfloat-linux-gnueabi-gcc --version

armv6j-hardfloat-linux-gnueabi-gcc (Gentoo 4.5.4 p1.0, pie-0.4.7) 4.5.4
Copyright (C) 2010 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.


I suggest you make a list of all the software you're going to need on your Pi and compile it straight away. Crossdev breaks every time I update @world.


Last edited by Ottre on Mon Jan 07, 2013 8:55 am; edited 3 times in total
Back to top
View user's profile Send private message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Mon Jan 07, 2013 8:51 am    Post subject: Reply with quote

crossdev is way to complicated for something as simple as crosscompiling.

What's the easiest way to cross compile? For different arch and or slower machine?

thanks
Back to top
View user's profile Send private message
mainhattan
n00b
n00b


Joined: 07 Jan 2013
Posts: 2

PostPosted: Mon Jan 07, 2013 10:48 am    Post subject: Reply with quote

Ottre wrote:
This worked for me when I was creating an armv6 toolchain for my Raspberry Pi:

Code:

USE="-* nocxx" crossdev -S --target armv6j-hardfloat-linux-gnueabi


Maybe you have in your CFLAGS no architecture specific flags like -march/-mtune or a fixed version of crossdev. The error depends on CFLAGS not on USE flags in crossdev-20120721.
Back to top
View user's profile Send private message
uuhan
n00b
n00b


Joined: 26 Aug 2012
Posts: 20

PostPosted: Tue Jan 08, 2013 4:53 pm    Post subject: Re: workaround Reply with quote

mainhattan wrote:
There is an error in the CFLAGS handling when crossdev compiles for the target. binutils and gcc are compiled for the host and configure uses the CFLAGS from make.conf, in your case -march=native -pipe -O2 -fno-strict-aliasing. configure of the glibc's ebuild uses the same CFLAGS when it tries to find out which object file suffix armv6j-hardfloat-linux-gnueabi-gcc generates. So the error occurs during the execution of armv6j-hardfloat-linux-gnueabi-gcc -march=native -pipe -O2 -fno-strict-aliasing. -march=native does not work for cross-compilers because the compiler on the host cannot check the target CPU.

Here is the workaround. In the second step enter the CFLAGS value of the target.
  1. crossdev --stage2 -S -v -t armv6j-hardfloat-linux-gnueabi
  2. CFLAGS="-O2 -pipe -march=armv6j -mfpu=vfp -mfloat-abi=hard" crossdev --stage3 -S -v -t armv6j-hardfloat-linux-gnueabi
  3. crossdev --stage4 -S -v -t armv6j-hardfloat-linux-gnueabi
These three steps worked for my Dockstar (armv5) and Cubox (armv7).


========================================================
It works ~ Thank you so much ! .I think this should be writen into the guide page :D :o :P . Now , I can enjoy my Pi with gentoo running inside ~
Back to top
View user's profile Send private message
uuhan
n00b
n00b


Joined: 26 Aug 2012
Posts: 20

PostPosted: Tue Jan 08, 2013 4:55 pm    Post subject: Reply with quote

Ottre wrote:
This worked for me when I was creating an armv6 toolchain for my Raspberry Pi:

Code:

USE="-* nocxx" crossdev -S --target armv6j-hardfloat-linux-gnueabi


gcc version:

Code:

armv6j-hardfloat-linux-gnueabi-gcc --version

armv6j-hardfloat-linux-gnueabi-gcc (Gentoo 4.5.4 p1.0, pie-0.4.7) 4.5.4
Copyright (C) 2010 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.


I suggest you make a list of all the software you're going to need on your Pi and compile it straight away. Crossdev breaks every time I update @world.


==============================
Thank you for you advice ~ I followed @mainhattan 's method , and that works for me . :wink: :wink:
Back to top
View user's profile Send private message
uuhan
n00b
n00b


Joined: 26 Aug 2012
Posts: 20

PostPosted: Tue Jan 08, 2013 4:59 pm    Post subject: Reply with quote

_______0 wrote:
crossdev is way to complicated for something as simple as crosscompiling.

What's the easiest way to cross compile? For different arch and or slower machine?

thanks


Hmm , I know not too much in cross-compiling. I think crossdev is a really smart way to set up a toolchain . :wink: :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum