From edd7c1a2eef6c9ae61c026765fce66db63c08140 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Wed, 9 Sep 2020 10:11:29 +0200 Subject: [PATCH] ulp: fix ULP assembler version detection for localized systems --- components/ulp/cmake/CMakeLists.txt | 4 ++-- components/ulp/component_ulp_common.mk | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/ulp/cmake/CMakeLists.txt b/components/ulp/cmake/CMakeLists.txt index f1bfd770df..cd7f51a05f 100644 --- a/components/ulp/cmake/CMakeLists.txt +++ b/components/ulp/cmake/CMakeLists.txt @@ -13,7 +13,7 @@ execute_process( OUTPUT_VARIABLE as_output 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}) @@ -143,4 +143,4 @@ add_custom_target(build ${CMAKE_CURRENT_BINARY_DIR}/${ULP_APP_NAME}.h WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(${ULP_APP_NAME} -T${CMAKE_CURRENT_BINARY_DIR}/${ULP_LD_SCRIPT} ${EXTRA_LINKER_ARGS}) \ No newline at end of file +target_link_libraries(${ULP_APP_NAME} -T${CMAKE_CURRENT_BINARY_DIR}/${ULP_LD_SCRIPT} ${EXTRA_LINKER_ARGS}) diff --git a/components/ulp/component_ulp_common.mk b/components/ulp/component_ulp_common.mk index a4174d1e1d..cf6292998f 100644 --- a/components/ulp/component_ulp_common.mk +++ b/components/ulp/component_ulp_common.mk @@ -26,7 +26,10 @@ ULP_PREPROCESSOR_ARGS := \ # Check the assembler version 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 ULP assembler version: $(ULP_AS_VER))