llvm: use more up-to-date upstream, build for riscv

This commit is contained in:
Sebastien Bourdeauducq 2019-04-06 21:25:34 +08:00
parent 52dbb6275f
commit 0ef16ba90c
1 changed files with 11 additions and 15 deletions

View File

@ -1,28 +1,24 @@
{ stdenv { stdenv
, fetchFromGitHub, runCommand , fetchurl, runCommand
, perl, groff, cmake, libxml2, python, libffi, valgrind , perl, groff, cmake, libxml2, python, libffi, valgrind
, ... , ...
}: }:
let let
llvm-src = fetchFromGitHub { llvm-src = fetchurl {
rev = "527aa86b578da5dfb9cf4510b71f0f46a11249f7"; url = "https://releases.llvm.org/7.0.1/llvm-7.0.1.src.tar.xz";
owner = "m-labs"; sha256 = "16s196wqzdw4pmri15hadzqgdi926zln3an2viwyq0kini6zr3d3";
repo = "llvm-or1k";
sha256 = "0lmcg9xj66pf4mb6racipw67vm8kwm84dl861hyqnywd61kvhrwa";
}; };
clang-src = fetchFromGitHub { clang-src = fetchurl {
rev = "9e996136d52ed506ed8f57ef8b13b0f0f735e6a3"; url = "https://releases.llvm.org/7.0.1/cfe-7.0.1.src.tar.xz";
owner = "m-labs"; sha256 = "067lwggnbg0w1dfrps790r5l6k8n5zwhlsw7zb6zvmfpwpfn4nx4";
repo = "clang-or1k";
sha256 = "0w5f450i76y162aswi2c7jip8x3arzljaxhbqp8qfdffm0rdbjp4";
}; };
combined-src = runCommand "llvm-clang-src" {} combined-src = runCommand "llvm-clang-src" {}
'' ''
mkdir -p $out mkdir -p $out
mkdir -p $out/tools/clang mkdir -p $out/tools/clang
cp -r ${llvm-src}/* $out/ tar xf ${llvm-src} -C $out --strip-components=1
cp -r ${clang-src}/* $out/tools/clang tar xf ${clang-src} -C $out/tools/clang --strip-components=1
''; '';
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -37,12 +33,12 @@ in
mkdir -p $out/ mkdir -p $out/
''; '';
cmakeFlags = with stdenv; [ cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_BUILD_TYPE=Release"
"-DLLVM_BUILD_LLVM_DYLIB=ON" "-DLLVM_BUILD_LLVM_DYLIB=ON"
"-DLLVM_LINK_LLVM_DYLIB=ON" "-DLLVM_LINK_LLVM_DYLIB=ON"
"-DLLVM_TARGETS_TO_BUILD=X86" "-DLLVM_TARGETS_TO_BUILD=X86"
"-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV;OR1K" "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV"
"-DLLVM_ENABLE_ASSERTIONS=OFF" "-DLLVM_ENABLE_ASSERTIONS=OFF"
"-DLLVM_INSTALL_UTILS=ON" "-DLLVM_INSTALL_UTILS=ON"
"-DLLVM_INCLUDE_TESTS=OFF" "-DLLVM_INCLUDE_TESTS=OFF"