Compile a prebuilt library for use with ESP-IDF

thegrayzone
Posts: 2
Joined: Fri Mar 28, 2025 3:31 pm

Compile a prebuilt library for use with ESP-IDF

Postby thegrayzone » Fri Mar 28, 2025 4:47 pm

Hi,

I'm trying to link a simple app_main() against some prebuilt libraries, using the method described in the last post (by dmarks_ls) in this thread:
https://esp32.com/viewtopic.php?t=16452

The linking stage of the build throws a bunch of errors with "dangerous relocation: call8: call target out of range".

This probably means that my library is built with the wrong compiler flags, can anyone give a pointer to where I can find the correct flags to use?

The libraries are built using Makefiles. Currently I am not using an IDE (I plan to use vscode, but I prefer to get things working on the command line first and worry about IDE integration later). Here is a sample gcc command so you can see the flags which are being used:

Code: Select all

xtensa-esp32s3-elf-gcc -c -o /home/chris/open-mika-freertos/build/esp32-s3/obj/generated/core-classes.o -g -Wall -Wsign-compare -Wshadow -Wpointer-arith -Wstrict-prototypes -Wformat -Winline -DDEBUG_LEVEL=7 -nostdlib -DESP_IDF -isystem/home/chris/open-mika-freertos/build/config  -isystem/home/chris/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include  -isystem/home/chris/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos  -isystem/home/chris/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos  -isystem/home/chris/esp/esp-idf/components/freertos/config/include  -isystem/home/chris/esp/esp-idf/components/freertos/config/include/freertos  -isystem/home/chris/esp/esp-idf/components/freertos/config/xtensa/include  -isystem/home/chris/esp/esp-idf/components/xtensa/include  -isystem/home/chris/esp/esp-idf/components/soc/esp32s3/include  -isystem/home/chris/esp/esp-idf/components/soc/esp32s3/register  -isystem/home/chris/esp/esp-idf/components/esp_common/include  -isystem/home/chris/esp/esp-idf/components/esp_system/include  -isystem/home/chris/esp/esp-idf/components/xtensa/esp32s3/include  -isystem/home/chris/esp/esp-idf/components/esp_hw_support/include  -isystem/home/chris/esp/esp-idf/components/heap/include  -isystem/home/chris/esp/esp-idf/components/esp_rom/include  -isystem/home/chris/esp/esp-idf/components/esp_driver_uart/include  -isystem/home/chris/esp/esp-idf/components/newlib/platform_include  -isystem/home/chris/esp/esp-idf/components/lwip/port/esp32xx/include  -isystem/home/chris/esp/esp-idf/components/lwip/port/include  -isystem/home/chris/esp/esp-idf/components/lwip/port/freertos/include  -isystem/home/chris/esp/esp-idf/components/lwip/lwip/src/include  -isystem/home/chris/esp/esp-idf/components/hal/include  -DSTORE_METHOD_DEBUG_INFO -DFREERTOS_H_FILE=\"freertos/FreeRTOS.h\" -DFREERTOSCONFIG_H_FILE=\"freertos/FreeRTOSConfig.h\" -DJAVA_THREAD_YIELD_IS_FREERTOS_DELAY -DUSE_OBJECT_HASHTABLE  -DESP32 -fno-inline-functions -D__NO_STRING_INLINES  -I /home/chris/open-mika-freertos/vm-cmp/fp/native/include -DBOOTCLASSDIR=\"/lib/mika\" -DBOOTCLASSFILE=\"mcl.jar\" -DEXTCLASSDIR=\"/lib/mika/ext\" -DDEFAULT_HEAP_SIZE=\"8M\" -DDEFAULT_STACK_SIZE=\"16384\" -DVERSION_STRING=\""Snapshot_esp32-s3-20250328-0c3559f"\" -DBOOTCLASSPATH=\"/lib/mika:/lib/mika/mcl.jar\" -DJDWP -DUNICODE_SUBSETS=\"0\" -DUSE_NATIVE_MALLOC -DCPU_MIPS=40 -DUSE_NANOSLEEP -DHOST_TIMER_GRANULARITY=20000 -DCLASSPATH=\"{}/app:\" -ggdb  -DO4F -D_REENTRANT -DFSROOT=\"/\" -DNATIVE_FP -DWONKA_INFO=\"" runtime classpath is {}/app:; using host OS filesystem, with virtual root at /\; no Java5 support\; with JDWP enabled\; using own hacks to call native code\; using the host OS network facilities\; no security\; using native floating-point\; using all-java math functions\; minimal Unicode support\; no recycling of native threads\; no javax.comm\; "\" -DTEST_INFO=\"" generating tests for Mauve and for the VisualTestEngine. "\" -DAWT_INFO=\"" no AWT\; "\" -DO4F_INFO=\"" hello world "\" -DBUILD_HOST=\"" <unknown> "\" -I /home/chris/open-mika-freertos/core-vm/include -I /home/chris/open-mika-freertos/core-vm/hal/cpu/esp32/include -I /home/chris/open-mika-freertos/vm-cmp/kernel/o4f/include -I /home/chris/open-mika-freertos/vm-cmp/kernel/common/include -I /home/chris/open-mika-freertos/vm-ext/jpda/jdwp/include -nostdlib -DFREERTOS -I /home/chris/open-mika-freertos/core-vm/hal/hostos/freertos/include -I /home/chris/open-mika-freertos/build/esp32-s3/generated -L /home/chris/open-mika-freertos/build/esp32-s3/lib /home/chris/open-mika-freertos/build/esp32-s3/generated/core-classes.c

Who is online

Users browsing this forum: Bing [Bot], PerplexityBot and 2 guests