Merge branch 'systemd-cross' into staging

This commit is contained in:
Shea Levy 2018-02-26 07:42:21 -05:00
commit 044c65bd06
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
13 changed files with 96 additions and 34 deletions

View File

@ -73,7 +73,9 @@ let version = "7.3.0";
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch;
++ optional langFortran ../gfortran-driving.patch
# https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00633.html
++ optional targetPlatform.isRiscV ./riscv-pthread-reentrant.patch;
javaEcj = fetchurl {
# The `$(top_srcdir)/ecj.jar' file is automatically picked up at

View File

@ -0,0 +1,13 @@
Index: gcc/config/riscv/linux.h
===================================================================
--- a/gcc/config/riscv/linux.h (revision 257620)
+++ b/gcc/config/riscv/linux.h (revision 257621)
@@ -47,6 +47,8 @@
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
+#define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
#define LINK_SPEC "\
-melf" XLEN_SPEC "lriscv \
%{shared} \

View File

@ -1,6 +1,6 @@
{ fetchurl, stdenv, libtool, readline, gmp, pkgconfig, boehmgc, libunistring
, libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null
, hostPlatform
, hostPlatform, buildPackages
}:
# Do either a coverage analysis build or a standard build.
@ -19,7 +19,9 @@
outputs = [ "out" "dev" "info" ];
setOutputFlags = false; # $dev gets into the library otherwise
nativeBuildInputs = [ makeWrapper gawk pkgconfig ];
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ makeWrapper gawk pkgconfig ] ++
stdenv.lib.optional stdenv.isCross buildPackages.buildPackages.guile_2_0;
buildInputs = [ readline libtool libunistring libffi ];
propagatedBuildInputs = [ gmp boehmgc ]
@ -29,9 +31,6 @@
# see below.
++ [ libtool libunistring ];
# A native Guile 2.0 is needed to cross-build Guile.
selfNativeBuildInput = true;
enableParallelBuilding = true;
patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ./clang.patch
@ -40,6 +39,7 @@
url = "http://git.savannah.gnu.org/cgit/guile.git/patch/?id=2fbde7f02adb8c6585e9baf6e293ee49cd23d4c4";
sha256 = "0p6c1lmw1iniq03z7x5m65kg3lq543kgvdb4nrxsaxjqf3zhl77v";
})
./riscv.patch
] ++
(stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch);

View File

@ -1,6 +1,6 @@
{ fetchurl, stdenv, libtool, readline, gmp, pkgconfig, boehmgc, libunistring
, libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null
, hostPlatform
, hostPlatform, buildPackages
}:
# Do either a coverage analysis build or a standard build.
@ -20,7 +20,9 @@
outputs = [ "out" "dev" "info" ];
setOutputFlags = false; # $dev gets into the library otherwise
nativeBuildInputs = [ makeWrapper gawk pkgconfig ];
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ makeWrapper gawk pkgconfig ] ++
stdenv.lib.optional stdenv.isCross buildPackages.buildPackages.guile;
buildInputs = [ readline libtool libunistring libffi ];
propagatedBuildInputs = [ gmp boehmgc ]
@ -30,13 +32,11 @@
# see below.
++ [ libtool libunistring ];
# A native Guile 2.0 is needed to cross-build Guile.
selfNativeBuildInput = true;
enableParallelBuilding = true;
patches = [
./eai_system.patch
./riscv.patch
] ++
(stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch);

View File

@ -0,0 +1,13 @@
diff --git a/module/system/base/target.scm b/module/system/base/target.scm
index 95ab8d8c9..93616f4a3 100644
--- a/module/system/base/target.scm
+++ b/module/system/base/target.scm
@@ -86,6 +86,8 @@
(endianness big))
((string=? "aarch64" cpu)
(endianness little))
+ ((string-match "riscv[1-9][0-9]*" cpu)
+ (endianness little))
(else
(error "unknown CPU endianness" cpu)))))

View File

@ -21,18 +21,18 @@ stdenv.mkDerivation rec {
# The build enables -O2 by default for everything else.
hardeningDisable = stdenv.lib.optional stdenv.cc.isClang "fortify";
depsBuildBuild = stdenv.lib.optional stdenv.isCross buildPackages.stdenv.cc;
depsBuildBuild = [ buildPackages.stdenv.cc ];
buildInputs = [ libgpgerror ]
++ stdenv.lib.optional stdenv.isDarwin gettext
++ stdenv.lib.optional enableCapabilities libcap;
preConfigure = if stdenv.isCross then ''
preConfigure = stdenv.lib.optionalString stdenv.isCross ''
# This is intentional: gpg-error-config is a shell script that will work during the build
mkdir -p "$NIX_BUILD_TOP"/bin
ln -s ${libgpgerror.dev}/bin/gpg-error-config "$NIX_BUILD_TOP/bin"
export PATH="$NIX_BUILD_TOP/bin:$PATH"
'' else null;
'';
# Make sure libraries are correct for .pc and .la files
# Also make sure includes are fixed for callers who don't use libgpgcrypt-config

View File

@ -1,4 +1,4 @@
{ fetchurl, stdenv, libiconv, libunistring, help2man, ronn }:
{ fetchurl, stdenv, libiconv, libunistring, help2man, ronn, buildPackages }:
with stdenv.lib;
@ -15,8 +15,10 @@ stdenv.mkDerivation rec {
patches = optional stdenv.isDarwin ./fix-error-darwin.patch;
buildInputs = [ libunistring ronn ]
++ optionals stdenv.isDarwin [ libiconv help2man ];
nativeBuildInputs = [ ronn ]
++ optional stdenv.isDarwin help2man;
buildInputs = [ libunistring ] ++ optional stdenv.isDarwin libiconv;
depsBuildBuild = [ buildPackages.stdenv.cc ];
meta = {
homepage = "https://www.gnu.org/software/libidn/#libidn2";

View File

@ -1,5 +1,7 @@
{ lib, python3Packages }:
python3Packages.buildPythonApplication rec {
{ lib, python3Packages, stdenv, targetPlatform, writeTextDir, m4 }: let
targetPrefix = lib.optionalString stdenv.isCross
(targetPlatform.config + "-");
in python3Packages.buildPythonApplication rec {
version = "0.44.0";
pname = "meson";
name = "${pname}-${version}";
@ -33,6 +35,26 @@ python3Packages.buildPythonApplication rec {
setupHook = ./setup-hook.sh;
crossFile = writeTextDir "cross-file.conf" ''
[binaries]
c = '${targetPrefix}cc'
cpp = '${targetPrefix}c++'
ar = '${targetPrefix}ar'
strip = '${targetPrefix}strip'
pkgconfig = 'pkg-config'
[properties]
needs_exe_wrapper = true
[host_machine]
system = '${targetPlatform.parsed.kernel.name}'
cpu_family = '${targetPlatform.parsed.cpu.family}'
cpu = '${targetPlatform.parsed.cpu.name}'
endian = ${if targetPlatform.isLittleEndian then "'little'" else "'big'"}
'';
inherit (stdenv) cc isCross;
meta = with lib; {
homepage = http://mesonbuild.com;
description = "SCons-like build system that use python as a front-end language and Ninja as a building backend";

View File

@ -6,11 +6,15 @@ mesonConfigurePhase() {
fi
# Build release by default.
mesonFlags="--buildtype=${mesonBuildType:-release} $mesonFlags"
if [ -n "@isCross@" ]; then
crossMesonFlags="--cross-file=@crossFile@/cross-file.conf"
fi
mesonFlags="${crossMesonFlags+$crossMesonFlags }--buildtype=${mesonBuildType:-release} $mesonFlags"
echo "meson flags: $mesonFlags ${mesonFlagsArray[@]}"
meson build $mesonFlags "${mesonFlagsArray[@]}"
CC=@cc@/bin/cc CXX=@cc@/bin/c++ meson build $mesonFlags "${mesonFlagsArray[@]}"
cd build
if ! [[ -v enableParallelBuilding ]]; then

View File

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ which pkgconfig perl ]
# autogen needs a build autogen when cross-compiling
++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
buildPackages.autogen buildPackages.texinfo ];
buildPackages.buildPackages.autogen buildPackages.texinfo ];
buildInputs = [
guile libxml2
];

View File

@ -8,6 +8,7 @@
, swig
, ncurses
, pam
, buildPackages
}:
let
@ -29,8 +30,8 @@ let
};
prePatchCommon = ''
substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${perl}/bin/pod2man"
substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${perl}/bin/pod2html"
substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${buildPackages.perl}/bin/pod2man"
substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${buildPackages.perl}/bin/pod2html"
substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h"
substituteInPlace ./common/Make.rules --replace "/usr/share/man" "share/man"
'';
@ -70,9 +71,10 @@ let
swig
ncurses
which
perl
];
buildInputs = [
buildInputs = stdenv.lib.optionals (!stdenv.isCross) [
perl
python
];
@ -87,11 +89,12 @@ let
inherit patches;
postPatch = "cd ./libraries/libapparmor";
configureFlags = "--with-python --with-perl";
# https://gitlab.com/apparmor/apparmor/issues/1
configureFlags = stdenv.lib.optionalString (!stdenv.isCross) "--with-python --with-perl";
outputs = [ "out" "python" ];
outputs = if stdenv.isCross then [ "out" ] else [ "out" "python" ];
postInstall = ''
postInstall = stdenv.lib.optionalString (!stdenv.isCross) ''
mkdir -p $python/lib
mv $out/lib/python* $python/lib/
'';

View File

@ -9,12 +9,13 @@
, patchelf
, getent
, hostPlatform
, buildPackages
}:
assert stdenv.isLinux;
let
pythonLxmlEnv = python3Packages.python.withPackages ( ps: with ps; [ python3Packages.lxml ]);
pythonLxmlEnv = buildPackages.python3Packages.python.withPackages ( ps: with ps; [ python3Packages.lxml ]);
in
@ -35,14 +36,16 @@ in
[ pkgconfig intltool gperf libxslt gettext docbook_xsl docbook_xml_dtd_42 docbook_xml_dtd_45
ninja meson
coreutils # meson calls date, stat etc.
pythonLxmlEnv glibcLocales
patchelf getent
glibcLocales
patchelf getent m4
];
buildInputs =
[ linuxHeaders libcap kmod xz pam acl
/* cryptsetup */ libuuid m4 glib libgcrypt libgpgerror libidn2
/* cryptsetup */ libuuid glib libgcrypt libgpgerror libidn2
libmicrohttpd kexectools libseccomp libffi audit lz4 bzip2 libapparmor
iptables gnu-efi
# This is actually native, but we already pull it from buildPackages
pythonLxmlEnv
];
#dontAddPrefix = true;
@ -128,7 +131,7 @@ in
for i in src/basic/generate-gperfs.py src/resolve/generate-dns_type-gperf.py src/test/generate-sym-test.py ; do
substituteInPlace $i \
--replace "#!/usr/bin/env python" "#!${python3Packages.python}/bin/python"
--replace "#!/usr/bin/env python" "#!${buildPackages.python3Packages.python}/bin/python"
done
substituteInPlace src/journal/catalog.c \

View File

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "1abbch762gv8rjr579q3qyyk6c80plklbv2mw4x0vg71dgsw9bgz";
};
configureFlags = "CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3";
configureFlags = "CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3" + stdenv.lib.optionalString stdenv.isCross " CXX=${stdenv.cc.targetPrefix}c++";
setupHook = ./lzip-setup-hook.sh;