Hi,
I am using ESP32 SDK to write a sample app, using esp-idf + esp-idf-template, but I got error like
/home/dev/esp/myapp/main/libsample.a(Json.cxx.o): In function `rapidjson::CrtAllocator::Malloc(unsigned int)':
Json.cxx:(.text._ZN9rapidjson12CrtAllocator6MallocEj[rapidjson::CrtAllocator::Malloc(unsigned int)]+0xf): dangerous relocation: call8: call target out of range: malloc
What I have done in the component.mk is that
CXXFLAGS += -std=c++11
COMPONENT_ADD_LDFLAGS += -lsample -L$(COMPONENT_PATH)
I found the compiler option "-mlongcalls" had already been set in project.mk
COMMON_FLAGS = \
-ffunction-sections -fdata-sections \
-fstrict-volatile-bitfields \
-mlongcalls
What is the solution to fix this call8 error? Anyone can give your hints? thanks.
BR
Hacr
Make error of dangerous relocation: call8: call target out of range
Re: Make error of dangerous relocation: call8: call target out of range
What is the -lsample library and how it is compiled?
Re: Make error of dangerous relocation: call8: call target out of range
libsample.a is another library which I use xtensa-esp32-elf as cross compile tool to build and create a static library.
Re: Make error of dangerous relocation: call8: call target out of range
So it means you aren't using mlongcalls flag when compiling the source files for that library.
You should add -mlongcalls to your CFLAGS and CXXFLAGS at that stage.
You should add -mlongcalls to your CFLAGS and CXXFLAGS at that stage.
Re: Make error of dangerous relocation: call8: call target out of range
Oh, great, I also find my mistake thanks!
Who is online
Users browsing this forum: No registered users and 278 guests