From be15f06f47b5690cf2ae7f3d0aa0ebebe4ae1a35 Mon Sep 17 00:00:00 2001 From: Davide Bettio Date: Thu, 29 Feb 2024 00:32:58 +0100 Subject: [PATCH] ESP32: enable jump tables for libAtomVM for xtensa devices Starting from a certain point jump tables are disabled since they are not compatible with moving code to IRAM. Enable that again for libAtomVM since we are not moving code to IRAM for it. See also: https://github.com/espressif/esp-idf/commit/c02aa6d0ae6599ec703c17afb3a774cfba0b1ee3 Signed-off-by: Davide Bettio --- src/platforms/esp32/components/libatomvm/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platforms/esp32/components/libatomvm/CMakeLists.txt b/src/platforms/esp32/components/libatomvm/CMakeLists.txt index f6d2923d4b..3803ed35eb 100644 --- a/src/platforms/esp32/components/libatomvm/CMakeLists.txt +++ b/src/platforms/esp32/components/libatomvm/CMakeLists.txt @@ -29,4 +29,7 @@ add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../../../../libAtomVM" "libAtomVM" target_link_libraries(${COMPONENT_LIB} INTERFACE libAtomVM "-u platform_nifs_get_nif" "-u platform_defaultatoms_init") +if ((IDF_VERSION_MAJOR GREATER_EQUAL 5) AND (${IDF_TARGET} MATCHES "^esp32$|esp32s2|esp32s3")) + target_compile_options("libAtomVM" PRIVATE "-fjump-tables -ftree-switch-conversion") +endif () target_compile_features(${COMPONENT_LIB} INTERFACE c_std_11)