about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-06-23 11:45:55 -0500
committerWill Dietz <w@wdtz.org>2018-06-23 15:53:44 -0500
commit182de524a1339cf00b186fe277a5aeefc3ac982c (patch)
tree5e3ca6e30ad2e78d87cc3887d2e5d9488e9d2f9e /pkgs/development/compilers/llvm
parenta1bf9b60943a777a1d2bd2360933729736ec7226 (diff)
downloadnixlib-182de524a1339cf00b186fe277a5aeefc3ac982c.tar
nixlib-182de524a1339cf00b186fe277a5aeefc3ac982c.tar.gz
nixlib-182de524a1339cf00b186fe277a5aeefc3ac982c.tar.bz2
nixlib-182de524a1339cf00b186fe277a5aeefc3ac982c.tar.lz
nixlib-182de524a1339cf00b186fe277a5aeefc3ac982c.tar.xz
nixlib-182de524a1339cf00b186fe277a5aeefc3ac982c.tar.zst
nixlib-182de524a1339cf00b186fe277a5aeefc3ac982c.zip
llvm_{39,4}: refactor to use same patch file
Diffstat (limited to 'pkgs/development/compilers/llvm')
-rw-r--r--pkgs/development/compilers/llvm/3.9/llvm.nix2
-rw-r--r--pkgs/development/compilers/llvm/4/dynamiclibrary-musl.patch33
-rw-r--r--pkgs/development/compilers/llvm/4/llvm.nix2
-rw-r--r--pkgs/development/compilers/llvm/dynamiclibrary-musl.patch (renamed from pkgs/development/compilers/llvm/3.9/dynamiclibrary-musl.patch)0
4 files changed, 2 insertions, 35 deletions
diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix
index 8fe1ac46ce9a..708e471bd4ac 100644
--- a/pkgs/development/compilers/llvm/3.9/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.9/llvm.nix
@@ -64,7 +64,7 @@ in stdenv.mkDerivation rec {
    })
    ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
      ../TLI-musl.patch
-     ./dynamiclibrary-musl.patch
+     ../dynamiclibrary-musl.patch
    ];
 
   postPatch = ""
diff --git a/pkgs/development/compilers/llvm/4/dynamiclibrary-musl.patch b/pkgs/development/compilers/llvm/4/dynamiclibrary-musl.patch
deleted file mode 100644
index d5d7f07b5e11..000000000000
--- a/pkgs/development/compilers/llvm/4/dynamiclibrary-musl.patch
+++ /dev/null
@@ -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
-
diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix
index a371296db326..06bcd74456c4 100644
--- a/pkgs/development/compilers/llvm/4/llvm.nix
+++ b/pkgs/development/compilers/llvm/4/llvm.nix
@@ -83,7 +83,7 @@ in stdenv.mkDerivation (rec {
     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 ${../dynamiclibrary-musl.patch}
     patch -p1 -i ${./sanitizers-nongnu.patch} -d projects/compiler-rt
   '';
 
diff --git a/pkgs/development/compilers/llvm/3.9/dynamiclibrary-musl.patch b/pkgs/development/compilers/llvm/dynamiclibrary-musl.patch
index d5d7f07b5e11..d5d7f07b5e11 100644
--- a/pkgs/development/compilers/llvm/3.9/dynamiclibrary-musl.patch
+++ b/pkgs/development/compilers/llvm/dynamiclibrary-musl.patch