Skip to content
Merged
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
22 changes: 22 additions & 0 deletions pkgs/development/compilers/llvm/20/libclc/use-default-paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From e8b910246d0c7c3d9fff994f71c6f8a48ec09a50 Mon Sep 17 00:00:00 2001
From: Tristan Ross <tristan.ross@midstall.com>
Date: Sat, 24 Aug 2024 19:56:24 -0700
Subject: [PATCH] [libclc] use default paths with find_program when possible

---
libclc/CMakeLists.txt | 4 ++--
1 file changed, 1 insertions(+), 1 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02bb859ae8590b..6bcd8ae52a5794 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,7 +55,7 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DI
# Import required tools
if( NOT EXISTS ${LIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR} )
foreach( tool IN ITEMS clang llvm-as llvm-link opt )
- find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
+ find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} )
set( ${tool}_exe ${LLVM_TOOL_${tool}} )
set( ${tool}_target )
endforeach()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--- a/libclc.pc.in
+++ b/libclc.pc.in
@@ -1,4 +1,4 @@
-libexecdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATADIR@/clc
+libexecdir=@CMAKE_INSTALL_FULL_DATADIR@/clc

Name: libclc
Description: Library requirements of the OpenCL C programming language
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ let
}
//
lib.optionalAttrs
(lib.versionAtLeast metadata.release_version "16" && lib.versionOlder metadata.release_version "20")
(lib.versionAtLeast metadata.release_version "16" && lib.versionOlder metadata.release_version "22")
{
libclc = callPackage ./libclc { };
}
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/llvm/common/libclc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: {
];

patches = [
./libclc-gnu-install-dirs.patch
(getVersionFile "libclc/gnu-install-dirs.patch")
]
# LLVM 19 changes how host tools are looked up.
# Need to remove NO_DEFAULT_PATH and the PATHS arguments for find_program
Expand Down Expand Up @@ -95,7 +95,7 @@ stdenv.mkDerivation (finalAttrs: {
ninja
python3
]
++ lib.optional (lib.versionAtLeast release_version "19") [
++ lib.optionals (lib.versionAtLeast release_version "19") [
clang-only
Comment on lines 96 to 99
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed like a typo to me, it caused buildInputs to eval as [..., [...]]. Kinda surprised that mkDerivation didn't complain about that

buildLlvmTools.llvm
spirv-llvm-translator
Expand Down
16 changes: 16 additions & 0 deletions pkgs/development/compilers/llvm/common/patches.nix
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,23 @@
"libclc/use-default-paths.patch" = [
{
after = "19";
before = "20";
path = ../19;
}
{
after = "20";
path = ../20;
}
];
"libclc/gnu-install-dirs.patch" = [
{
after = "16";
before = "21";
path = ../16;
}
{
after = "21";
path = ../21;
}
];
}
Loading