Linker failing build blink for Teensy 3.6

Status
Not open for further replies.

johnnyfp

Well-known member
Hi,

I'm trying to get make to work using these instructions with a Teensy 3.6 and am failing to link to a math file with the following error
Code:
/usr/share/arduino/hardware/tools/arm/bin/arm-none-eabi-gcc -mthumb --specs=nano.specs -larm_cortexM4lf_math -T/usr/share/arduino/hardware/teensy/cores/teensy3/mk66fx1m0.ld -mcpu=cortex-m4 -Wl,--gc-sections -Os -o build-teensy36/blink.elf build-teensy36/blink.o build-teensy36/libcore.a  -lc -lm
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: cannot find -larm_cortexM4lf_math

Any ideas?

Build options from my boards.txt

Code:
teensy36.build.additionalobject1=-larm_cortexM4lf_math
teensy36.build.architecture=arm
teensy36.build.board=TEENSY36
teensy36.build.core=teensy3
teensy36.build.cpu=cortex-m4
teensy36.build.fpu=fpv4-sp-d16
teensy36.build.mcu=mk66fx1m0
teensy36.build.warn_data_percentage=99
teensy36.build.toolchain=arm/bin/
teensy36.build.command.gcc=arm-none-eabi-gcc
teensy36.build.command.g++=arm-none-eabi-g++
teensy36.build.command.ar=arm-none-eabi-ar
teensy36.build.command.objcopy=arm-none-eabi-objcopy
teensy36.build.command.objdump=arm-none-eabi-objdump
teensy36.build.command.size=arm-none-eabi-size
teensy36.buils.cppoption1=-fno-rtti
teensy36.build.dependency=true
teensy36.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib
teensy36.build.flags.dep=-MMD
teensy36.build.flags.optimize=-Os
teensy36.build.flags.cpu=-mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
teensy36.build.flags.defs=-D__MK66FX1M0__ -DTEENSYDUINO=130
teensy36.build.flags.cpp=-fno-exceptions -felide-constructors -std=gnu++0x -fno-rtti
teensy36.build.flags.c=
teensy36.build.flags.S=-x assembler-with-cpp
teensy36.build.flags.ld=-Wl,--gc-sections,--relax,--defsym=__rtc_localtime={extra.time.local} "-T{build.core.path}/mk66fx1m0.ld"
teensy36.build.flags.libs=-larm_cortexM4lf_math -lm
teensy36.build.gnu0x=true
teensy36.build.linkoption1=-mthumb
teensy36.build.linkoption2=--specs=nano.specs
teensy36.build.linkscript=mk66fx1m0.ld
teensy36.build.option1=-mthumb
teensy36.build.option2=-nostdlib
teensy36.build.option3=-D__MK66FX1M0__
teensy36.build.option4=-DTEENSYDUINO=130
teensy36.build.option5=-fsingle-precision-constant
teensy36.build.option6=-mfloat-abi=hard
teensy36.build.option7=-mfpu=fpv4-sp-d16
teensy36.build.post_compile_script=teensy_post_compile
 
It is referenced here:
Arm_math.h (cores\teensy3): * - arm_cortexM4lf_math.lib (Little endian and Floating Point Unit on Cortex-M4)
Arm_math.h (cores\teensy3): * - arm_cortexM4lf_math.uvproj

that .h says this:
* The library installer contains project files to re build libraries on MDK Tool chain in the <code>CMSIS\\DSP_Lib\\Source\\ARM</code> folder.
 
Mmmh I seemed to be missing these libraries. I think the online linux repo for arduino and arm-none-eabi are lacking. Maybe I've missed an apt-get install. Do you think I can get away with copying them from the Ardunio arm-none-eabi/lib dir on a windows machine.
 
I don't see any LIB like that the closest I find is:

"C:\arduino-1.6.12\hardware\tools\arm\arm-none-eabi\lib\libarm_cortexM4lf_math.a"
It is 2.6 MB and compresses to 1.1MB

It is pre-built somewhere with text strings to folders I do not have on my machine. If you PM me your email I can send if you don't have it handy

This is Win 10 w/IDE 1.6.12

If I delete that file the compile fails with this familiar looking ending:
Linking everything together...
"C:\arduino-1.6.12\hardware\teensy/../tools/arm/bin/arm-none-eabi-gcc" -O -Wl,--gc-sections,--relax,--defsym=__rtc_localtime=1477007233 "-TC:\arduino-1.6.12\hardware\teensy\avr\cores\teensy3/mk66fx1m0.ld" -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -o "C:\Users\Tim\AppData\Local\Temp\arduino_build_805084/SerEEpromSysTickFAST.ino.elf" "C:\Users\Tim\AppData\Local\Temp\arduino_build_805084\sketch\SerEEpromSysTickFAST.ino.cpp.o" "C:\Users\Tim\AppData\Local\Temp\arduino_build_805084\libraries\EEPROM\EEPROM.cpp.o" "C:\Users\Tim\AppData\Local\Temp\arduino_build_805084/core\core.a" "-LC:\Users\Tim\AppData\Local\Temp\arduino_build_805084" -larm_cortexM4lf_math -lm
c:/arduino-1.6.12/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: cannot find -larm_cortexM4lf_math

collect2.exe: error: ld returned 1 exit status

And it does not rebuild - even on changing Teensy speed.

Mine is time stamped 8 minutes after my C:\arduino-1.6.12 folder, just after TeensyDuino was installed it seems based on some of those folder/file times.
 
I copied the libraries from a linux installed copy of ardunio and have got past the arm_cortext lib issue.
However, I am now getting a linker error with the merging because the linker thinks that my .ino file is using a soft-float where as all my libraries are compiled with a hard-float.

Code:
arduino-1.6.12/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld: error: build-teensy36/libcore.a(HardwareSerial1.o) uses VFP register arguments, build-teensy36/blink.elf does not

however when I look at the g++ command for the blink.o I am definitly specifying a hard float

Code:
/usr/share/arduino/hardware/tools/arm/bin/arm-none-eabi-g++ -x c++ -include Arduino.h -MMD -c -DLAYOUT_US_ENGLISH -DUSB_SERIAL -mthumb -nostdlib -D__MK66FX1M0__ -DTEENSYDUINO=130 -fsingle-precision-constant -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mcpu=cortex-m4 -DF_CPU=180000000 -DARDUINO=105 -DARDUINO_ARCH_ARM -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/teensy/cores/teensy3 -I/usr/share/arduino/hardware/teensy/arm/variants/    -Wall -ffunction-sections -fdata-sections -Os -fno-rtti -fno-exceptions -felide-constructors -std=gnu++0x -Wall -g -nostdlib -fno-exceptions -std=gnu++0x blink.ino -o build-teensy36/blink.o

and the serial is also using hard

Code:
/usr/share/arduino/hardware/tools/arm/bin/arm-none-eabi-g++ -MMD -c -DLAYOUT_US_ENGLISH -DUSB_SERIAL -mthumb -nostdlib -D__MK66FX1M0__ -DTEENSYDUINO=130 -fsingle-precision-constant -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mcpu=cortex-m4 -DF_CPU=180000000 -DARDUINO=105 -DARDUINO_ARCH_ARM -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/teensy/cores/teensy3 -I/usr/share/arduino/hardware/teensy/arm/variants/    -Wall -ffunction-sections -fdata-sections -Os -fno-rtti -fno-exceptions -felide-constructors -std=gnu++0x -Wall -g -nostdlib -fno-exceptions -std=gnu++0x /usr/share/arduino/hardware/teensy/cores/teensy3/HardwareSerial1.cpp -o build-teensy36/core/HardwareSerial1.o

So am a little stumpted.

Time for bed and a fresh head.
 
I have some scripts when compiling under (L)UBUNTU. I've installed Arduino, and just call the the arduino-builder (like in the first line of the output when compiling with arduino)
 
Status
Not open for further replies.
Back
Top