mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
tools: Adds newlib nano support for clang builds
This commit is contained in:
parent
989cb33fe4
commit
893cc19f75
@ -658,9 +658,6 @@ build_clang_test_apps_esp32c2:
|
||||
extends:
|
||||
- .build_clang_test_apps_riscv
|
||||
- .rules:build:custom_test-esp32c2
|
||||
# spec files and nano libc are not supported yet by esp-clang
|
||||
# TODO: LLVM-197
|
||||
allow_failure: true
|
||||
variables:
|
||||
IDF_TARGET: esp32c2
|
||||
|
||||
|
@ -49,7 +49,19 @@ list(APPEND EXTRA_LINK_FLAGS "-u newlib_include_assert_impl")
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "${EXTRA_LINK_FLAGS}")
|
||||
|
||||
if(CONFIG_NEWLIB_NANO_FORMAT)
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "--specs=nano.specs")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(libc_dir_cmd ${CMAKE_C_COMPILER})
|
||||
string(REPLACE " " ";" cflags_list ${CMAKE_C_FLAGS})
|
||||
list(APPEND libc_dir_cmd ${cflags_list} "-print-file-name=libc.a")
|
||||
execute_process(
|
||||
COMMAND ${libc_dir_cmd}
|
||||
OUTPUT_VARIABLE libc_dir
|
||||
)
|
||||
get_filename_component(libc_dir ${libc_dir} DIRECTORY)
|
||||
target_link_directories(${COMPONENT_LIB} INTERFACE "${libc_dir}/nano")
|
||||
else()
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "--specs=nano.specs")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_subdirectory(port)
|
||||
|
Loading…
x
Reference in New Issue
Block a user