embecosm / avr-gcc

A fork of the GCC mainline for work on the AVR tool chain
GNU General Public License v2.0
16 stars 3 forks source link

undefined reference to `__gcov_exit' #4

Closed kevr closed 3 years ago

kevr commented 3 years ago

Hello. Thanks a lot for porting GCC over to AVR 8-bit! Mostly everything's been fine for me, with the exception of avr-gcov/libgcov.a. When linking compiled object files into a final AVR 8-bit binary with sources using gcov flags, I get errors about undefined reference to '__gcov_exit'.

What's the exact state on gcov in this fork? I'd like to instrument coverage collection over gdb/serial. I haven't had much luck finding documentation about it with the recent version. After searching the repositoriy, I can find no reference of a defined __gcov_exit symbol, though it seems to have existed in the past.

Any help would be greatly appreciated, and I thank you very much for your time regardless!

Below are details about my environment.

operating system: Arch Linux, 64-bit
kernel version: 5.9.9
avr-gcc version: 10.2.0 (comes with avr-gcov).

Following is a log of my build process, which ends up with a failed link step due to a missing __gcov_exit.

mkdir -p bin
mkdir -p lib
avr-gcc -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/hooks.c -o arduino-avr-core/cores/arduino/hooks.c.o -lm -fprofile-arcs -ftest-coverage
avr-gcc -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/WInterrupts.c -o arduino-avr-core/cores/arduino/WInterrupts.c.o -lm -fprofile-arcs -ftest-coverage
avr-gcc -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/wiring_analog.c -o arduino-avr-core/cores/arduino/wiring_analog.c.o -lm -fprofile-arcs -ftest-coverage
avr-gcc -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/wiring.c -o arduino-avr-core/cores/arduino/wiring.c.o -lm -fprofile-arcs -ftest-coverage
avr-gcc -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/wiring_digital.c -o arduino-avr-core/cores/arduino/wiring_digital.c.o -lm -fprofile-arcs -ftest-coverage
avr-gcc -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/wiring_pulse.c -o arduino-avr-core/cores/arduino/wiring_pulse.c.o -lm -fprofile-arcs -ftest-coverage
avr-gcc -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/wiring_shift.c -o arduino-avr-core/cores/arduino/wiring_shift.c.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/abi.cpp -o arduino-avr-core/cores/arduino/abi.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/CDC.cpp -o arduino-avr-core/cores/arduino/CDC.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/HardwareSerial0.cpp -o arduino-avr-core/cores/arduino/HardwareSerial0.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/HardwareSerial1.cpp -o arduino-avr-core/cores/arduino/HardwareSerial1.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/HardwareSerial2.cpp -o arduino-avr-core/cores/arduino/HardwareSerial2.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/HardwareSerial3.cpp -o arduino-avr-core/cores/arduino/HardwareSerial3.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/HardwareSerial.cpp -o arduino-avr-core/cores/arduino/HardwareSerial.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/IPAddress.cpp -o arduino-avr-core/cores/arduino/IPAddress.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/main.cpp -o arduino-avr-core/cores/arduino/main.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/new.cpp -o arduino-avr-core/cores/arduino/new.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/PluggableUSB.cpp -o arduino-avr-core/cores/arduino/PluggableUSB.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/Print.cpp -o arduino-avr-core/cores/arduino/Print.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/Stream.cpp -o arduino-avr-core/cores/arduino/Stream.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/Tone.cpp -o arduino-avr-core/cores/arduino/Tone.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/USBCore.cpp -o arduino-avr-core/cores/arduino/USBCore.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/WMath.cpp -o arduino-avr-core/cores/arduino/WMath.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/cores/arduino/WString.cpp -o arduino-avr-core/cores/arduino/WString.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c arduino-avr-core/libraries/SoftwareSerial/src/SoftwareSerial.cpp -o arduino-avr-core/libraries/SoftwareSerial/src/SoftwareSerial.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c src/stubs/CoverageStubs.cpp -o src/stubs/CoverageStubs.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c src/tests/Main.test.cpp -o src/tests/Main.test.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c src/GPIO.cpp -o src/GPIO.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c src/LDR.cpp -o src/LDR.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c src/Main.cpp -o src/Main.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c src/Pin.cpp -o src/Pin.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c src/Stopwatch.cpp -o src/Stopwatch.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c src/Time.cpp -o src/Time.cpp.o -lm -fprofile-arcs -ftest-coverage
avr-gcc -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib -c src/Printf.c -o src/Printf.c.o -lm -fprofile-arcs -ftest-coverage
avr-gcc-ar rcs lib/libduino-main.a \
    arduino-avr-core/cores/arduino/main.cpp.o
avr-gcc-ar rcs lib/libduino.a \
    arduino-avr-core/cores/arduino/hooks.c.o arduino-avr-core/cores/arduino/WInterrupts.c.o arduino-avr-core/cores/arduino/wiring_analog.c.o arduino-avr-core/cores/arduino/wiring.c.o arduino-avr-core/cores/arduino/wiring_digital.c.o arduino-avr-core/cores/arduino/wiring_pulse.c.o arduino-avr-core/cores/arduino/wiring_shift.c.o arduino-avr-core/cores/arduino/abi.cpp.o arduino-avr-core/cores/arduino/CDC.cpp.o arduino-avr-core/cores/arduino/HardwareSerial0.cpp.o arduino-avr-core/cores/arduino/HardwareSerial1.cpp.o arduino-avr-core/cores/arduino/HardwareSerial2.cpp.o arduino-avr-core/cores/arduino/HardwareSerial3.cpp.o arduino-avr-core/cores/arduino/HardwareSerial.cpp.o arduino-avr-core/cores/arduino/IPAddress.cpp.o arduino-avr-core/cores/arduino/main.cpp.o arduino-avr-core/cores/arduino/new.cpp.o arduino-avr-core/cores/arduino/PluggableUSB.cpp.o arduino-avr-core/cores/arduino/Print.cpp.o arduino-avr-core/cores/arduino/Stream.cpp.o arduino-avr-core/cores/arduino/Tone.cpp.o arduino-avr-core/cores/arduino/USBCore.cpp.o arduino-avr-core/cores/arduino/WMath.cpp.o arduino-avr-core/cores/arduino/WString.cpp.o arduino-avr-core/libraries/SoftwareSerial/src/SoftwareSerial.cpp.o
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib \
    src/Printf.c.o src/GPIO.cpp.o src/LDR.cpp.o src/Main.cpp.o src/Pin.cpp.o src/Stopwatch.cpp.o src/Time.cpp.o  \
    src/tests/Main.test.cpp.o \
    -o bin/Main.test \
    -fprofile-arcs -ftest-coverage -lduino -lm
avr-g++ -std=gnu++11 -g -ggdb -O0 -w -fpermissive -Wno-error=narrowing  -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -DF_CPU=16000000L -mmcu=atmega2560 -I arduino-avr-core/cores/arduino -I arduino-avr-core/variants/standard -I arduino-avr-core/variants/eightanaloginputs -I arduino-avr-core/libraries/SoftwareSerial/src -L ./lib \
    src/GPIO.cpp.o src/LDR.cpp.o src/Main.cpp.o src/Pin.cpp.o src/Stopwatch.cpp.o src/Time.cpp.o src/Printf.c.o  \
    -o bin/avr-cs-sensor \
    -fprofile-arcs -ftest-coverage -lduino -lduino-main -lm
/usr/bin/avr-ld: src/GPIO.cpp.o: in function `_GLOBAL__sub_D__ZN11GPIOLibrary7pinModeEhh':
/home/kevr/dev/avr/src/GPIO.cpp:17: undefined reference to `__gcov_exit'
/usr/bin/avr-ld: src/LDR.cpp.o: in function `_GLOBAL__sub_I__ZNK3LDR5resetEm':
/home/kevr/dev/avr/src/LDR.cpp:11: undefined reference to `__gcov_exit'
/usr/bin/avr-ld: src/Main.cpp.o: in function `_GLOBAL__sub_I_setup':
/home/kevr/dev/avr/src/Main.cpp:82: undefined reference to `__gcov_exit'
/usr/bin/avr-ld: src/Pin.cpp.o: in function `_GLOBAL__sub_D__ZN3PinC2Eh':
/home/kevr/dev/avr/src/Pin.cpp:58: undefined reference to `__gcov_exit'
/usr/bin/avr-ld: src/Stopwatch.cpp.o: in function `_GLOBAL__sub_I__ZN9Stopwatch5startEv':
/home/kevr/dev/avr/src/Stopwatch.cpp:19: undefined reference to `__gcov_exit'
/usr/bin/avr-ld: src/Time.cpp.o:/home/kevr/dev/avr/src/Time.cpp:23: more undefined references to `__gcov_exit' follow
collect2: error: ld returned 1 exit status
/usr/bin/avr-ld: src/Printf.c.o: in function `uartPutchar':
/home/kevr/dev/avr/src/Printf.c:16: undefined reference to `__gcov_exit'
/usr/bin/avr-ld: src/GPIO.cpp.o: in function `_GLOBAL__sub_D__ZN11GPIOLibrary7pinModeEhh':
/home/kevr/dev/avr/src/GPIO.cpp:17: undefined reference to `__gcov_exit'
/usr/bin/avr-ld: src/LDR.cpp.o: in function `_GLOBAL__sub_I__ZNK3LDR5resetEm':
/home/kevr/dev/avr/src/LDR.cpp:11: undefined reference to `__gcov_exit'
make: *** [Makefile:78: avr-cs-sensor] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/avr-ld: src/Main.cpp.o: in function `_GLOBAL__sub_I_setup':
/home/kevr/dev/avr/src/Main.cpp:82: undefined reference to `__gcov_exit'
/usr/bin/avr-ld: src/Pin.cpp.o: in function `_GLOBAL__sub_D__ZN3PinC2Eh':
/home/kevr/dev/avr/src/Pin.cpp:58: undefined reference to `__gcov_exit'
/usr/bin/avr-ld: src/Stopwatch.cpp.o:/home/kevr/dev/avr/src/Stopwatch.cpp:19: more undefined references to `__gcov_exit' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:87: Main.test] Error 1

If there are any other details that may be important, please let me know.

jeremybennett commented 3 years ago

Hi @kevr

This is a legacy fork of the upstream GCC repository, which hasn't been touched for many years. You should be getting your AVR source code from upstream GCC.

Thanks for drawing our attention to this however. We shall delete this repository in the near future.