-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
275 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc | ||
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc | ||
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc | ||
@@ -370,15 +370,6 @@ | ||
|
||
#if SANITIZER_GLIBC | ||
// _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE | ||
- _(CYGETDEFTHRESH, WRITE, sizeof(int)); | ||
- _(CYGETDEFTIMEOUT, WRITE, sizeof(int)); | ||
- _(CYGETMON, WRITE, struct_cyclades_monitor_sz); | ||
- _(CYGETTHRESH, WRITE, sizeof(int)); | ||
- _(CYGETTIMEOUT, WRITE, sizeof(int)); | ||
- _(CYSETDEFTHRESH, NONE, 0); | ||
- _(CYSETDEFTIMEOUT, NONE, 0); | ||
- _(CYSETTHRESH, NONE, 0); | ||
- _(CYSETTIMEOUT, NONE, 0); | ||
_(EQL_EMANCIPATE, WRITE, struct_ifreq_sz); | ||
_(EQL_ENSLAVE, WRITE, struct_ifreq_sz); | ||
_(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz); | ||
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | ||
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | ||
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | ||
@@ -983,7 +983,6 @@ | ||
|
||
#if SANITIZER_LINUX && !SANITIZER_ANDROID | ||
extern unsigned struct_ax25_parms_struct_sz; | ||
-extern unsigned struct_cyclades_monitor_sz; | ||
extern unsigned struct_input_keymap_entry_sz; | ||
extern unsigned struct_ipx_config_data_sz; | ||
extern unsigned struct_kbdiacrs_sz; | ||
@@ -1328,15 +1327,6 @@ | ||
#endif // SANITIZER_LINUX | ||
|
||
#if SANITIZER_LINUX && !SANITIZER_ANDROID | ||
-extern unsigned IOCTL_CYGETDEFTHRESH; | ||
-extern unsigned IOCTL_CYGETDEFTIMEOUT; | ||
-extern unsigned IOCTL_CYGETMON; | ||
-extern unsigned IOCTL_CYGETTHRESH; | ||
-extern unsigned IOCTL_CYGETTIMEOUT; | ||
-extern unsigned IOCTL_CYSETDEFTHRESH; | ||
-extern unsigned IOCTL_CYSETDEFTIMEOUT; | ||
-extern unsigned IOCTL_CYSETTHRESH; | ||
-extern unsigned IOCTL_CYSETTIMEOUT; | ||
extern unsigned IOCTL_EQL_EMANCIPATE; | ||
extern unsigned IOCTL_EQL_ENSLAVE; | ||
extern unsigned IOCTL_EQL_GETMASTRCFG; | ||
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | ||
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | ||
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp | ||
@@ -143,7 +143,6 @@ | ||
# include <sys/procfs.h> | ||
#endif | ||
#include <sys/user.h> | ||
-#include <linux/cyclades.h> | ||
#include <linux/if_eql.h> | ||
#include <linux/if_plip.h> | ||
#include <linux/lp.h> | ||
@@ -460,7 +459,6 @@ | ||
|
||
#if SANITIZER_GLIBC | ||
unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct); | ||
- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor); | ||
#if EV_VERSION > (0x010000) | ||
unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry); | ||
#else | ||
@@ -824,15 +822,6 @@ | ||
#endif // SANITIZER_LINUX | ||
|
||
#if SANITIZER_LINUX && !SANITIZER_ANDROID | ||
- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH; | ||
- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT; | ||
- unsigned IOCTL_CYGETMON = CYGETMON; | ||
- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH; | ||
- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT; | ||
- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH; | ||
- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT; | ||
- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH; | ||
- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT; | ||
unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE; | ||
unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE; | ||
unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
|
||
import os | ||
|
||
from spack import * | ||
|
||
|
||
class LlvmAmdgpu(CMakePackage): | ||
"""Toolkit for the construction of highly optimized compilers, | ||
optimizers, and run-time environments.""" | ||
|
||
homepage = "https://github.com/RadeonOpenCompute/llvm-project" | ||
git = "https://github.com/RadeonOpenCompute/llvm-project.git" | ||
url = "https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-4.5.0.tar.gz" | ||
|
||
maintainers = ['srekolam', 'arjun-raj-kuppala', 'haampie'] | ||
|
||
version('master', branch='amd-stg-open') | ||
version('4.5.0', sha256='b71451bf26650ba06c0c5c4c7df70f13975151eaa673ef0cc77c1ab0000ccc97') | ||
version('4.3.1', sha256='b53c6b13be7d77dc93a7c62e4adbb414701e4e601e1af2d1e98da4ee07c9837f') | ||
version('4.3.0', sha256='1567d349cd3bcd2c217b3ecec2f70abccd5e9248bd2c3c9f21d4cdb44897fc87') | ||
version('4.2.0', sha256='751eca1d18595b565cfafa01c3cb43efb9107874865a60c80d6760ba83edb661') | ||
version('4.1.0', sha256='244e38d824fa7dfa8d0edf3c036b3c84e9c17a16791828e4b745a8d31eb374ae') | ||
version('4.0.0', sha256='aa1f80f429fded465e86bcfaef72255da1af1c5c52d58a4c979bc2f6c2da5a69') | ||
version('3.10.0', sha256='8262aff88c1ff6c4deb4da5a4f8cda1bf90668950e2b911f93f73edaee53b370') | ||
version('3.9.0', sha256='1ff14b56d10c2c44d36c3c412b190d3d8cd1bb12cfc7cd58af004c16fd9987d1') | ||
version('3.8.0', sha256='93a28464a4d0c1c9f4ba55e473e5d1cde4c5c0e6d087ec8a0a3aef1f5f5208e8') | ||
version('3.7.0', sha256='3e2542ce54b91b5c841f33d542143e0e43eae95e8785731405af29f08ace725b') | ||
version('3.5.0', sha256='4878fa85473b24d88edcc89938441edc85d2e8a785e567b7bd7ce274ecc2fd9c') | ||
|
||
variant('build_type', default='Release', values=("Release", "Debug", "RelWithDebInfo"), description='CMake build type') | ||
variant('rocm-device-libs', default=True, description='Build ROCm device libs as external LLVM project instead of a standalone spack package.') | ||
variant('openmp', default=True, description='Enable OpenMP') | ||
variant( | ||
"llvm_dylib", | ||
default=False, | ||
description="Build LLVM shared library, containing all " | ||
"components in a single shared library", | ||
) | ||
|
||
provides('libllvm@11', when='@3.5:3.8') | ||
provides('libllvm@12', when='@3.9:4.2') | ||
provides('libllvm@13', when='@4.3:') | ||
|
||
depends_on('cmake@3.4.3:', type='build', when='@:3.8') | ||
depends_on('cmake@3.13.4:', type='build', when='@3.9.0:') | ||
depends_on('python', type='build') | ||
depends_on('z3', type='link') | ||
depends_on('zlib', type='link') | ||
depends_on('ncurses+termlib', type='link') | ||
|
||
# openmp dependencies | ||
depends_on("perl-data-dumper", type=("build"), when='+openmp') | ||
depends_on("hwloc", when='+openmp') | ||
depends_on('libelf', type='link', when='+openmp') | ||
|
||
# Will likely only be fixed in LLVM 12 upstream | ||
patch('fix-system-zlib-ncurses.patch', when='@3.5.0:3.8.0') | ||
patch('fix-ncurses-3.9.0.patch', when='@3.9.0:4.0.0') | ||
|
||
# This is already fixed in upstream but not in 4.2.0 rocm release | ||
patch('fix-spack-detection-4.2.0.patch', when='@4.2.0:') | ||
|
||
conflicts('^cmake@3.19.0') | ||
|
||
root_cmakelists_dir = 'llvm' | ||
install_targets = ['clang-tidy', 'install'] | ||
|
||
# ADDED as hot fix for rse-ops containers, not present in spack | ||
# Remove cyclades support to build against newer kernel headers | ||
# https://reviews.llvm.org/D102059 | ||
patch('no_cyclades.patch') | ||
# patch('no_cyclades9.patch', when='@6:9') | ||
|
||
# Add device libs sources so they can be an external LLVM project | ||
for d_version, d_shasum in [ | ||
('4.5.0', '78412fb10ceb215952b5cc722ed08fa82501b5848d599dc00744ae1bdc196f77'), | ||
('4.3.1', 'a7291813168e500bfa8aaa5d1dccf5250764ddfe27535def01b51eb5021d4592'), | ||
('4.3.0', '055a67e63da6491c84cd45865500043553fb33c44d538313dd87040a6f3826f2'), | ||
('4.2.0', '34a2ac39b9bb7cfa8175cbab05d30e7f3c06aaffce99eed5f79c616d0f910f5f'), | ||
('4.1.0', 'f5f5aa6bfbd83ff80a968fa332f80220256447c4ccb71c36f1fbd2b4a8e9fc1b'), | ||
('4.0.0', 'd0aa495f9b63f6d8cf8ac668f4dc61831d996e9ae3f15280052a37b9d7670d2a'), | ||
('3.10.0', 'bca9291385d6bdc91a8b39a46f0fd816157d38abb1725ff5222e6a0daa0834cc'), | ||
('3.9.0', 'c99f45dacf5967aef9a31e3731011b9c142446d4a12bac69774998976f2576d7'), | ||
('3.8.0', 'e82cc9a8eb7d92de02cabb856583e28f17a05c8cf9c97aec5275608ef1a38574'), | ||
('3.7.0', 'b3a114180bf184b3b829c356067bc6a98021d52c1c6f9db6bc57272ebafc5f1d'), | ||
('3.5.0', 'dce3a4ba672c4a2da4c2260ee4dc96ff6dd51877f5e7e1993cb107372a35a378') | ||
]: | ||
resource( | ||
name='rocm-device-libs', | ||
placement='rocm-device-libs', | ||
url='https://github.com/RadeonOpenCompute/ROCm-Device-Libs/archive/rocm-{0}.tar.gz'.format(d_version), | ||
sha256=d_shasum, | ||
when='@{0} +rocm-device-libs'.format(d_version) | ||
) | ||
|
||
resource( | ||
name='rocm-device-libs', | ||
placement='rocm-device-libs', | ||
git='https://github.com/RadeonOpenCompute/ROCm-Device-Libs.git', | ||
branch='amd-stg-open', | ||
when='@master +rocm-device-libs' | ||
) | ||
|
||
def cmake_args(self): | ||
llvm_projects = [ | ||
'clang', | ||
'lld', | ||
'clang-tools-extra', | ||
'compiler-rt' | ||
] | ||
args = [] | ||
if self.spec.satisfies('@4.3.0:4.5.0'): | ||
llvm_projects.append('libcxx') | ||
llvm_projects.append('libcxxabi') | ||
|
||
args = [ | ||
self.define('LIBCXX_ENABLE_SHARED', 'OFF'), | ||
self.define('LIBCXX_ENABLE_STATIC', 'ON'), | ||
self.define('LIBCXX_INSTALL_LIBRARY', 'OFF'), | ||
self.define('LIBCXX_INSTALL_HEADERS', 'OFF'), | ||
self.define('LIBCXXABI_ENABLE_SHARED', 'OFF'), | ||
self.define('LIBCXXABI_ENABLE_STATIC', 'ON'), | ||
self.define('LIBCXXABI_INSTALL_STATIC_LIBRARY', 'OFF'), | ||
self.define('LLVM_ENABLE_Z3_SOLVER', 'OFF'), | ||
self.define('LLLVM_ENABLE_ZLIB', 'ON'), | ||
self.define('CLANG_DEFAULT_LINKER', 'lld'), | ||
] | ||
|
||
if '+openmp' in self.spec: | ||
llvm_projects.append('openmp') | ||
|
||
args.extend([self.define('LLVM_ENABLE_PROJECTS', ';'.join(llvm_projects))]) | ||
|
||
if self.spec.satisfies('@4.5.0:'): | ||
args.extend([self.define('PACKAGE_VENDOR', 'AMD')]) | ||
|
||
# Enable rocm-device-libs as a external project | ||
if '+rocm-device-libs' in self.spec: | ||
dir = os.path.join(self.stage.source_path, 'rocm-device-libs') | ||
args.extend([ | ||
self.define('LLVM_EXTERNAL_PROJECTS', 'device-libs'), | ||
self.define('LLVM_EXTERNAL_DEVICE_LIBS_SOURCE_DIR', dir) | ||
]) | ||
|
||
if '+llvm_dylib' in self.spec: | ||
cmake_args.append("-DLLVM_BUILD_LLVM_DYLIB:Bool=ON") | ||
|
||
# Get the GCC prefix for LLVM. | ||
if self.compiler.name == "gcc": | ||
compiler = Executable(self.compiler.cc) | ||
gcc_output = compiler('-print-search-dirs', output=str, error=str) | ||
|
||
gcc_prefix = "" | ||
for line in gcc_output.splitlines(): | ||
if line.startswith("install:"): | ||
# Get path and strip any whitespace | ||
# (causes oddity with ancestor) | ||
gcc_prefix = line.split(":")[1].strip() | ||
gcc_prefix = ancestor(gcc_prefix, 4) | ||
break | ||
args.append(self.define('GCC_INSTALL_PREFIX', gcc_prefix)) | ||
|
||
return args | ||
|
||
@run_after("install") | ||
def post_install(self): | ||
# TODO:Enabling LLVM_ENABLE_RUNTIMES for libcxx,libcxxabi did not build. | ||
# bootstraping the libcxx with the just built clang | ||
if self.spec.satisfies('@4.5.0:'): | ||
spec = self.spec | ||
define = CMakePackage.define | ||
libcxxdir = "build-bootstrapped-libcxx" | ||
with working_dir(libcxxdir, create=True): | ||
cmake_args = [ | ||
self.stage.source_path + "/libcxx", | ||
define("CMAKE_C_COMPILER", spec.prefix.bin + "/clang"), | ||
define("CMAKE_CXX_COMPILER", spec.prefix.bin + "/clang++"), | ||
define("CMAKE_INSTALL_PREFIX", spec.prefix), | ||
] | ||
cmake_args.extend(self.cmake_args()) | ||
cmake(*cmake_args) | ||
make() |