Wallacoloo / printipi

3d printing directly through the Raspberry Pi's GPIO pins
MIT License
141 stars 43 forks source link

Build fails with "internal compiler error" on gcc-4.7 #52

Closed Wallacoloo closed 9 years ago

Wallacoloo commented 9 years ago

Something changed in https://github.com/Wallacoloo/printipi/commit/08bb9ee9ed28198f7b3ec93460327b13336b6b1d causes an internal compiler error in gcc-4.7 when using link-time optimization (on x86-64). The bug isn't present on gcc-4.8 or 4.9, and also absent on 4.7 with lto disabled.

Output of make:

g++-4.7 ../build/debug-g++-4.7/common/common.a ../build/debug-g++-4.7/drivers/drivers.a ../build/debug-g++-4.7/gparse/gparse.a ../build/debug-g++-4.7/rest.a -o ../build/debug-g++-4.7/printipi-rpi-kosselrampsfd -std=c++0x -I/home/colin/proj/3dprinter/printipi-devel/src -Wall -Wextra -Wwrite-strings -Wno-unused-result -Wno-pmf-conversions -DDNO_LOG_M105   -flto  -fno-signaling-nans -fno-rounding-math -fno-signed-zeros -freciprocal-math -fno-math-errno  -march=native -mtune=native -DMACHINE='rpi::kosselrampsfd' -DMACHINE_PATH='"machines/rpi/kosselrampsfd.h"' -DDTARGET_PLATFORM_rpi -DDTARGET_PLATFORM_LOWER="rpi" -DDUSE_PTHREAD=1  -DPLATFORM_DRIVER_CHRONOCLOCK='"drivers/rpi/chronoclock.h"' -DPLATFORM_DRIVER_HARDWARESCHEDULER='"drivers/rpi/hardwarescheduler.h"' -DPLATFORM_DRIVER_PRIMITIVEIOPIN='"drivers/rpi/primitiveiopin.h"' -DBUILD_TYPE_debug -O0 -ggdb3 -fno-omit-frame-pointer  -lrt
lto1: internal compiler error: in lto_output_varpool_node, at lto-cgraph.c:595
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
lto-wrapper: g++-4.7 returned 1 exit status
/usr/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status
Makefile:130: recipe for target '../build/debug-g++-4.7/printipi-rpi-kosselrampsfd' failed
make: *** [../build/debug-g++-4.7/printipi-rpi-kosselrampsfd] Error 1
Wallacoloo commented 9 years ago

Failed attempts to solve:

Wallacoloo commented 9 years ago

Deleting the livingPin set in IoPin fixes the error. Specifically, deleting the line static bool registeredWithSched = false; in the templated IoPin constructor removed the error (but changed the functionality, of course).