Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
easyblock = 'Bundle'

name = 'ROCm-LLVM'
_llvm_version = '20.0.0'
version = _llvm_version
_rocm_version = '7.0.0'
versionsuffix = f'-ROCm-{_rocm_version}'

homepage = 'https://github.com/ROCm/llvm-project'
description = """ROCm-LLVM is an open source Clang/LLVM based compiler.
It is an AMD Fork of The LLVM Compiler Infrastructure, and aims to contain all of upstream LLVM.
It also includes several AMD-specific additions in the llvm-project/amd directory."""
docurls = ['https://rocmdocs.amd.com']

toolchain = {'name': 'GCCcore', 'version': '14.3.0'}

builddependencies = [
('CMake', '3.31.8'),
('Perl', '5.40.2'),
('Python', '3.13.5'),
('pkgconf', '2.4.3'),
('xxd', '9.1.1775'), # required for ROCR-Runtime
]

dependencies = [
('binutils', '2.44'),
('elfutils', '0.193'),
('zlib', '1.3.1'),
('hwloc', '2.12.1'),
('GMP', '6.3.0'),
('libxml2', '2.14.3'),
('ncurses', '6.5'),
('libffi', '3.5.1'),
('libdrm', '2.4.125'),
('numactl', '2.0.19'),
('Z3', '4.15.1'),
]

local_rocm_llvm_source = 'llvm-project-rocm-%s.tar.gz' % _rocm_version
local_common_cmake_configopts = ' '.join([
'-DCMAKE_C_COMPILER=%(installdir)s/bin/clang',
'-DCMAKE_CXX_COMPILER=%(installdir)s/bin/clang++',
'-DLLVM_INSTALL_PREFIX=%(installdir)s',
'-DLLVM_DIR=%(installdir)s/lib/cmake/llvm',
])
# We are not able to build rocprofiler-register without building ROCR-Runtime first, so explicitly
# disable finding the package to avoid the system version from being picked up
local_rocr_cmake_configopts = ' -DBUILD_SHARED_LIBS=ON -DCMAKE_DISABLE_FIND_PACKAGE_rocprofiler-register=ON '


default_easyblock = 'CMakeMake'

default_component_specs = {
'source_urls': ['https://github.com/ROCm/%(name)s/archive/'],
'sources': [{
'download_filename': '%(version)s.tar.gz',
'filename': '%(name)s-%(version)s.tar.gz',
}],
'srcdir': '%(name)s-%(version)s',
}

components = [
('llvm-project', '%s-rocm-%s' % (_llvm_version, _rocm_version), {
'easyblock': 'EB_ROCm_minus_LLVM',
'sources': [{
'download_filename': 'rocm-%s.tar.gz' % _rocm_version,
'filename': local_rocm_llvm_source, # '%(name)s-%(version)s.tar.gz',
# rename the extracted directory to the one that the LLVM easyblock expects
'extract_cmd': 'tar xfz %%s && mv %%(name)s-rocm-%s %%(name)s-%%(version)s.src' % _rocm_version,
}],
# Automatically applies to the second LLVM build as well, as sources are reused
'patches': ['ROCm-LLVM-20.0.0_remove_termio_struct.patch'],
'start_dir': f'llvm-project-{_llvm_version}-rocm-{_rocm_version}.src',
'bootstrap': True,
'build_lld': True,
'build_clang_extras': True,
'build_openmp_offload': False,
'build_openmp_tools': True,
'build_runtimes': True,
'full_llvm': False,
'skip_all_tests': True,
}),
('ROCm-comgr', 'rocm-%s' % _rocm_version, {
# sources are located in amd/comgr subdir of llvm-project component
'sources': [{'filename': local_rocm_llvm_source, 'extract_cmd': 'echo %s'}],
'srcdir': 'llvm-project-%s-%%(version)s.src/amd/comgr' % _llvm_version,
'prebuildopts': 'export ROCM_PATH=%(installdir)s && ',
'configopts': local_common_cmake_configopts + ' -DROCM_DIR=%(installdir)s/share/rocm/cmake'
}),
('ROCR-Runtime', 'rocm-%s' % _rocm_version, {
'srcdir': '%(name)s-%(version)s',
'configopts': local_common_cmake_configopts + local_rocr_cmake_configopts,
}),
('llvm-project-openmp', '%s-rocm-%s' % (_llvm_version, _rocm_version), {
'easyblock': 'EB_ROCm_minus_LLVM',
'sources': [{
'download_filename': 'rocm-%s.tar.gz' % _rocm_version,
'filename': local_rocm_llvm_source,
'extract_cmd': 'echo %s',
}],
'start_dir': f'llvm-project-{_llvm_version}-rocm-{_rocm_version}.src',
'bootstrap': True,
'build_lld': True,
'build_clang_extras': True,
'build_openmp_offload': True,
'build_openmp_tools': True,
'build_runtimes': True,
'full_llvm': False,
'skip_all_tests': True,
}),
('aomp-extras', 'rocm-%s' % _rocm_version, {
'configopts':
local_common_cmake_configopts +
' -DAOMP_STANDALONE_BUILD=0 '
'-DAOMP_VERSION_STRING=%s ' % _rocm_version
}),
]

sanity_check_components = ['llvm-project']

modextravars = {
'HIP_DEVICE_LIB_PATH': '%(installdir)s/amdgcn/bitcode',
}

moduleclass = 'tools'
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
From 83bf10fffd7065317d50f19e138c9e9fd6adc064 Mon Sep 17 00:00:00 2001
From: Tom Stellard <[email protected]>
Date: Fri, 25 Apr 2025 14:49:34 -0700
Subject: [PATCH] [sanitizer_common] Remove interceptors for deprecated struct
termio

This struct will be removed from glibc-2.42 and has been deprecated for
a very long time.

Fixes #137321
---
.../sanitizer_common_interceptors_ioctl.inc | 8 --------
.../sanitizer_common/sanitizer_platform_limits_posix.cpp | 3 ---
.../sanitizer_common/sanitizer_platform_limits_posix.h | 1 -
3 files changed, 12 deletions(-)

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
index f88f914b1d149..bc8f02826c614 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
@@ -342,17 +342,9 @@ static void ioctl_table_fill() {
_(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int));
_(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int));
_(TCFLSH, NONE, 0);
-#if SANITIZER_GLIBC
- _(TCGETA, WRITE, struct_termio_sz);
-#endif
_(TCGETS, WRITE, struct_termios_sz);
_(TCSBRK, NONE, 0);
_(TCSBRKP, NONE, 0);
-#if SANITIZER_GLIBC
- _(TCSETA, READ, struct_termio_sz);
- _(TCSETAF, READ, struct_termio_sz);
- _(TCSETAW, READ, struct_termio_sz);
-#endif
_(TCSETS, READ, struct_termios_sz);
_(TCSETSF, READ, struct_termios_sz);
_(TCSETSW, READ, struct_termios_sz);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index b4d87ab6228e5..7a89bf1c74985 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -494,9 +494,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
unsigned struct_input_id_sz = sizeof(struct input_id);
unsigned struct_mtpos_sz = sizeof(struct mtpos);
unsigned struct_rtentry_sz = sizeof(struct rtentry);
-#if SANITIZER_GLIBC || SANITIZER_ANDROID
- unsigned struct_termio_sz = sizeof(struct termio);
-#endif
unsigned struct_vt_consize_sz = sizeof(struct vt_consize);
unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes);
unsigned struct_vt_stat_sz = sizeof(struct vt_stat);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 348bb4f27aec3..fdc52aa56c493 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -1063,7 +1063,6 @@ extern unsigned struct_hd_geometry_sz;
extern unsigned struct_input_absinfo_sz;
extern unsigned struct_input_id_sz;
extern unsigned struct_mtpos_sz;
-extern unsigned struct_termio_sz;
extern unsigned struct_vt_consize_sz;
extern unsigned struct_vt_sizes_sz;
extern unsigned struct_vt_stat_sz;
Loading