about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-09-25 14:20:27 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-09-25 14:20:27 -0400
commitc701d6cb21e1e83a82ebdefe180f2d6233087f4a (patch)
tree3e7a7503cd7e84c8d2ee8aaffe264301fb591ebf /pkgs/development/compilers
parent6aa5f2db8f4c0df18364c8a70218a52a1b2c97cf (diff)
parent6cd28a468aec0005052ee01eaf8510735948a2dd (diff)
downloadnixlib-c701d6cb21e1e83a82ebdefe180f2d6233087f4a.tar
nixlib-c701d6cb21e1e83a82ebdefe180f2d6233087f4a.tar.gz
nixlib-c701d6cb21e1e83a82ebdefe180f2d6233087f4a.tar.bz2
nixlib-c701d6cb21e1e83a82ebdefe180f2d6233087f4a.tar.lz
nixlib-c701d6cb21e1e83a82ebdefe180f2d6233087f4a.tar.xz
nixlib-c701d6cb21e1e83a82ebdefe180f2d6233087f4a.tar.zst
nixlib-c701d6cb21e1e83a82ebdefe180f2d6233087f4a.zip
Merge remote-tracking branch 'upstream/master' into staging
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/dotnet/sdk/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix8
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix8
-rw-r--r--pkgs/development/compilers/gcc/7/default.nix10
-rw-r--r--pkgs/development/compilers/gcc/8/default.nix10
-rw-r--r--pkgs/development/compilers/gcc/libgomp-dont-force-initial-exec.patch40
-rw-r--r--pkgs/development/compilers/ghc/7.10.3.nix4
-rw-r--r--pkgs/development/compilers/ghc/8.0.2.nix4
-rw-r--r--pkgs/development/compilers/ghc/8.2.2.nix4
-rw-r--r--pkgs/development/compilers/ghc/8.4.3.nix4
-rw-r--r--pkgs/development/compilers/ghc/8.6.1.nix4
-rw-r--r--pkgs/development/compilers/ghc/head.nix4
-rw-r--r--pkgs/development/compilers/ghcjs-ng/default.nix11
-rw-r--r--pkgs/development/compilers/go/1.11.nix1
-rw-r--r--pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch151
15 files changed, 169 insertions, 100 deletions
diff --git a/pkgs/development/compilers/dotnet/sdk/default.nix b/pkgs/development/compilers/dotnet/sdk/default.nix
index 0e28e041cc5d..d1db965bc814 100644
--- a/pkgs/development/compilers/dotnet/sdk/default.nix
+++ b/pkgs/development/compilers/dotnet/sdk/default.nix
@@ -21,7 +21,11 @@ in
       sha512 = "639f9f68f225246d9cce798d72d011f65c7eda0d775914d1394df050bddf93e2886555f5eed85a75d6c72e9063a54d8aa053c64c326c683b94e9e0a0570e5654";
     };
 
-    unpackPhase = "tar xvzf $src";
+    unpackPhase = ''
+      mkdir src
+      cd src
+      tar xvzf $src
+    '';
 
     buildPhase = ''
       runHook preBuild
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index efd6ec072573..47c849d2dcc8 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -60,6 +60,7 @@ let version = "5.5.0";
       ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
       ++ optional noSysDirs ../no-sys-dirs.patch
       ++ optional langFortran ../gfortran-driving.patch
+      ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
       ++ optional stdenv.hostPlatform.isMusl (fetchpatch {
         url = https://raw.githubusercontent.com/richfelker/musl-cross-make/e84b1bd1fc12a3def33111ca6df522cd6e5ec361/patches/gcc-5.3.0/0001-musl.diff;
         sha256 = "0pppbf8myi2kjhm3z3479ihn1cm60kycfv60gj8yy1bs0pl1qcfm";
@@ -329,7 +330,12 @@ stdenv.mkDerivation ({
       # On Illumos/Solaris GNU as is preferred
       "--with-gnu-as" "--without-gnu-ld"
     ]
-    ++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
+    ++ optionals (targetPlatform == hostPlatform && targetPlatform.libc == "musl") [
+      "--disable-libsanitizer"
+      "--disable-symvers"
+      "libat_cv_have_ifunc=no"
+      "--disable-gnu-indirect-function"
+    ]
   ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index 4760d18a7d81..eeb57be97157 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -61,6 +61,7 @@ let version = "6.4.0";
       ++ optional langFortran ../gfortran-driving.patch
       ++ [ ../struct-ucontext.patch ../struct-sigaltstack.patch ] # glibc-2.26
       ++ optional langJava [ ../struct-ucontext-libjava.patch ] # glibc-2.26
+      ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch
       ;
 
     javaEcj = fetchurl {
@@ -334,7 +335,12 @@ stdenv.mkDerivation ({
       # On Illumos/Solaris GNU as is preferred
       "--with-gnu-as" "--without-gnu-ld"
     ]
-    ++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
+    ++ optionals (targetPlatform == hostPlatform && targetPlatform.libc == "musl") [
+      "--disable-libsanitizer"
+      "--disable-symvers"
+      "libat_cv_have_ifunc=no"
+      "--disable-gnu-indirect-function"
+    ]
   ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix
index e2c686b7e7e8..59897ccff426 100644
--- a/pkgs/development/compilers/gcc/7/default.nix
+++ b/pkgs/development/compilers/gcc/7/default.nix
@@ -56,7 +56,8 @@ let version = "7.3.0";
         sha256 = "0mrvxsdwip2p3l17dscpc1x8vhdsciqw1z5q9i6p5g9yg1cqnmgs";
       })
       ++ optional langFortran ../gfortran-driving.patch
-      ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch;
+      ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
+      ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch;
 
     /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
@@ -288,7 +289,12 @@ stdenv.mkDerivation ({
       # On Illumos/Solaris GNU as is preferred
       "--with-gnu-as" "--without-gnu-ld"
     ]
-    ++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
+    ++ optionals (targetPlatform == hostPlatform && targetPlatform.libc == "musl") [
+      "--disable-libsanitizer"
+      "--disable-symvers"
+      "libat_cv_have_ifunc=no"
+      "--disable-gnu-indirect-function"
+    ]
     ++ optional (targetPlatform.isAarch64) "--enable-fix-cortex-a53-843419"
   ;
 
diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix
index 59d7653c52cd..7842110a2146 100644
--- a/pkgs/development/compilers/gcc/8/default.nix
+++ b/pkgs/development/compilers/gcc/8/default.nix
@@ -51,7 +51,8 @@ let version = "8.2.0";
         sha256 = ""; # TODO: uncomment and check hash when available.
       }) */
       ++ optional langFortran ../gfortran-driving.patch
-      ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch;
+      ++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch
+      ++ optional (targetPlatform.libc == "musl") ../libgomp-dont-force-initial-exec.patch;
 
     /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
@@ -282,7 +283,12 @@ stdenv.mkDerivation ({
       # On Illumos/Solaris GNU as is preferred
       "--with-gnu-as" "--without-gnu-ld"
     ]
-    ++ optional (targetPlatform == hostPlatform && targetPlatform.libc == "musl") "--disable-libsanitizer"
+    ++ optionals (targetPlatform == hostPlatform && targetPlatform.libc == "musl") [
+      "--disable-libsanitizer"
+      "--disable-symvers"
+      "libat_cv_have_ifunc=no"
+      "--disable-gnu-indirect-function"
+    ]
   ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
diff --git a/pkgs/development/compilers/gcc/libgomp-dont-force-initial-exec.patch b/pkgs/development/compilers/gcc/libgomp-dont-force-initial-exec.patch
new file mode 100644
index 000000000000..afd1f7456d32
--- /dev/null
+++ b/pkgs/development/compilers/gcc/libgomp-dont-force-initial-exec.patch
@@ -0,0 +1,40 @@
+From 01c433f4788441c0963005b9d3fad5b2865e6651 Mon Sep 17 00:00:00 2001
+From: Will Dietz <w@wdtz.org>
+Date: Mon, 24 Sep 2018 19:57:50 -0500
+Subject: [PATCH] libgomp/configure.tgt: don't force initial-exec tls-model
+
+---
+ libgomp/configure.tgt | 17 -----------------
+ 1 file changed, 17 deletions(-)
+
+diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
+index 74d95a570c7..b608c55f0c1 100644
+--- a/libgomp/configure.tgt
++++ b/libgomp/configure.tgt
+@@ -10,23 +10,6 @@
+ #  XCFLAGS		Add extra compile flags to use.
+ #  XLDFLAGS		Add extra link flags to use.
+ 
+-# Optimize TLS usage by avoiding the overhead of dynamic allocation.
+-if test $gcc_cv_have_tls = yes ; then
+-  case "${target}" in
+-
+-    *-*-k*bsd*-gnu*)
+-	;;
+-
+-    *-*-linux* | *-*-gnu*)
+-	XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
+-	;;
+-
+-    *-*-rtems*)
+-	XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
+-	;;
+-  esac
+-fi
+-
+ # Since we require POSIX threads, assume a POSIX system by default.
+ config_path="posix"
+ 
+-- 
+2.19.0
+
diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix
index 9c87d815b4a9..a4374a452402 100644
--- a/pkgs/development/compilers/ghc/7.10.3.nix
+++ b/pkgs/development/compilers/ghc/7.10.3.nix
@@ -1,7 +1,7 @@
 { stdenv, targetPackages
 
 # build-tools
-, bootPkgs, hscolour
+, bootPkgs
 , coreutils, fetchurl, perl
 , docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
 
@@ -142,7 +142,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42
-    ghc hscolour
+    ghc bootPkgs.hscolour
   ];
 
   # For building runtime libs
diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix
index 935d09b57446..0946db713783 100644
--- a/pkgs/development/compilers/ghc/8.0.2.nix
+++ b/pkgs/development/compilers/ghc/8.0.2.nix
@@ -1,7 +1,7 @@
 { stdenv, targetPackages
 
 # build-tools
-, bootPkgs, hscolour
+, bootPkgs
 , coreutils, fetchpatch, fetchurl, perl, sphinx
 
 , libiconv ? null, ncurses
@@ -144,7 +144,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     perl sphinx
-    ghc hscolour
+    ghc bootPkgs.hscolour
   ];
 
   # For building runtime libs
diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix
index cf448d8d849a..6a1914a9c2c8 100644
--- a/pkgs/development/compilers/ghc/8.2.2.nix
+++ b/pkgs/development/compilers/ghc/8.2.2.nix
@@ -1,7 +1,7 @@
 { stdenv, targetPackages
 
 # build-tools
-, bootPkgs, alex, happy, hscolour
+, bootPkgs
 , autoconf, autoreconfHook, automake, coreutils, fetchurl, fetchpatch, perl, python3, sphinx
 , runCommand
 
@@ -182,7 +182,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoconf autoreconfHook automake perl python3 sphinx
-    ghc alex happy hscolour
+    ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
   ];
 
   # For building runtime libs
diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.4.3.nix
index 365f401119da..8fba60d527fd 100644
--- a/pkgs/development/compilers/ghc/8.4.3.nix
+++ b/pkgs/development/compilers/ghc/8.4.3.nix
@@ -1,7 +1,7 @@
 { stdenv, targetPackages
 
 # build-tools
-, bootPkgs, alex, happy, hscolour
+, bootPkgs
 , autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4
 
 , libiconv ? null, ncurses
@@ -184,7 +184,7 @@ stdenv.mkDerivation (rec {
 
   nativeBuildInputs = [
     perl autoconf automake m4 python3
-    ghc alex happy hscolour
+    ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
   ];
 
   # For building runtime libs
diff --git a/pkgs/development/compilers/ghc/8.6.1.nix b/pkgs/development/compilers/ghc/8.6.1.nix
index d4f2f931c31c..c12401f05778 100644
--- a/pkgs/development/compilers/ghc/8.6.1.nix
+++ b/pkgs/development/compilers/ghc/8.6.1.nix
@@ -1,7 +1,7 @@
 { stdenv, targetPackages
 
 # build-tools
-, bootPkgs, alex, happy, hscolour
+, bootPkgs
 , autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3, m4
 
 , libiconv ? null, ncurses
@@ -169,7 +169,7 @@ stdenv.mkDerivation (rec {
 
   nativeBuildInputs = [
     perl autoconf automake m4 python3
-    ghc alex happy hscolour
+    ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
   ];
 
   # For building runtime libs
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index ee95bd0f6047..af5efbd7df8c 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -1,7 +1,7 @@
 { stdenv, targetPackages
 
 # build-tools
-, bootPkgs, alex, happy, hscolour
+, bootPkgs
 , autoconf, automake, coreutils, fetchgit, perl, python3, m4
 
 , libiconv ? null, ncurses
@@ -150,7 +150,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     perl autoconf automake m4 python3
-    ghc alex happy hscolour
+    ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
   ];
 
   # For building runtime libs
diff --git a/pkgs/development/compilers/ghcjs-ng/default.nix b/pkgs/development/compilers/ghcjs-ng/default.nix
index 5db2777c8bb0..92211042acd9 100644
--- a/pkgs/development/compilers/ghcjs-ng/default.nix
+++ b/pkgs/development/compilers/ghcjs-ng/default.nix
@@ -4,8 +4,6 @@
 , ghcjsSrcJson ? null
 , ghcjsSrc ? fetchgit (builtins.fromJSON (builtins.readFile ghcjsSrcJson))
 , bootPkgs
-, alex
-, happy
 , stage0
 , haskellLib
 , cabal-install
@@ -24,8 +22,8 @@
 let
   passthru = {
     configuredSrc = callPackage ./configured-ghcjs-src.nix {
-      inherit ghcjsSrc alex happy;
-      inherit (bootPkgs) ghc;
+      inherit ghcjsSrc;
+      inherit (bootPkgs) ghc alex happy;
     };
     genStage0 = callPackage ./mk-stage0.nix { inherit (passthru) configuredSrc; };
     bootPkgs = bootPkgs.extend (lib.foldr lib.composeExtensions (_:_:{}) [
@@ -34,7 +32,10 @@ let
         inherit (self) callPackage;
       })
 
-      (callPackage ./common-overrides.nix { inherit haskellLib alex happy; })
+      (callPackage ./common-overrides.nix {
+        inherit haskellLib;
+        inherit (bootPkgs) alex happy;
+      })
       ghcjsDepOverrides
     ]);
 
diff --git a/pkgs/development/compilers/go/1.11.nix b/pkgs/development/compilers/go/1.11.nix
index e4872597e79c..56d363f1015f 100644
--- a/pkgs/development/compilers/go/1.11.nix
+++ b/pkgs/development/compilers/go/1.11.nix
@@ -178,6 +178,7 @@ stdenv.mkDerivation rec {
 
   preFixup = ''
     rm -r $out/share/go/pkg/bootstrap
+    rm -r $out/share/go/pkg/obj
     ln -s $out/share/go/bin $out/bin
   '';
 
diff --git a/pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch
index 6266eb1958d1..1f2ac97818eb 100644
--- a/pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch
+++ b/pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch
@@ -1,7 +1,7 @@
-From 7b4b3333a2718628b1d510ec1d8438ad67308299 Mon Sep 17 00:00:00 2001
+From f7a253f8f85d0f49df6b73996737a3e84ac64236 Mon Sep 17 00:00:00 2001
 From: Will Dietz <w@wdtz.org>
-Date: Fri, 29 Jun 2018 09:48:59 -0500
-Subject: [PATCH] Ported to 6.0, taken from gentoo-musl project.
+Date: Mon, 24 Sep 2018 11:17:25 -0500
+Subject: [PATCH] Ported to 7.0, taken from gentoo-musl project.
 
 ------
 Ported to compiler-rt-sanitizers-5.0.0. Taken from
@@ -13,7 +13,7 @@ Taken from gentoo-musl project, with a few additional minor fixes.
 ---
  lib/asan/asan_linux.cc                        |  4 +-
  lib/interception/interception_linux.cc        |  2 +-
- lib/interception/interception_linux.h         |  3 +-
+ lib/interception/interception_linux.h         |  2 +-
  lib/msan/msan_linux.cc                        |  2 +-
  lib/sanitizer_common/sanitizer_allocator.cc   |  2 +-
  .../sanitizer_common_interceptors_ioctl.inc   |  4 +-
@@ -24,7 +24,7 @@ Taken from gentoo-musl project, with a few additional minor fixes.
  .../sanitizer_platform_interceptors.h         |  4 +-
  .../sanitizer_platform_limits_posix.cc        | 37 +++++++++++--------
  lib/tsan/rtl/tsan_platform_linux.cc           |  2 +-
- 13 files changed, 51 insertions(+), 35 deletions(-)
+ 13 files changed, 51 insertions(+), 34 deletions(-)
 
 diff --git a/lib/asan/asan_linux.cc b/lib/asan/asan_linux.cc
 index 625f32d40..73cf77aca 100644
@@ -49,34 +49,33 @@ index 625f32d40..73cf77aca 100644
  void AsanCheckDynamicRTPrereqs() {}
  void AsanCheckIncompatibleRT() {}
 diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
-index c991550a4..2b706418b 100644
+index 26bfcd8f6..529b234f7 100644
 --- a/lib/interception/interception_linux.cc
 +++ b/lib/interception/interception_linux.cc
 @@ -43,7 +43,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
  }
  
  // Android and Solaris do not have dlvsym
--#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS
-+#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_NONGNU
+-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
++#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU
  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 98fe51b85..c13302b98 100644
+index 942c25609..24a4d5080 100644
 --- a/lib/interception/interception_linux.h
 +++ b/lib/interception/interception_linux.h
-@@ -35,8 +35,7 @@ void *GetFuncAddrVer(const char *func_name, const char *ver);
-       (::__interception::uptr) & (func),                                   \
+@@ -36,7 +36,7 @@ void *GetFuncAddrVer(const char *func_name, const char *ver);
        (::__interception::uptr) & WRAP(func))
  
--// Android and Solaris do not have dlvsym
--#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS
-+#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_NONGNU
+ // Android,  Solaris and OpenBSD do not have dlvsym
+-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
++#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD && !SANITIZER_NONGNU
  #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 4e6321fcb..4d50feb82 100644
+index 385a650c4..6e30a8ce9 100644
 --- a/lib/msan/msan_linux.cc
 +++ b/lib/msan/msan_linux.cc
 @@ -13,7 +13,7 @@
@@ -87,12 +86,12 @@ index 4e6321fcb..4d50feb82 100644
 +#if SANITIZER_FREEBSD || (SANITIZER_LINUX && !SANITIZER_NONGNU) || SANITIZER_NETBSD
  
  #include "msan.h"
- #include "msan_thread.h"
+ #include "msan_report.h"
 diff --git a/lib/sanitizer_common/sanitizer_allocator.cc b/lib/sanitizer_common/sanitizer_allocator.cc
-index fc4f7a75a..76cf4f769 100644
+index 6bfd5e5ee..048f6154f 100644
 --- a/lib/sanitizer_common/sanitizer_allocator.cc
 +++ b/lib/sanitizer_common/sanitizer_allocator.cc
-@@ -23,7 +23,7 @@ namespace __sanitizer {
+@@ -27,7 +27,7 @@ const char *SecondaryAllocatorName = "LargeMmapAllocator";
  
  // ThreadSanitizer for Go uses libc malloc/free.
  #if SANITIZER_GO || defined(SANITIZER_USE_MALLOC)
@@ -102,10 +101,10 @@ index fc4f7a75a..76cf4f769 100644
  #  if !SANITIZER_GO
  extern "C" void *__libc_memalign(uptr alignment, uptr size);
 diff --git a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-index 24e7548a5..20259b1d6 100644
+index 2d633c173..b6eb23116 100644
 --- a/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
 +++ b/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-@@ -102,7 +102,7 @@ static void ioctl_table_fill() {
+@@ -104,7 +104,7 @@ static void ioctl_table_fill() {
    _(SIOCGETVIFCNT, WRITE, struct_sioc_vif_req_sz);
  #endif
  
@@ -114,7 +113,7 @@ index 24e7548a5..20259b1d6 100644
    // Conflicting request ids.
    // _(CDROMAUDIOBUFSIZ, NONE, 0);
    // _(SNDCTL_TMR_CONTINUE, NONE, 0);
-@@ -363,7 +363,7 @@ static void ioctl_table_fill() {
+@@ -365,7 +365,7 @@ static void ioctl_table_fill() {
    _(VT_WAITACTIVE, NONE, 0);
  #endif
  
@@ -137,59 +136,59 @@ index 469c8eb7e..24f87867d 100644
                         void *old_rlim) {
    if (new_rlim) PRE_READ(new_rlim, struct_rlimit64_sz);
 diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc
-index 6c83e8db4..542c4fe64 100644
+index 96d6c1eff..9e2b7fb9d 100644
 --- a/lib/sanitizer_common/sanitizer_linux.cc
 +++ b/lib/sanitizer_common/sanitizer_linux.cc
-@@ -522,13 +522,13 @@ const char *GetEnv(const char *name) {
+@@ -541,13 +541,13 @@ const char *GetEnv(const char *name) {
  #endif
  }
  
--#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
-+#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_NONGNU
+-#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD
++#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_NONGNU
  extern "C" {
-   SANITIZER_WEAK_ATTRIBUTE extern void *__libc_stack_end;
+ SANITIZER_WEAK_ATTRIBUTE extern void *__libc_stack_end;
  }
  #endif
  
--#if !SANITIZER_GO && !SANITIZER_FREEBSD && !SANITIZER_NETBSD
-+#if (!SANITIZER_GO || SANITIZER_NONGNU) && !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+-#if !SANITIZER_GO && !SANITIZER_FREEBSD && !SANITIZER_NETBSD &&                \
++#if (!SANITIZER_GO || SANITIZER_NONGNU) && !SANITIZER_FREEBSD && !SANITIZER_NETBSD &&                \
+     !SANITIZER_OPENBSD
  static void ReadNullSepFileToArray(const char *path, char ***arr,
                                     int arr_size) {
-   char *buff;
-@@ -569,6 +569,10 @@ static void GetArgsAndEnv(char ***argv, char ***envp) {
+@@ -590,6 +590,10 @@ static void GetArgsAndEnv(char ***argv, char ***envp) {
  #elif SANITIZER_NETBSD
    *argv = __ps_strings->ps_argvstr;
-   *argv = __ps_strings->ps_envstr;
+   *envp = __ps_strings->ps_envstr;
 +#elif SANITIZER_NONGNU
 +    static const int kMaxArgv = 2000, kMaxEnvp = 2000;
 +    ReadNullSepFileToArray("/proc/self/cmdline", argv, kMaxArgv);
 +    ReadNullSepFileToArray("/proc/self/environ", envp, kMaxEnvp);
- #else
+ #else // SANITIZER_FREEBSD
  #if !SANITIZER_GO
    if (&__libc_stack_end) {
 diff --git a/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
-index 56fdfc870..a932d5db1 100644
+index 4962ff832..438f94dbe 100644
 --- a/lib/sanitizer_common/sanitizer_linux_libcdep.cc
 +++ b/lib/sanitizer_common/sanitizer_linux_libcdep.cc
-@@ -174,7 +174,7 @@ bool SanitizerGetThreadName(char *name, int max_len) {
+@@ -179,7 +179,7 @@ __attribute__((unused)) static bool GetLibcVersion(int *major, int *minor,
  }
  
- #if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && \
--    !SANITIZER_NETBSD && !SANITIZER_SOLARIS
-+    !SANITIZER_NETBSD && !SANITIZER_SOLARIS && !SANITIZER_NONGNU
+ #if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO &&               \
+-    !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS
++    !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_SOLARIS && !SANITIZER_NONGNU
  static uptr g_tls_size;
  
  #ifdef __i386__
-@@ -207,7 +207,7 @@ void InitTlsSize() { }
- 
- #if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) \
-     || defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__) \
--    || defined(__arm__)) && SANITIZER_LINUX && !SANITIZER_ANDROID
-+    || defined(__arm__)) && SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
+@@ -261,7 +261,7 @@ void InitTlsSize() { }
+ #if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) ||          \
+      defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__) ||    \
+      defined(__arm__)) &&                                                      \
+-    SANITIZER_LINUX && !SANITIZER_ANDROID
++    SANITIZER_LINUX && !SANITIZER_ANDROID && !SANITIZER_NONGNU
  // sizeof(struct pthread) from glibc.
- static atomic_uintptr_t kThreadDescriptorSize;
+ static atomic_uintptr_t thread_descriptor_size;
  
-@@ -391,7 +391,7 @@ int GetSizeFromHdr(struct dl_phdr_info *info, size_t size, void *data) {
+@@ -426,7 +426,7 @@ int GetSizeFromHdr(struct dl_phdr_info *info, size_t size, void *data) {
  
  #if !SANITIZER_GO
  static void GetTls(uptr *addr, uptr *size) {
@@ -198,29 +197,29 @@ index 56fdfc870..a932d5db1 100644
  # if defined(__x86_64__) || defined(__i386__) || defined(__s390__)
    *addr = ThreadSelf();
    *size = GetTlsSize();
-@@ -432,7 +432,7 @@ static void GetTls(uptr *addr, uptr *size) {
-       *addr = (uptr)tcb->tcb_dtv[1];
-     }
-   }
+@@ -470,7 +470,7 @@ static void GetTls(uptr *addr, uptr *size) {
+ #elif SANITIZER_OPENBSD
+   *addr = 0;
+   *size = 0;
 -#elif SANITIZER_ANDROID
 +#elif SANITIZER_ANDROID || SANITIZER_NONGNU
    *addr = 0;
    *size = 0;
  #elif SANITIZER_SOLARIS
-@@ -448,7 +448,7 @@ static void GetTls(uptr *addr, uptr *size) {
+@@ -486,7 +486,7 @@ static void GetTls(uptr *addr, uptr *size) {
  #if !SANITIZER_GO
  uptr GetTlsSize() {
- #if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NETBSD || \
--    SANITIZER_SOLARIS
-+    SANITIZER_SOLARIS || SANITIZER_NONGNU
+ #if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NETBSD ||              \
+-    SANITIZER_OPENBSD || SANITIZER_SOLARIS
++    SANITIZER_OPENBSD || SANITIZER_SOLARIS || 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 334903c26..fc2afac2c 100644
+index d81e25580..e10680ac8 100644
 --- a/lib/sanitizer_common/sanitizer_platform.h
 +++ b/lib/sanitizer_common/sanitizer_platform.h
-@@ -195,6 +195,12 @@
+@@ -208,6 +208,12 @@
  # define SANITIZER_SOLARIS32 0
  #endif
  
@@ -230,14 +229,14 @@ index 334903c26..fc2afac2c 100644
 +# 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.
+ #if defined(__myriad2__)
+ # define SANITIZER_MYRIAD2 1
+ #else
 diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
-index b99ac4480..628d226a1 100644
+index f95539a73..6c53b3415 100644
 --- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
 +++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
-@@ -38,7 +38,7 @@
+@@ -39,7 +39,7 @@
  # include "sanitizer_platform_limits_solaris.h"
  #endif
  
@@ -246,17 +245,17 @@ index b99ac4480..628d226a1 100644
  # define SI_LINUX_NOT_ANDROID 1
  #else
  # define SI_LINUX_NOT_ANDROID 0
-@@ -291,7 +291,7 @@
-   (SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID)
+@@ -322,7 +322,7 @@
  #define SANITIZER_INTERCEPT_ETHER_R (SI_FREEBSD || SI_LINUX_NOT_ANDROID)
- #define SANITIZER_INTERCEPT_SHMCTL                       \
--  (SI_NETBSD || SI_SOLARIS || ((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && \
-+  (SI_NETBSD || SI_SOLARIS || ((SI_FREEBSD || SI_LINUX_NOT_ANDROID || SANITIZER_NONGNU) && \
-                  SANITIZER_WORDSIZE == 64))  // NOLINT
+ #define SANITIZER_INTERCEPT_SHMCTL          \
+   (SI_NETBSD || SI_OPENBSD || SI_SOLARIS || \
+-  ((SI_FREEBSD || SI_LINUX_NOT_ANDROID) && \
++  ((SI_FREEBSD || SI_LINUX_NOT_ANDROID || SANITIZER_NONGNU) && \
+     SANITIZER_WORDSIZE == 64))  // NOLINT
  #define SANITIZER_INTERCEPT_RANDOM_R SI_LINUX_NOT_ANDROID
  #define SANITIZER_INTERCEPT_PTHREAD_ATTR_GET SI_POSIX
 diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-index feb7bad6f..4e89ab2a6 100644
+index 54da635d7..2f6ff69c3 100644
 --- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
 +++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
 @@ -14,6 +14,9 @@
@@ -357,9 +356,9 @@ index feb7bad6f..4e89ab2a6 100644
  CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
 +#endif
  
- COMPILER_CHECK(sizeof(__sanitizer_dirent) <= sizeof(dirent));
- CHECK_SIZE_AND_OFFSET(dirent, d_ino);
-@@ -1138,7 +1145,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
+ #ifndef __GLIBC_PREREQ
+ #define __GLIBC_PREREQ(x, y) 0
+@@ -1145,7 +1152,7 @@ CHECK_SIZE_AND_OFFSET(mntent, mnt_passno);
  
  CHECK_TYPE_SIZE(ether_addr);
  
@@ -368,7 +367,7 @@ index feb7bad6f..4e89ab2a6 100644
  CHECK_TYPE_SIZE(ipc_perm);
  # if SANITIZER_FREEBSD
  CHECK_SIZE_AND_OFFSET(ipc_perm, key);
-@@ -1199,7 +1206,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
+@@ -1206,7 +1213,7 @@ CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_dstaddr);
  CHECK_SIZE_AND_OFFSET(ifaddrs, ifa_data);
  #endif
  
@@ -377,7 +376,7 @@ index feb7bad6f..4e89ab2a6 100644
  COMPILER_CHECK(sizeof(__sanitizer_mallinfo) == sizeof(struct mallinfo));
  #endif
  
-@@ -1249,7 +1256,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE);
+@@ -1256,7 +1263,7 @@ COMPILER_CHECK(__sanitizer_XDR_DECODE == XDR_DECODE);
  COMPILER_CHECK(__sanitizer_XDR_FREE == XDR_FREE);
  #endif
  
@@ -386,7 +385,7 @@ index feb7bad6f..4e89ab2a6 100644
  COMPILER_CHECK(sizeof(__sanitizer_FILE) <= sizeof(FILE));
  CHECK_SIZE_AND_OFFSET(FILE, _flags);
  CHECK_SIZE_AND_OFFSET(FILE, _IO_read_ptr);
-@@ -1268,7 +1275,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain);
+@@ -1275,7 +1282,7 @@ CHECK_SIZE_AND_OFFSET(FILE, _chain);
  CHECK_SIZE_AND_OFFSET(FILE, _fileno);
  #endif
  
@@ -396,10 +395,10 @@ index feb7bad6f..4e89ab2a6 100644
  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 e14d5f575..389a3bc88 100644
+index de989b780..51a97b554 100644
 --- a/lib/tsan/rtl/tsan_platform_linux.cc
 +++ b/lib/tsan/rtl/tsan_platform_linux.cc
-@@ -285,7 +285,7 @@ void InitializePlatform() {
+@@ -294,7 +294,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) {
@@ -409,5 +408,5 @@ index e14d5f575..389a3bc88 100644
    struct __res_state *statp = (struct __res_state*)state;
    for (int i = 0; i < MAXNS && cnt < nfd; i++) {
 -- 
-2.18.0
+2.19.0