uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
55
pkgs/development/compilers/llvm/14/lld/default.nix
Normal file
55
pkgs/development/compilers/llvm/14/lld/default.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ lib, stdenv, llvm_meta
|
||||
, buildLlvmTools
|
||||
, monorepoSrc, runCommand
|
||||
, cmake
|
||||
, libxml2
|
||||
, libllvm
|
||||
, version
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lld";
|
||||
inherit version;
|
||||
|
||||
# Blank llvm dir just so relative path works
|
||||
src = runCommand "${pname}-src-${version}" {} ''
|
||||
mkdir -p "$out"
|
||||
cp -r ${monorepoSrc}/cmake "$out"
|
||||
cp -r ${monorepoSrc}/${pname} "$out"
|
||||
mkdir -p "$out/libunwind"
|
||||
cp -r ${monorepoSrc}/libunwind/include "$out/libunwind"
|
||||
mkdir -p "$out/llvm"
|
||||
'';
|
||||
|
||||
sourceRoot = "${src.name}/${pname}";
|
||||
|
||||
patches = [
|
||||
./gnu-install-dirs.patch
|
||||
# On Darwin the llvm-config is perhaps not working fine as the
|
||||
# LLVM_MAIN_SRC_DIR is not getting set correctly, and the build fails as
|
||||
# the include path is not correct.
|
||||
./fix-root-src-dir.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ libllvm libxml2 ];
|
||||
|
||||
cmakeFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
||||
"-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
|
||||
];
|
||||
|
||||
outputs = [ "out" "lib" "dev" ];
|
||||
|
||||
meta = llvm_meta // {
|
||||
homepage = "https://lld.llvm.org/";
|
||||
description = "The LLVM linker (unwrapped)";
|
||||
longDescription = ''
|
||||
LLD is a linker from the LLVM project that is a drop-in replacement for
|
||||
system linkers and runs much faster than them. It also provides features
|
||||
that are useful for toolchain developers.
|
||||
The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS), and
|
||||
WebAssembly in descending order of completeness. Internally, LLD consists
|
||||
of several different linkers.
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 9bcc135665d0..d38679ed41e9 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -74,7 +74,7 @@ if(LLD_BUILT_STANDALONE)
|
||||
|
||||
set(LLVM_MAIN_INCLUDE_DIR "${MAIN_INCLUDE_DIR}" CACHE PATH "Path to llvm/include")
|
||||
set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
|
||||
- set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source tree")
|
||||
+ set(LLVM_MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" CACHE PATH "Path to LLVM source tree")
|
||||
|
||||
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
|
||||
NO_DEFAULT_PATH)
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
diff --git a/cmake/modules/AddLLD.cmake b/cmake/modules/AddLLD.cmake
|
||||
index dd2898ce6236..ebbea040ff54 100644
|
||||
--- a/cmake/modules/AddLLD.cmake
|
||||
+++ b/cmake/modules/AddLLD.cmake
|
||||
@@ -18,8 +18,8 @@ macro(add_lld_library name)
|
||||
install(TARGETS ${name}
|
||||
COMPONENT ${name}
|
||||
${export_to_lldtargets}
|
||||
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
|
||||
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
|
||||
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}"
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
|
||||
if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
@@ -62,5 +62,5 @@ endmacro()
|
||||
macro(add_lld_symlink name dest)
|
||||
add_llvm_tool_symlink(${name} ${dest} ALWAYS_GENERATE)
|
||||
# Always generate install targets
|
||||
- llvm_install_symlink(${name} ${dest} ALWAYS_GENERATE)
|
||||
+ llvm_install_symlink(${name} ${dest} ${CMAKE_INSTALL_FULL_BINDIR} ALWAYS_GENERATE)
|
||||
endmacro()
|
||||
Loading…
Add table
Add a link
Reference in a new issue