2025-04-20 16:07:24 +00:00
committed by Git OBS Bridge
parent e7234ca4ae
commit eb992419cf
3 changed files with 76 additions and 25 deletions

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dca1c145a23f05229d5d646241f9d1d3c5dbf1d745b338ae020eabe33beb965c
size 218887266

View File

@@ -51,6 +51,9 @@ sed -i -f pm.sed amd/hipcc/bin/hipvars.pm
echo "s@hipClangPath /= \"lib/llvm/bin\"@hipClangPath = \"${LLVM_BINDIR}\"@" > h.sed
sed -i -f h.sed amd/hipcc/src/hipBin_amd.h
# Fix up the path to the device libs hipcc uses
sed -i -e 's@amdgcnBitcode = roccmPath@amdgcnBitcode = "%{_prefix}/%{amd_device_libs_prefix}/"@' amd/hipcc/src/hipBin_amd.h
# Fix up the location AMD_DEVICE_LIBS_PREFIX
sed -i 's|@AMD_DEVICE_LIBS_PREFIX_CODE@|set(AMD_DEVICE_LIBS_PREFIX "%{_prefix}/%{amd_device_libs_prefix}")|' amd/device-libs/AMDDeviceLibsConfig.cmake.in
@@ -77,3 +80,10 @@ sed -i -e 's@D.SysRoot + "/opt/rocm"@D.SysRoot + "/usr"@' clang/lib/Driver/ToolC
# Policy CMP0053 may not be set to OLD behavior because this version of CMake no longer supports it.
sed -i -e 's@cmake_policy(SET CMP0053 OLD)@#cmake_policy(SET CMP0053 OLD)@' amd/device-libs/cmake/OCL.cmake
# gcc 15 include cstdint
sed -i '/#include <memory*/a#include <cstdint>' llvm/include/llvm/ADT/SmallVector.h
sed -i '/#include <memory*/a#include <cstdint>' llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
# ConstantFolding.cpp:2129:16: error: no matching function for call to 'ConstantFoldFP128'
# signature of function is wrong
sed -i -e 's@long double@float128@g' llvm/lib/Analysis/ConstantFolding.cpp

View File

@@ -1,15 +1,15 @@
# The package follows LLVM's major version, but API version is still important:
%global comgr_maj_api_ver 2
%global comgr_maj_api_ver 3
# local, fedora
%global _comgr_full_api_ver %{comgr_maj_api_ver}.8
%global _comgr_full_api_ver %{comgr_maj_api_ver}.0
# mock, suse
%global comgr_full_api_ver %{comgr_maj_api_ver}.8.0
%global comgr_full_api_ver %{comgr_maj_api_ver}.0.0
# Upstream tags are based on rocm releases:
%global rocm_release 6.3
%global rocm_patch 2
%global rocm_release 6.4
%global rocm_patch 0
%global rocm_version %{rocm_release}.%{rocm_patch}
# What LLVM is upstream using (use LLVM_VERSION_MAJOR from llvm/CMakeLists.txt):
%global llvm_maj_ver 18
%global llvm_maj_ver 19
%global upstreamname llvm-project
%bcond_without bundled_llvm
@@ -37,8 +37,8 @@
# Compression type and level for source/binary package payloads.
# "w7T0.xzdio" xz level 7 using %%{getncpus} threads
%define _source_payload w7T0.xzdio
%define _binary_payload w7T0.xzdio
%global _source_payload w7T0.xzdio
%global _binary_payload w7T0.xzdio
%else
# Used to tell cmake where to install device libs (must be relative to prefix)
@@ -61,7 +61,7 @@
Name: rocm-compilersupport
Version: %{llvm_maj_ver}
Release: 43.rocm%{rocm_version}%{?dist}
Release: 3.rocm%{rocm_version}%{?dist}
Summary: Various AMD ROCm LLVM related services
%if 0%{?suse_version}
Group: Development/Languages/Other
@@ -75,12 +75,11 @@ Source1: rocm-compilersupport.prep.in
Patch3: 0001-Remove-err_drv_duplicate_config-check.patch
Patch4: 0001-Replace-use-of-mktemp-with-mkstemp.patch
# https://github.com/llvm/llvm-project/issues/106521
Patch5: 0001-Fix-build-with-GCC-14-on-ARM-78704.patch
# Subject: [PATCH] [gold] Fix compilation (#130334)
Patch5: %{url}/commit/b0baa1d8bd68a2ce2f7c5f2b62333e410e9122a1.patch
# Link comgr with static versions of llvm's libraries
Patch6: 0001-comgr-link-with-static-llvm.patch
# For gcc-15
Patch7: 0001-gcc-15-cstdint-needs-to-include.patch
Patch8: 0001-rocm-llvm-work-around-new-assert-in-array.patch
BuildRequires: cmake
@@ -162,7 +161,7 @@ libraries in the form of bit code. Specifically:
# 15.6
# rocm-comgr.x86_64: E: shlib-policy-name-error (Badness: 10000) libamd_comgr2
# Your package contains a single shared library but is not named after its SONAME.
%global comgr_name libamd_comgr2
%global comgr_name libamd_comgr3
%else
%global comgr_name rocm-comgr
%endif
@@ -406,6 +405,7 @@ sed -i -e 's@sys::path::append(LLVMPath, "llvm");@//sys::path::append(LLVMPath,
# Fixup finding /opt/rocm/hip
sed -i -e 's@sys::path::append(HIPPath, "hip");@//sys::path::append(HIPPath, "hip");@' amd/comgr/src/comgr-env.cpp
%if %{without bundled_llvm}
# Tests known to fail with upstream LLVM (as opposed to the bundled llvm):
sed -i -e "/add_isa_test(fract/d" \
-e "/add_isa_test(frexp/d" \
@@ -414,6 +414,7 @@ sed -i -e "/add_comgr_test(compile_source_with_device_libs_to_bc_test/d" \
-e "/add_comgr_test(name_expression_map_test/d" \
-e "/add_comgr_test(nested_kernel_test/d" \
amd/comgr/test/CMakeLists.txt
%endif
# Fix script shebang (Fedora doesn't allow using "env"):
sed -i -e 's@env perl@perl@' amd/hipcc/bin/hipcc
@@ -448,6 +449,9 @@ sed -i 's|@AMD_DEVICE_LIBS_PREFIX_CODE@|set(AMD_DEVICE_LIBS_PREFIX "%{_prefix}/%
%else
#Force static linking of libclang in comgr
sed -i "s/TARGET clangFrontendTool/true/" amd/comgr/CMakeLists.txt
install -pm 755 %{SOURCE1} prep.sh
sed -i -e 's@%%{_prefix}@%{_prefix}@' prep.sh
sed -i -e 's@%%{_lib}@%{_lib}@' prep.sh
@@ -523,7 +527,7 @@ if [ "$LINK_JOBS" -lt "$JOBS" ]; then
JOBS=$LINK_JOBS
fi
%global llvm_projects "llvm;clang;clang-tools-extra;lld"
%global llvm_projects "clang;clang-tools-extra;lld"
%global llvm_runtimes "compiler-rt;libcxx;libcxxabi"
p=$PWD
@@ -541,6 +545,7 @@ p=$PWD
-DCMAKE_INSTALL_DO_STRIP=ON \\\
-DCMAKE_INSTALL_PREFIX=%{bundle_prefix} \\\
-DCOMPILER_RT_BUILD_BUILTINS=ON \\\
-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF \\\
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF \\\
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \\\
-DCOMPILER_RT_BUILD_MEMPROF=OFF \\\
@@ -565,6 +570,7 @@ p=$PWD
-DLLVM_INCLUDE_EXAMPLES=OFF \\\
-DLLVM_INCLUDE_TESTS=OFF \\\
-DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \\\
-DLLVM_TOOL_GOLD_BUILD=ON \\\
-DLLVM_TOOL_LLVM_AS_FUZZER_BUILD=OFF \\\
-DLLVM_TOOL_LLVM_DIS_FUZZER_BUILD=OFF \\\
-DLLVM_TOOL_LLVM_DLANG_DEMANGLE_FUZZER_BUILD=OFF \\\
@@ -754,13 +760,13 @@ pushd .
# cmake produces a link.txt that includes libLLVM*.so, hack it out
%if 0%{?suse_version}
sed -i -e 's@libLLVM-%{llvm_maj_ver}git.so@libLLVMCore.a@' CMakeFiles/amd_comgr.dir/link.txt
sed -i -e 's@libLLVM.so.19.0git@libLLVMCore.a@' CMakeFiles/amd_comgr.dir/link.txt
# Order of link is wrong include some missing libs
sed -i -e 's@-lm -lrt@-lLLVMCoverage -lLLVMFrontendDriver -lLLVMFrontendHLSL -lLLVMLTO -lLLVMOption -lLLVMSymbolize -lLLVMWindowsDriver -lm -lrt@' CMakeFiles/amd_comgr.dir/link.txt
sed -i -e 's@-lrt -lm@-lLLVMCoverage -lLLVMFrontendDriver -lLLVMFrontendHLSL -lLLVMLTO -lLLVMOption -lLLVMSymbolize -lLLVMWindowsDriver -lrt -lm@' CMakeFiles/amd_comgr.dir/link.txt
%else
sed -i -e 's@libLLVM-%{llvm_maj_ver}git.so@libLLVMCore.a@' build-comgr/CMakeFiles/amd_comgr.dir/link.txt
sed -i -e 's@libLLVM.so.19.0git@libLLVMCore.a@' build-comgr/CMakeFiles/amd_comgr.dir/link.txt
# Order of link is wrong include some missing libs
sed -i -e 's@-lm -lrt@-lLLVMCoverage -lLLVMFrontendDriver -lLLVMFrontendHLSL -lLLVMLTO -lLLVMOption -lLLVMSymbolize -lLLVMWindowsDriver -lm -lrt@' build-comgr/CMakeFiles/amd_comgr.dir/link.txt
sed -i -e 's@-lrt -lm@-lLLVMCoverage -lLLVMFrontendDriver -lLLVMFrontendHLSL -lLLVMLTO -lLLVMOption -lLLVMSymbolize -lLLVMWindowsDriver -lrt -lm@' build-comgr/CMakeFiles/amd_comgr.dir/link.txt
%endif
%cmake_build -j ${JOBS}
@@ -772,8 +778,8 @@ popd
%endif
%if %{without bundled_llvm}
%check
%if %{without bundled_llvm}
pushd amd/device-libs
# Workaround for bug in cmake tests not finding amdgcn:
ln -s %{amd_device_libs_prefix}/amdgcn %__cmake_builddir/amdgcn
@@ -794,7 +800,20 @@ ln -s %{_bindir}/clang++-%{llvm_maj_ver} $ROCM_PATH/bin
touch $ROCM_PATH/bin/rocm_agent_enumerator
chmod a+x $ROCM_PATH/bin/rocm_agent_enumerator
amd/hipcc/%__cmake_builddir/hipcc -c t.hip
%else
%if 0%{?suse_version}
%define __sourcedir amd/device-libs
%define __builddir build-devicelibs
%else
%define _vpath_srcdir amd/device-libs
%define _vpath_builddir build-devicelibs
%endif
pushd .
# Workaround for bug in cmake tests not finding amdgcn:
ln -s %{amd_device_libs_prefix}/amdgcn build-devicelibs/amdgcn
%ctest
popd
%endif
%install
@@ -1095,6 +1114,7 @@ rm %{buildroot}%{_bindir}/hip*.pl
%files -n rocm-llvm-libs
%{bundle_prefix}/lib/libLLVM-*.so
%{bundle_prefix}/lib/libLLVM.so.*
%{bundle_prefix}/lib/libLTO.so.*
%{bundle_prefix}/lib/libRemarks.so.*
@@ -1109,12 +1129,10 @@ rm %{buildroot}%{_bindir}/hip*.pl
%{bundle_prefix}/bin/llc
%{bundle_prefix}/bin/lli
%{bundle_prefix}/bin/amdgpu-arch
%{bundle_prefix}/bin/amdgpu-offload-arch
%{bundle_prefix}/bin/dsymutil
%{bundle_prefix}/bin/llvm*
%{bundle_prefix}/bin/nvidia-arch
%{bundle_prefix}/bin/opt
%{bundle_prefix}/bin/offload-arch
%{bundle_prefix}/bin/reduce-chunk-list
%{bundle_prefix}/bin/sancov
%{bundle_prefix}/bin/sanstats
%{bundle_prefix}/bin/verify-uselistorder
@@ -1125,7 +1143,7 @@ rm %{buildroot}%{_bindir}/hip*.pl
%{bundle_prefix}/include/llvm/*
%{bundle_prefix}/include/llvm-c/*
%{bundle_prefix}/lib/cmake/llvm/*
%{bundle_prefix}/lib/libLLVM.so
%{bundle_prefix}/lib/libLLVM.so*
%{bundle_prefix}/lib/libLTO.so
%{bundle_prefix}/lib/libRemarks.so
%{bundle_prefix}/lib/LLVMgold.so
@@ -1156,6 +1174,7 @@ rm %{buildroot}%{_bindir}/hip*.pl
%{bundle_prefix}/bin/nvptx-arch
%{bundle_prefix}/bin/pp-trace
%{bundle_prefix}/share/clang/*
%{bundle_prefix}/share/clang-doc
%files -n rocm-clang-devel
%license clang/LICENSE.TXT
@@ -1171,7 +1190,7 @@ rm %{buildroot}%{_bindir}/hip*.pl
%files -n rocm-clang-tools-extra-devel
%license clang-tools-extra/LICENSE.TXT
%{bundle_prefix}/include/clang-tidy/
%{bundle_prefix}/include/clang-tidy/*
# ROCM LLD
%files -n rocm-lld
@@ -1187,6 +1206,8 @@ rm %{buildroot}%{_bindir}/hip*.pl
%license libcxx/LICENSE.TXT
%{bundle_prefix}/lib/libc++.so.*
%{bundle_prefix}/lib/libc++abi.so.*
%{bundle_prefix}/lib/libc++.modules.json
%{bundle_prefix}/share/libc++
%if 0%{?suse_version}
%post -n rocm-libc++ -p /sbin/ldconfig
@@ -1195,6 +1216,7 @@ rm %{buildroot}%{_bindir}/hip*.pl
%files -n rocm-libc++-devel
%{bundle_prefix}/include/c++/
%{bundle_prefix}/share/libc++/
%{bundle_prefix}/lib/libc++.so
%{bundle_prefix}/lib/libc++abi.so
@@ -1206,6 +1228,22 @@ rm %{buildroot}%{_bindir}/hip*.pl
%endif
%changelog
* Thu Apr 18 2025 Tom Rix <Tom.Rix@amd.com> - 19-3.rocm6.4.0
- Fix location of extras
* Thu Apr 17 2025 Tom Rix <Tom.Rix@amd.com> - 19-2.rocm6.4.0
- static link comgr
- fix tools extra
* Wed Apr 16 2025 Jeremy Newton <alexjnewt at hotmail dot com> - 19-1.rocm6.4.0
- Update to 6.4.0
* Tue Apr 08 2025 Dennis Gilmore <dennis@ausil.us> - 18-44.rocm6.3.2
- enable alt_arch in rawhide same as Fedora 42
* Tue Mar 11 2025 Tom Rix <Tom.Rix@amd.com> - 18-43.rocm6.3.2
- Workaround gcc 15 assert in array
* Fri Feb 28 2025 Tom Rix <Tom.Rix@amd.com> - 18-42.rocm6.3.2
- Do not use cmake CMP0053