From f8d72c8fa902f1d9ef19db24ddafbf81852b69ee Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 17 Oct 2020 12:31:40 +0100 Subject: [PATCH] MUSL stack size (#4995) --- CMake/Fixups.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMake/Fixups.cmake b/CMake/Fixups.cmake index f671bd6ac..ffe098f6c 100644 --- a/CMake/Fixups.cmake +++ b/CMake/Fixups.cmake @@ -4,4 +4,12 @@ function(emit_fixups) # https://tls.mbed.org/kb/development/arm-thumb-error-r7-cannot-be-used-in-asm-here target_compile_options(mbedcrypto PRIVATE -fomit-frame-pointer) endif() + + if(UNIX) + execute_process(COMMAND ldd OUTPUT_VARIABLE LDD_OUTPUT ERROR_VARIABLE LDD_OUTPUT) + if (LDD_OUTPUT MATCHES musl) + # Bring musl stack size in line with other platforms: + target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,stack-size=1048576") + endif() + endif() endfunction()