Bug 972384 - avr-libc doesn't link for some AVR target mcu's
avr-libc doesn't link for some AVR target mcu's
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: avr-libc (Show other bugs)
18
All Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Thibault North
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-08 23:25 EDT by Peter Zelezny
Modified: 2016-10-28 02:48 EDT (History)
3 users (show)

See Also:
Fixed In Version: avr-libc-1.8.0-5.fc19 avr-libc-1.8.0-5.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-10-28 02:48:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Zelezny 2013-06-08 23:25:37 EDT
Description of problem:
avr-libc combined with avr-gcc cannot link for some mcu's. If you combine it with older versions (avr-gcc-4.6.3-1.fc17) it does work. I believe this is something to do with recent avr-gcc changes that avr-libc hasn't kept pace with.

The avr-gcc/libc release from Atmel doesn't have the same problem and they have published their source patches at:

http://distribute.atmel.no/tools/opensource/Atmel-AVR-Toolchain-3.4.2/avr/

Perhaps including some/all of their patches should be considered?


Version-Release number of selected component (if applicable):
avr-libc-1.8.0-2.fc18.noarch

How reproducible:
Every time.

Steps to Reproduce:
1. Compile with -mmcu=attiny2313a. Other targets may also be a problem, but I don't know which.
2.
3.

Actual results:
avr-gcc -Wall -fshort-enums -fpack-struct -fwhole-program -ffreestanding -funsigned-char -Os -mmcu=attiny2313a ibus.c -o ibus.o -Wa,-ahls=ibus.lst
/usr/lib/gcc/avr/4.7.2/../../../../avr/bin/ld: cannot find crttn2313a.o: No such file or directory
collect2: error: ld returned 1 exit status



Expected results:
 A successful link.


Additional info:
* avr-gcc-4.6.3-1.fc17 doesn't exhibit this problem.
* avr8-gnu-toolchain-3.4.2.939-linux.any.x86_64.tar.gz from Atmel doesn't exhibit this problem.
Comment 1 Peter Zelezny 2013-06-08 23:46:40 EDT
avr-gcc is trying to access crttn2313a.o from the "tiny-stack" subdirectory, which doesn't exist, but should.

In comparison, Atmel's release contains these files:

avr8-gnu-toolchain-linux_x86_64/avr/lib/avr25/tiny-stack/crttn2313a.o
avr8-gnu-toolchain-linux_x86_64/avr/lib/avr25/crttn2313a.o


strace:
~~~~~~~
access("/usr/lib/gcc/avr/4.7.2/avr25/tiny-stack/crttn2313a.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/avr/4.7.2/../../../../avr/lib/avr/4.7.2/avr25/tiny-stack/crttn2313a.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/avr/4.7.2/../../../../avr/lib/avr25/tiny-stack/crttn2313a.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/avr/4.7.2/crttn2313a.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/avr/4.7.2/../../../../avr/lib/avr/4.7.2/crttn2313a.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/avr/4.7.2/../../../../avr/lib/crttn2313a.o", R_OK) = -1 ENOENT (No such file or directory)
wait4(1812, /usr/lib/gcc/avr/4.7.2/../../../../avr/bin/ld: cannot find crttn2313a.o: No such file or directory
Comment 2 Michal Hlavinka 2013-06-13 10:47:08 EDT
reproducible

unfortunately this is not easy to solve.

atmel uses older releases and has patches for those older releases

we use newer releases, because they contain more fixes and the resulting code is significantly smaller

new compiler does not tolerate some misuse present in old avr-libc, so we need new avr-libc too

avr-libc does not have support for all microcontrollers, because atmel does not try to upstream necessary patches and for undermanned avr-libc upstream it's slow work

Right now, what we have is avr-libc with a big patch from atmel. But that patch needs to be forwardported because some code in avr-libc is newer and changes in atmel patch are incompatible. With this patch, attiny2313a is one of the microcontrollers that does not work.

I checked repository snapshot of avr-libc and there attine2313a works, but our patch is no longer applicable so a lot of MCUs from atxmega familly no longer works.

I'll have to port atmel's patch to latest avr-libc code, but it will take some time.
Comment 3 Peter Zelezny 2013-06-23 00:17:59 EDT
Are you sure Atmel uses older releases?

As far as I can see, it's avr-libc-1.8.0 in both Fedora and Atmel's build and avr-gcc is also 4.7.2 in both.

The tiny-stack changes occurred in avr-libc SVN a long time ago, but it seems they haven't done a regular tarball release for a LONG time:

http://svn.savannah.nongnu.org/viewvc?view=rev&root=avr-libc&revision=2291
Comment 4 Michal Hlavinka 2013-06-24 04:50:45 EDT
(In reply to Peter Zelezny from comment #3)
> The tiny-stack changes occurred in avr-libc SVN a long time ago, but it
> seems they haven't done a regular tarball release for a LONG time:

I know, read my comment #2 again. I tested new versions:
> I checked repository snapshot of avr-libc and there attine2313a works, but our > patch is no longer applicable so a lot of MCUs from atxmega familly no longer > works.
Comment 5 Fedora Update System 2013-06-26 07:37:32 EDT
avr-libc-1.8.0-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/avr-libc-1.8.0-3.fc18
Comment 6 Fedora Update System 2013-06-26 07:37:43 EDT
avr-libc-1.8.0-5.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/avr-libc-1.8.0-5.fc19
Comment 7 Fedora Update System 2013-06-26 13:08:28 EDT
Package avr-libc-1.8.0-5.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing avr-libc-1.8.0-5.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-11722/avr-libc-1.8.0-5.fc19
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2013-08-09 23:53:55 EDT
avr-libc-1.8.0-5.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2013-08-10 08:36:01 EDT
avr-libc-1.8.0-3.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Fedora Update System 2013-08-10 08:37:59 EDT
avr-libc-1.8.0-5.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2016-09-26 18:49:07 EDT
avr-libc-1.8.0-5.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-7c5e2b33d0
Comment 12 Fedora Update System 2016-10-28 02:48:14 EDT
avr-libc-1.8.0-5.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.