diff options
-rw-r--r-- | cmake/Functions.cmake | 21 | ||||
-rw-r--r-- | configure.cmake | 9 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 3 |
3 files changed, 33 insertions, 0 deletions
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() diff --git a/configure.cmake b/configure.cmake index d9711a034..30a423798 100644 --- a/configure.cmake +++ b/configure.cmake @@ -50,6 +50,9 @@ if(PkgConfig_FOUND) endif() #### Tests +if(LINUX) + check_for_ulimit() +endif() qt_config_compile_test(re2 LABEL "re2" @@ -493,3 +496,9 @@ qt_configure_add_report_entry( MESSAGE "Building fat libray with device and simulator architectures will disable NEON." CONDITION IOS AND simulator AND device AND QT_FEATURE_qtpdf_build ) +if(PRINT_BFD_LINKER_WARNING) + qt_configure_add_report_entry( + TYPE WARNING + MESSAGE "Using bfd linker requires at least 4096 open files limit" + ) +endif() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index e9f8fd01e..4cf7f9bf9 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -464,6 +464,9 @@ target_include_directories(WebEngineCore PRIVATE add_gn_build_aritfacts_to_target(WebEngineCore QtWebEngineCore core ${buildDir}) add_dependencies(WebEngineCore run_core_NinjaDone) +if(COIN_BUG_699) + set_property(TARGET WebEngineCore PROPERTY CXX_LINKER_LAUNCHER ${PROJECT_BINARY_DIR}/linker_ulimit.sh) +endif() ## # SANDBOX |