Make error of dangerous relocation: call8: call target out of range
Posted: Thu Apr 06, 2017 1:37 pm
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
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