forked from rarias/jungle
Add wrapper stub
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
lib,
|
lib,
|
||||||
ninja,
|
ninja,
|
||||||
autoAddDriverRunpath,
|
autoAddDriverRunpath,
|
||||||
|
wrapCC,
|
||||||
cmake,
|
cmake,
|
||||||
emhash,
|
emhash,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
@@ -23,6 +24,8 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
llvmMajorVersion = "21";
|
||||||
version = "6.2.1";
|
version = "6.2.1";
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "intel";
|
owner = "intel";
|
||||||
@@ -188,6 +191,43 @@ stdenv.mkDerivation {
|
|||||||
(lib.cmakeBool "LIBCLC_NATIVECPU_HOST_TARGET" false)
|
(lib.cmakeBool "LIBCLC_NATIVECPU_HOST_TARGET" false)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch =
|
||||||
|
|
||||||
|
let
|
||||||
|
# See the postPatch phase for details on why this is used
|
||||||
|
ccWrapperStub = wrapCC (
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "ccWrapperStub";
|
||||||
|
dontUnpack = true;
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cat > $out/bin/clang-${llvmMajorVersion} <<'EOF'
|
||||||
|
#!/bin/sh
|
||||||
|
exec "$NIX_BUILD_TOP/source/build/bin/clang-${llvmMajorVersion}" "$@"
|
||||||
|
EOF
|
||||||
|
chmod +x $out/bin/clang-${llvmMajorVersion}
|
||||||
|
cp $out/bin/clang-${llvmMajorVersion} $out/bin/clang
|
||||||
|
cp $out/bin/clang-${llvmMajorVersion} $out/bin/clang++
|
||||||
|
'';
|
||||||
|
passthru.isClang = true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
in
|
||||||
|
''
|
||||||
|
# Parts of libdevice are built using the freshly-built compiler.
|
||||||
|
# As it tries to link to system libraries, we need to wrap it with the
|
||||||
|
# usual nix cc-wrapper.
|
||||||
|
# Since the compiler to be wrapped is not available at this point,
|
||||||
|
# we use a stub that points to where it will be later on
|
||||||
|
# in `$NIX_BUILD_TOP/source/build/bin/clang-${llvmMajorVersion}`
|
||||||
|
substituteInPlace libdevice/cmake/modules/SYCLLibdevice.cmake \
|
||||||
|
--replace-fail "\''${clang_exe}" "${ccWrapperStub}/bin/clang++"
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
inherit llvmMajorVersion;
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://github.com/intel/llvm";
|
homepage = "https://github.com/intel/llvm";
|
||||||
description = "Intel staging area for llvm.org contribution";
|
description = "Intel staging area for llvm.org contribution";
|
||||||
|
|||||||
Reference in New Issue
Block a user