diff --git a/cmake/AwsPrebuildDependency.cmake b/cmake/AwsPrebuildDependency.cmake index d75499c38..193ac8fb6 100644 --- a/cmake/AwsPrebuildDependency.cmake +++ b/cmake/AwsPrebuildDependency.cmake @@ -25,11 +25,14 @@ function(aws_prebuild_dependency) set(depInstallDir ${depBinaryDir}/install) file(MAKE_DIRECTORY ${depBinaryDir}) + # Convert prefix path from list to escaped string, to be passed on command line + string(REPLACE ";" "\\\\;" ESCAPED_PREFIX_PATH "${CMAKE_PREFIX_PATH}") # For execute_process to accept a dynamically constructed command, it should be passed in a list format. - set(cmakeCommand "COMMAND" "${CMAKE_COMMAND}") + + set(cmakeCommand "${CMAKE_COMMAND}") list(APPEND cmakeCommand ${AWS_PREBUILD_SOURCE_DIR}) list(APPEND cmakeCommand -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) - list(APPEND cmakeCommand -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}) + list(APPEND cmakeCommand -DCMAKE_PREFIX_PATH=${ESCAPED_PREFIX_PATH}) list(APPEND cmakeCommand -DCMAKE_INSTALL_PREFIX=${depInstallDir}) list(APPEND cmakeCommand -DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}) list(APPEND cmakeCommand -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}) @@ -39,11 +42,13 @@ function(aws_prebuild_dependency) list(APPEND cmakeCommand ${AWS_PREBUILD_CMAKE_ARGUMENTS}) endif() - list(APPEND cmakeCommand WORKING_DIRECTORY ${depBinaryDir}) - list(APPEND cmakeCommand RESULT_VARIABLE result) - # Configure dependency project. - execute_process(${cmakeCommand}) + execute_process( + COMMAND ${cmakeCommand} + WORKING_DIRECTORY ${depBinaryDir} + RESULT_VARIABLE result + ) + if (NOT ${result} EQUAL 0) message(FATAL_ERROR "Configuration failed for dependency project ${AWS_PREBUILD_DEPENDENCY_NAME}") endif() diff --git a/cmake/AwsSIMD.cmake b/cmake/AwsSIMD.cmake index 753e53397..c9bb3c155 100644 --- a/cmake/AwsSIMD.cmake +++ b/cmake/AwsSIMD.cmake @@ -19,6 +19,7 @@ else() set(AWS_CLMUL_FLAG "-mpclmul") set(AWS_SSE4_2_FLAG "-msse4.2") + # AWS Graviton3 processors use neoverse-v1 check_c_compiler_flag("-mtune=neoverse-v1" HAVE_MTUNE_NEOVERSE_V1) if (HAVE_MTUNE_NEOVERSE_V1) set(AWS_ARMv8_1_FLAG "-march=armv8-a+crc+crypto -mtune=neoverse-v1") @@ -58,7 +59,7 @@ if (USE_CPU_EXTENSIONS) _mm256_permutevar8x32_epi32(vec, vec); return 0; - }" AWS_HAVE_AVX2_INTRINSICS) + }" AWS_HAVE_AVX2_INTRINSICS) check_c_source_compiles(" #include diff --git a/include/aws/common/condition_variable.h b/include/aws/common/condition_variable.h index 82431dd4f..a4eb1bdfe 100644 --- a/include/aws/common/condition_variable.h +++ b/include/aws/common/condition_variable.h @@ -69,14 +69,17 @@ AWS_COMMON_API int aws_condition_variable_notify_all(struct aws_condition_variable *condition_variable); /** - * Waits the calling thread on a notification from another thread. + * Waits the calling thread on a notification from another thread. This function must be called with the mutex locked + * by the calling thread otherwise the behavior is undefined. Spurious wakeups can occur and to avoid this causing + * any problems use the _pred version of this function. */ AWS_COMMON_API int aws_condition_variable_wait(struct aws_condition_variable *condition_variable, struct aws_mutex *mutex); /** * Waits the calling thread on a notification from another thread. If predicate returns false, the wait is reentered, - * otherwise control returns to the caller. + * otherwise control returns to the caller. This function must be called with the mutex locked by the calling thread + * otherwise the behavior is undefined. */ AWS_COMMON_API int aws_condition_variable_wait_pred( @@ -87,7 +90,8 @@ int aws_condition_variable_wait_pred( /** * Waits the calling thread on a notification from another thread. Times out after time_to_wait. time_to_wait is in - * nanoseconds. + * nanoseconds. This function must be called with the mutex locked by the calling thread otherwise the behavior is + * undefined. Spurious wakeups can occur and to avoid this causing any problems use the _pred version of this function. */ AWS_COMMON_API int aws_condition_variable_wait_for( @@ -97,7 +101,8 @@ int aws_condition_variable_wait_for( /** * Waits the calling thread on a notification from another thread. Times out after time_to_wait. time_to_wait is in - * nanoseconds. If predicate returns false, the wait is reentered, otherwise control returns to the caller. + * nanoseconds. If predicate returns false, the wait is reentered, otherwise control returns to the caller. This + * function must be called with the mutex locked by the calling thread otherwise the behavior is undefined. */ AWS_COMMON_API int aws_condition_variable_wait_for_pred(