esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
16.06k stars 13.33k forks source link

"fmod" causes linker error undefined reference to `__ieee754_remainder' #1385

Closed bmitov closed 8 years ago

bmitov commented 8 years ago

This simple Sketch fails to compile in 2.1.0-rc1:

void setup() { // put your setup code here, to run once:

float ATest2 = 3.3; float ATest1 = fmod( ATest2, 1 ); }

void loop() { // put your main code here, to run repeatedly: }

It produces:

e_fmod.c:(.text+0x48): undefined reference to `__ieee754_remainder'

error. This prevents a number of Visuino components from compiling for ESP8266. Please let me know if there is a workaround, but I think this is a very serious compiler/linker/library bug.

Arduino IDE 1.6.7, happens both on Windows 7, and Windows 8.1

SalvorinFex commented 8 years ago

I can confirm this in the "stable" version 2.0.0, running WIN 8.1 and arduino IDE 1.6.5.

c:/users/WINUSER/appdata/roaming/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libm.a(lib_a-e_fmod.o):(.literal+0x4): undefined reference to__ieee754_remainder'`

c:/users/WINUSER/appdata/roaming/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libm.a(lib_a-e_fmod.o): In function__ieee754_fmod':`

e_fmod.c:(.text+0x48): undefined reference to__ieee754_remainder'`

collect2.exe: error: ld returned 1 exit status

Error compiling.

igrr commented 8 years ago

This is tracked as #612, let's keep the discussion there.