Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 231098 - cross-avr/gcc-4.3.1-r1 'crossdev -t avr' fails with 'illegal opcode movw for mcu avr3'
Summary: cross-avr/gcc-4.3.1-r1 'crossdev -t avr' fails with 'illegal opcode movw for ...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-07 20:04 UTC by Lord Realname
Modified: 2009-07-27 17:13 UTC (History)
10 users (show)

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


Attachments
buildlog (cross-avr-gcc-stage1.log,1.17 MB, text/plain)
2008-07-07 20:07 UTC, Lord Realname
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lord Realname 2008-07-07 20:04:49 UTC
I was following the comment in bug report #230343 to get 'crossdev -t avr' compile avr-gcc. I got rid of the error described in that report but then crashed into a new one.

Reproducible: Always

Steps to Reproduce:
'crossdev -t avr' after
Actual Results:  
Compiling cross-avr/gcc-4.3.1-r1 failed, buildlog attached.

Expected Results:  
Compile without errors...

# emerge --info
WARNING: repository at /usr/local/portage is missing a repo_name entry
Portage 2.2_rc1 (default-linux/x86/2007.0/desktop, gcc-4.3.1, glibc-2.8_p20080602-r0, 2.6.25-gentoo-r6 i686)
=================================================================
System uname: Linux-2.6.25-gentoo-r6-i686-Intel-R-_Pentium-R-_M_processor_1.60GHz-with-glibc2.0
Timestamp of tree: Mon, 07 Jul 2008 16:49:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7, 2.1.6-r1
dev-lang/python:     2.4.4-r8, 2.5.2-r5
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-apps/sandbox:    1.2.18.1-r3
sys-devel/autoconf:  2.13, 2.62-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.4
virtual/os-headers:  2.6.25-r4
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium-m -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks parallel-fetch preserve-libs sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://212.219.56.135/sites/www.ibiblio.org/gentoo/"
LC_ALL="en_US.UTF-8"
LDFLAGS=""
LINGUAS="de en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X aac acpi alsa bash-completion berkdb bzip2 cairo cdr cli cpudetection cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode evo fam firefox flac fortran fuse gdbm gif glitz gpm gstreamer gtk hal iconv imlib injection isdnlog jack jpeg kerberos mad md5sum midi mikmod mmx mp3 mpeg mudflap musepack ncurses nls nptl nptlonly ocamlopt ogg openmp pam pcre pdf perl png pppd python qt3 qt3support qt4 quicktime readline reflection samba sdl session sid sndfile spl sse sse2 ssl svg tcpd tiff truetype tta type1 unicode vim-syntax vorbis wavpack wifi win32codecs wma x86 xml xorg xprint xv zlib" ALSA_CARDS="usb-usx2y" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" ELIBC="glibc" INPUT_DEVICES="evdev synaptics mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en" USERLAND="GNU" VIDEO_CARDS="i810 vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 1 Lord Realname 2008-07-07 20:07:07 UTC
Created attachment 159818 [details]
buildlog
Comment 2 Lord Realname 2008-07-07 20:11:10 UTC
Oh, missed something:

Steps to Reproduce:
'crossdev -t avr' after setting WITH_DEF_HEADERS="no" in /usr/sbin/crossdev line 334, because WITH_DEF_HEADERS="yes" failed. See http://bugs.gentoo.org/show_bug.cgi?id=230343
Comment 3 Justin Richards 2008-07-28 13:48:59 UTC
I get the exact same problem, I believe it is a mismatch between gcc and binutils. gcc-4.3.0+ needs binutils 2.18.50 or higher. testing it now
Comment 4 Alessandro Re 2008-08-03 13:26:25 UTC
(In reply to comment #3)
> I get the exact same problem, I believe it is a mismatch between gcc and
> binutils. gcc-4.3.0+ needs binutils 2.18.50 or higher. testing it now

I got the same with gcc 4.1.2 and binutils 2.17-r1.
Trying to update.
Comment 5 hlg 2008-08-28 09:58:47 UTC
I was able to work around this by first pulling in the overlay with

crossdev -t avr

After crashing I removed the avr-dev related entries from the /etc/portage/package.keywords and emerged cross-avr/binutils, cross-avr/gcc, cross-avr/avr-libc, cross-avr/gdb and cross-avr/insight manually. 
Comment 6 Blu3 2008-09-12 15:10:01 UTC
@hlg, what gcc version did you build?
Comment 7 Håvard Wall 2008-09-24 14:49:09 UTC
This seems to work for me:

crossdev --b 2.18.50.0.9 --g 4.3.1-r1 --target avr
Comment 8 Iain Buchanan 2008-10-08 05:04:42 UTC
I also came from Bug #230343 and comment #5 mostly worked for me, but I had to emerge cross-avr/gcc manually before emerging the others.  This provided avr-gcc which crossdev was complaining about, so I could then re-run crossdev -t avr.

But I also masked >=cross-dev/gcc-4.0.0 because I need a 3.x version for a particular PLC and software.
Comment 9 Cody Schafer 2008-10-08 08:09:20 UTC
The issue here is that though crossdev should emerge the most recent binutils (2.18.50.* at the time of writing), it instead merges an older one that is not compatible with the new gcc version.

If the newer binutils is specified manualy on the crossdev line, then gcc compiles correctly. 

ex:
#crossdev -t avr --b 2.18.50.0.9
Comment 10 Blu3 2008-10-08 09:33:30 UTC
#7, #9, nope.  may work for you, but not others.  4.x gcc does not do avr yet.  3.4.6-r2 will.

/../gcc/config/avr/libgcc.S: Assembler messages:
/../gcc/config/avr/libgcc.S:281: Error: illegal opcode movw for mcu avr3
/../gcc/config/avr/libgcc.S:283: Error: illegal opcode movw for mcu avr3
Comment 11 Robert A. 2008-10-26 20:51:26 UTC
(In reply to comment #10)
> #7, #9, nope.  may work for you, but not others.  4.x gcc does not do avr yet. 
> 3.4.6-r2 will.

#crossdev -t avr --b 2.18.50.0.9

works for me (as gcc 3.4.6 and gcc 4.1.2 did)
Comment 12 bb 2008-11-02 20:40:02 UTC
It seems to be fixed
Comment 13 Blu3 2008-11-03 00:02:48 UTC
Scott ~ # crossdev -t avr

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * libc:                  avr-libc-[latest]


/usr/vport/cross/avr/portage/cross-avr/gcc-4.3.2/work/gcc-4.3.2/libgcc/../gcc/config/avr/libgcc.S: Assembler messages:
/usr/vport/cross/avr/portage/cross-avr/gcc-4.3.2/work/gcc-4.3.2/libgcc/../gcc/config/avr/libgcc.S:281: Error: illegal opcode movw for mcu avr3
/usr/vport/cross/avr/portage/cross-avr/gcc-4.3.2/work/gcc-4.3.2/libgcc/../gcc/config/avr/libgcc.S:283: Error: illegal opcode movw for mcu avr3

Scott ~ # crossdev --g 4.3.1-r1 -t avr

 * binutils:              binutils-[latest]
 * gcc:                   gcc-4.3.1-r1
 * libc:                  avr-libc-[latest]

/usr/vport/cross/avr/portage/cross-avr/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/../gcc/config/avr/libgcc.S: Assembler messages:
/usr/vport/cross/avr/portage/cross-avr/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/../gcc/config/avr/libgcc.S:281: Error: illegal opcode movw for mcu avr3
/usr/vport/cross/avr/portage/cross-avr/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/../gcc/config/avr/libgcc.S:283: Error: illegal opcode movw for mcu avr3


seems not to be, with or without --b 2.18.50.0.9
Comment 14 Boris Borisov 2008-12-06 16:52:52 UTC
This is bug in crossdev script. This script is not working correctly for AVR port of GCC. I subscribe how-to install avr toolchain in avr-devel mail list.
http://lists.gnu.org/archive/html/avr-libc-dev/2008-12/msg00010.html
I'm not expert in bash programming but the problem in script will be solved if:
1. Script can check dependency of avr-lib, binutils and gcc for competability of version.
2. Perform correct sequence of installing binutils, gcc, avr-libc - curently sequence is binutils, avr-libc (on this stage is fail), gcc. I can't force instalation of stage 1 (gcc only). 
Comment 15 SpanKY gentoo-dev 2009-03-14 19:11:40 UTC
crossdev follows whatever is default stable/unstable for your host arch.  there is no version checking to make sure things work.  if you need specific versions, then specify them with --bver/--gver/--lver.  i'm not adding logic to crossdev to check for working combinations.
Comment 16 Thomas Capricelli 2009-07-27 17:13:33 UTC
#15 i understand. Though when i start 'crossdev avr' it outputs only '[latest]', so that i dont even know which version it tries to install.. could be possible to display the version considered ?