···11+diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h
22+--- a/rts/LinkerInternals.h
33++++ b/rts/LinkerInternals.h
44+@@ -303,4 +303,14 @@
55+ # define OBJFORMAT_MACHO
66+ #endif
77+88++/* In order to simplify control flow a bit, some references to mmap-related
99++ definitions are blocked off by a C-level if statement rather than a CPP-level
1010++ #if statement. Since those are dead branches when !RTS_LINKER_USE_MMAP, we
1111++ just stub out the relevant symbols here
1212++*/
1313++#if !RTS_LINKER_USE_MMAP
1414++#define munmap(x,y) /* nothing */
1515++#define MAP_ANONYMOUS 0
1616++#endif
1717++
1818+ #endif /* LINKERINTERNALS_H */
1919+
+22
pkgs/development/compilers/ghc/D2711.patch
···11+diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
22+--- a/rts/sm/Storage.c
33++++ b/rts/sm/Storage.c
44+@@ -1314,7 +1314,7 @@
55+ ------------------------------------------------------------------------- */
66+77+ #if (defined(arm_HOST_ARCH) || defined(aarch64_HOST_ARCH)) && defined(ios_HOST_OS)
88+-void sys_icache_invalidate(void *start, size_t len);
99++#include <libkern/OSCacheControl.h>
1010+ #endif
1111+1212+ /* On ARM and other platforms, we need to flush the cache after
1313+@@ -1327,7 +1327,7 @@
1414+ (void)exec_addr;
1515+ #elif (defined(arm_HOST_ARCH) || defined(aarch64_HOST_ARCH)) && defined(ios_HOST_OS)
1616+ /* On iOS we need to use the special 'sys_icache_invalidate' call. */
1717+- sys_icache_invalidate(exec_addr, ((unsigned char*)exec_addr)+len);
1818++ sys_icache_invalidate(exec_addr, len);
1919+ #elif defined(__GNUC__)
2020+ /* For all other platforms, fall back to a libgcc builtin. */
2121+ unsigned char* begin = (unsigned char*)exec_addr;
2222+
+158
pkgs/development/compilers/ghc/D2712.patch
···11+diff --git a/includes/rts/OSThreads.h b/includes/rts/OSThreads.h
22+--- a/includes/rts/OSThreads.h
33++++ b/includes/rts/OSThreads.h
44+@@ -15,7 +15,12 @@
55+ #ifndef RTS_OSTHREADS_H
66+ #define RTS_OSTHREADS_H
77+88+-#if defined(THREADED_RTS) /* to near the end */
99++#if defined(HAVE_PTHREAD_H) && !defined(mingw32_HOST_OS)
1010++#define BUILD_OSTHREAD_POSIX
1111++#endif
1212++
1313++
1414++#if defined(THREADED_RTS) || defined(BUILD_OSTHREAD_POSIX) /* to near end */
1515+1616+ #if defined(HAVE_PTHREAD_H) && !defined(mingw32_HOST_OS)
1717+1818+@@ -205,13 +210,25 @@
1919+ void releaseThreadNode (void);
2020+ #endif // !CMINUSMINUS
2121+2222+-#else
2323++#endif /* defined(THREADED_RTS) || defined(BUILD_OSTHREAD_POSIX) */
2424++
2525++#ifndef THREADED_RTS
2626++
2727++#ifdef ACQUIRE_LOCK
2828++// If we have pthreads, we pull in the threading primitives even when the RTS
2929++// isn't threaded, but we expect these macros to be noops on non-threaded RTS.
3030++
3131++#undef ACQUIRE_LOCK
3232++#undef RELEASE_LOCK
3333++#undef ASSERT_LOCK_HELD
3434++
3535++#endif
3636+3737+ #define ACQUIRE_LOCK(l)
3838+ #define RELEASE_LOCK(l)
3939+ #define ASSERT_LOCK_HELD(l)
4040+4141+-#endif /* defined(THREADED_RTS) */
4242++#endif
4343+4444+ #ifndef CMINUSMINUS
4545+ //
4646+diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c
4747+--- a/rts/posix/OSThreads.c
4848++++ b/rts/posix/OSThreads.c
4949+@@ -35,7 +35,7 @@
5050+ #endif
5151+ #endif
5252+5353+-#if defined(THREADED_RTS)
5454++#if defined(THREADED_RTS) || defined(BUILD_OSTHREAD_POSIX)
5555+ #include "RtsUtils.h"
5656+ #include "Task.h"
5757+5858+@@ -225,47 +225,6 @@
5959+ return NULL;
6060+ }
6161+6262+-int
6363+-forkOS_createThread ( HsStablePtr entry )
6464+-{
6565+- pthread_t tid;
6666+- int result = pthread_create(&tid, NULL,
6767+- forkOS_createThreadWrapper, (void*)entry);
6868+- if(!result)
6969+- pthread_detach(tid);
7070+- return result;
7171+-}
7272+-
7373+-void freeThreadingResources (void) { /* nothing */ }
7474+-
7575+-uint32_t
7676+-getNumberOfProcessors (void)
7777+-{
7878+- static uint32_t nproc = 0;
7979+-
8080+- if (nproc == 0) {
8181+-#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
8282+- nproc = sysconf(_SC_NPROCESSORS_ONLN);
8383+-#elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_CONF)
8484+- nproc = sysconf(_SC_NPROCESSORS_CONF);
8585+-#elif defined(darwin_HOST_OS)
8686+- size_t size = sizeof(uint32_t);
8787+- if(sysctlbyname("hw.logicalcpu",&nproc,&size,NULL,0) != 0) {
8888+- if(sysctlbyname("hw.ncpu",&nproc,&size,NULL,0) != 0)
8989+- nproc = 1;
9090+- }
9191+-#elif defined(freebsd_HOST_OS)
9292+- size_t size = sizeof(uint32_t);
9393+- if(sysctlbyname("hw.ncpu",&nproc,&size,NULL,0) != 0)
9494+- nproc = 1;
9595+-#else
9696+- nproc = 1;
9797+-#endif
9898+- }
9999+-
100100+- return nproc;
101101+-}
102102+-
103103+ #if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETAFFINITY)
104104+ // Schedules the thread to run on CPU n of m. m may be less than the
105105+ // number of physical CPUs, in which case, the thread will be allowed
106106+@@ -353,6 +312,51 @@
107107+ pthread_kill(id, SIGPIPE);
108108+ }
109109+110110++#endif /* defined(THREADED_RTS) || defined(BUILD_OSTHREAD_POSIX) */
111111++
112112++#if defined(THREADED_RTS)
113113++
114114++int
115115++forkOS_createThread ( HsStablePtr entry )
116116++{
117117++ pthread_t tid;
118118++ int result = pthread_create(&tid, NULL,
119119++ forkOS_createThreadWrapper, (void*)entry);
120120++ if(!result)
121121++ pthread_detach(tid);
122122++ return result;
123123++}
124124++
125125++void freeThreadingResources (void) { /* nothing */ }
126126++
127127++uint32_t
128128++getNumberOfProcessors (void)
129129++{
130130++ static uint32_t nproc = 0;
131131++
132132++ if (nproc == 0) {
133133++#if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
134134++ nproc = sysconf(_SC_NPROCESSORS_ONLN);
135135++#elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_CONF)
136136++ nproc = sysconf(_SC_NPROCESSORS_CONF);
137137++#elif defined(darwin_HOST_OS)
138138++ size_t size = sizeof(uint32_t);
139139++ if(sysctlbyname("hw.logicalcpu",&nproc,&size,NULL,0) != 0) {
140140++ if(sysctlbyname("hw.ncpu",&nproc,&size,NULL,0) != 0)
141141++ nproc = 1;
142142++ }
143143++#elif defined(freebsd_HOST_OS)
144144++ size_t size = sizeof(uint32_t);
145145++ if(sysctlbyname("hw.ncpu",&nproc,&size,NULL,0) != 0)
146146++ nproc = 1;
147147++#else
148148++ nproc = 1;
149149++#endif
150150++ }
151151++
152152++ return nproc;
153153++}
154154++
155155+ #else /* !defined(THREADED_RTS) */
156156+157157+ int
158158+
+17
pkgs/development/compilers/ghc/D2713.patch
···11+diff --git a/configure.ac b/configure.ac
22+--- a/configure.ac
33++++ b/configure.ac
44+@@ -437,7 +437,11 @@
55+ else
66+ CrossCompilePrefix=""
77+ fi
88+-TargetPlatformFull="${TargetPlatform}"
99++# Despite its similarity in name to TargetPlatform, TargetPlatformFull is used
1010++# in calls to subproject configure scripts and thus must be set to the autoconf
1111++# triple, not the normalized GHC triple that TargetPlatform is set to.
1212++# It may be better to just do away with the GHC triples all together.
1313++TargetPlatformFull="${target}"
1414+ AC_SUBST(CrossCompiling)
1515+ AC_SUBST(CrossCompilePrefix)
1616+ AC_SUBST(TargetPlatformFull)
1717+
···11+commit eb92f5a745014532b83abfba04602fce87ca8393
22+Author: Chuang-Yu Cheng <cycheng@multicorewareinc.com>
33+Date: Fri Apr 8 12:04:32 2016 +0000
44+55+ CXX_FAST_TLS calling convention: performance improvement for PPC64
66+77+ This is the same change on PPC64 as r255821 on AArch64. I have even borrowed
88+ his commit message.
99+1010+ The access function has a short entry and a short exit, the initialization
1111+ block is only run the first time. To improve the performance, we want to
1212+ have a short frame at the entry and exit.
1313+1414+ We explicitly handle most of the CSRs via copies. Only the CSRs that are not
1515+ handled via copies will be in CSR_SaveList.
1616+1717+ Frame lowering and prologue/epilogue insertion will generate a short frame
1818+ in the entry and exit according to CSR_SaveList. The majority of the CSRs will
1919+ be handled by register allcoator. Register allocator will try to spill and
2020+ reload them in the initialization block.
2121+2222+ We add CSRsViaCopy, it will be explicitly handled during lowering.
2323+2424+ 1> we first set FunctionLoweringInfo->SplitCSR if conditions are met (the target
2525+ supports it for the given machine function and the function has only return
2626+ exits). We also call TLI->initializeSplitCSR to perform initialization.
2727+ 2> we call TLI->insertCopiesSplitCSR to insert copies from CSRsViaCopy to
2828+ virtual registers at beginning of the entry block and copies from virtual
2929+ registers to CSRsViaCopy at beginning of the exit blocks.
3030+ 3> we also need to make sure the explicit copies will not be eliminated.
3131+3232+ Author: Tom Jablin (tjablin)
3333+ Reviewers: hfinkel kbarton cycheng
3434+3535+ http://reviews.llvm.org/D17533
3636+3737+ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265781 91177308-0d34-0410-b5e6-96231b3b80d8
3838+3939+diff --git a/lib/CodeGen/TargetFrameLoweringImpl.cpp b/lib/CodeGen/TargetFrameLoweringImpl.cpp
4040+index 679ade1..0a0e079 100644
4141+--- a/lib/CodeGen/TargetFrameLoweringImpl.cpp
4242++++ b/lib/CodeGen/TargetFrameLoweringImpl.cpp
4343+@@ -63,12 +63,15 @@ void TargetFrameLowering::determineCalleeSaves(MachineFunction &MF,
4444+ const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo();
4545+ const MCPhysReg *CSRegs = TRI.getCalleeSavedRegs(&MF);
4646+4747++ // Resize before the early returns. Some backends expect that
4848++ // SavedRegs.size() == TRI.getNumRegs() after this call even if there are no
4949++ // saved registers.
5050++ SavedRegs.resize(TRI.getNumRegs());
5151++
5252+ // Early exit if there are no callee saved registers.
5353+ if (!CSRegs || CSRegs[0] == 0)
5454+ return;
5555+5656+- SavedRegs.resize(TRI.getNumRegs());
5757+-
5858+ // In Naked functions we aren't going to save any registers.
5959+ if (MF.getFunction()->hasFnAttribute(Attribute::Naked))
6060+ return;
+5-1
pkgs/development/compilers/llvm/3.8/llvm.nix
···35353636 propagatedBuildInputs = [ ncurses zlib ];
37373838+ # Fix a segfault in llc
3939+ # See http://lists.llvm.org/pipermail/llvm-dev/2016-October/106500.html
4040+ patches = [ ./D17533-1.patch ];
4141+3842 # hacky fix: New LLVM releases require a newer OS X SDK than
3943 # 10.9. This is a temporary measure until nixpkgs darwin support is
4044 # updated.
4141- patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
4545+ postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
4246 sed -i 's/os_trace(\(.*\)");$/printf(\1\\n");/g' ./projects/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
4347 '';
4448
+6-6
pkgs/development/compilers/rust/bootstrap.nix
···1414 then "x86_64-apple-darwin"
1515 else abort "missing boostrap url for platform ${stdenv.system}";
16161717- # fetch hashes by running `print-hashes.sh 1.9.0`
1717+ # fetch hashes by running `print-hashes.sh 1.12.1`
1818 bootstrapHash =
1919 if stdenv.system == "i686-linux"
2020- then "f5a3f5d53defe827a71447b1a0e7a656394b87ee23e009d7bf73a0277c1b5ac2"
2020+ then "ede9b9d14d1ddbc29975d1ead73fcf2758719b4b371363afe1c32eb8d6e96bb3"
2121 else if stdenv.system == "x86_64-linux"
2222- then "f4ebbd6d9494cb8fa6c410cb58954e1913546c2bca8963faebc424591547d83f"
2222+ then "9e546aec13e389429ba2d86c8f4e67eba5af146c979e4faa16ffb40ddaf9984c"
2323 else if stdenv.system == "i686-darwin"
2424- then "bf07182bc362985fcdd48af905cdb559e20c68518cd71dabec3c30b78ca8a94a"
2424+ then "2648645c4fe1ecf36beb7de63501dd99e9547a7a6d5683acf2693b919a550b69"
2525 else if stdenv.system == "x86_64-darwin"
2626- then "2cdbc47438dc86ecaf35298317b77d735956eb160862e3f6d0fda0da656ecc35"
2626+ then "0ac5e58dba3d24bf09dcc90eaac02d2df053122b0def945ec4cfe36ac6d4d011"
2727 else throw "missing boostrap hash for platform ${stdenv.system}";
28282929 needsPatchelf = stdenv.isLinux;
···3333 sha256 = bootstrapHash;
3434 };
35353636- version = "1.11.0";
3636+ version = "1.12.1";
3737in
38383939rec {
···1616 outputs = [ "out" "dev" ];
1717 outputBin = "dev";
18181919- makeFlags = stdenv.lib.optionalString stdenv.isDarwin
2020- "CXXFLAGS=-headerpad_max_install_names";
2121-2219 # FIXME: This fixes dylib references in the dylibs themselves, but
2320 # not in the programs in $out/bin.
2421 buildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+5-2
pkgs/development/libraries/jasper/default.nix
···11{ stdenv, fetchurl, fetchpatch, libjpeg, autoreconfHook }:
2233stdenv.mkDerivation rec {
44- name = "jasper-1.900.21";
44+ name = "jasper-1.900.28";
5566 src = fetchurl {
77+ # You can find this code on Github at https://github.com/mdadams/jasper
88+ # however note at https://www.ece.uvic.ca/~frodo/jasper/#download
99+ # not all tagged releases are for distribution.
710 url = "http://www.ece.uvic.ca/~mdadams/jasper/software/${name}.tar.gz";
88- sha256 = "1cypmlzq5vmbacsn8n3ls9p7g64scv3fzx88qf8c270dz10s5j79";
1111+ sha256 = "0nsiblsfpfa0dahsk6hw9cd18fp9c8sk1z5hdp19m33c0bf92ip9";
912 };
10131114 # newer reconf to recognize a multiout flag
+6
pkgs/development/libraries/ldns/default.nix
···88 sha256 = "1kf8pkwhcssvgzhh6ha1pjjiziwvwmfaali7kaafh6118mcy124b";
99 };
10101111+ outputs = [ "out" "dev" ];
1212+1113 patches = [ ./perl-5.22-compat.patch ];
12141315 postPatch = ''
···1820 buildInputs = [ openssl ];
19212022 configureFlags = [ "--with-ssl=${openssl.dev}" "--with-drill" ];
2323+2424+ postInstall = ''
2525+ moveToOutput "bin/ldns-config" "$dev"
2626+ '';
21272228 meta = with stdenv.lib; {
2329 description = "Library with the aim of simplifying DNS programming in C";
···11-diff -ruN a/src/config.py b/src/config.py
22---- a/src/config.py 2015-07-31 19:35:37.000000000 +0000
33-+++ b/src/config.py 2015-08-03 09:23:34.322098081 +0000
44-@@ -14,6 +14,7 @@
55-66- import logging.config
77- import os
88-+import stat
99- import sys
1010- import pkg_resources
1111-1212-@@ -563,6 +564,13 @@
1313- copy2(default, options.filename)
1414- elif path.isfile(other):
1515- copy2(other, options.filename)
1616-+
1717-+ # Inside the nixstore, the reference file is readonly, so is the copy.
1818-+ # Make it writable by the user who just created it.
1919-+ if os.path.exists(options.filename):
2020-+ os.chmod(options.filename,
2121-+ os.stat(options.filename).st_mode | stat.S_IWUSR)
2222-+
2323- global firstrun
2424- firstrun = True
2525-
···11---- rush-1.7/gnu/stdio.in.h.org 2010-06-13 19:14:59.000000000 +0200
22-+++ rush-1.7/gnu/stdio.in.h 2013-12-30 14:29:55.000000000 +0100
33-@@ -138,8 +138,10 @@ _GL_WARN_ON_USE (fflush, "fflush is not
44- /* It is very rare that the developer ever has full control of stdin,
55- so any use of gets warrants an unconditional warning. Assume it is
66- always declared, since it is required by C89. */
77-+#if defined gets
88- #undef gets
99- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
1010-+#endif
1111-1212- #if @GNULIB_FOPEN@
1313- # if @REPLACE_FOPEN@
···38383939 inherit (import ./darwin { inherit system allPackages platform config; }) stdenvDarwin;
40404141- inherit (import ./cross { inherit system allPackages platform crossSystem config lib; }) stdenvCross;
4141+ inherit (import ./cross { inherit system allPackages platform crossSystem config lib; }) stdenvCross stdenvCrossiOS;
42424343 inherit (import ./custom { inherit system allPackages platform crossSystem config lib; }) stdenvCustom;
44444545 # Select the appropriate stdenv for the platform `system'.
4646 stdenv =
4747- if crossSystem != null then stdenvCross else
4747+ if crossSystem != null then
4848+ if crossSystem.useiOSCross or false then stdenvCrossiOS
4949+ else stdenvCross else
4850 if config ? replaceStdenv then stdenvCustom else
4951 if system == "i686-linux" then stdenvLinux else
5052 if system == "x86_64-linux" then stdenvLinux else
+1-1
pkgs/stdenv/generic/default.nix
···139139 { nixpkgs.config.allow${up reason} = true; }
140140 in configuration.nix to override this.
141141142142- b) For `nix-env`, `nix-build` or any other Nix command you can add
142142+ b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
143143 { allow${up reason} = true; }
144144 to ~/.nixpkgs/config.nix.
145145 ''));