Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions root-llvm-cxx17.patch
Original file line number Diff line number Diff line change
@@ -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 )
2 changes: 2 additions & 0 deletions root.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions scram-tools.file/tools/gcc/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down