Merge gcc-9 into staging (#68029)
This commit is contained in:
@@ -4,13 +4,13 @@ with builtins;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "arachne-pnr";
|
||||
version = "2018.09.09";
|
||||
version = "2019.07.29";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "yosyshq";
|
||||
repo = "arachne-pnr";
|
||||
rev = "840bdfdeb38809f9f6af4d89dd7b22959b176fdd";
|
||||
sha256 = "1dqvjvgvsridybishv4pnigw9gypxh7r7nrqp9z9qq92v7c5rxzl";
|
||||
rev = "c40fb2289952f4f120cc10a5a4c82a6fb88442dc";
|
||||
sha256 = "0lg9rccr486cvips3jf289af2b4a2j9chc8iqnkhykgi1hw4pszc";
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "iasl";
|
||||
version = "20190108";
|
||||
version = "20191213";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://acpica.org/sites/acpica/files/acpica-unix-${version}.tar.gz";
|
||||
sha256 = "0bqhr3ndchvfhxb31147z8gd81dysyz5dwkvmp56832d0js2564q";
|
||||
sha256 = "1ip684is3dplf7snkn024vv6bg3dv5msx8v7pz6x9lrnk3gk0j9h";
|
||||
};
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-O3";
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
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
|
||||
|
||||
@@ -27,7 +27,10 @@ let
|
||||
(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 ];
|
||||
patches = [
|
||||
./purity.patch
|
||||
./0001-Fix-compilation-w-gcc9.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
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
|
||||
|
||||
@@ -38,7 +38,10 @@ let
|
||||
++ 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 ];
|
||||
patches = [
|
||||
./purity.patch
|
||||
./0001-Fix-compilation-w-gcc9.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' lib/Driver/Tools.cpp
|
||||
|
||||
33
pkgs/development/compilers/llvm/4/fix-gcc9.patch
Normal file
33
pkgs/development/compilers/llvm/4/fix-gcc9.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
@@ -53,6 +53,13 @@ stdenv.mkDerivation ({
|
||||
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
|
||||
|
||||
33
pkgs/development/compilers/llvm/5/fix-gcc9.patch
Normal file
33
pkgs/development/compilers/llvm/5/fix-gcc9.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
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
|
||||
@@ -70,6 +70,7 @@
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <new>
|
||||
+#include <array>
|
||||
|
||||
#define DEBUG_TYPE "mips-fastisel"
|
||||
|
||||
@@ -1309,13 +1310,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;
|
||||
@@ -50,6 +50,13 @@ stdenv.mkDerivation ({
|
||||
name = "llvm-gcc8-type-mismatch.patch";
|
||||
sha256 = "0ga2123aclq3x9w72d0rm0az12m8c1i4r1106vh701hf4cghgbch";
|
||||
})
|
||||
./fix-gcc9.patch
|
||||
#(fetchpatch {
|
||||
# name = "llvm-fix-gcc9.patch";
|
||||
# url = "https://reviews.llvm.org/file/data/zs3ck5ryvc5n672fd2kw/PHID-FILE-byoqefzwmkd7qnlip4v2/file";
|
||||
# sha256 = "0injj1hqgrbcbihhwp2nbal88jfykad30r54f2cdcx7gws2fcy8i";
|
||||
# stripLen = 1;
|
||||
#})
|
||||
];
|
||||
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
substituteInPlace cmake/modules/AddLLVM.cmake \
|
||||
|
||||
@@ -54,6 +54,8 @@ stdenv.mkDerivation ( rec {
|
||||
|
||||
checkTarget = "test-ci";
|
||||
|
||||
NIX_CFLAGS_COMPILE = [ "-Wno-error=redundant-move" ];
|
||||
|
||||
preCheck = ''
|
||||
export PONYPATH="$out/lib:${stdenv.lib.makeLibraryPath [ pcre2 libressl ]}"
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user