diff --git a/.github/workflows/root-ci-config/buildconfig/fedora44-clang_libcxx.txt b/.github/workflows/root-ci-config/buildconfig/fedora44-clang_libcxx.txt new file mode 100644 index 0000000000000..439578254e761 --- /dev/null +++ b/.github/workflows/root-ci-config/buildconfig/fedora44-clang_libcxx.txt @@ -0,0 +1,38 @@ +# Build ROOT with Clang and libc++ instead of GNU libstdc++ on Linux. +# The Fedora 44 image provides clang and libcxx/libcxxabi-devel packages. +CMAKE_C_COMPILER=clang +CMAKE_CXX_COMPILER=clang++ +CMAKE_GENERATOR=Ninja +CMAKE_CXX_STANDARD=20 +soversion=ON +libcxx=ON +davix=OFF +tpython=OFF +minuit2_omp=OFF +# All C++ dependencies must be built with the same toolchain: the ones +# shipped by the distribution are compiled with libstdc++ and are ABI +# incompatible with a libc++ ROOT build. +builtin_civetweb=ON +builtin_fftw3=ON +builtin_freetype=ON +builtin_ftgl=ON +builtin_gif=ON +builtin_gl2ps=ON +builtin_gtest=ON +builtin_gsl=ON +builtin_jpeg=ON +builtin_lz4=ON +builtin_lzma=ON +builtin_nlohmann=ON +builtin_pcre=ON +builtin_png=ON +builtin_tbb=ON +builtin_tiff=ON +builtin_unuran=ON +builtin_vdt=ON +builtin_xrootd=ON +builtin_xxhash=ON +builtin_zlib=ON +builtin_zstd=ON +test_distrdf_dask=OFF +test_distrdf_pyspark=OFF diff --git a/.github/workflows/root-ci.yml b/.github/workflows/root-ci.yml index 0af636192a117..ace11ab1be0c1 100644 --- a/.github/workflows/root-ci.yml +++ b/.github/workflows/root-ci.yml @@ -430,6 +430,11 @@ jobs: is_special: true property: "clang Ninja builtins auto-registration off" overrides: ["CMAKE_CXX_STANDARD=20"] + # Fedora 44 with Clang and libc++ instead of GNU libstdc++ + - image: fedora44 + platform_config: fedora44-clang_libcxx + is_special: true + property: "clang Ninja libc++" # Asan build - image: alma10 platform_config: alma10-asan diff --git a/interpreter/cling/lib/Interpreter/CMakeLists.txt b/interpreter/cling/lib/Interpreter/CMakeLists.txt index 0474f07d9892a..8aab15bac107d 100644 --- a/interpreter/cling/lib/Interpreter/CMakeLists.txt +++ b/interpreter/cling/lib/Interpreter/CMakeLists.txt @@ -264,11 +264,19 @@ if (UNIX) endif() endif() + # If CMAKE_CXX_FLAGS selects the C++ standard library (e.g. -stdlib=libc++ + # with a clang that defaults to libstdc++), cling has to look up the headers + # of that library, not the ones of the compiler default. + string(REGEX MATCH "-stdlib=[^ ]+" cling_cxx_stdlib "${CMAKE_CXX_FLAGS}") + if (cling_cxx_stdlib AND CLING_CXX_RLTV) + set(CLING_CXX_RLTV "${CLING_CXX_RLTV} ${cling_cxx_stdlib}") + endif() + if(NOT CLING_CXX_HEADERS) if (CLING_CXX_PATH) - execute_process(COMMAND ${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS} -xc++ -E -v /dev/null + execute_process(COMMAND ${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS} ${cling_cxx_stdlib} -xc++ -E -v /dev/null OUTPUT_QUIET ERROR_VARIABLE CLING_CXX_HEADERS) - set(CLING_CXX_PATH "${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS}") + set(CLING_CXX_PATH "${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS} ${cling_cxx_stdlib}") else() # convert CMAKE_CXX_FLAGS to a list for execute_process string(REPLACE "-fdiagnostics-color=always" "" cling_tmp_arg_list ${CMAKE_CXX_FLAGS})