rx-elf-ld fails with undefined reference to `__errno’
rx-elf-ld fails with undefined reference to `__errno’
In Renesas e2-Studio with KPIT Toolchain I cannot get rx-elf-gcc to work with errno.h.
Consider tho following code:
#include <errno.h>
int main(void)
{errno = 0;
while (1) {}
return 0;
}
compiles ok, but gives
‘Invoking: Linker’
‘Building target:’
rx-elf-ld -o “testmini.x” -T”D:\Repository\testmini\HardwareDebug\testmini_HardwareDebug_auto.gsi” @”D:\Repository\testmini\HardwareDebug\LinkerSubCommand.tmp” libtestmini.a -M=testmini.map -L”D:\Repository\testmini\HardwareDebug” –start-group -ltestmini -lgcc –end-group
./src/testmini.o: In function `main’:
D:\Repository\testmini\HardwareDebug/../src/testmini.c:47: undefined reference to `__errno’
make: *** [testmini.x] Error 1
makefile:93: recipe for target ‘testmini.x’ failed
Any help is apprciated.
Marc
Hello Marc,
In order for us to be able to provide a comprehensive answer, we’ll need more information including, but not limited to:
– toolchain version
– used library(optlib/newlib)
– library build mode(prebuilt, project built)
Thank You,
Grigore Dobra,
The GNU Support Team
P.S. all libraries are enabled
Hmm, a day later the same worked.