Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 144645 - dev-embedded/avr-libc-1.4.4 - skipping incompatible libc.a
Summary: dev-embedded/avr-libc-1.4.4 - skipping incompatible libc.a
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Daniel Black (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-21 07:59 UTC by Johannes Bauer
Modified: 2007-07-31 03:24 UTC (History)
4 users (show)

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


Attachments
avr-libc-strip.patch (avr-libc-strip.patch,1.31 KB, patch)
2006-09-17 00:27 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Bauer 2006-08-21 07:59:57 UTC
Hello,

I encountered a bug with the Gentoo-patches of avr-libc. When compiling with crossdev:

acer [~]: crossdev -s3 -t avr

Crossdev (I'm using crossdev-0.9.15) emerges the packages as it's supposed to do:

---------------------------------------------------------------------------------------------------------------------------- * Host Portage ARCH:     x86
 * Target Portage ARCH:   x86
 * Target System:         avr
 * Stage:                 3 (C compiler & libc)

 * binutils:              binutils-2.16.1-r2
 * gcc:                   gcc-3.4.6
 * libc:                  avr-libc-[latest]

 * PORTDIR_OVERLAY:       /usr/local/portage
 * PORT_LOGDIR:           /var/log/portage
 * PKGDIR:                /usr/portage/packages/cross/avr
 * PORTAGE_TMPDIR:        /var/tmp/cross/avr
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _
 * Forcing the latest versions of binutils-config/gcc-config ...                                                      [ ok ] * Log: /var/log/portage/cross-avr-binutils.log
 * Emerging cross-binutils ...                                                                                        [ ok ] * Log: /var/log/portage/cross-avr-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                                                                      [ ok ] * Log: /var/log/portage/cross-avr-avr-libc.log
 * Emerging cross-avr-libc ...  

Finally, the following packages are merged:

cross-avr/binutils-2.16.1-r2
cross-avr/gcc-3.4.6
cross-avr/avr-libc-1.4.4

Then, when trying to use avr-gcc, compiling works fine, but when trying to link a project:

avr-gcc -Wall -Werror -Wunused -Wuninitialized -Wno-inline -Os -mmcu=at90s8515 -DF_CPU=7372800UL -I/usr/avr/include -I../Libraries  -o "TempGrid" "TempGrid.c" Tools.o CRC8.o BitBanging.o DynamicMemory.o ROMCommands.o FuncCommands.o RS232.o Intro.o MemCheck.o ../Libraries/LibLCD/LibLCD.a
/usr/lib/gcc/avr/3.4.6/../../../../avr/bin/ld: skipping incompatible /usr/lib/gcc/avr/3.4.6/../../../../avr/lib/libc.a when searching for -lc
/usr/lib/gcc/avr/3.4.6/../../../../avr/bin/ld: skipping incompatible /usr/avr/binutils-bin/2.16.1/../../lib/libc.a when searching for -lc
/usr/lib/gcc/avr/3.4.6/../../../../avr/bin/ld: cannot find -lc
make: *** [TempGrid] Error 1

What's happened with /usr/avr/lib/libc.a?

# file /usr/avr/lib/libc.a
/usr/avr/lib/libc.a: current ar archive
# avr-ar tv /usr/avr/lib/libc.a
rw-r--r-- 0/0    690 Aug 21 16:48 2006 abs.o
rw-r--r-- 0/0   5308 Aug 21 16:48 2006 assert.o
rw-r--r-- 0/0   3608 Aug 21 16:48 2006 bsearch.o
rw-r--r-- 0/0   3140 Aug 21 16:48 2006 calloc.o
rw-r--r-- 0/0   2340 Aug 21 16:48 2006 errno.o
rw-r--r-- 0/0   2868 Aug 21 16:48 2006 labs.o
rw-r--r-- 0/0   6664 Aug 21 16:48 2006 malloc.o
rw-r--r-- 0/0   5912 Aug 21 16:48 2006 qsort.o
rw-r--r-- 0/0   3896 Aug 21 16:48 2006 rand.o
rw-r--r-- 0/0   3976 Aug 21 16:48 2006 random.o
rw-r--r-- 0/0   6164 Aug 21 16:48 2006 realloc.o
[...]
# avr-ar xv /usr/avr/lib/libc.a malloc.o
x - malloc.o
# avr-ar p /usr/avr/lib/libc.a malloc.o > malloc.o
# file malloc.o
malloc.o: ELF 32-bit LSB relocatable, version 1 (SYSV), not stripped
# avr-objdump -d malloc.o
malloc.o:     file format elf32-avr

Disassembly of section .text:

00000000 <malloc>:
   0:   cf 93           push    r28
   2:   df 93           push    r29
   4:   48 2f           mov     r20, r24
   6:   59 2f           mov     r21, r25
   8:   02 97           sbiw    r24, 0x02       ; 2
   a:   10 f4           brcc    .+4             ; 0x10 <malloc+0x10>
   c:   42 e0           ldi     r20, 0x02       ; 2
   e:   50 e0           ldi     r21, 0x00       ; 0
[...]
#

So the libc.a is looking good... hmm...

When I unmerged the avr-libc 1.4.4, compiled it manually without first applying any patches, it worked perfectly. So therefore I suspect an error within the Gentoo-patches. Compiling avr-libc manually will do for a workaround, but it's no real good solution.

BTW, how can you force crossdev to remerge packages? It just does nothing when the package is already merged - very annoying behaviour!

Feel free to ask if you have any further questions. I've already talked to upstream about that problem (because I falsely suspected the problem there first), the according reference is at http://lists.gnu.org/archive/html/avr-gcc-list/2006-08/msg00042.html - I'll also post a message linking to this bug report there.

Greetings,
Johannes


Portage 2.1-r2 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.17.7 i686)
=================================================================
System uname: 2.6.17.7 i686 Intel(R) Pentium(R) M processor 1400MHz
Gentoo Base System version 1.12.4
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.3.5, 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="de"
MAKEOPTS="-j2"
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.gentoo.org/gentoo-portage"
USE="x86 X acl acpi alsa apache2 avi bash-completion berkdb bitmap-fonts bluetooth bzip2 cli crypt cups dba dlloader dri dv dvb dvd dvdr eds emboss encode esd fbcon foomaticdb fortran gd gdbm gif gimpprint gnome gstreamer gtk gtk2 hbci imagemagick imlib ipv6 irda isdnlog jack jpeg libg++ libwww mad md5sum mikmod mmx motif mp3 mpeg ncurses nls nodrm nptl ogg opengl oss pam pcmcia pcre pdflib perl png postgres pppd python qt3 qt4 quicktime readline recode reflection samba sdl session soundtouch spell spl sse ssl tcpd truetype truetype-fonts type1-fonts udev unicode usb vorbis win32codecs xml xmms xorg xv xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_evdev kernel_linux linguas_de userland_GNU video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i740 video_cards_i810 video_cards_imstt video_cards_mga video_cards_neomagic video_cards_nsc video_cards_nv video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Tim Boundy 2006-09-14 08:24:25 UTC
I have confirmed that this is an issue on my machine, however the ebuild for the latest version does not appear to apply any patches. It seems portage does something weird during the emerge process...

Portage 2.1.1 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 i686)
=================================================================
System uname: 2.6.17-gentoo-r8 i686 AMD Athlon(tm) XP 3200+
Gentoo Base System version 1.12.4
Last Sync: Thu, 14 Sep 2006 09:50:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.3.5-r2, 2.4.3-r3
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer -mmmx -msse -m3dnow"
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/lib/X11/xkb /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=athlon-xp -pipe -fomit-frame-pointer -mmmx -msse -m3dnow"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.citylink.co.nz/gentoo http://mirror.pacific.net.au/linux/Gentoo"
LC_ALL="en_US.utf8"
LINGUAS="en"
MAKEOPTS="-j2"
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 /usr/portage/local/layman/portage-xgl"
SYNC="rsync://sempron/gentoo-portage"
USE="x86 3dnow 3dnowext X a52 aac acl acpi alsa arts asf audiofile bash-completion berkdb bitmap-fonts bzip2 cairo calendar cdr cli crypt cups dbus dlloader dri dvd dvdr dvdread elibc_glibc emboss encode esd fam fbsplash ffmpeg firefox flac foomaticdb fortran ftp gdbm gecko-sdk gif gpm gtk hal idn imagemagick imap imlib input_devices_keyboard input_devices_mouse ip1000 ipv6 isdnlog jabber java javascript jpeg kde kdeenablefinal kdexdeltas kerberos kernel_linux libg++ libwww linguas_en lirc_devices_streamzap mad mikmod mime mmx mmxext mng mono mozilla mozsvg mp3 mpeg mplayer msn ncurses nls nptl nptlonly nsplugin nvidia offensive ogg ogvorbis opengl oss pam pcre pdf perl png posix ppds pppd python qt qt3 qt4 quicktime rdesktop readline reflection samba sdl servicetools session spell spl sse ssl svg tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode unstablecups usb userland_GNU video_cards_nv video_cards_nvidia video_cards_vesa vorbis win32codecs wxwindows xcomposite xine xinerama xml xml2 xorg xosd xpm xscreensaver xv xvid zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Erik Johannessen 2006-09-14 11:40:51 UTC
I also see this.  I think it's because portage calls i686-pc-linux-gnu-strip on the lib before installing.

After adding RESTRICT="strip" to the ebuild it seems to work.

-Erik
Comment 3 Tim Boundy 2006-09-14 19:00:32 UTC
(In reply to comment #2)
> I also see this.  I think it's because portage calls i686-pc-linux-gnu-strip on
> the lib before installing.
> 
> After adding RESTRICT="strip" to the ebuild it seems to work.
> 
> -Erik
> 

This solution works for me. :)
Comment 4 SpanKY gentoo-dev 2006-09-17 00:27:06 UTC
Created attachment 97204 [details, diff]
avr-libc-strip.patch

i havent tested this patch but this is the method utilized in glibc/uclibc/newlib/etc...
Comment 5 Tim Boundy 2006-09-17 05:18:49 UTC
This patch did not work, leaving it unstripped seems to be necessary at this point.
Comment 6 SpanKY gentoo-dev 2006-09-17 12:31:44 UTC
no, you just need to make sure you strip the libs with the proper toolchain
Comment 7 SpanKY gentoo-dev 2006-09-18 01:21:02 UTC
1.4.4 should be fixed in cvs now