Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Crossdev error

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
uuhan
n00b
n00b
Posts: 20
Joined: Sun Aug 26, 2012 11:57 am

Crossdev error

  • Quote

Post by uuhan » Fri Jan 04, 2013 3:03 am

I want to set up a compile tool-chain for my Raspberry pi B and follow the guide :
http://wiki.gentoo.org/wiki/Raspberry_P ... tall_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=http://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/pu ... distfiles/ ftp://chi-10g-1-mirror.fastsoft.net/pub ... 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:
Top
uuhan
n00b
n00b
Posts: 20
Joined: Sun Aug 26, 2012 11:57 am

  • Quote

Post by uuhan » Sat Jan 05, 2013 4:16 am

I installed several new gentoos in my vbox .Do the same installation,but ALL FAILED . Quite annoying :oops:
Top
mainhattan
n00b
n00b
Posts: 2
Joined: Mon Jan 07, 2013 7:36 am

workaround

  • Quote

Post by mainhattan » Mon Jan 07, 2013 8:13 am

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).
Top
Ottre
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 129
Joined: Sun Dec 23, 2012 2:39 pm

  • Quote

Post by Ottre » Mon Jan 07, 2013 8:47 am

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

Code: Select all

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

Code: Select all

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.
Top
_______0
Guru
Guru
Posts: 521
Joined: Mon Oct 15, 2012 6:05 pm

  • Quote

Post by _______0 » Mon Jan 07, 2013 8:51 am

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
Top
mainhattan
n00b
n00b
Posts: 2
Joined: Mon Jan 07, 2013 7:36 am

  • Quote

Post by mainhattan » Mon Jan 07, 2013 10:48 am

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

Code: Select all

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.
Top
uuhan
n00b
n00b
Posts: 20
Joined: Sun Aug 26, 2012 11:57 am

Re: workaround

  • Quote

Post by uuhan » Tue Jan 08, 2013 4:53 pm

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 ~
Top
uuhan
n00b
n00b
Posts: 20
Joined: Sun Aug 26, 2012 11:57 am

  • Quote

Post by uuhan » Tue Jan 08, 2013 4:55 pm

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

Code: Select all

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

Code: Select all

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:
Top
uuhan
n00b
n00b
Posts: 20
Joined: Sun Aug 26, 2012 11:57 am

  • Quote

Post by uuhan » Tue Jan 08, 2013 4:59 pm

_______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:
Top
Post Reply

9 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy