Merge pull request #77989 from lblasc/llvm3-removal
llvm: remove 3.5, 3.8 and 4
This commit is contained in:
commit
645ea323d7
@ -536,6 +536,9 @@ auth required pam_succeed_if.so uid >= 1000 quiet
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>The LLVM versions 3.5, 3.9 and 4 (including the corresponding CLang versions) have been dropped.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
|
||||
|
@ -69,7 +69,7 @@ in buildFHSUserEnv {
|
||||
flac
|
||||
|
||||
# rpcs3 // TODO: "error while loading shared libraries: libz.so.1..."
|
||||
llvm_4
|
||||
llvm
|
||||
|
||||
# ScummVM
|
||||
nasm sndio
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl, gmp4, ncurses, zlib, clang_35 }:
|
||||
{ stdenv, fetchurl, gmp4, ncurses, zlib, clang }:
|
||||
|
||||
let
|
||||
libPath = stdenv.lib.makeLibraryPath
|
||||
@ -38,7 +38,7 @@ stdenv.mkDerivation {
|
||||
ln -s ${stdenv.cc.libc}/lib/libpthread.so.0 $out/lib/libpthread.so.0
|
||||
|
||||
# Add a clang symlink for easy building with a suitable compiler.
|
||||
ln -s ${clang_35}/bin/clang $out/bin/saw-clang
|
||||
ln -s ${clang}/bin/clang $out/bin/saw-clang
|
||||
'';
|
||||
|
||||
fixupPhase = ''
|
||||
|
@ -3,12 +3,12 @@
|
||||
, cmake
|
||||
, pkgconfig
|
||||
, libffi
|
||||
, llvm_35
|
||||
, llvm_6
|
||||
, doCheck ? false
|
||||
, perl
|
||||
}:
|
||||
|
||||
let version = "20170519";
|
||||
let version = "20181024";
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
pname = "dale";
|
||||
@ -17,16 +17,14 @@ in stdenv.mkDerivation {
|
||||
src = fetchFromGitHub {
|
||||
owner = "tomhrr";
|
||||
repo = "dale";
|
||||
rev = "39e16d8e89fa070de65a673d4462e783d530f95a";
|
||||
sha256 = "0dc5cjahv7lzlp92hidlh83rwgrpgb6xz2pnba2pm5xrv2pnsskl";
|
||||
rev = "f5db8b486f4e7c423fc25941a8315f1209bc0e54";
|
||||
sha256 = "0v4ajrzrqvf279kd7wsd9flrpsav57lzxlwwimk9vnfwh7xpzf9v";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ cmake libffi llvm_35 ]
|
||||
buildInputs = [ cmake libffi llvm_6 ]
|
||||
++ stdenv.lib.optional doCheck perl;
|
||||
|
||||
patches = [ ./link-llvm.patch ];
|
||||
|
||||
inherit doCheck;
|
||||
|
||||
checkTarget = "tests";
|
||||
|
@ -1,10 +0,0 @@
|
||||
--- dale-39e16d8e89fa070de65a673d4462e783d530f95a-src.org/CMakeLists.txt 2017-06-22 08:01:05.839531242 +0100
|
||||
+++ dale-39e16d8e89fa070de65a673d4462e783d530f95a-src/CMakeLists.txt 2017-06-22 07:59:11.777566801 +0100
|
||||
@@ -78,6 +78,7 @@
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --libs
|
||||
OUTPUT_VARIABLE LLVM_LIBS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
+STRING(REGEX REPLACE " " ";" LLVM_LIBS "${LLVM_LIBS}")
|
||||
if (${D_LLVM_VERSION_MINOR} GREATER 4)
|
||||
execute_process (COMMAND ${LLVM_CONFIG} --system-libs
|
||||
OUTPUT_VARIABLE LLVM_SYSTEM_LIBS
|
@ -1,5 +1,5 @@
|
||||
{ stdenv, substituteAll
|
||||
, fetchurl, perl, gcc, llvm_39
|
||||
, fetchurl, perl, gcc, llvm
|
||||
, ncurses5, gmp, glibc, libiconv
|
||||
}:
|
||||
|
||||
@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
|
||||
or (throw "cannot bootstrap GHC on this platform"));
|
||||
|
||||
nativeBuildInputs = [ perl ];
|
||||
buildInputs = stdenv.lib.optionals (stdenv.targetPlatform.isAarch32 || stdenv.targetPlatform.isAarch64) [ llvm_39 ];
|
||||
buildInputs = stdenv.lib.optionals (stdenv.targetPlatform.isAarch32 || stdenv.targetPlatform.isAarch64) [ llvm ];
|
||||
|
||||
# Cannot patchelf beforehand due to relative RPATHs that anticipate
|
||||
# the final install location/
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ stdenv
|
||||
, fetchurl, perl, gcc, llvm_39
|
||||
, fetchurl, perl, gcc
|
||||
, ncurses5, gmp, glibc, libiconv
|
||||
}:
|
||||
|
||||
@ -45,7 +45,6 @@ stdenv.mkDerivation rec {
|
||||
or (throw "cannot bootstrap GHC on this platform"));
|
||||
|
||||
nativeBuildInputs = [ perl ];
|
||||
buildInputs = stdenv.lib.optionals (stdenv.targetPlatform.isAarch32 || stdenv.targetPlatform.isAarch64) [ llvm_39 ];
|
||||
|
||||
# Cannot patchelf beforehand due to relative RPATHs that anticipate
|
||||
# the final install location/
|
||||
|
@ -1,22 +0,0 @@
|
||||
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
|
||||
index 198e82e..810d006 100644
|
||||
--- a/lib/Driver/Tools.cpp
|
||||
+++ b/lib/Driver/Tools.cpp
|
||||
@@ -7355,17 +7355,6 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
CmdArgs.push_back("-shared");
|
||||
}
|
||||
|
||||
- if (ToolChain.getArch() == llvm::Triple::arm ||
|
||||
- ToolChain.getArch() == llvm::Triple::armeb ||
|
||||
- ToolChain.getArch() == llvm::Triple::thumb ||
|
||||
- ToolChain.getArch() == llvm::Triple::thumbeb ||
|
||||
- (!Args.hasArg(options::OPT_static) &&
|
||||
- !Args.hasArg(options::OPT_shared))) {
|
||||
- CmdArgs.push_back("-dynamic-linker");
|
||||
- CmdArgs.push_back(Args.MakeArgString(
|
||||
- D.DyldPrefix + getLinuxDynamicLinker(Args, ToolChain)));
|
||||
- }
|
||||
-
|
||||
CmdArgs.push_back("-o");
|
||||
CmdArgs.push_back(Output.getFilename());
|
||||
|
@ -1,8 +0,0 @@
|
||||
diff -Naur clang-3.4-orig/tools/extra/CMakeLists.txt clang-3.4/tools/extra/CMakeLists.txt
|
||||
--- clang-3.4-orig/tools/extra/CMakeLists.txt 2013-11-07 19:08:23.000000000 -0500
|
||||
+++ clang-3.4/tools/extra/CMakeLists.txt 2014-01-20 11:47:22.678435223 -0500
|
||||
@@ -1,3 +1,4 @@
|
||||
+include(CheckLibraryExists)
|
||||
check_library_exists(edit el_init "" HAVE_LIBEDIT)
|
||||
|
||||
add_subdirectory(clang-apply-replacements)
|
@ -1,59 +0,0 @@
|
||||
{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src }:
|
||||
let
|
||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||
in stdenv.mkDerivation {
|
||||
pname = "clang";
|
||||
inherit version;
|
||||
|
||||
src = fetch "cfe" "0846h8vn3zlc00jkmvrmy88gc6ql6014c02l4jv78fpvfigmgssg";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile $src
|
||||
mv cfe-${version}.src clang
|
||||
sourceRoot=$PWD/clang
|
||||
unpackFile ${clang-tools-extra_src}
|
||||
mv clang-tools-extra-* $sourceRoot/tools/extra
|
||||
'';
|
||||
|
||||
buildInputs = [ cmake libxml2 llvm ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
||||
] ++
|
||||
# Maybe with compiler-rt this won't be needed?
|
||||
(stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}") ++
|
||||
(stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include");
|
||||
|
||||
patches = [ ./clang-purity.patch ];
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
|
||||
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp
|
||||
'';
|
||||
|
||||
# Clang expects to find LLVMgold in its own prefix
|
||||
# Clang expects to find sanitizer libraries in its own prefix
|
||||
postInstall = ''
|
||||
if [ -e ${llvm}/lib/LLVMgold.so ]; then
|
||||
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
|
||||
fi
|
||||
|
||||
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
|
||||
ln -sv $out/bin/clang $out/bin/cpp
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru = {
|
||||
isClang = true;
|
||||
} // stdenv.lib.optionalAttrs stdenv.isLinux {
|
||||
inherit gcc;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
{ pkgs, newScope, stdenv, isl, fetchurl }:
|
||||
let
|
||||
callPackage = newScope (self // { inherit stdenv isl version fetch; });
|
||||
|
||||
version = "3.5.2";
|
||||
|
||||
fetch = fetch_v version;
|
||||
fetch_v = ver: name: sha256: fetchurl {
|
||||
url = "https://releases.llvm.org/${ver}/${name}-${ver}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
compiler-rt_src = fetch "compiler-rt" "1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal";
|
||||
clang-tools-extra_src = fetch "clang-tools-extra" "01607w6hdf1pjgaapn9fy6smk22i3d4ncqjlhk4xi55ifi6kf6pj";
|
||||
|
||||
self = {
|
||||
llvm = callPackage ./llvm.nix rec {
|
||||
version = "3.5.2";
|
||||
fetch = fetch_v version;
|
||||
inherit compiler-rt_src;
|
||||
};
|
||||
|
||||
clang = callPackage ./clang.nix rec {
|
||||
version = "3.5.2";
|
||||
fetch = fetch_v version;
|
||||
inherit clang-tools-extra_src;
|
||||
};
|
||||
|
||||
lld = callPackage ./lld.nix {};
|
||||
|
||||
lldb = callPackage ./lldb.nix {};
|
||||
|
||||
polly = callPackage ./polly.nix {};
|
||||
|
||||
dragonegg = callPackage ./dragonegg.nix {};
|
||||
|
||||
libcxx = callPackage ./libc++ { stdenv = pkgs.clangStdenv; };
|
||||
|
||||
libcxxabi = callPackage ./libc++abi { stdenv = pkgs.clangStdenv; };
|
||||
|
||||
#openmp = callPackage ./openmp {};
|
||||
};
|
||||
in self
|
@ -1,27 +0,0 @@
|
||||
{stdenv, fetch, llvm, gmp, mpfr, libmpc, ncurses, zlib, version}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dragonegg";
|
||||
inherit version;
|
||||
|
||||
src = fetch "dragonegg" "1va4wv2b1dj0dpzsksnpnd0jic52q7pqj79w3m9jwdb58h7104dw";
|
||||
|
||||
# The gcc the plugin will be built for (the same used building dragonegg)
|
||||
GCC = "gcc";
|
||||
|
||||
buildInputs = [ llvm gmp mpfr libmpc ncurses zlib ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib $out/share/doc/${pname}-${version}
|
||||
cp -d dragonegg.so $out/lib
|
||||
cp README COPYING $out/share/doc/${pname}-${version}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://dragonegg.llvm.org/;
|
||||
description = "gcc plugin that replaces gcc's optimizers and code generators by those in LLVM";
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
};
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
diff --git a/include/llvm/ADT/IntrusiveRefCntPtr.h b/include/llvm/ADT/IntrusiveRefCntPtr.h
|
||||
index f9df378..9d860ec 100644
|
||||
--- a/include/llvm/ADT/IntrusiveRefCntPtr.h
|
||||
+++ b/include/llvm/ADT/IntrusiveRefCntPtr.h
|
||||
@@ -134,9 +134,9 @@ public:
|
||||
//===----------------------------------------------------------------------===//
|
||||
template <typename T>
|
||||
class IntrusiveRefCntPtr {
|
||||
+ public:
|
||||
T* Obj;
|
||||
|
||||
- public:
|
||||
typedef T element_type;
|
||||
|
||||
explicit IntrusiveRefCntPtr() : Obj(nullptr) {}
|
@ -1,30 +0,0 @@
|
||||
diff -ru -x '*~' libcxx-3.4.2.src-orig/lib/CMakeLists.txt libcxx-3.4.2.src/lib/CMakeLists.txt
|
||||
--- libcxx-3.4.2.src-orig/lib/CMakeLists.txt 2013-11-15 18:18:57.000000000 +0100
|
||||
+++ libcxx-3.4.2.src/lib/CMakeLists.txt 2014-09-24 14:04:01.000000000 +0200
|
||||
@@ -56,7 +56,7 @@
|
||||
"-compatibility_version 1"
|
||||
"-current_version ${LIBCXX_VERSION}"
|
||||
"-install_name /usr/lib/libc++.1.dylib"
|
||||
- "-Wl,-reexport_library,/usr/lib/libc++abi.dylib"
|
||||
+ "-Wl,-reexport_library,${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
|
||||
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
|
||||
"/usr/lib/libSystem.B.dylib")
|
||||
else()
|
||||
@@ -64,14 +64,14 @@
|
||||
list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7)
|
||||
if (OSX_HAS_ARMV7)
|
||||
set(OSX_RE_EXPORT_LINE
|
||||
- "${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"
|
||||
+ "${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
|
||||
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
|
||||
else()
|
||||
set(OSX_RE_EXPORT_LINE
|
||||
- "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib")
|
||||
+ "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib")
|
||||
endif()
|
||||
else()
|
||||
- set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
|
||||
+ set (OSX_RE_EXPORT_LINE "${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
|
||||
endif()
|
||||
|
||||
list(APPEND link_flags
|
@ -1,54 +0,0 @@
|
||||
{ lib, stdenv, fetchurl, cmake, libcxxabi, fixDarwinDylibNames }:
|
||||
|
||||
let version = "3.5.2"; in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libc++";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://llvm.org/releases/${version}/libcxx-${version}.src.tar.xz";
|
||||
sha256 = "0irnl54fwzh2hzn9x4jfvnfyq5kd0zn0iwbzdivgwhqzw6fjdwdv";
|
||||
};
|
||||
|
||||
# instead of allowing libc++ to link with /usr/lib/libc++abi.dylib,
|
||||
# force it to link with our copy
|
||||
preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
substituteInPlace lib/CMakeLists.txt \
|
||||
--replace 'OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib' \
|
||||
'OSX_RE_EXPORT_LINE "${libcxxabi}/lib/libc++abi.dylib' \
|
||||
--replace '"''${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"' \
|
||||
'"${libcxxabi}/lib/libc++abi.dylib"'
|
||||
'';
|
||||
|
||||
patches = [
|
||||
./darwin.patch
|
||||
# glibc 2.26 fix
|
||||
./xlocale-glibc-2.26.patch
|
||||
];
|
||||
|
||||
buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=${libcxxabi}/include"
|
||||
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
|
||||
"-DLIBCXX_LIBCPPABI_VERSION=2"
|
||||
"-DLIBCXX_CXX_ABI=libcxxabi"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
linkCxxAbi = stdenv.isLinux;
|
||||
|
||||
setupHooks = [
|
||||
../../../../../build-support/setup-hooks/role.bash
|
||||
./setup-hook.sh
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxx.llvm.org/;
|
||||
description = "A new implementation of the C++ standard library, targeting C++11";
|
||||
license = with stdenv.lib.licenses; [ ncsa mit ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
# See pkgs/build-support/setup-hooks/role.bash
|
||||
getHostRole
|
||||
|
||||
linkCxxAbi="@linkCxxAbi@"
|
||||
export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1"
|
||||
export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}"
|
@ -1,17 +0,0 @@
|
||||
diff --git a/include/__locale b/include/__locale
|
||||
index 3daa1f1..cb8e151 100644
|
||||
--- a/include/__locale
|
||||
+++ b/include/__locale
|
||||
@@ -29,10 +29,10 @@
|
||||
# if __ANDROID_API__ <= 20
|
||||
# include <support/android/locale_bionic.h>
|
||||
# endif
|
||||
-#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
|
||||
+#elif (defined(__APPLE__) || defined(__FreeBSD__) \
|
||||
|| defined(__sun__) || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
|
||||
# include <xlocale.h>
|
||||
-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
|
||||
+#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
@ -1,60 +0,0 @@
|
||||
{ stdenv, cmake, fetchurl, libcxx, libunwind, llvm }:
|
||||
|
||||
let
|
||||
version = "3.5.2";
|
||||
cmakeLists = fetchurl {
|
||||
name = "CMakeLists.txt";
|
||||
url = "http://llvm.org/svn/llvm-project/libcxxabi/trunk/CMakeLists.txt?p=217324";
|
||||
sha256 = "10idgcbs4pcx6mjsbq1vjm8hzqqdk2p7k86cw9f473jmfyfwgf5j";
|
||||
};
|
||||
in stdenv.mkDerivation {
|
||||
pname = "libc++abi";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://llvm.org/releases/${version}/libcxxabi-${version}.src.tar.xz";
|
||||
sha256 = "1c6rv0zx0na1w4hdmdfq2f6nj7limb7d1krrknwajxxkcn4yws92";
|
||||
};
|
||||
|
||||
buildInputs = [ cmake ] ++ stdenv.lib.optional (!stdenv.isDarwin) libunwind;
|
||||
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxx.src}
|
||||
unpackFile ${llvm.src}
|
||||
echo cp ${cmakeLists} libcxxabi-*/CMakeLists.txt
|
||||
cp ${cmakeLists} libcxxabi-*/CMakeLists.txt
|
||||
export NIX_CFLAGS_COMPILE+=" -I$PWD/include"
|
||||
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_INCLUDES=$PWD/$(ls -d libcxx-*)/include"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export TRIPLE=x86_64-apple-darwin
|
||||
'';
|
||||
|
||||
installPhase = if stdenv.isDarwin
|
||||
then ''
|
||||
for file in lib/*; do
|
||||
# this should be done in CMake, but having trouble figuring out
|
||||
# the magic combination of necessary CMake variables
|
||||
# if you fancy a try, take a look at
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
install_name_tool -id $out/$file $file
|
||||
done
|
||||
make install
|
||||
install -d 755 $out/include
|
||||
install -m 644 ../include/cxxabi.h $out/include
|
||||
''
|
||||
else ''
|
||||
install -d -m 755 $out/include $out/lib
|
||||
install -m 644 lib/libc++abi.so.1.0 $out/lib
|
||||
install -m 644 $src/include/cxxabi.h $out/include
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxxabi.llvm.org/;
|
||||
description = "A new implementation of low level support for a standard C++ library";
|
||||
license = with stdenv.lib.licenses; [ ncsa mit ];
|
||||
maintainers = with stdenv.lib.maintainers; [ vlstill ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
{ stdenv, fetch, cmake, llvm, ncurses, zlib, python, version }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "lld";
|
||||
inherit version;
|
||||
|
||||
src = fetch "lld" "1hpqawg1sc8mdqxqaxqmlzbrn69w1pkj8rxhjgqgmwra6c0xky89";
|
||||
|
||||
preUnpack = ''
|
||||
# !!! Hopefully won't be needed for 3.5
|
||||
unpackFile ${llvm.src}
|
||||
export cmakeFlags="$cmakeFlags -DLLD_PATH_TO_LLVM_SOURCE="`ls -d $PWD/llvm-*`
|
||||
'';
|
||||
|
||||
buildInputs = [ cmake ncurses zlib python ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
||||
"-DLLD_PATH_TO_LLVM_BUILD=${llvm}"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "A set of modular code for creating linker tools";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, zlib
|
||||
, ncurses
|
||||
, swig
|
||||
, which
|
||||
, libedit
|
||||
, llvm
|
||||
, clang
|
||||
, python
|
||||
, version
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "lldb";
|
||||
inherit version;
|
||||
|
||||
src = fetch "lldb" "0ffi9jn4k3yd0hvxs1v4n710x8siq21lb49v3351d7j5qinrpgi7";
|
||||
|
||||
patchPhase = ''
|
||||
sed -i 's|/usr/bin/env||' \
|
||||
scripts/Python/finish-swig-Python-LLDB.sh \
|
||||
scripts/Python/build-swig-Python.sh
|
||||
'';
|
||||
|
||||
buildInputs = [ cmake python which swig ncurses zlib libedit ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
||||
"-DLLDB_PATH_TO_LLVM_BUILD=${llvm}"
|
||||
"-DLLDB_PATH_TO_CLANG_BUILD=${clang}"
|
||||
"-DLLDB_DISABLE_LIBEDIT=1" # https://llvm.org/bugs/show_bug.cgi?id=28898
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "A next-generation high-performance debugger";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
broken = true;
|
||||
};
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
diff -Naur llvm-3.4-orig/cmake/modules/TableGen.cmake llvm-3.4/cmake/modules/TableGen.cmake
|
||||
--- llvm-3.4-orig/cmake/modules/TableGen.cmake 2013-10-06 21:00:07.000000000 -0400
|
||||
+++ llvm-3.4/cmake/modules/TableGen.cmake 2014-01-20 13:06:55.273022149 -0500
|
||||
@@ -78,8 +78,6 @@
|
||||
endif()
|
||||
|
||||
macro(add_tablegen target project)
|
||||
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})
|
||||
-
|
||||
set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
|
||||
set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
|
||||
add_llvm_utility(${target} ${ARGN})
|
@ -1,97 +0,0 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, fetchpatch
|
||||
, perl
|
||||
, groff
|
||||
, cmake
|
||||
, python
|
||||
, libffi
|
||||
, libbfd
|
||||
, libxml2
|
||||
, valgrind
|
||||
, ncurses
|
||||
, version
|
||||
, zlib
|
||||
, compiler-rt_src
|
||||
, debugVersion ? false
|
||||
, enableSharedLibraries ? !stdenv.isDarwin
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
src = fetch "llvm" "0xf5q17kkxsrm2gsi93h4pwlv663kji73r2g4asb97klsmb626a4";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile $src
|
||||
mv llvm-${version}.src llvm
|
||||
sourceRoot=$PWD/llvm
|
||||
unpackFile ${compiler-rt_src}
|
||||
mv compiler-rt-* $sourceRoot/projects/compiler-rt
|
||||
'';
|
||||
|
||||
buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind;
|
||||
|
||||
propagatedBuildInputs = [ ncurses zlib ];
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace 'set(CMAKE_INSTALL_NAME_DIR "@rpath")' "set(CMAKE_INSTALL_NAME_DIR "$out/lib")" \
|
||||
--replace 'set(CMAKE_INSTALL_RPATH "@executable_path/../lib")' ""
|
||||
'';
|
||||
|
||||
postPatch = stdenv.lib.optionalString (stdenv ? glibc) ''
|
||||
(
|
||||
cd projects/compiler-rt
|
||||
patch -p1 < ${
|
||||
fetchpatch {
|
||||
name = "sigaltstack.patch"; # for glibc-2.26
|
||||
url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff;
|
||||
sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi";
|
||||
}
|
||||
}
|
||||
|
||||
sed -i "s,#include <pthread.h>,&\n#include <signal.h>,g" \
|
||||
lib/asan/asan_linux.cc
|
||||
)
|
||||
'';
|
||||
|
||||
# hacky fix: created binaries need to be run before installation
|
||||
preBuild = ''
|
||||
mkdir -p $out/
|
||||
ln -sv $PWD/lib $out
|
||||
'';
|
||||
|
||||
cmakeFlags = with stdenv; [
|
||||
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
|
||||
"-DLLVM_BUILD_TESTS=ON"
|
||||
"-DLLVM_ENABLE_FFI=ON"
|
||||
"-DLLVM_REQUIRES_RTTI=1"
|
||||
] ++ stdenv.lib.optional enableSharedLibraries
|
||||
"-DBUILD_SHARED_LIBS=ON"
|
||||
++ stdenv.lib.optional (!isDarwin)
|
||||
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
|
||||
++ stdenv.lib.optionals ( isDarwin) [
|
||||
"-DCMAKE_CXX_FLAGS=-stdlib=libc++"
|
||||
"-DCAN_TARGET_i386=false"
|
||||
];
|
||||
|
||||
patches = [ ./fix-15974.patch ] ++
|
||||
stdenv.lib.optionals (!stdenv.isDarwin) [../fix-llvm-config.patch ];
|
||||
|
||||
postBuild = ''
|
||||
rm -fR $out
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "Collection of modular and reusable compiler and toolchain technologies";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin ];
|
||||
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" "armv7l-linux"];
|
||||
};
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
diff -Naur polly-3.4-orig/CMakeLists.txt polly-3.4/CMakeLists.txt
|
||||
--- polly-3.4-orig/CMakeLists.txt 2013-11-21 06:51:46.000000000 -0500
|
||||
+++ polly-3.4/CMakeLists.txt 2014-01-20 18:49:34.907919933 -0500
|
||||
@@ -53,7 +53,7 @@
|
||||
execute_process(COMMAND "${LLVM_INSTALL_ROOT}/bin/llvm-config" --cxxflags
|
||||
OUTPUT_VARIABLE LLVM_CXX_FLAGS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
- set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${LLVM_CXX_FLAGS})
|
||||
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LLVM_CXX_FLAGS}")
|
||||
endif(NOT DEFINED LLVM_MAIN_SRC_DIR)
|
||||
|
||||
set(POLLY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
@ -1,26 +0,0 @@
|
||||
{ stdenv, fetch, cmake, isl, python, gmp, llvm, version }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "polly";
|
||||
inherit version;
|
||||
|
||||
src = fetch "polly" "1s6v54czmgq626an4yk2k34lrzkwmz1bjrbiafh7j23yc2w4nalx";
|
||||
|
||||
patches = [ ./polly-separate-build.patch ];
|
||||
|
||||
buildInputs = [ cmake isl python gmp ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
||||
"-DLLVM_INSTALL_ROOT=${llvm}"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "A polyhedral optimizer for llvm";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
From 7225c7754cc3431d05df367c60f309f27586f188 Mon Sep 17 00:00:00 2001
|
||||
From: Maximilian Bosch <maximilian@mbosch.me>
|
||||
Date: Mon, 30 Dec 2019 01:42:52 +0100
|
||||
Subject: [PATCH] Fix compilation w/gcc9
|
||||
|
||||
Build broken with the following errors:
|
||||
|
||||
```
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp: In lambda function:
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp:6078:55: error: lambda parameter 'CGF' previously declared as a capture
|
||||
clang> 6078 | &NumOfPtrs](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
clang> | ~~~~~~~~~~~~~~~~~^~~
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp: In lambda function:
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp:6126:53: error: lambda parameter 'CGF' previously declared as a capture
|
||||
clang> 6126 | &NumOfPtrs](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
clang> | ~~~~~~~~~~~~~~~~~^~~
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp: In lambda function:
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp:6191:56: error: lambda parameter 'CGF' previously declared as a capture
|
||||
clang> 6191 | auto &&ThenGen = [&D, &CGF, Device](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
clang> | ~~~~~~~~~~~~~~~~~^~~
|
||||
```
|
||||
|
||||
This was due to a bug about name-collisions fixed in GCC 9.0[1].
|
||||
|
||||
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2211
|
||||
---
|
||||
lib/CodeGen/CGOpenMPRuntime.cpp | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp
|
||||
index 6a0edbe..96c281c 100644
|
||||
--- a/lib/CodeGen/CGOpenMPRuntime.cpp
|
||||
+++ b/lib/CodeGen/CGOpenMPRuntime.cpp
|
||||
@@ -6073,7 +6073,7 @@ void CGOpenMPRuntime::emitTargetDataCalls(CodeGenFunction &CGF,
|
||||
// Generate the code for the opening of the data environment. Capture all the
|
||||
// arguments of the runtime call by reference because they are used in the
|
||||
// closing of the region.
|
||||
- auto &&BeginThenGen = [&D, &CGF, &BasePointersArray, &PointersArray,
|
||||
+ auto &&BeginThenGen = [&D, &BasePointersArray, &PointersArray,
|
||||
&SizesArray, &MapTypesArray, Device,
|
||||
&NumOfPtrs](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
// Fill up the arrays with all the mapped variables.
|
||||
@@ -6121,7 +6121,7 @@ void CGOpenMPRuntime::emitTargetDataCalls(CodeGenFunction &CGF,
|
||||
};
|
||||
|
||||
// Generate code for the closing of the data region.
|
||||
- auto &&EndThenGen = [&CGF, &BasePointersArray, &PointersArray, &SizesArray,
|
||||
+ auto &&EndThenGen = [&BasePointersArray, &PointersArray, &SizesArray,
|
||||
&MapTypesArray, Device,
|
||||
&NumOfPtrs](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
assert(BasePointersArray && PointersArray && SizesArray && MapTypesArray &&
|
||||
@@ -6188,7 +6188,7 @@ void CGOpenMPRuntime::emitTargetDataStandAloneCall(
|
||||
"Expecting either target enter, exit data, or update directives.");
|
||||
|
||||
// Generate the code for the opening of the data environment.
|
||||
- auto &&ThenGen = [&D, &CGF, Device](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
+ auto &&ThenGen = [&D, Device](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
// Fill up the arrays with all the mapped variables.
|
||||
MappableExprsHandler::MapValuesArrayTy BasePointers;
|
||||
MappableExprsHandler::MapValuesArrayTy Pointers;
|
||||
--
|
||||
2.23.1
|
||||
|
@ -1,85 +0,0 @@
|
||||
{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python }:
|
||||
|
||||
let
|
||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||
self = stdenv.mkDerivation {
|
||||
pname = "clang";
|
||||
inherit version;
|
||||
|
||||
src = fetch "cfe" "0qsyyb40iwifhhlx9a3drf8z6ni6zwyk3bvh0kx2gs6yjsxwxi76";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile $src
|
||||
mv cfe-${version}.src clang
|
||||
sourceRoot=$PWD/clang
|
||||
unpackFile ${clang-tools-extra_src}
|
||||
mv clang-tools-extra-* $sourceRoot/tools/extra
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
buildInputs = [ libxml2 llvm python ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
||||
] ++
|
||||
# Maybe with compiler-rt this won't be needed?
|
||||
(stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}") ++
|
||||
(stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include");
|
||||
|
||||
patches = [
|
||||
./purity.patch
|
||||
./0001-Fix-compilation-w-gcc9.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
|
||||
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp
|
||||
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/Tools.cpp
|
||||
'';
|
||||
|
||||
outputs = [ "out" "lib" "python" ];
|
||||
|
||||
# Clang expects to find LLVMgold in its own prefix
|
||||
# Clang expects to find sanitizer libraries in its own prefix
|
||||
postInstall = ''
|
||||
if [ -e ${llvm}/lib/LLVMgold.so ]; then
|
||||
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
|
||||
fi
|
||||
|
||||
ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/
|
||||
ln -sv $out/bin/clang $out/bin/cpp
|
||||
|
||||
# Move libclang to 'lib' output
|
||||
moveToOutput "lib/libclang.*" "$lib"
|
||||
substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang."
|
||||
|
||||
mkdir -p $python/bin $python/share/clang/
|
||||
mv $out/bin/{git-clang-format,scan-view} $python/bin
|
||||
if [ -e $out/bin/set-xcode-analyzer ]; then
|
||||
mv $out/bin/set-xcode-analyzer $python/bin
|
||||
fi
|
||||
mv $out/share/clang/*.py $python/share/clang
|
||||
|
||||
rm $out/bin/c-index-test
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru = {
|
||||
isClang = true;
|
||||
inherit llvm;
|
||||
} // stdenv.lib.optionalAttrs stdenv.isLinux {
|
||||
inherit gcc;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
};
|
||||
in self
|
@ -1,16 +0,0 @@
|
||||
--- a/lib/Driver/Tools.cpp 2016-08-25 15:48:05.187553443 +0200
|
||||
+++ b/lib/Driver/Tools.cpp 2016-08-25 15:48:47.534468882 +0200
|
||||
@@ -9420,13 +9420,6 @@
|
||||
if (!Args.hasArg(options::OPT_static)) {
|
||||
if (Args.hasArg(options::OPT_rdynamic))
|
||||
CmdArgs.push_back("-export-dynamic");
|
||||
-
|
||||
- if (!Args.hasArg(options::OPT_shared)) {
|
||||
- const std::string Loader =
|
||||
- D.DyldPrefix + ToolChain.getDynamicLinker(Args);
|
||||
- CmdArgs.push_back("-dynamic-linker");
|
||||
- CmdArgs.push_back(Args.MakeArgString(Loader));
|
||||
- }
|
||||
}
|
||||
|
||||
CmdArgs.push_back("-o");
|
@ -1,59 +0,0 @@
|
||||
{ newScope, stdenv, libstdcxxHook, isl, fetchurl, overrideCC, wrapCCWith
|
||||
, buildLlvmTools # tools, but from the previous stage, for cross
|
||||
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
||||
}:
|
||||
|
||||
let
|
||||
version = "3.9.1";
|
||||
|
||||
fetch = fetch_v version;
|
||||
fetch_v = ver: name: sha256: fetchurl {
|
||||
url = "https://releases.llvm.org/${version}/${name}-${ver}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
compiler-rt_src = fetch "compiler-rt" "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk";
|
||||
clang-tools-extra_src = fetch "clang-tools-extra" "0d9nh7j7brbh9avigcn69dlaihsl9p3cf9s45mw6fxzzvrdvd999";
|
||||
|
||||
tools = stdenv.lib.makeExtensible (tools: let
|
||||
callPackage = newScope (tools // { inherit stdenv isl version fetch; });
|
||||
in {
|
||||
llvm = callPackage ./llvm.nix {
|
||||
inherit compiler-rt_src;
|
||||
};
|
||||
|
||||
clang-unwrapped = callPackage ./clang {
|
||||
inherit clang-tools-extra_src;
|
||||
};
|
||||
|
||||
libclang = tools.clang-unwrapped.lib;
|
||||
|
||||
clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang;
|
||||
|
||||
libstdcxxClang = wrapCCWith {
|
||||
cc = tools.clang-unwrapped;
|
||||
extraPackages = [ libstdcxxHook ];
|
||||
};
|
||||
|
||||
libcxxClang = wrapCCWith {
|
||||
cc = tools.clang-unwrapped;
|
||||
extraPackages = [ targetLlvmLibraries.libcxx targetLlvmLibraries.libcxxabi ];
|
||||
};
|
||||
|
||||
lldb = callPackage ./lldb.nix {};
|
||||
});
|
||||
|
||||
libraries = stdenv.lib.makeExtensible (libraries: let
|
||||
callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv isl version fetch; });
|
||||
in {
|
||||
|
||||
stdenv = overrideCC stdenv buildLlvmTools.clang;
|
||||
|
||||
libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
|
||||
|
||||
libcxx = callPackage ./libc++ {};
|
||||
|
||||
libcxxabi = callPackage ./libc++abi.nix {};
|
||||
});
|
||||
|
||||
in { inherit tools libraries; } // libraries // tools
|
@ -1,39 +0,0 @@
|
||||
--- libcxx-3.8.0.src.org/lib/CMakeLists.txt 2015-12-16 15:41:05.000000000 -0800
|
||||
+++ libcxx-3.8.0.src/lib/CMakeLists.txt 2016-06-17 19:40:00.293394500 -0700
|
||||
@@ -94,30 +94,30 @@
|
||||
add_definitions(-D__STRICT_ANSI__)
|
||||
add_link_flags(
|
||||
"-compatibility_version 1"
|
||||
"-current_version 1"
|
||||
- "-install_name /usr/lib/libc++.1.dylib"
|
||||
- "-Wl,-reexport_library,/usr/lib/libc++abi.dylib"
|
||||
+ "-install_name ${LIBCXX_LIBCXXABI_LIB_PATH}/libc++.1.dylib"
|
||||
+ "-Wl,-reexport_library,${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
|
||||
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
|
||||
"/usr/lib/libSystem.B.dylib")
|
||||
else()
|
||||
if ( ${CMAKE_OSX_SYSROOT} )
|
||||
list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7)
|
||||
if (OSX_HAS_ARMV7)
|
||||
set(OSX_RE_EXPORT_LINE
|
||||
- "${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"
|
||||
+ "${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib"
|
||||
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
|
||||
else()
|
||||
set(OSX_RE_EXPORT_LINE
|
||||
- "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib")
|
||||
+ "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib")
|
||||
endif()
|
||||
else()
|
||||
- set(OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
|
||||
+ set(OSX_RE_EXPORT_LINE "${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
|
||||
endif()
|
||||
|
||||
add_link_flags(
|
||||
"-compatibility_version 1"
|
||||
- "-install_name /usr/lib/libc++.1.dylib"
|
||||
+ "-install_name ${LIBCXX_LIBCXXABI_LIB_PATH}/libc++.1.dylib"
|
||||
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
|
||||
"${OSX_RE_EXPORT_LINE}"
|
||||
"-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/notweak.exp"
|
||||
"-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/weak.exp")
|
@ -1,52 +0,0 @@
|
||||
{ lib, stdenv, fetch, cmake, libcxxabi, fixDarwinDylibNames, version }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libc++";
|
||||
inherit version;
|
||||
|
||||
src = fetch "libcxx" "0qbl3afl2p2h87p977lsqr5kykl6cgjpkzczs0g6a3pn53j1bri5";
|
||||
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxxabi.src}
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
|
||||
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$NIX_BUILD_TOP/libcxxabi-${version}.src/include")
|
||||
'';
|
||||
|
||||
patches = [
|
||||
# glibc 2.26 fix
|
||||
./xlocale-glibc-2.26.patch
|
||||
]
|
||||
++ lib.optional stdenv.isDarwin ./darwin.patch
|
||||
++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
|
||||
../../libcxx-0001-musl-hacks.patch
|
||||
../../libcxx-max_align_t.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
|
||||
"-DLIBCXX_LIBCPPABI_VERSION=2"
|
||||
"-DLIBCXX_CXX_ABI=libcxxabi"
|
||||
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
linkCxxAbi = stdenv.isLinux;
|
||||
|
||||
setupHooks = [
|
||||
../../../../../build-support/setup-hooks/role.bash
|
||||
./setup-hook.sh
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxx.llvm.org/;
|
||||
description = "A new implementation of the C++ standard library, targeting C++11";
|
||||
license = with stdenv.lib.licenses; [ ncsa mit ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
# See pkgs/build-support/setup-hooks/role.bash
|
||||
getHostRole
|
||||
|
||||
linkCxxAbi="@linkCxxAbi@"
|
||||
export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1"
|
||||
export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}"
|
@ -1,19 +0,0 @@
|
||||
diff --git a/include/__locale b/include/__locale
|
||||
index 7bc701d..ea75c86 100644
|
||||
--- a/include/__locale
|
||||
+++ b/include/__locale
|
||||
@@ -34,12 +34,12 @@
|
||||
# include <support/solaris/xlocale.h>
|
||||
#elif defined(_NEWLIB_VERSION)
|
||||
# include <support/newlib/xlocale.h>
|
||||
-#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
|
||||
+#elif (defined(__APPLE__) || defined(__FreeBSD__) \
|
||||
|| defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
|
||||
# include <xlocale.h>
|
||||
#elif defined(_LIBCPP_HAS_MUSL_LIBC)
|
||||
# include <support/musl/xlocale.h>
|
||||
-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
|
||||
+#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
@ -1,52 +0,0 @@
|
||||
{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libc++abi";
|
||||
inherit version;
|
||||
|
||||
src = fetch "libcxxabi" "1qi9q06zanqm8awzq83810avmvi52air6gr9zfip8mbg5viqn3cj";
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
|
||||
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxx.src}
|
||||
unpackFile ${llvm.src}
|
||||
export NIX_CFLAGS_COMPILE+=" -I$PWD/include"
|
||||
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_INCLUDES=$PWD/$(ls -d libcxx-*)/include"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export TRIPLE=x86_64-apple-darwin
|
||||
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
|
||||
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-max_align_t.patch}
|
||||
'';
|
||||
|
||||
installPhase = if stdenv.isDarwin
|
||||
then ''
|
||||
for file in lib/*.dylib; do
|
||||
# this should be done in CMake, but having trouble figuring out
|
||||
# the magic combination of necessary CMake variables
|
||||
# if you fancy a try, take a look at
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
install_name_tool -id $out/$file $file
|
||||
done
|
||||
make install
|
||||
install -d 755 $out/include
|
||||
install -m 644 ../include/*.h $out/include
|
||||
''
|
||||
else ''
|
||||
install -d -m 755 $out/include $out/lib
|
||||
install -m 644 lib/libc++abi.so.1.0 $out/lib
|
||||
install -m 644 ../include/cxxabi.h $out/include
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxxabi.llvm.org/;
|
||||
description = "A new implementation of low level support for a standard C++ library";
|
||||
license = with stdenv.lib.licenses; [ ncsa mit ];
|
||||
maintainers = with stdenv.lib.maintainers; [ vlstill ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, zlib
|
||||
, ncurses
|
||||
, swig
|
||||
, which
|
||||
, libedit
|
||||
, llvm
|
||||
, clang-unwrapped
|
||||
, python
|
||||
, version
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "lldb";
|
||||
inherit version;
|
||||
|
||||
src = fetch "lldb" "1z30ljmcpp261bjng1i5k3bb9jkrs1cr97z04qs4s3zql6r12cvy";
|
||||
|
||||
postUnpack = ''
|
||||
# Hack around broken standalone build as of 3.8
|
||||
unpackFile ${llvm.src}
|
||||
srcDir="$(ls -d lldb-*.src)"
|
||||
mkdir -p "$srcDir/tools/lib/Support"
|
||||
cp "$(ls -d llvm-*.src)/lib/Support/regex_impl.h" "$srcDir/tools/lib/Support/"
|
||||
|
||||
# Fix up various paths that assume llvm and clang are installed in the same place
|
||||
substituteInPlace $srcDir/cmake/modules/LLDBStandalone.cmake \
|
||||
--replace CheckAtomic $(readlink -f llvm-*.src)/cmake/modules/CheckAtomic.cmake
|
||||
sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \
|
||||
$srcDir/cmake/modules/LLDBStandalone.cmake
|
||||
sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \
|
||||
$srcDir/cmake/modules/LLDBStandalone.cmake
|
||||
sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \
|
||||
$srcDir/cmake/modules/LLDBStandalone.cmake
|
||||
'';
|
||||
|
||||
buildInputs = [ cmake python which swig ncurses zlib libedit llvm ];
|
||||
|
||||
CXXFLAGS = "-fno-rtti";
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLLVM_MAIN_INCLUDE_DIR=${llvm}/include"
|
||||
"-DLLDB_DISABLE_LIBEDIT=1" # https://llvm.org/bugs/show_bug.cgi?id=28898
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "A next-generation high-performance debugger";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
|
||||
index 94d426b..37f7794 100644
|
||||
--- a/tools/llvm-config/llvm-config.cpp
|
||||
+++ b/tools/llvm-config/llvm-config.cpp
|
||||
@@ -333,6 +333,21 @@ int main(int argc, char **argv) {
|
||||
ActiveIncludeOption = "-I" + ActiveIncludeDir;
|
||||
}
|
||||
|
||||
+ /// Nix-specific multiple-output handling: override ActiveLibDir if --link-shared
|
||||
+ if (!IsInDevelopmentTree) {
|
||||
+ bool WantShared = true;
|
||||
+ for (int i = 1; i < argc; ++i) {
|
||||
+ StringRef Arg = argv[i];
|
||||
+ if (Arg == "--link-shared")
|
||||
+ WantShared = true;
|
||||
+ else if (Arg == "--link-static")
|
||||
+ WantShared = false; // the last one wins
|
||||
+ }
|
||||
+
|
||||
+ if (WantShared)
|
||||
+ ActiveLibDir = std::string("@lib@") + "/lib" + LLVM_LIBDIR_SUFFIX;
|
||||
+ }
|
||||
+
|
||||
/// We only use `shared library` mode in cases where the static library form
|
||||
/// of the components provided are not available; note however that this is
|
||||
/// skipped if we're run from within the build dir. However, once installed,
|
@ -1,174 +0,0 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, fetchpatch
|
||||
, perl
|
||||
, groff
|
||||
, cmake
|
||||
, python
|
||||
, libffi
|
||||
, libbfd
|
||||
, libxml2
|
||||
, ncurses
|
||||
, version
|
||||
, zlib
|
||||
, compiler-rt_src
|
||||
, debugVersion ? false
|
||||
, enableSharedLibraries ? (stdenv.buildPlatform == stdenv.hostPlatform)
|
||||
, buildPackages
|
||||
}:
|
||||
|
||||
assert (stdenv.hostPlatform != stdenv.buildPlatform) -> !enableSharedLibraries;
|
||||
|
||||
let
|
||||
# Used when creating a versioned symlinks of libLLVM.dylib
|
||||
versionSuffixes = with stdenv.lib;
|
||||
let parts = splitVersion version; in
|
||||
imap (i: _: concatStringsSep "." (take i parts)) parts;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile $src
|
||||
mv llvm-${version}.src llvm
|
||||
sourceRoot=$PWD/llvm
|
||||
unpackFile ${compiler-rt_src}
|
||||
mv compiler-rt-* $sourceRoot/projects/compiler-rt
|
||||
'';
|
||||
|
||||
outputs = [ "out" ] ++ stdenv.lib.optional enableSharedLibraries "lib";
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl
|
||||
cmake
|
||||
python
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
groff
|
||||
libxml2
|
||||
libffi
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ ncurses zlib ];
|
||||
|
||||
patches = [
|
||||
# fix output of llvm-config (fixed in llvm 4.0)
|
||||
(fetchpatch {
|
||||
url = https://github.com/llvm-mirror/llvm/commit/5340b5b3d970069aebf3dde49d8964583742e01a.patch;
|
||||
sha256 = "095f8knplwqbc2p7rad1kq8633i34qynni9jna93an7kyc80wdxl";
|
||||
})
|
||||
] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
|
||||
../TLI-musl.patch
|
||||
../dynamiclibrary-musl.patch
|
||||
];
|
||||
|
||||
postPatch = ""
|
||||
+ ''
|
||||
patch -p1 --reverse < ${fetchpatch {
|
||||
name = "fix-red-icons.diff"; # https://bugs.freedesktop.org/show_bug.cgi?id=99078
|
||||
url = https://github.com/llvm-mirror/llvm/commit/c280d74837d8.diff;
|
||||
sha256 = "11sq86spw41v72f676igksapdlsgh7fiqp5qkkmgfj0ndqcn9skf";
|
||||
}}
|
||||
''
|
||||
# TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
|
||||
# to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
|
||||
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
|
||||
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
|
||||
# a flag and turn the flag off during the stdenv build. I realize that this LLVM isn't used in the stdenv but I want to
|
||||
# keep it consistent with 4.0. We really shouldn't be copying and pasting all this code around...
|
||||
+ stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
substituteInPlace ./projects/compiler-rt/cmake/config-ix.cmake \
|
||||
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
|
||||
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace 'set(CMAKE_INSTALL_NAME_DIR "@rpath")' "set(CMAKE_INSTALL_NAME_DIR "$lib/lib")" \
|
||||
--replace 'set(CMAKE_INSTALL_RPATH "@executable_path/../lib")' ""
|
||||
''
|
||||
# Patch llvm-config to return correct library path based on --link-{shared,static}.
|
||||
+ stdenv.lib.optionalString (enableSharedLibraries) ''
|
||||
substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
|
||||
patch -p1 < ./llvm-outputs.patch
|
||||
''
|
||||
+ ''
|
||||
(
|
||||
cd projects/compiler-rt
|
||||
patch -p1 < ${
|
||||
fetchpatch {
|
||||
name = "sigaltstack.patch"; # for glibc-2.26
|
||||
url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff;
|
||||
sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi";
|
||||
}
|
||||
}
|
||||
substituteInPlace lib/esan/esan_sideline_linux.cpp \
|
||||
--replace 'struct sigaltstack' 'stack_t'
|
||||
)
|
||||
'';
|
||||
|
||||
# hacky fix: created binaries need to be run before installation
|
||||
preBuild = ''
|
||||
mkdir -p $out/
|
||||
ln -sv $PWD/lib $out
|
||||
'';
|
||||
|
||||
cmakeFlags = with stdenv; [
|
||||
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
|
||||
"-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
|
||||
"-DLLVM_BUILD_TESTS=ON"
|
||||
"-DLLVM_ENABLE_FFI=ON"
|
||||
"-DLLVM_ENABLE_RTTI=ON"
|
||||
"-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code
|
||||
|
||||
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
|
||||
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
|
||||
"-DTARGET_TRIPLE=${stdenv.hostPlatform.config}"
|
||||
] ++ stdenv.lib.optional enableSharedLibraries [
|
||||
"-DLLVM_LINK_LLVM_DYLIB=ON"
|
||||
] ++ stdenv.lib.optional (!isDarwin)
|
||||
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
|
||||
++ stdenv.lib.optionals (isDarwin) [
|
||||
"-DLLVM_ENABLE_LIBCXX=ON"
|
||||
"-DCAN_TARGET_i386=false"
|
||||
] ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
||||
"-DCMAKE_CROSSCOMPILING=True"
|
||||
"-DLLVM_TABLEGEN=${buildPackages.llvmPackages_39.llvm}/bin/llvm-tblgen"
|
||||
] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
|
||||
# Not yet supported
|
||||
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
|
||||
"-DCOMPILER_RT_BUILD_XRAY=OFF"
|
||||
|
||||
];
|
||||
|
||||
postBuild = ''
|
||||
rm -fR $out
|
||||
'';
|
||||
|
||||
postInstall = ""
|
||||
+ stdenv.lib.optionalString (enableSharedLibraries) ''
|
||||
moveToOutput "lib/libLLVM-*" "$lib"
|
||||
moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
|
||||
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
|
||||
''
|
||||
+ stdenv.lib.optionalString (stdenv.isDarwin && enableSharedLibraries) ''
|
||||
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
|
||||
${stdenv.lib.concatMapStringsSep "\n" (v: ''
|
||||
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
|
||||
'') versionSuffixes}
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "Collection of modular and reusable compiler and toolchain technologies";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin ];
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
From a2af0b02eba35d0670e3e442ff7c61b3e2304edd Mon Sep 17 00:00:00 2001
|
||||
From: Maximilian Bosch <maximilian@mbosch.me>
|
||||
Date: Mon, 30 Dec 2019 02:11:35 +0100
|
||||
Subject: [PATCH] Fix compilation w/gcc9
|
||||
|
||||
Build broken with the following errors:
|
||||
|
||||
```
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp: In lambda function:
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp:6275:24: error: lambda parameter 'CGF' previously declared as a capture
|
||||
clang> 6275 | CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
clang> | ~~~~~~~~~~~~~~~~~^~~
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp: In lambda function:
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp:6321:62: error: lambda parameter 'CGF' previously declared as a capture
|
||||
clang> 6321 | auto &&EndThenGen = [&CGF, Device, &Info](CodeGenFunction &CGF,
|
||||
clang> | ~~~~~~~~~~~~~~~~~^~~
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp: In lambda function:
|
||||
clang> /build/clang/lib/CodeGen/CGOpenMPRuntime.cpp:6400:56: error: lambda parameter 'CGF' previously declared as a capture
|
||||
clang> 6400 | auto &&ThenGen = [&D, &CGF, Device](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
clang> | ~~~~~~~~~~~~~~~~~^~~
|
||||
```
|
||||
---
|
||||
lib/CodeGen/CGOpenMPRuntime.cpp | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp
|
||||
index 4025217..40a73ef 100644
|
||||
--- a/lib/CodeGen/CGOpenMPRuntime.cpp
|
||||
+++ b/lib/CodeGen/CGOpenMPRuntime.cpp
|
||||
@@ -6271,7 +6271,7 @@ void CGOpenMPRuntime::emitTargetDataCalls(
|
||||
// Generate the code for the opening of the data environment. Capture all the
|
||||
// arguments of the runtime call by reference because they are used in the
|
||||
// closing of the region.
|
||||
- auto &&BeginThenGen = [&D, &CGF, Device, &Info, &CodeGen, &NoPrivAction](
|
||||
+ auto &&BeginThenGen = [&D, Device, &Info, &CodeGen, &NoPrivAction](
|
||||
CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
// Fill up the arrays with all the mapped variables.
|
||||
MappableExprsHandler::MapBaseValuesArrayTy BasePointers;
|
||||
@@ -6318,7 +6318,7 @@ void CGOpenMPRuntime::emitTargetDataCalls(
|
||||
};
|
||||
|
||||
// Generate code for the closing of the data region.
|
||||
- auto &&EndThenGen = [&CGF, Device, &Info](CodeGenFunction &CGF,
|
||||
+ auto &&EndThenGen = [Device, &Info](CodeGenFunction &CGF,
|
||||
PrePostActionTy &) {
|
||||
assert(Info.isValid() && "Invalid data environment closing arguments.");
|
||||
|
||||
@@ -6397,7 +6397,7 @@ void CGOpenMPRuntime::emitTargetDataStandAloneCall(
|
||||
"Expecting either target enter, exit data, or update directives.");
|
||||
|
||||
// Generate the code for the opening of the data environment.
|
||||
- auto &&ThenGen = [&D, &CGF, Device](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
+ auto &&ThenGen = [&D, Device](CodeGenFunction &CGF, PrePostActionTy &) {
|
||||
// Fill up the arrays with all the mapped variables.
|
||||
MappableExprsHandler::MapBaseValuesArrayTy BasePointers;
|
||||
MappableExprsHandler::MapValuesArrayTy Pointers;
|
||||
--
|
||||
2.23.1
|
||||
|
@ -1,116 +0,0 @@
|
||||
{ stdenv, fetch, cmake, libxml2, llvm, version, release_version, clang-tools-extra_src, python3
|
||||
, fixDarwinDylibNames
|
||||
, enableManpages ? false
|
||||
}:
|
||||
|
||||
let
|
||||
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
|
||||
self = stdenv.mkDerivation ({
|
||||
pname = "clang";
|
||||
inherit version;
|
||||
|
||||
src = fetch "cfe" "16vnv3msnvx33dydd17k2cq0icndi1a06bg5vcxkrhjjb1rqlwv1";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile $src
|
||||
mv cfe-${version}* clang
|
||||
sourceRoot=$PWD/clang
|
||||
unpackFile ${clang-tools-extra_src}
|
||||
mv clang-tools-extra-* $sourceRoot/tools/extra
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake python3 ]
|
||||
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
|
||||
|
||||
buildInputs = [ libxml2 llvm ]
|
||||
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_CXX_FLAGS=-std=c++11"
|
||||
] ++ stdenv.lib.optionals enableManpages [
|
||||
"-DCLANG_INCLUDE_DOCS=ON"
|
||||
"-DLLVM_ENABLE_SPHINX=ON"
|
||||
"-DSPHINX_OUTPUT_MAN=ON"
|
||||
"-DSPHINX_OUTPUT_HTML=OFF"
|
||||
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
|
||||
]
|
||||
# Maybe with compiler-rt this won't be needed?
|
||||
++ stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}"
|
||||
++ stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include";
|
||||
|
||||
patches = [
|
||||
./purity.patch
|
||||
./0001-Fix-compilation-w-gcc9.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
|
||||
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/ToolChains.cpp
|
||||
|
||||
# Patch for standalone doc building
|
||||
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
|
||||
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/Tools.cpp
|
||||
'';
|
||||
|
||||
outputs = [ "out" "lib" "python" ];
|
||||
|
||||
# Clang expects to find LLVMgold in its own prefix
|
||||
# Clang expects to find sanitizer libraries in its own prefix
|
||||
postInstall = ''
|
||||
if [ -e ${llvm}/lib/LLVMgold.so ]; then
|
||||
ln -sv ${llvm}/lib/LLVMgold.so $out/lib
|
||||
fi
|
||||
|
||||
ln -sv ${llvm}/lib/clang/${release_version}/lib $out/lib/clang/${release_version}/
|
||||
ln -sv $out/bin/clang $out/bin/cpp
|
||||
|
||||
# Move libclang to 'lib' output
|
||||
moveToOutput "lib/libclang.*" "$lib"
|
||||
substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang."
|
||||
|
||||
mkdir -p $python/bin $python/share/clang/
|
||||
mv $out/bin/{git-clang-format,scan-view} $python/bin
|
||||
if [ -e $out/bin/set-xcode-analyzer ]; then
|
||||
mv $out/bin/set-xcode-analyzer $python/bin
|
||||
fi
|
||||
mv $out/share/clang/*.py $python/share/clang
|
||||
rm $out/bin/c-index-test
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
passthru = {
|
||||
isClang = true;
|
||||
inherit llvm;
|
||||
} // stdenv.lib.optionalAttrs stdenv.isLinux {
|
||||
inherit gcc;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
pname = "clang-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-clang-man
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share/man/man1
|
||||
# Manually install clang manpage
|
||||
cp docs/man/*.1 $out/share/man/man1/
|
||||
'';
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta.description = "man page for Clang ${version}";
|
||||
});
|
||||
in self
|
@ -1,16 +0,0 @@
|
||||
--- a/lib/Driver/Tools.cpp 2016-08-25 15:48:05.187553443 +0200
|
||||
+++ b/lib/Driver/Tools.cpp 2016-08-25 15:48:47.534468882 +0200
|
||||
@@ -9420,13 +9420,6 @@
|
||||
if (!Args.hasArg(options::OPT_static)) {
|
||||
if (Args.hasArg(options::OPT_rdynamic))
|
||||
CmdArgs.push_back("-export-dynamic");
|
||||
-
|
||||
- if (!Args.hasArg(options::OPT_shared)) {
|
||||
- const std::string Loader =
|
||||
- D.DyldPrefix + ToolChain.getDynamicLinker(Args);
|
||||
- CmdArgs.push_back("-dynamic-linker");
|
||||
- CmdArgs.push_back(Args.MakeArgString(Loader));
|
||||
- }
|
||||
}
|
||||
|
||||
CmdArgs.push_back("-o");
|
@ -1,39 +0,0 @@
|
||||
From c7a9aa3a697c81432786a5583bf973771c7be15e Mon Sep 17 00:00:00 2001
|
||||
From: Don Hinton <hintonda@gmail.com>
|
||||
Date: Wed, 12 Jul 2017 01:15:46 +0000
|
||||
Subject: [PATCH] Fix minor typo introduced in r276404
|
||||
|
||||
Summary:
|
||||
A space was added between '-' and 'help' when emitting help output.
|
||||
|
||||
See https://reviews.llvm.org/D22621 for details.
|
||||
|
||||
Reviewers: MaggieYi, vsk
|
||||
|
||||
Reviewed By: vsk
|
||||
|
||||
Subscribers: llvm-commits
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D35283
|
||||
|
||||
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307745 91177308-0d34-0410-b5e6-96231b3b80d8
|
||||
---
|
||||
lib/Support/CommandLine.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp
|
||||
index 3889902eea5..79defa5c36c 100644
|
||||
--- a/lib/Support/CommandLine.cpp
|
||||
+++ b/lib/Support/CommandLine.cpp
|
||||
@@ -1236,7 +1236,7 @@ bool CommandLineParser::ParseCommandLineOptions(int argc,
|
||||
<< ": Not enough positional command line arguments specified!\n"
|
||||
<< "Must specify at least " << NumPositionalRequired
|
||||
<< " positional argument" << (NumPositionalRequired > 1 ? "s" : "")
|
||||
- << ": See: " << argv[0] << " - help\n";
|
||||
+ << ": See: " << argv[0] << " -help\n";
|
||||
}
|
||||
|
||||
ErrorParsing = true;
|
||||
--
|
||||
2.14.0
|
||||
|
@ -1,74 +0,0 @@
|
||||
{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook
|
||||
, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
|
||||
, buildLlvmTools # tools, but from the previous stage, for cross
|
||||
, targetLlvmLibraries # libraries, but from the next stage, for cross
|
||||
}:
|
||||
|
||||
let
|
||||
release_version = "4.0.1";
|
||||
version = release_version; # differentiating these is important for rc's
|
||||
|
||||
fetch = name: sha256: fetchurl {
|
||||
url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
compiler-rt_src = fetch "compiler-rt" "0h5lpv1z554szi4r4blbskhwrkd78ir50v3ng8xvk1s86fa7gj53";
|
||||
clang-tools-extra_src = fetch "clang-tools-extra" "1dhmp7ccfpr42bmvk3kp37ngjpf3a9m5d4kkpsn7d00hzi7fdl9m";
|
||||
|
||||
tools = stdenv.lib.makeExtensible (tools: let
|
||||
callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
|
||||
in {
|
||||
|
||||
llvm = callPackage ./llvm.nix {
|
||||
inherit compiler-rt_src;
|
||||
};
|
||||
clang-unwrapped = callPackage ./clang {
|
||||
inherit clang-tools-extra_src;
|
||||
};
|
||||
|
||||
llvm-manpages = lowPrio (tools.llvm.override {
|
||||
enableManpages = true;
|
||||
python3 = pkgs.python3; # don't use python-boot
|
||||
});
|
||||
|
||||
clang-manpages = lowPrio (tools.clang-unwrapped.override {
|
||||
enableManpages = true;
|
||||
python3 = pkgs.python3; # don't use python-boot
|
||||
});
|
||||
|
||||
libclang = tools.clang-unwrapped.lib;
|
||||
|
||||
clang = if stdenv.cc.isGNU then tools.libstdcxxClang else tools.libcxxClang;
|
||||
|
||||
libstdcxxClang = wrapCCWith {
|
||||
cc = tools.clang-unwrapped;
|
||||
extraPackages = [ libstdcxxHook ];
|
||||
};
|
||||
|
||||
libcxxClang = wrapCCWith {
|
||||
cc = tools.clang-unwrapped;
|
||||
extraPackages = [ targetLlvmLibraries.libcxx targetLlvmLibraries.libcxxabi ];
|
||||
};
|
||||
|
||||
lld = callPackage ./lld.nix {};
|
||||
|
||||
lldb = callPackage ./lldb.nix {};
|
||||
});
|
||||
|
||||
libraries = stdenv.lib.makeExtensible (libraries: let
|
||||
callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
|
||||
in {
|
||||
|
||||
stdenv = overrideCC stdenv buildLlvmTools.clang;
|
||||
|
||||
libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
|
||||
|
||||
libcxx = callPackage ./libc++ {};
|
||||
|
||||
libcxxabi = callPackage ./libc++abi.nix {};
|
||||
|
||||
openmp = callPackage ./openmp.nix {};
|
||||
});
|
||||
|
||||
in { inherit tools libraries; } // libraries // tools
|
@ -1,33 +0,0 @@
|
||||
diff --git a/lib/Target/Mips/MipsFastISel.cpp b/lib/Target/Mips/MipsFastISel.cpp
|
||||
index f79cb0e6..c6279046 100644
|
||||
--- a/lib/Target/Mips/MipsFastISel.cpp
|
||||
+++ b/lib/Target/Mips/MipsFastISel.cpp
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
+#include <array>
|
||||
|
||||
#define DEBUG_TYPE "mips-fastisel"
|
||||
|
||||
@@ -1268,13 +1269,13 @@ bool MipsFastISel::fastLowerArguments() {
|
||||
return false;
|
||||
}
|
||||
|
||||
- const ArrayRef<MCPhysReg> GPR32ArgRegs = {Mips::A0, Mips::A1, Mips::A2,
|
||||
- Mips::A3};
|
||||
- const ArrayRef<MCPhysReg> FGR32ArgRegs = {Mips::F12, Mips::F14};
|
||||
- const ArrayRef<MCPhysReg> AFGR64ArgRegs = {Mips::D6, Mips::D7};
|
||||
- ArrayRef<MCPhysReg>::iterator NextGPR32 = GPR32ArgRegs.begin();
|
||||
- ArrayRef<MCPhysReg>::iterator NextFGR32 = FGR32ArgRegs.begin();
|
||||
- ArrayRef<MCPhysReg>::iterator NextAFGR64 = AFGR64ArgRegs.begin();
|
||||
+ std::array<MCPhysReg, 4> GPR32ArgRegs = {{Mips::A0, Mips::A1, Mips::A2,
|
||||
+ Mips::A3}};
|
||||
+ std::array<MCPhysReg, 2> FGR32ArgRegs = {{Mips::F12, Mips::F14}};
|
||||
+ std::array<MCPhysReg, 2> AFGR64ArgRegs = {{Mips::D6, Mips::D7}};
|
||||
+ auto NextGPR32 = GPR32ArgRegs.begin();
|
||||
+ auto NextFGR32 = FGR32ArgRegs.begin();
|
||||
+ auto NextAFGR64 = AFGR64ArgRegs.begin();
|
||||
|
||||
struct AllocatedReg {
|
||||
const TargetRegisterClass *RC;
|
@ -1,59 +0,0 @@
|
||||
{ lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libc++";
|
||||
inherit version;
|
||||
|
||||
src = fetch "libcxx" "0k6cmjcxnp2pyl8xwy1wkyyckkmdrjddim94yf1gzjbjy9qi22jj";
|
||||
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxxabi.src}
|
||||
export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
|
||||
'';
|
||||
|
||||
patches = [
|
||||
# https://github.com/llvm-mirror/libcxx/commit/bcc92d75df0274b9593ebd097fcae60494e3bffc
|
||||
./pthread_mach_thread_np.patch
|
||||
# glibc 2.26 fix
|
||||
./xlocale-glibc-2.26.patch
|
||||
] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
|
||||
../../libcxx-0001-musl-hacks.patch
|
||||
../../libcxx-max_align_t.patch
|
||||
];
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
|
||||
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
|
||||
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
patchShebangs utils/cat_files.py
|
||||
'';
|
||||
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3;
|
||||
|
||||
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
|
||||
"-DLIBCXX_LIBCPPABI_VERSION=2"
|
||||
"-DLIBCXX_CXX_ABI=libcxxabi"
|
||||
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
linkCxxAbi = stdenv.isLinux;
|
||||
|
||||
setupHooks = [
|
||||
../../../../../build-support/setup-hooks/role.bash
|
||||
./setup-hook.sh
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxx.llvm.org/;
|
||||
description = "A new implementation of the C++ standard library, targeting C++11";
|
||||
license = with stdenv.lib.licenses; [ ncsa mit ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
From bcc92d75df0274b9593ebd097fcae60494e3bffc Mon Sep 17 00:00:00 2001
|
||||
From: Asiri Rathnayake <asiri.rathnayake@arm.com>
|
||||
Date: Thu, 26 Jan 2017 10:40:17 +0000
|
||||
Subject: [PATCH] Fix chromium build (libcxx)
|
||||
|
||||
Remove the reference to pthread_mach_thread_np() in libcxx headers.
|
||||
|
||||
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293167 91177308-0d34-0410-b5e6-96231b3b80d8
|
||||
---
|
||||
include/__threading_support | 11 -----------
|
||||
1 file changed, 11 deletions(-)
|
||||
|
||||
diff --git a/include/__threading_support b/include/__threading_support
|
||||
index 13ab769..dfe7fe1 100644
|
||||
--- a/include/__threading_support
|
||||
+++ b/include/__threading_support
|
||||
@@ -149,11 +149,6 @@ int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
|
||||
void (*init_routine)(void));
|
||||
|
||||
// Thread id
|
||||
-#if defined(__APPLE__) && !defined(__arm__)
|
||||
-_LIBCPP_THREAD_ABI_VISIBILITY
|
||||
-mach_port_t __libcpp_thread_get_port();
|
||||
-#endif
|
||||
-
|
||||
_LIBCPP_THREAD_ABI_VISIBILITY
|
||||
bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2);
|
||||
|
||||
@@ -297,12 +292,6 @@ int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
|
||||
}
|
||||
|
||||
// Thread id
|
||||
-#if defined(__APPLE__) && !defined(__arm__)
|
||||
-mach_port_t __libcpp_thread_get_port() {
|
||||
- return pthread_mach_thread_np(pthread_self());
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
// Returns non-zero if the thread ids are equal, otherwise 0
|
||||
bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2)
|
||||
{
|
@ -1,6 +0,0 @@
|
||||
# See pkgs/build-support/setup-hooks/role.bash
|
||||
getHostRole
|
||||
|
||||
linkCxxAbi="@linkCxxAbi@"
|
||||
export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1"
|
||||
export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}"
|
@ -1,19 +0,0 @@
|
||||
diff --git a/include/__locale b/include/__locale
|
||||
index f4882de..29443b4 100644
|
||||
--- a/include/__locale
|
||||
+++ b/include/__locale
|
||||
@@ -34,12 +34,12 @@
|
||||
# include <support/solaris/xlocale.h>
|
||||
#elif defined(_NEWLIB_VERSION)
|
||||
# include <support/newlib/xlocale.h>
|
||||
-#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
|
||||
+#elif (defined(__APPLE__) || defined(__FreeBSD__) \
|
||||
|| defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
|
||||
# include <xlocale.h>
|
||||
#elif defined(_LIBCPP_HAS_MUSL_LIBC)
|
||||
# include <support/musl/xlocale.h>
|
||||
-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
|
||||
+#endif // __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
@ -1,52 +0,0 @@
|
||||
{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "libc++abi";
|
||||
inherit version;
|
||||
|
||||
src = fetch "libcxxabi" "0cqvzallxh0nwiijsf6i4d5ds9m5ijfzywg7376ncv50i64if24g";
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
|
||||
|
||||
postUnpack = ''
|
||||
unpackFile ${libcxx.src}
|
||||
unpackFile ${llvm.src}
|
||||
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
|
||||
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export TRIPLE=x86_64-apple-darwin
|
||||
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
|
||||
patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-max_align_t.patch}
|
||||
'';
|
||||
|
||||
installPhase = if stdenv.isDarwin
|
||||
then ''
|
||||
for file in lib/*.dylib; do
|
||||
# this should be done in CMake, but having trouble figuring out
|
||||
# the magic combination of necessary CMake variables
|
||||
# if you fancy a try, take a look at
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
install_name_tool -id $out/$file $file
|
||||
done
|
||||
make install
|
||||
install -d 755 $out/include
|
||||
install -m 644 ../include/*.h $out/include
|
||||
''
|
||||
else ''
|
||||
install -d -m 755 $out/include $out/lib
|
||||
install -m 644 lib/libc++abi.a $out/lib
|
||||
install -m 644 lib/libc++abi.so.1.0 $out/lib
|
||||
install -m 644 ../include/cxxabi.h $out/include
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
|
||||
ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = http://libcxxabi.llvm.org/;
|
||||
description = "A new implementation of low level support for a standard C++ library";
|
||||
license = with stdenv.lib.licenses; [ ncsa mit ];
|
||||
maintainers = with stdenv.lib.maintainers; [ vlstill ];
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
};
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, llvm
|
||||
, version
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "lld";
|
||||
inherit version;
|
||||
|
||||
src = fetch "lld" "1v9nkpr158j4yd4zmi6rpnfxkp78r1fapr8wji9s6v176gji1kk3";
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ llvm ];
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = ''
|
||||
moveToOutput include "$dev"
|
||||
moveToOutput lib "$dev"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "The LLVM Linker";
|
||||
homepage = http://lld.llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
badPlatforms = [ "x86_64-darwin" ];
|
||||
};
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
From 94764369222a8e6c65420a6981d7f179a18a5417 Mon Sep 17 00:00:00 2001
|
||||
From: Will Dietz <w@wdtz.org>
|
||||
Date: Thu, 25 May 2017 15:03:42 -0500
|
||||
Subject: [PATCH] EditLine.h: libedit supports wide chars on NixOS
|
||||
|
||||
---
|
||||
include/lldb/Host/Editline.h | 5 +----
|
||||
1 file changed, 1 insertion(+), 4 deletions(-)
|
||||
|
||||
diff --git a/include/lldb/Host/Editline.h b/include/lldb/Host/Editline.h
|
||||
index faed373bc..b248cdee1 100644
|
||||
--- a/include/lldb/Host/Editline.h
|
||||
+++ b/include/lldb/Host/Editline.h
|
||||
@@ -43,12 +43,9 @@
|
||||
// will only be
|
||||
// used in cases where this is true. This is a compile time dependecy, for now
|
||||
// selected per target Platform
|
||||
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
+// (libedit on NixOS is always wide-char capable)
|
||||
#define LLDB_EDITLINE_USE_WCHAR 1
|
||||
#include <codecvt>
|
||||
-#else
|
||||
-#define LLDB_EDITLINE_USE_WCHAR 0
|
||||
-#endif
|
||||
|
||||
#include "lldb/Host/ConnectionFileDescriptor.h"
|
||||
#include "lldb/lldb-private.h"
|
||||
--
|
||||
2.13.0
|
||||
|
@ -1,63 +0,0 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, zlib
|
||||
, ncurses
|
||||
, swig
|
||||
, which
|
||||
, libedit
|
||||
, libxml2
|
||||
, llvm
|
||||
, clang-unwrapped
|
||||
, python3
|
||||
, version
|
||||
, darwin
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "lldb";
|
||||
inherit version;
|
||||
|
||||
src = fetch "lldb" "0yy43a27zx3r51b6gkv3v2mdiqcq3mf0ngki47ya0i30v3gx4cl4";
|
||||
|
||||
patches = [ ./lldb-libedit.patch ];
|
||||
postPatch = ''
|
||||
# Fix up various paths that assume llvm and clang are installed in the same place
|
||||
sed -i 's,".*ClangConfig.cmake","${clang-unwrapped}/lib/cmake/clang/ClangConfig.cmake",' \
|
||||
cmake/modules/LLDBStandalone.cmake
|
||||
sed -i 's,".*tools/clang/include","${clang-unwrapped}/include",' \
|
||||
cmake/modules/LLDBStandalone.cmake
|
||||
sed -i 's,"$.LLVM_LIBRARY_DIR.",${llvm}/lib ${clang-unwrapped}/lib,' \
|
||||
cmake/modules/LLDBStandalone.cmake
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake python3 which swig ];
|
||||
buildInputs = [ ncurses zlib libedit libxml2 llvm ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
|
||||
|
||||
CXXFLAGS = "-fno-rtti";
|
||||
hardeningDisable = [ "format" ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
|
||||
];
|
||||
|
||||
# Add missing include to fix error when using std::bind
|
||||
prePatch = ''
|
||||
sed -i -e '30i#include <functional>' include/lldb/Utility/TaskPool.h
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/man/man1
|
||||
cp ../docs/lldb.1 $out/share/man/man1/
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A next-generation high-performance debugger";
|
||||
homepage = http://llvm.org/;
|
||||
license = licenses.ncsa;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
|
||||
index 94d426b..37f7794 100644
|
||||
--- a/tools/llvm-config/llvm-config.cpp
|
||||
+++ b/tools/llvm-config/llvm-config.cpp
|
||||
@@ -333,6 +333,21 @@ int main(int argc, char **argv) {
|
||||
ActiveIncludeOption = "-I" + ActiveIncludeDir;
|
||||
}
|
||||
|
||||
+ /// Nix-specific multiple-output handling: override ActiveLibDir if --link-shared
|
||||
+ if (!IsInDevelopmentTree) {
|
||||
+ bool WantShared = true;
|
||||
+ for (int i = 1; i < argc; ++i) {
|
||||
+ StringRef Arg = argv[i];
|
||||
+ if (Arg == "--link-shared")
|
||||
+ WantShared = true;
|
||||
+ else if (Arg == "--link-static")
|
||||
+ WantShared = false; // the last one wins
|
||||
+ }
|
||||
+
|
||||
+ if (WantShared)
|
||||
+ ActiveLibDir = std::string("@lib@") + "/lib" + LLVM_LIBDIR_SUFFIX;
|
||||
+ }
|
||||
+
|
||||
/// We only use `shared library` mode in cases where the static library form
|
||||
/// of the components provided are not available; note however that this is
|
||||
/// skipped if we're run from within the build dir. However, once installed,
|
@ -1,194 +0,0 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, fetchpatch
|
||||
, cmake
|
||||
, python3
|
||||
, libffi
|
||||
, libbfd
|
||||
, libxml2
|
||||
, ncurses
|
||||
, version
|
||||
, release_version
|
||||
, zlib
|
||||
, compiler-rt_src
|
||||
, debugVersion ? false
|
||||
, enableManpages ? false
|
||||
, enableSharedLibraries ? !enableManpages
|
||||
}:
|
||||
|
||||
let
|
||||
# Used when creating a versioned symlinks of libLLVM.dylib
|
||||
versionSuffixes = with stdenv.lib;
|
||||
let parts = splitVersion release_version; in
|
||||
imap (i: _: concatStringsSep "." (take i parts)) parts;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
pname = "llvm";
|
||||
inherit version;
|
||||
|
||||
src = fetch "llvm" "0l9bf7kdwhlj0kq1hawpyxhna1062z3h7qcz2y8nfl9dz2qksy6s";
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile $src
|
||||
mv llvm-${version}* llvm
|
||||
sourceRoot=$PWD/llvm
|
||||
unpackFile ${compiler-rt_src}
|
||||
mv compiler-rt-* $sourceRoot/projects/compiler-rt
|
||||
'';
|
||||
|
||||
outputs = [ "out" ]
|
||||
++ stdenv.lib.optional enableSharedLibraries "lib";
|
||||
|
||||
nativeBuildInputs = [ cmake python3 ]
|
||||
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
|
||||
|
||||
buildInputs = [ libxml2 libffi ];
|
||||
|
||||
propagatedBuildInputs = [ ncurses zlib ];
|
||||
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
name = "0001-Fix-return-type-in-ORC-readMem-client-interface.patch";
|
||||
url = "https://bugzilla.redhat.com/attachment.cgi?id=1389687";
|
||||
sha256 = "0ga2123aclq3x9w72d0rm0az12m8c1i4r1106vh701hf4cghgbch";
|
||||
})
|
||||
./fix-gcc9.patch
|
||||
(fetchpatch {
|
||||
name = "llvm4-avoid-undefined-behavior-in-unittest.patch";
|
||||
url = "https://aur.archlinux.org/cgit/aur.git/plain/D32089-Avoid-undefined-behavior-in-unittest.patch?h=llvm40&id=f459b0bad8aa3b94bc2733d79d176071a32846a6";
|
||||
sha256 = "0x5q6a8lk6xg4ns4qh75fxvvmfnifwvyrq17ck85q8c0753i1irf";
|
||||
extraPrefix = "";
|
||||
})
|
||||
];
|
||||
|
||||
# TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
|
||||
# to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
|
||||
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
|
||||
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
|
||||
# a flag and turn the flag off during the stdenv build.
|
||||
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
substituteInPlace ./projects/compiler-rt/cmake/config-ix.cmake \
|
||||
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
|
||||
|
||||
substituteInPlace cmake/modules/AddLLVM.cmake \
|
||||
--replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \
|
||||
--replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' ""
|
||||
''
|
||||
# Patch llvm-config to return correct library path based on --link-{shared,static}.
|
||||
+ stdenv.lib.optionalString (enableSharedLibraries) ''
|
||||
substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
|
||||
patch -p1 < ./llvm-outputs.patch
|
||||
''
|
||||
+ ''
|
||||
(
|
||||
cd projects/compiler-rt
|
||||
patch -p1 < ${
|
||||
fetchpatch {
|
||||
name = "sigaltstack.patch"; # for glibc-2.26
|
||||
url = https://github.com/llvm-mirror/compiler-rt/commit/8a5e425a68d.diff;
|
||||
sha256 = "0h4y5vl74qaa7dl54b1fcyqalvlpd8zban2d1jxfkxpzyi7m8ifi";
|
||||
}
|
||||
}
|
||||
substituteInPlace lib/esan/esan_sideline_linux.cpp \
|
||||
--replace 'struct sigaltstack' 'stack_t'
|
||||
)
|
||||
'' + # Fix extra space printed in commandline help sometimes, "- help"
|
||||
''
|
||||
patch -p1 -i ${./cmdline-help.patch}
|
||||
'' + stdenv.lib.optionalString stdenv.isAarch64 ''
|
||||
patch -p0 < ${../aarch64.patch}
|
||||
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
patch -p1 -i ${../TLI-musl.patch}
|
||||
patch -p1 -i ${../dynamiclibrary-musl.patch}
|
||||
patch -p1 -i ${./sanitizers-nongnu.patch} -d projects/compiler-rt
|
||||
'';
|
||||
|
||||
# hacky fix: created binaries need to be run before installation
|
||||
preBuild = ''
|
||||
mkdir -p $out/
|
||||
ln -sv $PWD/lib $out
|
||||
'';
|
||||
|
||||
cmakeFlags = with stdenv; [
|
||||
"-DCMAKE_BUILD_TYPE=${if debugVersion then "Debug" else "Release"}"
|
||||
"-DLLVM_INSTALL_UTILS=ON" # Needed by rustc
|
||||
"-DLLVM_BUILD_TESTS=ON"
|
||||
"-DLLVM_ENABLE_FFI=ON"
|
||||
"-DLLVM_ENABLE_RTTI=ON"
|
||||
"-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code
|
||||
|
||||
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
|
||||
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
|
||||
"-DTARGET_TRIPLE=${stdenv.hostPlatform.config}"
|
||||
]
|
||||
++ stdenv.lib.optional enableSharedLibraries
|
||||
"-DLLVM_LINK_LLVM_DYLIB=ON"
|
||||
++ stdenv.lib.optionals enableManpages [
|
||||
"-DLLVM_BUILD_DOCS=ON"
|
||||
"-DLLVM_ENABLE_SPHINX=ON"
|
||||
"-DSPHINX_OUTPUT_MAN=ON"
|
||||
"-DSPHINX_OUTPUT_HTML=OFF"
|
||||
"-DSPHINX_WARNINGS_AS_ERRORS=OFF"
|
||||
]
|
||||
++ stdenv.lib.optional (!isDarwin)
|
||||
"-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
|
||||
++ stdenv.lib.optionals (isDarwin) [
|
||||
"-DLLVM_ENABLE_LIBCXX=ON"
|
||||
"-DCAN_TARGET_i386=false"
|
||||
];
|
||||
|
||||
postBuild = ''
|
||||
rm -fR $out
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/lib
|
||||
'';
|
||||
|
||||
postInstall = stdenv.lib.optionalString enableSharedLibraries ''
|
||||
moveToOutput "lib/libLLVM-*" "$lib"
|
||||
moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
|
||||
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
|
||||
''
|
||||
+ stdenv.lib.optionalString (stdenv.isDarwin && enableSharedLibraries) ''
|
||||
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
|
||||
${stdenv.lib.concatMapStringsSep "\n" (v: ''
|
||||
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
|
||||
'') versionSuffixes}
|
||||
'';
|
||||
|
||||
doCheck = stdenv.isLinux && (!stdenv.isi686);
|
||||
|
||||
checkTarget = "check-all";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "Collection of modular and reusable compiler and toolchain technologies";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.ncsa;
|
||||
maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ];
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs enableManpages {
|
||||
pname = "llvm-manpages";
|
||||
|
||||
buildPhase = ''
|
||||
make docs-llvm-man
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [ ];
|
||||
|
||||
installPhase = ''
|
||||
make -C docs install
|
||||
'';
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta.description = "man pages for LLVM ${version}";
|
||||
})
|
@ -1,26 +0,0 @@
|
||||
{ stdenv
|
||||
, fetch
|
||||
, cmake
|
||||
, llvm
|
||||
, perl
|
||||
, version
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "openmp";
|
||||
inherit version;
|
||||
|
||||
src = fetch "openmp" "195dykamd39yhi5az7nqj3ksqhb3wq30l93jnfkxl0061qbknsgc";
|
||||
|
||||
nativeBuildInputs = [ cmake perl ];
|
||||
buildInputs = [ llvm ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "Components required to build an executable OpenMP program";
|
||||
homepage = http://openmp.llvm.org/;
|
||||
license = stdenv.lib.licenses.mit;
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
@ -1,368 +0,0 @@
|
||||
From dac4d3912378069b44340204e5fc6237aa1baf94 Mon Sep 17 00:00:00 2001
|
||||
From: Matthias Maier <tamiko@43-1.org>
|
||||
Date: Fri, 5 May 2017 17:47:39 +0000
|
||||
Subject: [PATCH] Musl patches
|
||||
|
||||
Ported to compiler-rt-sanitizers-4.0.0. Taken from
|
||||
|
||||
https://gist.githubusercontent.com/pwaller/2337f3290f12634cad3e3730cff0a6c1/raw/83c87a8585e2f9662494db5662e5361beb093c26/nongnu.patch
|
||||
---
|
||||
lib/asan/asan_linux.cc | 4 +--
|
||||
lib/interception/interception_linux.cc | 2 +-
|
||||
lib/interception/interception_linux.h | 2 +-
|
||||
lib/msan/msan_linux.cc | 2 +-
|
||||
.../sanitizer_common_interceptors_ioctl.inc | 4 +--
|
||||
lib/sanitizer_common/sanitizer_common_syscalls.inc | 2 +-
|
||||
lib/sanitizer_common/sanitizer_linux_libcdep.cc | 12 +++----
|
||||
lib/sanitizer_common/sanitizer_platform.h | 7 ++++
|
||||
.../sanitizer_platform_interceptors.h | 2 +-
|
||||
.../sanitizer_platform_limits_posix.cc | 39 +++++++++++++---------
|
||||
lib/tsan/rtl/tsan_platform_linux.cc | 2 +-
|
||||
11 files changed, 46 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
|
||||
index c051573dd..e295f6004 100644
|
||||
--- a/lib/asan/asan_linux.cc
|
||||
+++ b/lib/asan/asan_linux.cc
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <sys/link_elf.h>
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_ANDROID || SANITIZER_FREEBSD
|
||||
+#if SANITIZER_ANDROID || SANITIZER_FREEBSD || SANITIZER_NONGNU
|
||||
#include <ucontext.h>
|
||||
extern "C" void* _DYNAMIC;
|
||||
#else
|
||||
@@ -80,7 +80,7 @@ void AsanApplyToGlobals(globals_op_fptr op, const void *needle) {
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
||||
-#if SANITIZER_ANDROID
|
||||
+#if SANITIZER_ANDROID || SANITIZER_NONGNU
|
||||
// FIXME: should we do anything for Android?
|
||||
void AsanCheckDynamicRTPrereqs() {}
|
||||
void AsanCheckIncompatibleRT() {}
|
||||
diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
|
||||
index 6e908ac01..8f23d9adc 100644
|
||||
--- a/lib/interception/interception_linux.cc
|
||||
+++ b/lib/interception/interception_linux.cc
|
||||
@@ -24,7 +24,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
|
||||
return real == wrapper;
|
||||
}
|
||||
|
||||
-#if !defined(__ANDROID__) // android does not have dlvsym
|
||||
+#if !defined(__ANDROID__) && !SANITIZER_NONGNU // android does not have dlvsym
|
||||
void *GetFuncAddrVer(const char *func_name, const char *ver) {
|
||||
return dlvsym(RTLD_NEXT, func_name, ver);
|
||||
}
|
||||
diff --git a/lib/interception/interception_linux.h b/lib/interception/interception_linux.h
|
||||
index 27a66c882..3b559a303 100644
|
||||
--- a/lib/interception/interception_linux.h
|
||||
+++ b/lib/interception/interception_linux.h
|
||||
@@ -34,7 +34,7 @@ void *GetFuncAddrVer(const char *func_name, const char *ver);
|
||||
(::__interception::uptr) & (func), \
|
||||
(::__interception::uptr) & WRAP(func))
|
||||
|
||||
-#if !defined(__ANDROID__) // android does not have dlvsym
|
||||
+#if !defined(__ANDROID__) && !SANITIZER_NONGNU // android does not have dlvsym
|
||||
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
|
||||
(::__interception::real_##func = (func##_f)( \
|
||||
unsigned long)::__interception::GetFuncAddrVer(#func, symver))
|
||||
diff --git a/lib/msan/msan_linux.cc b/lib/msan/msan_linux.cc
|
||||
index 0a687f620..0852d97d7 100644
|
||||
--- a/lib/msan/msan_linux.cc
|
||||
+++ b/lib/msan/msan_linux.cc
|
||||
@@ -13,7 +13,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "sanitizer_common/sanitizer_platform.h"
|
||||
-#if SANITIZER_FREEBSD || SANITIZER_LINUX
|
||||
+#if SANITIZER_FREEBSD || SANITIZER_LINUX && !SANITIZER_NONGNU
|
||||
|
||||
#include "msan.h"
|
||||
#include "msan_thread.h"
|
||||
diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
|
||||
index 4ed9afedf..64f584e93 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
|
||||
+++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
|
||||
@@ -100,7 +100,7 @@ static void ioctl_table_fill() {
|
||||
_(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX
|
||||
+#if SANITIZER_LINUX && !SANITIZER_NONGNU
|
||||
// Conflicting request ids.
|
||||
// _(CDROMAUDIOBUFSIZ, NONE, 0);
|
||||
// _(SNDCTL_TMR_CONTINUE, NONE, 0);
|
||||
@@ -361,7 +361,7 @@ static void ioctl_table_fill() {
|
||||
_(VT_WAITACTIVE, NONE, 0);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
// _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
|
||||
_(CYGETDEFTHRESH, WRITE, sizeof(int));
|
||||
_(CYGETDEFTIMEOUT, WRITE, sizeof(int));
|
||||
diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc
|
||||
index 469c8eb7e..24f87867d 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_common_syscalls.inc
|
||||
+++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc
|
||||
@@ -2038,7 +2038,7 @@ POST_SYSCALL(setrlimit)(long res, long resource, void *rlim) {
|
||||
}
|
||||
}
|
||||
|
||||
-#if !SANITIZER_ANDROID
|
||||
+#if !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
PRE_SYSCALL(prlimit64)(long pid, long resource, const void *new_rlim,
|
||||
void *old_rlim) {
|
||||
if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz);
|
||||
diff --git a/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
|
||||
index f99f0b594..3a773a94e 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_linux_libcdep.cc
|
||||
+++ b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
|
||||
@@ -152,7 +152,7 @@ bool SanitizerGetThreadName(char *name, int max_len) {
|
||||
#endif
|
||||
}
|
||||
|
||||
-#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO
|
||||
+#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && !SANITIZER_NONGNU
|
||||
static uptr g_tls_size;
|
||||
|
||||
#ifdef __i386__
|
||||
@@ -180,11 +180,11 @@ void InitTlsSize() {
|
||||
}
|
||||
#else
|
||||
void InitTlsSize() { }
|
||||
-#endif // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO
|
||||
+#endif // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && !SANITIZER_NONGNU
|
||||
|
||||
#if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) \
|
||||
|| defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__)) \
|
||||
- && SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+ && SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
// sizeof(struct pthread) from glibc.
|
||||
static atomic_uintptr_t kThreadDescriptorSize;
|
||||
|
||||
@@ -338,7 +338,7 @@ uptr ThreadSelf() {
|
||||
|
||||
#if !SANITIZER_GO
|
||||
static void GetTls(uptr *addr, uptr *size) {
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
# if defined(__x86_64__) || defined(__i386__) || defined(__s390__)
|
||||
*addr = ThreadSelf();
|
||||
*size = GetTlsSize();
|
||||
@@ -364,7 +364,7 @@ static void GetTls(uptr *addr, uptr *size) {
|
||||
*addr = (uptr) dtv[2];
|
||||
*size = (*addr == 0) ? 0 : ((uptr) segbase[0] - (uptr) dtv[2]);
|
||||
}
|
||||
-#elif SANITIZER_ANDROID
|
||||
+#elif SANITIZER_ANDROID || SANITIZER_NONGNU
|
||||
*addr = 0;
|
||||
*size = 0;
|
||||
#else
|
||||
@@ -375,7 +375,7 @@ static void GetTls(uptr *addr, uptr *size) {
|
||||
|
||||
#if !SANITIZER_GO
|
||||
uptr GetTlsSize() {
|
||||
-#if SANITIZER_FREEBSD || SANITIZER_ANDROID
|
||||
+#if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NONGNU
|
||||
uptr addr, size;
|
||||
GetTls(&addr, &size);
|
||||
return size;
|
||||
diff --git a/lib/sanitizer_common/sanitizer_platform.h b/lib/sanitizer_common/sanitizer_platform.h
|
||||
index d9a8e8df1..fe01c5744 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_platform.h
|
||||
+++ b/lib/sanitizer_common/sanitizer_platform.h
|
||||
@@ -162,6 +162,13 @@
|
||||
# define SANITIZER_PPC64V2 0
|
||||
#endif
|
||||
|
||||
+
|
||||
+#if defined(__linux__) && !defined(__GLIBC__)
|
||||
+# define SANITIZER_NONGNU 1
|
||||
+#else
|
||||
+# define SANITIZER_NONGNU 0
|
||||
+#endif
|
||||
+
|
||||
// By default we allow to use SizeClassAllocator64 on 64-bit platform.
|
||||
// But in some cases (e.g. AArch64's 39-bit address space) SizeClassAllocator64
|
||||
// does not work well and we need to fallback to SizeClassAllocator32.
|
||||
diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
|
||||
index 62875d11a..212e6e882 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
|
||||
+++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
|
||||
@@ -23,7 +23,7 @@
|
||||
# define SI_NOT_WINDOWS 0
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
# define SI_LINUX_NOT_ANDROID 1
|
||||
#else
|
||||
# define SI_LINUX_NOT_ANDROID 0
|
||||
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
index 683f019d7..fd4880962 100644
|
||||
--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "sanitizer_platform.h"
|
||||
|
||||
+#define _LINUX_SYSINFO_H
|
||||
+
|
||||
#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC
|
||||
// Tests in this file assume that off_t-dependent data structures match the
|
||||
// libc ABI. For example, struct dirent here is what readdir() function (as
|
||||
@@ -139,12 +141,14 @@ typedef struct user_fpregs elf_fpregset_t;
|
||||
|
||||
#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
#include <glob.h>
|
||||
-#include <obstack.h>
|
||||
+# if !SANITIZER_NONGNU
|
||||
+# include <obstack.h>
|
||||
+# endif
|
||||
#include <mqueue.h>
|
||||
-#include <net/if_ppp.h>
|
||||
-#include <netax25/ax25.h>
|
||||
-#include <netipx/ipx.h>
|
||||
-#include <netrom/netrom.h>
|
||||
+#include <linux/if_ppp.h>
|
||||
+#include <linux/ax25.h>
|
||||
+#include <linux/ipx.h>
|
||||
+#include <linux/netrom.h>
|
||||
#if HAVE_RPC_XDR_H
|
||||
# include <rpc/xdr.h>
|
||||
#elif HAVE_TIRPC_RPC_XDR_H
|
||||
@@ -160,7 +164,8 @@ typedef struct user_fpregs elf_fpregset_t;
|
||||
# include <sys/procfs.h>
|
||||
#endif
|
||||
#include <sys/user.h>
|
||||
-#include <sys/ustat.h>
|
||||
+// #include <sys/ustat.h>
|
||||
+#include <sys/statfs.h>
|
||||
#include <linux/cyclades.h>
|
||||
#include <linux/if_eql.h>
|
||||
#include <linux/if_plip.h>
|
||||
@@ -252,7 +257,7 @@ namespace __sanitizer {
|
||||
unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
|
||||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
unsigned struct_ustat_sz = sizeof(struct ustat);
|
||||
unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
|
||||
unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
|
||||
@@ -310,7 +315,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(ElfW(Phdr));
|
||||
unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
|
||||
#endif
|
||||
|
||||
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
||||
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
int glob_nomatch = GLOB_NOMATCH;
|
||||
int glob_altdirfunc = GLOB_ALTDIRFUNC;
|
||||
#endif
|
||||
@@ -404,7 +409,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
|
||||
unsigned struct_termios_sz = sizeof(struct termios);
|
||||
unsigned struct_winsize_sz = sizeof(struct winsize);
|
||||
|
||||
-#if SANITIZER_LINUX
|
||||
+#if SANITIZER_LINUX && !SANITIZER_NONGNU
|
||||
unsigned struct_arpreq_sz = sizeof(struct arpreq);
|
||||
unsigned struct_cdrom_msf_sz = sizeof(struct cdrom_msf);
|
||||
unsigned struct_cdrom_multisession_sz = sizeof(struct cdrom_multisession);
|
||||
@@ -454,7 +459,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
|
||||
unsigned struct_vt_mode_sz = sizeof(struct vt_mode);
|
||||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
|
||||
unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
|
||||
#if EV_VERSION > (0x010000)
|
||||
@@ -822,7 +827,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
|
||||
unsigned IOCTL_VT_WAITACTIVE = VT_WAITACTIVE;
|
||||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
|
||||
unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
|
||||
unsigned IOCTL_CYGETMON = CYGETMON;
|
||||
@@ -985,7 +990,7 @@ CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phdr);
|
||||
CHECK_SIZE_AND_OFFSET(dl_phdr_info, dlpi_phnum);
|
||||
#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
|
||||
|
||||
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
||||
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
CHECK_TYPE_SIZE(glob_t);
|
||||
CHECK_SIZE_AND_OFFSET(glob_t, gl_pathc);
|
||||
CHECK_SIZE_AND_OFFSET(glob_t, gl_pathv);
|
||||
@@ -1019,6 +1024,7 @@ CHECK_TYPE_SIZE(iovec);
|
||||
CHECK_SIZE_AND_OFFSET(iovec, iov_base);
|
||||
CHECK_SIZE_AND_OFFSET(iovec, iov_len);
|
||||
|
||||
+#if !SANITIZER_NONGNU
|
||||
CHECK_TYPE_SIZE(msghdr);
|
||||
CHECK_SIZE_AND_OFFSET(msghdr, msg_name);
|
||||
CHECK_SIZE_AND_OFFSET(msghdr, msg_namelen);
|
||||
@@ -1032,6 +1038,7 @@ CHECK_TYPE_SIZE(cmsghdr);
|
||||
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
|
||||
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
|
||||
CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
|
||||
+#endif
|
||||
|
||||
COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent));
|
||||
CHECK_SIZE_AND_OFFSET(dirent, d_ino);
|
||||
@@ -1134,7 +1141,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
|
||||
|
||||
CHECK_TYPE_SIZE(ether_addr);
|
||||
|
||||
-#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID
|
||||
+#if (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
CHECK_TYPE_SIZE(ipc_perm);
|
||||
# if SANITIZER_FREEBSD
|
||||
CHECK_SIZE_AND_OFFSET(ipc_perm, key);
|
||||
@@ -1195,7 +1202,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
|
||||
CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX
|
||||
+#if SANITIZER_LINUX && !SANITIZER_NONGNU
|
||||
COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo));
|
||||
#endif
|
||||
|
||||
@@ -1245,7 +1252,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE);
|
||||
COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE));
|
||||
CHECK_SIZE_AND_OFFSET(FILE, _flags);
|
||||
CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr);
|
||||
@@ -1264,7 +1271,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain);
|
||||
CHECK_SIZE_AND_OFFSET(FILE, _fileno);
|
||||
#endif
|
||||
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
COMPILER_CHECK(sizeof(__sanitizer__obstack_chunk) <= sizeof(_obstack_chunk));
|
||||
CHECK_SIZE_AND_OFFSET(_obstack_chunk, limit);
|
||||
CHECK_SIZE_AND_OFFSET(_obstack_chunk, prev);
|
||||
diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc
|
||||
index 3313288a7..103c7b6b9 100644
|
||||
--- a/lib/tsan/rtl/tsan_platform_linux.cc
|
||||
+++ b/lib/tsan/rtl/tsan_platform_linux.cc
|
||||
@@ -287,7 +287,7 @@ void InitializePlatform() {
|
||||
// This is required to properly "close" the fds, because we do not see internal
|
||||
// closes within glibc. The code is a pure hack.
|
||||
int ExtractResolvFDs(void *state, int *fds, int nfd) {
|
||||
-#if SANITIZER_LINUX && !SANITIZER_ANDROID
|
||||
+#if SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
|
||||
int cnt = 0;
|
||||
__res_state *statp = (__res_state*)state;
|
||||
for (int i = 0; i < MAXNS && cnt < nfd; i++) {
|
||||
--
|
||||
2.16.2
|
||||
|
@ -1,33 +0,0 @@
|
||||
From d12ecb83d01dcb580dd94f4d57828f33d3eb4c35 Mon Sep 17 00:00:00 2001
|
||||
From: Natanael Copa <ncopa@alpinelinux.org>
|
||||
Date: Thu, 18 Feb 2016 15:33:21 +0100
|
||||
Subject: [PATCH 3/3] Fix DynamicLibrary to build with musl libc
|
||||
|
||||
stdin/out/err is part of the libc and not the kernel so we check for the
|
||||
specific libc that does the unexpected instead of linux.
|
||||
|
||||
This is needed for making it build with musl libc.
|
||||
---
|
||||
lib/Support/DynamicLibrary.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp
|
||||
index 9a7aeb5..0c1c8f8 100644
|
||||
--- a/lib/Support/DynamicLibrary.cpp
|
||||
+++ b/lib/Support/DynamicLibrary.cpp
|
||||
@@ -140,10 +140,10 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
|
||||
#define EXPLICIT_SYMBOL(SYM) \
|
||||
if (!strcmp(symbolName, #SYM)) return &SYM
|
||||
|
||||
-// On linux we have a weird situation. The stderr/out/in symbols are both
|
||||
+// On GNU libc we have a weird situation. The stderr/out/in symbols are both
|
||||
// macros and global variables because of standards requirements. So, we
|
||||
// boldly use the EXPLICIT_SYMBOL macro without checking for a #define first.
|
||||
-#if defined(__linux__) and !defined(__ANDROID__)
|
||||
+#if defined(__GLIBC__)
|
||||
{
|
||||
EXPLICIT_SYMBOL(stderr);
|
||||
EXPLICIT_SYMBOL(stdout);
|
||||
--
|
||||
2.7.3
|
||||
|
@ -1,13 +0,0 @@
|
||||
diff --git a/utils/llvm-build/llvmbuild/main.py b/utils/llvm-build/llvmbuild/main.py
|
||||
index eacefdf60bf..40d25f5cef8 100644
|
||||
--- a/utils/llvm-build/llvmbuild/main.py
|
||||
+++ b/utils/llvm-build/llvmbuild/main.py
|
||||
@@ -412,7 +412,7 @@ subdirectories = %s
|
||||
if library_name is None:
|
||||
library_name_as_cstr = '0'
|
||||
else:
|
||||
- library_name_as_cstr = '"lib%s.a"' % library_name
|
||||
+ library_name_as_cstr = '"lib%s.so"' % library_name
|
||||
f.write(' { "%s", %s, %d, { %s } },\n' % (
|
||||
name, library_name_as_cstr, is_installed,
|
||||
', '.join('"%s"' % dep
|
@ -1,54 +0,0 @@
|
||||
From 917331c88bd2afce0cf0fdbcab55a64541b5bcf0 Mon Sep 17 00:00:00 2001
|
||||
From: "David L. Jones" <dlj@google.com>
|
||||
Date: Fri, 10 Feb 2017 01:27:42 +0000
|
||||
Subject: [PATCH] Check for musl-libc's max_align_t in addition to other
|
||||
variants.
|
||||
|
||||
Summary:
|
||||
Libcxx will define its own max_align_t when it is not available. However, the
|
||||
availability checks today only check for Clang's definition and GCC's
|
||||
definition. In particular, it does not check for musl's definition, which is the
|
||||
same as GCC's but guarded with a different macro.
|
||||
|
||||
Reviewers: mclow.lists, EricWF
|
||||
|
||||
Reviewed By: EricWF
|
||||
|
||||
Subscribers: chandlerc, cfe-commits
|
||||
|
||||
Differential Revision: https://reviews.llvm.org/D28478
|
||||
|
||||
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294683 91177308-0d34-0410-b5e6-96231b3b80d8
|
||||
---
|
||||
include/cstddef | 3 ++-
|
||||
include/stddef.h | 3 ++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/cstddef b/include/cstddef
|
||||
index edd106c00..103898b7d 100644
|
||||
--- a/include/cstddef
|
||||
+++ b/include/cstddef
|
||||
@@ -48,7 +48,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
using ::ptrdiff_t;
|
||||
using ::size_t;
|
||||
|
||||
-#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T)
|
||||
+#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) || \
|
||||
+ defined(__DEFINED_max_align_t)
|
||||
// Re-use the compiler's <stddef.h> max_align_t where possible.
|
||||
using ::max_align_t;
|
||||
#else
|
||||
diff --git a/include/stddef.h b/include/stddef.h
|
||||
index 8841bbea2..faf8552d8 100644
|
||||
--- a/include/stddef.h
|
||||
+++ b/include/stddef.h
|
||||
@@ -53,7 +53,8 @@ using std::nullptr_t;
|
||||
}
|
||||
|
||||
// Re-use the compiler's <stddef.h> max_align_t where possible.
|
||||
-#if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T)
|
||||
+#if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T) && \
|
||||
+ !defined(__DEFINED_max_align_t)
|
||||
typedef long double max_align_t;
|
||||
#endif
|
||||
|
@ -6,7 +6,7 @@
|
||||
, makeWrapper
|
||||
, boost
|
||||
, llvmPackages
|
||||
, llvmPackages_4
|
||||
, llvmPackages_5
|
||||
, gmp
|
||||
, emacs
|
||||
, emacs25-nox
|
||||
@ -48,7 +48,7 @@ in stdenv.mkDerivation rec {
|
||||
"-DCMAKE_C_COMPILER=${llvmPackages.clang}/bin/clang"
|
||||
"-DBoost_USE_STATIC_LIBS=OFF"
|
||||
"-DMOZART_BOOST_USE_STATIC_LIBS=OFF"
|
||||
"-DCMAKE_PROGRAM_PATH=${llvmPackages_4.clang}/bin"
|
||||
"-DCMAKE_PROGRAM_PATH=${llvmPackages_5.clang}/bin"
|
||||
# Rationale: Nix's cc-wrapper needs to see a compile flag (like -c) to
|
||||
# infer that it is not a linking call, and stop trashing the command line
|
||||
# with linker flags.
|
||||
@ -69,9 +69,9 @@ in stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
llvmPackages_4.llvm
|
||||
llvmPackages_4.clang
|
||||
llvmPackages_4.clang-unwrapped
|
||||
llvmPackages_5.llvm
|
||||
llvmPackages_5.clang
|
||||
llvmPackages_5.clang-unwrapped
|
||||
gmp
|
||||
emacs25-nox
|
||||
jre_headless
|
||||
|
@ -5,7 +5,7 @@ with haskellLib;
|
||||
self: super: {
|
||||
|
||||
# Suitable LLVM version.
|
||||
llvmPackages = pkgs.llvmPackages_39;
|
||||
llvmPackages = pkgs.llvmPackages;
|
||||
|
||||
# Disable GHC 8.2.x core libraries.
|
||||
array = null;
|
||||
|
@ -282,20 +282,6 @@ self: super: builtins.intersectAttrs super {
|
||||
# Uses OpenGL in testing
|
||||
caramia = dontCheck super.caramia;
|
||||
|
||||
llvm-general =
|
||||
# Supports only 3.5 for now, https://github.com/bscarlet/llvm-general/issues/142
|
||||
let base = super.llvm-general.override { llvm-config = pkgs.llvm_35; };
|
||||
in if !pkgs.stdenv.isDarwin then base else overrideCabal base (
|
||||
drv: {
|
||||
preConfigure = ''
|
||||
sed -i llvm-general.cabal \
|
||||
-e 's,extra-libraries: stdc++,extra-libraries: c++,'
|
||||
'';
|
||||
configureFlags = (drv.configureFlags or []) ++ ["--extra-include-dirs=${pkgs.libcxx}/include/c++/v1"];
|
||||
librarySystemDepends = [ pkgs.libcxx ] ++ drv.librarySystemDepends or [];
|
||||
}
|
||||
);
|
||||
|
||||
llvm-hs =
|
||||
let llvmHsWithLlvm8 = super.llvm-hs.override { llvm-config = pkgs.llvm_8; };
|
||||
in
|
||||
|
@ -40,5 +40,6 @@ stdenv.mkDerivation rec {
|
||||
platforms = with lib.platforms;
|
||||
linux;
|
||||
license = lib.licenses.gpl3Plus;
|
||||
broken = true;
|
||||
};
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ stdenv, writeScript, fetchurl, requireFile, unzip, clang_35, mono, which,
|
||||
{ stdenv, writeScript, fetchurl, requireFile, unzip, clang, mono, which,
|
||||
xorg, xdg-user-dirs }:
|
||||
|
||||
let
|
||||
@ -70,7 +70,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
cp -r . "$sharedir"
|
||||
'';
|
||||
buildInputs = [ clang_35 mono which xdg-user-dirs ];
|
||||
buildInputs = [ clang mono which xdg-user-dirs ];
|
||||
|
||||
meta = {
|
||||
description = "A suite of integrated tools for game developers to design and build games, simulations, and visualizations";
|
||||
|
@ -1,17 +1,17 @@
|
||||
{ stdenv, fetchFromGitHub, pkgconfig, cmake, curl, zlib, ffmpeg, glew, pcre
|
||||
, rtmpdump, cairo, boost, SDL2, SDL2_mixer, libjpeg, gnome2, lzma, nasm
|
||||
, llvm_39, glibmm
|
||||
, llvm, glibmm
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lightspark";
|
||||
version = "0.8.1";
|
||||
version = "0.8.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lightspark";
|
||||
repo = "lightspark";
|
||||
rev = version;
|
||||
sha256 = "0chydd516wfi73n8dvivk6nwxb9kjimdfghyv9sffmqmza0mv13s";
|
||||
sha256 = "04wn6d6gmpf848x0yghw26m9syv0hm6q5dwqiw3fxhs155jjqfgv";
|
||||
};
|
||||
|
||||
patchPhase = ''
|
||||
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [
|
||||
curl zlib ffmpeg glew pcre rtmpdump cairo boost SDL2 SDL2_mixer libjpeg
|
||||
gnome2.pango lzma nasm llvm_39 glibmm
|
||||
gnome2.pango lzma nasm llvm glibmm
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
@ -165,7 +165,7 @@ in rec {
|
||||
ln -s ${bootstrapTools}/include/c++ $out/include/c++
|
||||
'';
|
||||
linkCxxAbi = false;
|
||||
setupHook = ../../development/compilers/llvm/3.9/libc++/setup-hook.sh;
|
||||
setupHook = ../../development/compilers/llvm/7/libc++/setup-hook.sh;
|
||||
};
|
||||
|
||||
libcxxabi = stdenv.mkDerivation {
|
||||
|
@ -10,10 +10,6 @@ with pkgs;
|
||||
cc-wrapper-gcc9 = callPackage ./cc-wrapper { stdenv = gcc9Stdenv; };
|
||||
cc-wrapper-clang = callPackage ./cc-wrapper { stdenv = llvmPackages.stdenv; };
|
||||
cc-wrapper-libcxx = callPackage ./cc-wrapper { stdenv = llvmPackages.libcxxStdenv; };
|
||||
cc-wrapper-clang-39 = callPackage ./cc-wrapper { stdenv = llvmPackages_39.stdenv; };
|
||||
cc-wrapper-libcxx-39 = callPackage ./cc-wrapper { stdenv = llvmPackages_39.libcxxStdenv; };
|
||||
cc-wrapper-clang-4 = callPackage ./cc-wrapper { stdenv = llvmPackages_4.stdenv; };
|
||||
cc-wrapper-libcxx-4 = callPackage ./cc-wrapper { stdenv = llvmPackages_4.libcxxStdenv; };
|
||||
cc-wrapper-clang-5 = callPackage ./cc-wrapper { stdenv = llvmPackages_5.stdenv; };
|
||||
cc-wrapper-libcxx-5 = callPackage ./cc-wrapper { stdenv = llvmPackages_5.libcxxStdenv; };
|
||||
cc-wrapper-clang-6 = callPackage ./cc-wrapper { stdenv = llvmPackages_6.stdenv; };
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchFromGitHub, rustPlatform, pkgconfig, openssl, libsodium
|
||||
, llvmPackages, clang_39, lzma
|
||||
, llvmPackages, clang, lzma
|
||||
, Security }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec {
|
||||
./v3.1.1-fix-Cargo.lock.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ pkgconfig llvmPackages.libclang clang_39 ];
|
||||
nativeBuildInputs = [ pkgconfig llvmPackages.libclang clang ];
|
||||
buildInputs = [ openssl libsodium lzma ]
|
||||
++ (stdenv.lib.optional stdenv.isDarwin Security);
|
||||
|
||||
|
@ -540,4 +540,21 @@ mapAliases ({
|
||||
tor-browser-bundle = throw "tor-browser-bundle was removed because it was out of date and inadequately maintained. Please use tor-browser-bundle-bin instead. See #77452.";
|
||||
# added 2020-01-10
|
||||
tor-browser-unwrapped = throw "tor-browser-unwrapped was removed because it was out of date and inadequately maintained. Please use tor-browser-bundle-bin instead. See #77452.";
|
||||
|
||||
/* Cleanup before 20.09 */
|
||||
llvm_4 = throw ''
|
||||
The LLVM versions 3.5, 3.9 and 4.0 have been removed in NixOS 20.03
|
||||
due to a lack of compatibility with glibc 2.30!
|
||||
'';
|
||||
llvm_39 = llvm_4;
|
||||
llvm_35 = llvm_4;
|
||||
lld_4 = llvm_4;
|
||||
|
||||
llvmPackages_4 = llvm_4;
|
||||
llvmPackages_39 = llvm_4;
|
||||
llvmPackages_35 = llvm_4;
|
||||
|
||||
clang_39 = llvm_4;
|
||||
clang_35 = llvm_4;
|
||||
clang_4 = llvm_4;
|
||||
})
|
||||
|
@ -7826,9 +7826,6 @@ in
|
||||
clang_7 = llvmPackages_7.clang;
|
||||
clang_6 = llvmPackages_6.clang;
|
||||
clang_5 = llvmPackages_5.clang;
|
||||
clang_4 = llvmPackages_4.clang;
|
||||
clang_39 = llvmPackages_39.clang;
|
||||
clang_35 = wrapCC llvmPackages_35.clang;
|
||||
|
||||
clang-tools = callPackage ../development/tools/clang-tools {
|
||||
llvmPackages = llvmPackages_latest;
|
||||
@ -8523,7 +8520,6 @@ in
|
||||
lizardfs = callPackage ../tools/filesystems/lizardfs { };
|
||||
|
||||
lld = llvmPackages.lld;
|
||||
lld_4 = llvmPackages_4.lld;
|
||||
lld_5 = llvmPackages_5.lld;
|
||||
lld_6 = llvmPackages_6.lld;
|
||||
lld_7 = llvmPackages_7.lld;
|
||||
@ -8531,7 +8527,6 @@ in
|
||||
lld_9 = llvmPackages_9.lld;
|
||||
|
||||
lldb = llvmPackages.lldb;
|
||||
lldb_4 = llvmPackages_4.lldb;
|
||||
lldb_5 = llvmPackages_5.lldb;
|
||||
lldb_6 = llvmPackages_6.lldb;
|
||||
lldb_7 = llvmPackages_7.lldb;
|
||||
@ -8546,34 +8541,9 @@ in
|
||||
llvm_7 = llvmPackages_7.llvm;
|
||||
llvm_6 = llvmPackages_6.llvm;
|
||||
llvm_5 = llvmPackages_5.llvm;
|
||||
llvm_4 = llvmPackages_4.llvm;
|
||||
llvm_39 = llvmPackages_39.llvm;
|
||||
llvm_35 = llvmPackages_35.llvm;
|
||||
|
||||
llvmPackages = recurseIntoAttrs llvmPackages_7;
|
||||
|
||||
llvmPackages_35 = callPackage ../development/compilers/llvm/3.5 ({
|
||||
isl = isl_0_14;
|
||||
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) {
|
||||
stdenv = gcc6Stdenv;
|
||||
});
|
||||
|
||||
llvmPackages_39 = callPackage ../development/compilers/llvm/3.9 ({
|
||||
inherit (stdenvAdapters) overrideCC;
|
||||
buildLlvmTools = buildPackages.llvmPackages_39.tools;
|
||||
targetLlvmLibraries = targetPackages.llvmPackages_39.libraries;
|
||||
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) {
|
||||
stdenv = gcc6Stdenv;
|
||||
});
|
||||
|
||||
llvmPackages_4 = callPackage ../development/compilers/llvm/4 ({
|
||||
inherit (stdenvAdapters) overrideCC;
|
||||
buildLlvmTools = buildPackages.llvmPackages_4.tools;
|
||||
targetLlvmLibraries = targetPackages.llvmPackages_4.libraries;
|
||||
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) {
|
||||
stdenv = gcc6Stdenv;
|
||||
});
|
||||
|
||||
llvmPackages_5 = callPackage ../development/compilers/llvm/5 ({
|
||||
inherit (stdenvAdapters) overrideCC;
|
||||
buildLlvmTools = buildPackages.llvmPackages_5.tools;
|
||||
@ -9325,7 +9295,7 @@ in
|
||||
polyml57 = callPackage ../development/compilers/polyml/5.7.nix { };
|
||||
|
||||
pure = callPackage ../development/interpreters/pure {
|
||||
llvm = llvm_35;
|
||||
/*llvm = llvm_35;*/
|
||||
};
|
||||
purePackages = recurseIntoAttrs (callPackage ./pure-packages.nix {});
|
||||
|
||||
@ -11285,7 +11255,7 @@ in
|
||||
};
|
||||
|
||||
far2l = callPackage ../applications/misc/far2l {
|
||||
stdenv = if stdenv.cc.isClang then llvmPackages_4.stdenv else stdenv;
|
||||
stdenv = if stdenv.cc.isClang then llvmPackages.stdenv else stdenv;
|
||||
};
|
||||
|
||||
farbfeld = callPackage ../development/libraries/farbfeld { };
|
||||
|
@ -76,8 +76,6 @@ let
|
||||
jobs.tests.cc-wrapper.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-clang.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-libcxx.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-clang-39.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-libcxx-39.x86_64-darwin
|
||||
jobs.tests.stdenv-inputs.x86_64-darwin
|
||||
jobs.tests.macOSSierraShared.x86_64-darwin
|
||||
jobs.tests.patch-shebangs.x86_64-darwin
|
||||
@ -116,10 +114,6 @@ let
|
||||
|
||||
jobs.tests.cc-wrapper-clang.x86_64-linux
|
||||
jobs.tests.cc-wrapper-libcxx.x86_64-linux
|
||||
jobs.tests.cc-wrapper-clang-39.x86_64-linux
|
||||
jobs.tests.cc-wrapper-libcxx-39.x86_64-linux
|
||||
jobs.tests.cc-wrapper-clang-4.x86_64-linux
|
||||
jobs.tests.cc-wrapper-libcxx-4.x86_64-linux
|
||||
jobs.tests.cc-wrapper-clang-5.x86_64-linux
|
||||
jobs.tests.cc-wrapper-libcxx-5.x86_64-linux
|
||||
jobs.tests.cc-wrapper-clang-6.x86_64-linux
|
||||
@ -149,10 +143,6 @@ let
|
||||
# jobs.tests.cc-wrapper-gcc8.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-clang.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-libcxx.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-clang-39.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-libcxx-39.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-clang-4.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-libcxx-4.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-clang-5.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-libcxx-6.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-clang-6.x86_64-darwin
|
||||
|
Loading…
Reference in New Issue
Block a user