permal wrote: ↑Sun Aug 11, 2019 4:53 pmProgress!
Apparently, target_link_options doesn't do what I expect, or I'm using it wrongly.
This doesn't work:
This, however, does:Code: Select all
target_link_options(${PROJECT_NAME} PUBLIC -mlongcalls -mtext-section-literals)
Both the C and C++ version has to be set. Note that this is only when building for Xtensa (if you are also compiling for Linux like I am).Code: Select all
if(${ESP_PLATFORM}) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlongcalls -mtext-section-literals") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlongcalls -mtext-section-literals") endif()
Surely modern CMake scripts are not meant to use CMAKE_C_FLAGS directly and instead use target_link_libraries?!
yes it was a (8266)bug i think - not sure - usually this is not happend in ESP32 again, but read yours - perhabs in ESP32 again, still, (hope ) in progress. remember me in mongosse
Code: Select all
# Flags for other component builds, including SPIFFS, go here.
CFLAGS += -Wall -Werror -mtext-section-literals \
-DCS_SPIFFS_ENABLE_VFS -I$(MGOS_PATH) \
-DMBEDTLS_X509_CA_CHAIN_ON_DISK \
-DSPIFFS_ON_PAGE_MOVE_HOOK=esp_spiffs_on_page_move_hook
Code: Select all
/app/src//pcmutils_lib.cpp:706:(.text.unlikely._ZL21getChannelDescription20PCM_DMX_CHANNEL_MODEPA8_KhP18AUDIO_CHANNEL_TYPEPhS5_+0x54): dangerous relocation: l32r: literal target out of range (try using text-section-literals): .literal.unlikely._ZL21getChannelDescription20PCM_DMX_CHANNEL_MODEPA8_KhP18AUDIO_CHANNEL_TYPEPhS5_
best wishes
rudi