diff --git a/root-llvm-cxx17.patch b/root-llvm-cxx17.patch new file mode 100644 index 00000000000..04962fdf0ed --- /dev/null +++ b/root-llvm-cxx17.patch @@ -0,0 +1,40 @@ +diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt +index de5056d..8f993f7 100644 +--- a/interpreter/CMakeLists.txt ++++ b/interpreter/CMakeLists.txt +@@ -229,6 +229,11 @@ if(builtin_llvm) + + set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "") + ++ # Always build LLVM with C++17. It is not necessary to compile with the same ++ # C++ standard as the rest of ROOT and sometimes it doesn't even work. ++ set(_cxx_standard ${CMAKE_CXX_STANDARD}) ++ set(CMAKE_CXX_STANDARD 17) ++ + #---Add the sub-directory excluding all the targets from all----------------------------------------- + if(CMAKE_GENERATOR MATCHES "Xcode") + add_subdirectory(llvm-project/llvm) +@@ -236,6 +241,8 @@ if(builtin_llvm) + add_subdirectory(llvm-project/llvm EXCLUDE_FROM_ALL) + endif() + ++ set(CMAKE_CXX_STANDARD ${_cxx_standard}) ++ + set(LLVM_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/interpreter/llvm-project/llvm/include + ${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/include + CACHE STRING "LLVM include directories." +@@ -446,7 +453,14 @@ else() + # Disable linking against shared LLVM + set(LLVM_LINK_LLVM_DYLIB OFF) + ++ # Always build LLVM with C++17. It is not necessary to compile with the same ++ # C++ standard as the rest of ROOT and sometimes it doesn't even work. ++ set(_cxx_standard ${CMAKE_CXX_STANDARD}) ++ set(CMAKE_CXX_STANDARD 17) ++ + add_subdirectory(llvm-project/clang EXCLUDE_FROM_ALL) ++ ++ set(CMAKE_CXX_STANDARD ${_cxx_standard}) + endif(builtin_clang) + + set( CLANG_BUILT_STANDALONE 1 ) diff --git a/root.spec b/root.spec index a5784445aca..231c9ca9f79 100644 --- a/root.spec +++ b/root.spec @@ -8,6 +8,7 @@ %define github_user cms-sw Source: git+https://github.com/%{github_user}/root.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz +Patch0: root-llvm-cxx17 BuildRequires: cmake ninja @@ -27,6 +28,7 @@ Requires: dcap %prep %setup -n %{n}-%{realversion} +%patch0 -p1 %get_config_sub graf2d/asimage/src/libAfterImage/config.sub %get_config_guess graf2d/asimage/src/libAfterImage/config.guess chmod +x graf2d/asimage/src/libAfterImage/config.{sub,guess} diff --git a/scram-tools.file/tools/gcc/env.sh b/scram-tools.file/tools/gcc/env.sh index aa78f591e37..a0af4ad49d9 100644 --- a/scram-tools.file/tools/gcc/env.sh +++ b/scram-tools.file/tools/gcc/env.sh @@ -43,6 +43,10 @@ GCC_CXXFLAGS="$GCC_CXXFLAGS -Xassembler --compress-debug-sections" #FIXME: GCC 12.2 workaround if [[ "$GCC_VERSION" =~ ^12\.[23]\. ]] ; then GCC_CXXFLAGS="$GCC_CXXFLAGS -Wno-error=array-bounds -Warray-bounds" +elif [[ "$GCC_VERSION" =~ ^13\. ]] ; then + GCC_CXXFLAGS="$GCC_CXXFLAGS -Wno-error=array-bounds -Warray-bounds" +elif [[ "$GCC_VERSION" =~ ^14\. ]] ; then + GCC_CXXFLAGS="$GCC_CXXFLAGS -Wno-error=array-bounds -Warray-bounds" fi # Explicitly use the GNU binutils ld.bfd linker