Linker crashes on Mac OSX with LTO enabled

Bug #1668354 reported by Scott Shawcroft
This bug report is a duplicate of:  Bug #1570613: lto1.exe: internal compiler error. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
New
Undecided
Unassigned

Bug Description

With the Q1 update binaries on Mac OSX the linker crashes with Abort 6:

lto1: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:135

lto1: internal compiler error: Abort trap: 6
arm-none-eabi-gcc: internal compiler error: Abort trap: 6 (program lto1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: fatal error: arm-none-eabi-gcc returned 4 exit status
compilation terminated.
/usr/local/Caskroom/gcc-arm-embedded/6-2017-q1/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [build-cplay_m0_flash/firmware.elf] Error 1

Steps to reproduce:

1) Download source: https://github.com/adafruit/circuitpython/archive/d598c2a919e9d3dc550092a4ac7e7ed68dc27f86.zip or https://github.com/adafruit/circuitpython/tree/d598c2a919e9d3dc550092a4ac7e7ed68dc27f86

2) Add the line "BOARD_CFLAGS = -flto" to the end of atmel-samd/boards/cplay_m0_flash/mpconfigboard.mk.

3) make -C atmel-samd BOARD=cplay_m0_flash (add V=2 to have it output the full commands its running)

The same source compiles fine without the -flto flag. There are also only minor differences between the cplay_m0_flash board and the gemma_m0 board which compiles fine. The boards that fail have atmel-samd/spi_flash.c instead of atmel-samd/internal_flash.c and other super minor differences.

Full GCC version string:
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors 6-2017-q1-update) 6.3.1 20170215 (release) [ARM/embedded-6-branch revision 245512]

Mac OSX version:
10.12.4 Beta (16E163f)

Revision history for this message
Tejas Belagod (belagod-tejas) wrote :

Hi Scott,

Any chance you can narrow the test to a minimal case? It would be really helpful if you could narrow it down to the smallest preprocessed file(s) that can reproduce the problem.

Thanks,
Tejas.

Revision history for this message
Tejas Belagod (belagod-tejas) wrote :

Also, have you tried this on any other platform (linux/Windows)? Is this something exclusive to Mac?

Revision history for this message
Scott Shawcroft (scott-shawcroft) wrote :

Yeah, I know its kinda a big source. Unfortunately, I'm not sure where to start with it. I was hoping that someone would be able to get a better error from the linker and go from there.

I don't have a Windows box handy but it does also fail on an Ubuntu VM:
lto1: internal compiler error: in add_symbol_to_partition_1, at lto/lto-partition.c:135
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: fatal error: arm-none-eabi-gcc returned 1 exit status
compilation terminated.
/usr/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [build-cplay_m0_flash/firmware.elf] Error 1

This is the version string from gcc on ubuntu:
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors 6-2017-q1-update) 6.3.1 20170215 (release) [ARM/embedded-6-branch revision 245512]

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

Hi Scott, I believe this is the same bug as #1570613. As you can see on that bug, a patch has been proposed to FSF community and should hopefully find its way in our 2017Q2 release.

[1] https://bugs.launchpad.net/gcc-arm-embedded/+bug/1570613

Best regards.

Revision history for this message
Scott Shawcroft (scott-shawcroft) wrote : Re: [Bug 1668354] Re: Linker crashes on Mac OSX with LTO enabled

Ok thanks! I'll keep an eye on it. Feel free to deduplicate. Thanks!

On Fri, Mar 3, 2017 at 4:21 PM Thomas Preud'homme <email address hidden>
wrote:

> Hi Scott, I believe this is the same bug as #1570613. As you can see on
> that bug, a patch has been proposed to FSF community and should
> hopefully find its way in our 2017Q2 release.
>
> [1] https://bugs.launchpad.net/gcc-arm-embedded/+bug/1570613
>
> Best regards.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1668354
>
> Title:
> Linker crashes on Mac OSX with LTO enabled
>
> Status in GNU ARM Embedded Toolchain:
> New
>
> Bug description:
> With the Q1 update binaries on Mac OSX the linker crashes with Abort
> 6:
>
> lto1: internal compiler error: in add_symbol_to_partition_1, at lto
> /lto-partition.c:135
>
> lto1: internal compiler error: Abort trap: 6
> arm-none-eabi-gcc: internal compiler error: Abort trap: 6 (program lto1)
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> lto-wrapper: fatal error: arm-none-eabi-gcc returned 4 exit status
> compilation terminated.
>
> /usr/local/Caskroom/gcc-arm-embedded/6-2017-q1/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld:
> error: lto-wrapper failed
> collect2: error: ld returned 1 exit status
> make: *** [build-cplay_m0_flash/firmware.elf] Error 1
>
> Steps to reproduce:
>
> 1) Download source:
>
> https://github.com/adafruit/circuitpython/archive/d598c2a919e9d3dc550092a4ac7e7ed68dc27f86.zip
> or
>
> https://github.com/adafruit/circuitpython/tree/d598c2a919e9d3dc550092a4ac7e7ed68dc27f86
>
> 2) Add the line "BOARD_CFLAGS = -flto" to the end of atmel-
> samd/boards/cplay_m0_flash/mpconfigboard.mk.
>
> 3) make -C atmel-samd BOARD=cplay_m0_flash (add V=2 to have it output
> the full commands its running)
>
> The same source compiles fine without the -flto flag. There are also
> only minor differences between the cplay_m0_flash board and the
> gemma_m0 board which compiles fine. The boards that fail have atmel-
> samd/spi_flash.c instead of atmel-samd/internal_flash.c and other
> super minor differences.
>
>
> Full GCC version string:
> arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors
> 6-2017-q1-update) 6.3.1 20170215 (release) [ARM/embedded-6-branch revision
> 245512]
>
> Mac OSX version:
> 10.12.4 Beta (16E163f)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gcc-arm-embedded/+bug/1668354/+subscriptions
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.