From b9926a56350867e76db3d4e25b0db91e9001f968 Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Thu, 16 Sep 2021 21:35:27 +0300 Subject: [PATCH] Update gcc CI to use gcc-11 container (#59202) --- eng/native/configurecompiler.cmake | 8 +++++--- eng/pipelines/common/platform-matrix.yml | 6 +++++- eng/pipelines/runtime.yml | 1 + src/coreclr/jit/CMakeLists.txt | 8 ++++++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 8eeffc769259b..3e819071f6111 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 bc8803b848708..89c31d95506fb 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 c85ddd293736e..82312622baae1 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 8af142cf63fe9..a3f8a99380e3d 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)