diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 8eeffc769259bb..3e819071f6111c 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -401,9 +401,11 @@ if (CLR_CMAKE_HOST_UNIX) add_compile_options($<$:-Wno-stringop-truncation>) add_compile_options($<$:-Wno-placement-new>) - check_cxx_compiler_flag(-faligned-new COMPILER_SUPPORTS_F_ALIGNED_NEW) - if (COMPILER_SUPPORTS_F_ALIGNED_NEW) - add_compile_options($<$:-faligned-new>) + if (CMAKE_CXX_COMPILER_ID) + check_cxx_compiler_flag(-faligned-new COMPILER_SUPPORTS_F_ALIGNED_NEW) + if (COMPILER_SUPPORTS_F_ALIGNED_NEW) + add_compile_options($<$:-faligned-new>) + endif() endif() endif() diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index bc8803b8487085..89c31d95506fb3 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -21,6 +21,7 @@ parameters: # When set to true, passes the 'platforms' value as a job parameter also named 'platforms'. # Handled as an opt-in parameter to avoid excessive yaml. passPlatforms: false + container: '' jobParameters: {} variables: [] @@ -169,7 +170,10 @@ jobs: targetRid: linux-x64 platform: Linux_x64 container: - image: centos-7-20210714125435-9b5bbc2 + ${{ if eq(parameters.container, '') }}: + image: centos-7-20210714125435-9b5bbc2 + ${{ if ne(parameters.container, '') }}: + image: ${{ parameters.container }} registry: mcr jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index c85ddd293736e1..82312622baae1f 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -94,6 +94,7 @@ jobs: buildConfig: checked platforms: - Linux_x64 + container: debian-11-gcc11-amd64-20210916125744-f42d766 jobParameters: testGroup: innerloop compilerName: gcc diff --git a/src/coreclr/jit/CMakeLists.txt b/src/coreclr/jit/CMakeLists.txt index 8af142cf63fe9f..a3f8a99380e3df 100644 --- a/src/coreclr/jit/CMakeLists.txt +++ b/src/coreclr/jit/CMakeLists.txt @@ -3,8 +3,12 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories("./jitstd") include_directories("../inc") -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - add_compile_options(-Wno-error) # tracked by https://github.com/dotnet/runtime/issues/33541 +# gcc 10 and lower versions are too sensitive to bit fields width and warn from core compiler. +# Since there is no better / specific suppression available for these core warnings, we disable +# warn-as-error (-Werror) for JIT in this case. This issue has been fixed in gcc 11. +# See https://github.com/dotnet/runtime/issues/33541 +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0) + add_compile_options(-Wno-error) endif() function(create_standalone_jit)