Merge branch 'bugfix/ulp_as_version_v4.2' into 'release/v4.2'

ulp: fix ULP assembler version detection for localized systems (v4.2)

See merge request espressif/esp-idf!10393
This commit is contained in:
Angus Gratton 2020-09-15 15:23:26 +08:00
commit a4c3aebc3d
2 changed files with 6 additions and 3 deletions

View File

@ -11,7 +11,7 @@ execute_process(
OUTPUT_VARIABLE as_output OUTPUT_VARIABLE as_output
ERROR_QUIET) ERROR_QUIET)
string(REGEX MATCH "GNU assembler \\(GNU Binutils\\) (${version_pattern})" as_version ${as_output}) string(REGEX MATCH "\\(GNU Binutils\\) (${version_pattern})" as_version ${as_output})
set(as_version ${CMAKE_MATCH_1}) set(as_version ${CMAKE_MATCH_1})
message(STATUS "Building ULP app ${ULP_APP_NAME}") message(STATUS "Building ULP app ${ULP_APP_NAME}")
@ -100,4 +100,4 @@ add_custom_target(build
${CMAKE_CURRENT_BINARY_DIR}/${ULP_APP_NAME}.h ${CMAKE_CURRENT_BINARY_DIR}/${ULP_APP_NAME}.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(${ULP_APP_NAME} -T${CMAKE_CURRENT_BINARY_DIR}/${ULP_LD_SCRIPT} -Map=${CMAKE_CURRENT_BINARY_DIR}/${ULP_APP_NAME}.map) target_link_libraries(${ULP_APP_NAME} -T${CMAKE_CURRENT_BINARY_DIR}/${ULP_LD_SCRIPT} -Map=${CMAKE_CURRENT_BINARY_DIR}/${ULP_APP_NAME}.map)

View File

@ -26,7 +26,10 @@ ULP_PREPROCESSOR_ARGS := \
# Check the assembler version # Check the assembler version
include $(IDF_PATH)/components/ulp/toolchain_ulp_version.mk include $(IDF_PATH)/components/ulp/toolchain_ulp_version.mk
ULP_AS_VER := $(shell $(ULP_AS) --version | sed -E -n 's|GNU assembler \(GNU Binutils\) ([a-z0-9\.-]+)|\1|gp') # $(ULP_AS) --version output might be localized, for example the first line could be
# "Ensamblador (GNU Binutils) 2.28.51-esp-20191205 de GNU" instead of
# "GNU assembler (GNU Binutils) 2.28.51-esp-20191205".
ULP_AS_VER := $(shell $(ULP_AS) --version | sed -E -n 's/.+ \(GNU Binutils\) ([a-z0-9\.-]+)( .*)?/\1/gp')
$(info Building ULP app $(ULP_APP_NAME)) $(info Building ULP app $(ULP_APP_NAME))
$(info ULP assembler version: $(ULP_AS_VER)) $(info ULP assembler version: $(ULP_AS_VER))