Bug 1245253 - Cannot build for atmega328p
Summary: Cannot build for atmega328p
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: avr-gcc
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-21 14:48 UTC by Miro Hrončok
Modified: 2016-11-25 19:38 UTC (History)
11 users (show)

Fixed In Version: avr-gcc-6.2.0-1.fc25 avr-gcc-6.2.0-1.fc24 avr-gcc-6.2.0-1.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-24 16:28:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1259646 0 unspecified CLOSED Not compile 2021-02-22 00:41:40 UTC

Internal Links: 1259646

Description Miro Hrončok 2015-07-21 14:48:13 UTC
Description of problem:
I'm building a firmware for atmega328p using avr-gcc and while it works fine on f21 anf f22, it fails on rawhide (and possibly f23).

Version-Release number of selected component (if applicable):
avr-gcc-5.1.0-2.fc23

How reproducible:
Always.

Steps to Reproduce:
1. install avr-gcc and avr-libc
2. git clone git:bq/horus-fw.git && cd horus-fw
3. make

Actual results:
...
avr-gcc -Wall -Os -DF_CPU=16000000 -mmcu=atmega328p -I. -ffunction-sections -o main.elf main.o motion_control.o gcode.o serial.o laser_control.o ldr.o protocol.o stepper.o eeprom.o settings.o planner.o nuts_bolts.o print.o probe.o report.o system.o -lm -Wl,--gc-sections
/usr/lib/gcc/avr/5.1.0/../../../../avr/bin/ld: cannot find dev/atmega328p/crt1.o: No such file or directory
/usr/lib/gcc/avr/5.1.0/../../../../avr/bin/ld: cannot find dev/atmega328p/libdev.a: No such file or directory
collect2: error: ld returned 1 exit status
Makefile:85: recipe for target 'main.elf' failed
make: *** [main.elf] Error 1

Expected results:
builds fine

Complete logs here: https://copr.fedoraproject.org/coprs/churchyard/horus/build/105080/

Comment 1 d 2015-10-11 13:42:41 UTC
i tried to build my little project for a mini328 on f23, got this:

user@box ~/duino> ino build
Linking firmware.elf
/usr/lib/gcc/avr/5.1.0/../../../../avr/bin/ld: cannot find dev/atmega328p/crt1.o: No such file or directory
/usr/lib/gcc/avr/5.1.0/../../../../avr/bin/ld: cannot find dev/atmega328p/libdev.a: No such file or directory
collect2: error: ld returned 1 exit status
.build/mini328/Makefile:178: recipe for target '.build/mini328/firmware.elf' failed
make: *** [.build/mini328/firmware.elf] Error 1
Make failed with code 2

Comment 2 Jim George 2015-11-09 20:53:09 UTC
This is true for other AVR architectures too. I tried to compile a project that uses an Atmega164p and got this:

/usr/lib/gcc/avr/5.1.0/../../../../avr/bin/ld: cannot find dev/atmega164p/crt1.o: No such file or directory
/usr/lib/gcc/avr/5.1.0/../../../../avr/bin/ld: cannot find dev/atmega164p/libdev.a: No such file or directory

The same project compiled fine under Fedora 21. Packages installed under Fedora 23 are:

avr-libc-doc-1.8.0-10.fc23.noarch
avra-1.3.0-4.fc23.x86_64
avr-binutils-2.25-2.fc23.x86_64
avr-gcc-5.1.0-2.fc23.x86_64
avrdude-6.1-3.fc23.x86_64
avr-libc-1.8.0-10.fc23.noarch
avr-gcc-c++-5.1.0-2.fc23.x86_64

Comment 3 Tuomas Kuosmanen 2015-11-10 08:30:57 UTC
I got it working. DL;DR: downgrade to avr-gcc* 4.x from Fedora build system to get things working again.

The above error happened for me as well, so I poked around the interwebs and discovered two things:

  * avr-gcc-list thread [1] that claims avr-gcc 5.0 is broken and fails to 
    compile trivial things. Now, this is not exactly the same architecture
    as my arduino-based board but it got me thinking.

  * Debian and ubuntu ship 4.x. Building the arduino sketch worked without
    problems on Ubuntu. Maybe they avoided 5.x for a reason?

So I searched for the most recent avr-gcc 4.x build in the Fedora build system [2] and did a dnf install on those binary RPM's to downgrade my avr-gcc and avr-gcc-c++, and the sketch built without problems.

So I would think the 5.x builds are broken at least with the way Arduino ide uses them.

[1] http://lists.gnu.org/archive/html/avr-gcc-list/2015-02/msg00006.html
[2] http://koji.fedoraproject.org/koji/buildinfo?buildID=632688

Comment 4 Tuomas Kuosmanen 2015-11-10 08:53:30 UTC
I also tried the example in the initial bug report and the horus-fw project compiled without errors on 4.9.2-2.fc23.

Comment 5 Jan Kurik 2016-02-24 13:27:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 6 Fedora Update System 2016-11-13 16:02:46 UTC
avr-libc-2.0.0-1.fc23 avr-binutils-2.27-1.fc23 avr-gcc-6.2.0-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f9189fdac7

Comment 7 Fedora Update System 2016-11-13 16:02:59 UTC
avr-libc-2.0.0-1.fc24 avr-binutils-2.27-1.fc24 avr-gcc-6.2.0-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-2459cd6d15

Comment 8 Fedora Update System 2016-11-13 16:03:11 UTC
avr-libc-2.0.0-1.fc25 avr-binutils-2.27-1.fc25 avr-gcc-6.2.0-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7a536a8707

Comment 9 Fedora Update System 2016-11-15 02:25:47 UTC
avr-binutils-2.27-1.fc23, avr-gcc-6.2.0-1.fc23, avr-libc-2.0.0-1.fc23 has been pushed to the Fedora 23 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-2016-f9189fdac7

Comment 10 Fedora Update System 2016-11-15 02:29:47 UTC
avr-binutils-2.27-1.fc24, avr-gcc-6.2.0-1.fc24, avr-libc-2.0.0-1.fc24 has been pushed to the Fedora 24 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-2016-2459cd6d15

Comment 11 Fedora Update System 2016-11-15 13:26:14 UTC
avr-binutils-2.27-1.fc25, avr-gcc-6.2.0-1.fc25, avr-libc-2.0.0-1.fc25 has been pushed to the Fedora 25 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-2016-7a536a8707

Comment 12 Fedora Update System 2016-11-24 16:28:47 UTC
avr-binutils-2.27-1.fc25, avr-gcc-6.2.0-1.fc25, avr-libc-2.0.0-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-11-24 20:27:45 UTC
avr-binutils-2.27-1.fc24, avr-gcc-6.2.0-1.fc24, avr-libc-2.0.0-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2016-11-25 07:22:19 UTC
avr-binutils-2.27-1.fc23, avr-gcc-6.2.0-1.fc23, avr-libc-2.0.0-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Tuomas Kuosmanen 2016-11-25 19:38:04 UTC
Just notifying here that this works now. Thanks to everybody involved!


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