From c18a4d6f354838ea3edfb18d31007237dad08aa6 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 25 Aug 2021 11:22:04 +0200 Subject: Add workaround for not working linking with bfd linker Removal of external project removed also workaround for coin bug, which is still not fixed. Add linker launcher in case maximum number of open files is below 4096 on linux for WebEngineCore target. This launches bash script wrapper which sets ulimit. This is poor man workaround and requires cmake 3.21 to work. Task-number: COIN-699 Task-number: QTBUG-95590 Pick-to: 6.2 Change-Id: Ib9d0c4ced988d4692746e51f3abbe63ff5085836 Reviewed-by: Allan Sandfeld Jensen --- cmake/Functions.cmake | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'cmake/Functions.cmake') diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake index 36f554827..b7c386fc3 100644 --- a/cmake/Functions.cmake +++ b/cmake/Functions.cmake @@ -996,3 +996,24 @@ function(addCopyCommand target src dst) USES_TERMINAL ) endfunction() + +function(check_for_ulimit) + message("-- Checking 'ulimit -n'") + execute_process(COMMAND bash -c "ulimit -n" + OUTPUT_VARIABLE ulimitOutput + ) + string(REGEX MATCHALL "[0-9]+" limit "${ulimitOutput}") + message(" -- Open files limit ${limit}") + if(NOT (QT_FEATURE_use_gold_linker OR QT_FEATURE_use_lld_linker) AND ulimitOutput LESS 4096) + if(NOT ${CMAKE_VERSION} VERSION_LESS "3.21.0") + message(" -- Creating linker launcher") + file(GENERATE OUTPUT ${PROJECT_BINARY_DIR}/linker_ulimit.sh + CONTENT "#!/bin/bash\nulimit -n 4096\nexec \"$@\"" + FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + ) + set(COIN_BUG_699 ON PARENT_SCOPE) + else() + set(PRINT_BFD_LINKER_WARNING ON PARENT_SCOPE) + endif() + endif() +endfunction() -- cgit v1.2.3