Opened 8 years ago

Closed 8 years ago

#33107 closed update (fixed)

avr-gcc: update to 4.6.2

Reported by: marc.sowen@… Owned by: titus@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: metamagix@…, nospam2000@…, titus@…, neverpanic (Clemens Lang)
Port: avr-gcc

Description

This patch updates avr-gcc to version 4.6.2.

Attachments (4)

Portfile-avr-gcc-4.6.2.patch (1.7 KB) - added by marc.sowen@… 8 years ago.
Portfile-avr-gcc-4.6.2-v2.patch (2.0 KB) - added by marc.sowen@… 8 years ago.
This patch adds removal of libiberty library which is provided by binutils.
Portfile-avrgcc.diff (4.3 KB) - added by titus@… 8 years ago.
Corrected patch for review
lto-plugin-osx.diff (362 bytes) - added by titus@… 8 years ago.
patch file necessary for gcc-4.6.2's LTO plugin on OSX

Download all attachments as: .zip

Change History (22)

Changed 8 years ago by marc.sowen@…

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Cc: metamagix@… added
Keywords: haspatch added
Port: avr-gcc added
Version: 2.0.3

In the future, please fill in the Port field and Cc the port maintainer(s). Granted the maintainer did not respond in #17524.

comment:2 in reply to:  1 Changed 8 years ago by marc.sowen@…

Replying to macsforever2000@…:

In the future, please fill in the Port field and Cc the port maintainer(s).

Ok, will do! Please also note that the current macports version of avr-libc won't compile with this. Use new avr-libc version from ticket #33106.

comment:3 Changed 8 years ago by nospam2000@…

Cc: nospam2000@… added

Cc Me!

comment:4 Changed 8 years ago by ned@…

I (metamagix@…) am stepping down as maintainer.

comment:5 Changed 8 years ago by marc.sowen@…

Does this mean that nobody will check-in the patch into trunk? If I would step in, what would be my duties?

comment:6 Changed 8 years ago by titus@…

The patch seems to be unsufficient:

Error: Target org.macports.activate returned: Image error:
/opt/local/lib/x86_64/libiberty.a is being used by the active binutils port. 
Please deactivate this port first, or use 'port -f activate avr-gcc' to force the activation.

comment:7 Changed 8 years ago by titus@…

Cc: titus@… added

Cc Me!

Changed 8 years ago by marc.sowen@…

This patch adds removal of libiberty library which is provided by binutils.

comment:8 Changed 8 years ago by marc.sowen@…

I modified the patch which removes libiberty library now. I tested it on my system with binutils installed and it worked.

Changed 8 years ago by titus@…

Attachment: Portfile-avrgcc.diff added

Corrected patch for review

comment:9 Changed 8 years ago by titus@…

Owner: changed from macports-tickets@… to titus@…
Status: newassigned

For review

comment:10 Changed 8 years ago by titus@…

I tested avr-gcc 4.6.2 on my machine with the old binutils 2.20, new avr-binutils-2.22, avr-libc 1.8.0; with and without LTO.

Since I am not an everyday avr user I have included patch file Portfile-avrgcc.diff for review.

I'll commit this beginning of next week if nobody complains.

Changed 8 years ago by titus@…

Attachment: lto-plugin-osx.diff added

patch file necessary for gcc-4.6.2's LTO plugin on OSX

comment:11 Changed 8 years ago by titus@…

See ticket #33201 for upgrade of avr-binutils.

Since I enabled LTO in avr-gcc's port file, an upgrade of binutils would be required as well.

comment:12 Changed 8 years ago by marc.sowen@…

Ok, I have installed avr-binutils-2.22 from #33201 and your new avr-gcc-4.6.2 and after that avr-libc 1.8.0 from trunk. Currently I seem to be unable to link:

$:~/Downloads/LUFA-111009/Projects/AVRISP-MKII$ make


avr-gcc (GCC) 4.6.2 Copyright (C) 2011 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.

Linking: AVRISP-MKII.elf avr-gcc -mmcu=at90usb162 -I. -gdwarf-2 -DF_CPU=16000000UL -DF_USB=16000000UL -DBOARD=BOARD_USBTINYMKII -DARCH=ARCH_AVR8 -D USB_DEVICE_ONLY -D DEVICE_STATE_AS_GPIOR=0 -D ORDERED_EP_CONFIG -D FIXED_CONTROL_ENDPOINT_SIZE=16 -D FIXED_NUM_CONFIGURATIONS=1 -D USE_FLASH_DESCRIPTORS -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -D NO_INTERNAL_SERIAL -D NO_DEVICE_REMOTE_WAKEUP -D NO_DEVICE_SELF_POWER -D AUX_LINE_PORT=PORTB -D AUX_LINE_PIN=PINB -D AUX_LINE_DDR=DDRB -D AUX_LINE_MASK="(1 << 4)" -D ENABLE_ISP_PROTOCOL -D ENABLE_XPROG_PROTOCOL -D VTARGET_ADC_CHANNEL=2 -D VTARGET_REF_VOLTS=5 -D VTARGET_SCALE_FACTOR=1 -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -fno-split-wide-types -Wall -Wstrict-prototypes -Wa,-adhlns=AVRISP-MKII.o -I../../ -std=c99 -MMD -MP -MF .dep/AVRISP-MKII.elf.d AVRISP-MKII.o Descriptors.o Lib/V2Protocol.o Lib/V2ProtocolParams.o Lib/ISP/ISPProtocol.o Lib/ISP/ISPTarget.o Lib/XPROG/XPROGProtocol.o Lib/XPROG/XPROGTarget.o Lib/XPROG/XMEGANVM.o Lib/XPROG/TINYNVM.o ../../LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o ../../LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o ../../LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o ../../LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o ../../LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o ../../LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o ../../LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.o ../../LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o ../../LUFA/Drivers/USB/Core/ConfigDescriptor.o ../../LUFA/Drivers/USB/Core/DeviceStandardReq.o ../../LUFA/Drivers/USB/Core/Events.o ../../LUFA/Drivers/USB/Core/HostStandardReq.o ../../LUFA/Drivers/USB/Core/USBTask.o ../../LUFA/Drivers/USB/Class/Common/HIDParser.o --output AVRISP-MKII.elf -Wl,-Map=AVRISP-MKII.map,--cref -Wl,--relax -Wl,--gc-sections -lm collect2: ld terminated with signal 11 [Segmentation fault: 11] make: * [AVRISP-MKII.elf] Error 1

(I removed the build lines)

I will check whether LTO is the problem.

comment:13 Changed 8 years ago by marc.sowen@…

When I comment the lines "--enable-lto" and "--with-plugin-ld=${crossgcc-target}-ld" I get this:

Adding multilib support to Makefile in /opt/local/var/macports/build/_Users_mso_PortTest_cross_avr-gcc/avr-gcc/work/gcc-4.6.2/libquadmath
with_multisubdir=avr6
make[1]: Leaving directory `/opt/local/var/macports/build/_Users_mso_PortTest_cross_avr-gcc/avr-gcc/work/build'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_Users_mso_PortTest_cross_avr-gcc/avr-gcc/work/build'
shell command " cd "/opt/local/var/macports/build/_Users_mso_PortTest_cross_avr-gcc/avr-gcc/work/build" && /usr/bin/make -j4 -w all AR_FOR_TARGET=avr-ar AS_FOR_TARGET=avr-as LD_FOR_TARGET=avr-ld NM_FOR_TARGET=avr-nm RANLIB_FOR_TARGET=avr-ranlib " returned error 2
Error: Target org.macports.build returned: shell command failed (see log for details)
Warning: the following items did not execute (for avr-gcc): org.macports.activate org.macports.build org.macports.destroot org.macports.install
Log for avr-gcc is at: /opt/local/var/macports/logs/_Users_mso_PortTest_cross_avr-gcc/avr-gcc/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Any suggestions?

comment:14 Changed 8 years ago by neverpanic (Clemens Lang)

Cc: cal@… added

Cc Me!

comment:15 Changed 8 years ago by titus@…

What OS version are you building on?

The last build error snippet does not show the error.

I doubt that it has anything to do with LTO. LTO has to be enabled on the command line, not only during compiler configuration. Your linker command line does not show LTO options. However, if I add to my LDFLAGS --relax, ld also crashes on my machine.

What is that option supposed to do? ld docs does not say that's for AVR (http://sourceware.org/binutils/docs/ld/Options.html).

comment:16 Changed 8 years ago by titus@…

I found http://sourceware.org/bugzilla/show_bug.cgi?id=12161

which apparently describes this problem.

Mind to test the patch from this PR for binutils-2.22 (at least they claim it fits for 2.22), and report if your build is ok?

comment:17 Changed 8 years ago by marc.sowen@…

The patch from http://sourceware.org/bugzilla/show_bug.cgi?id=12161 does the trick. If you ask me, you can close the ticket and commit it to trunk.

comment:18 Changed 8 years ago by titus@…

Resolution: fixed
Status: assignedclosed

Committed in r89852

Note: See TracTickets for help on using tickets.