mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 21:33:03 +03:00
Merge commit '9d8f9b2e531bf95a700a949d879927fb6996ffc9' into binutils-wrapper
This commit is contained in:
commit
7ef4448c97
@ -238,7 +238,7 @@ stdenv.mkDerivation {
|
||||
# compile, because it uses "#include_next <limits.h>" to find the
|
||||
# limits.h file in ../includes-fixed. To remedy the problem,
|
||||
# another -idirafter is necessary to add that directory again.
|
||||
echo "-B${libc_lib}/lib/ -idirafter ${libc_dev}/include -idirafter ${cc}/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
|
||||
echo "-B${libc_lib}/lib/ -idirafter ${libc_dev}/include ${optionalString isGNU "-idirafter ${cc}/lib/gcc/*/*/include-fixed"}" > $out/nix-support/libc-cflags
|
||||
|
||||
echo "${libc_lib}" > $out/nix-support/orig-libc
|
||||
echo "${libc_dev}" > $out/nix-support/orig-libc-dev
|
||||
|
44
pkgs/development/compilers/llvm/multi.nix
Normal file
44
pkgs/development/compilers/llvm/multi.nix
Normal file
@ -0,0 +1,44 @@
|
||||
{ runCommand,
|
||||
clang,
|
||||
gcc64,
|
||||
gcc32,
|
||||
glibc_multi
|
||||
}:
|
||||
|
||||
let
|
||||
combine = basegcc: runCommand "combine-gcc-libc" {} ''
|
||||
mkdir -p $out
|
||||
cp -r ${basegcc.cc}/lib $out/lib
|
||||
|
||||
chmod u+rw -R $out/lib
|
||||
cp -r ${basegcc.libc}/lib/* $(ls -d $out/lib/gcc/*/*)
|
||||
'';
|
||||
gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {} ''
|
||||
mkdir -p $out/lib/gcc
|
||||
|
||||
ln -s ${combine gcc64}/lib/gcc/* $out/lib/gcc/
|
||||
ln -s ${combine gcc32}/lib/gcc/* $out/lib/gcc/
|
||||
# XXX: This shouldn't be needed, clang just doesn't look for "i686-unknown"
|
||||
ln -s $out/lib/gcc/i686-unknown-linux-gnu $out/lib/gcc/i686-pc-linux-gnu
|
||||
|
||||
|
||||
# includes
|
||||
ln -s ${glibc_multi.dev}/include $out/
|
||||
|
||||
# dynamic linkers
|
||||
mkdir -p $out/lib/32
|
||||
ln -s ${glibc_multi.out}/lib/ld-linux* $out/lib
|
||||
ln -s ${glibc_multi.out}/lib/32/ld-linux* $out/lib/32/
|
||||
'';
|
||||
|
||||
clangMulti = clang.override {
|
||||
# Only used for providing expected structure re:dynamic linkers, AFAIK
|
||||
# Most of the magic is done by setting the --gcc-toolchain option below
|
||||
libc = gcc_multi_sysroot;
|
||||
|
||||
extraBuildCommands = ''
|
||||
sed -e '$a --gcc-toolchain=${gcc_multi_sysroot}' -i $out/nix-support/libc-cflags
|
||||
'';
|
||||
};
|
||||
|
||||
in clangMulti
|
@ -128,7 +128,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
postConfigure = ''
|
||||
echo "applying patch ${./parallel-build.patch}"
|
||||
patch -p1 -i ${./parallel-build.patch}
|
||||
patch -p1 < ${./parallel-build.patch}
|
||||
'';
|
||||
|
||||
prefixKey = "-prefix ";
|
||||
|
37
pkgs/test/cc-wrapper/multilib.nix
Normal file
37
pkgs/test/cc-wrapper/multilib.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{ stdenv }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "cc-multilib-test";
|
||||
|
||||
# XXX: "depend" on cc-wrapper test?
|
||||
|
||||
# TODO: Have tests report pointer size or something; ensure they are what we asked for
|
||||
buildCommand = ''
|
||||
NIX_DEBUG=1 $CC -v
|
||||
NIX_DEBUG=1 $CXX -v
|
||||
|
||||
printf "checking whether compiler builds valid C binaries... " >&2
|
||||
$CC -o cc-check ${./cc-main.c}
|
||||
./cc-check
|
||||
|
||||
printf "checking whether compiler builds valid 32bit C binaries... " >&2
|
||||
$CC -m32 -o c32-check ${./cc-main.c}
|
||||
./c32-check
|
||||
|
||||
printf "checking whether compiler builds valid 64bit C binaries... " >&2
|
||||
$CC -m64 -o c64-check ${./cc-main.c}
|
||||
./c64-check
|
||||
|
||||
printf "checking whether compiler builds valid 32bit C++ binaries... " >&2
|
||||
$CXX -m32 -o cxx32-check ${./cxx-main.cc}
|
||||
./cxx32-check
|
||||
|
||||
printf "checking whether compiler builds valid 64bit C++ binaries... " >&2
|
||||
$CXX -m64 -o cxx64-check ${./cxx-main.cc}
|
||||
./cxx64-check
|
||||
|
||||
touch $out
|
||||
'';
|
||||
|
||||
meta.platforms = stdenv.lib.platforms.x86_64;
|
||||
}
|
@ -8,6 +8,7 @@
|
||||
, scpSupport ? false, libssh2 ? null
|
||||
, gssSupport ? false, gss ? null
|
||||
, c-aresSupport ? false, c-ares ? null
|
||||
, brotliSupport ? false, brotli ? null
|
||||
}:
|
||||
|
||||
assert http2Support -> nghttp2 != null;
|
||||
@ -19,6 +20,7 @@ assert !(gnutlsSupport && sslSupport);
|
||||
assert gnutlsSupport -> gnutls != null;
|
||||
assert scpSupport -> libssh2 != null;
|
||||
assert c-aresSupport -> c-ares != null;
|
||||
assert brotliSupport -> brotli != null;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "curl-7.57.0";
|
||||
@ -47,7 +49,8 @@ stdenv.mkDerivation rec {
|
||||
optional c-aresSupport c-ares ++
|
||||
optional sslSupport openssl ++
|
||||
optional gnutlsSupport gnutls ++
|
||||
optional scpSupport libssh2;
|
||||
optional scpSupport libssh2 ++
|
||||
optional brotliSupport brotli;
|
||||
|
||||
# for the second line see https://curl.haxx.se/mail/tracker-2014-03/0087.html
|
||||
preConfigure = ''
|
||||
@ -64,6 +67,7 @@ stdenv.mkDerivation rec {
|
||||
( if ldapSupport then "--enable-ldap" else "--disable-ldap" )
|
||||
( if ldapSupport then "--enable-ldaps" else "--disable-ldaps" )
|
||||
( if idnSupport then "--with-libidn=${libidn.dev}" else "--without-libidn" )
|
||||
( if brotliSupport then "--with-brotli" else "--without-brotli" )
|
||||
]
|
||||
++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}"
|
||||
++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}";
|
||||
|
@ -1639,6 +1639,7 @@ with pkgs;
|
||||
idnSupport = true;
|
||||
ldapSupport = true;
|
||||
gssSupport = true;
|
||||
brotliSupport = true;
|
||||
};
|
||||
|
||||
curl = callPackage ../tools/networking/curl rec {
|
||||
@ -5585,7 +5586,20 @@ with pkgs;
|
||||
'';
|
||||
}) else throw "Multilib ${cc.name} not supported on ‘${system}’";
|
||||
|
||||
wrapClangMulti = clang:
|
||||
if system == "x86_64-linux" then
|
||||
callPackages ../development/compilers/llvm/multi.nix {
|
||||
inherit clang;
|
||||
gcc32 = pkgsi686Linux.gcc;
|
||||
gcc64 = pkgs.gcc;
|
||||
}
|
||||
else throw "Multilib ${clang.cc.name} not supported on '${system}'";
|
||||
|
||||
gcc_multi = wrapCCMulti gcc;
|
||||
clang_multi = wrapClangMulti clang;
|
||||
|
||||
gccMultiStdenv = overrideCC stdenv gcc_multi;
|
||||
clangMultiStdenv = overrideCC stdenv clang_multi;
|
||||
|
||||
gcc_debug = lowPrio (wrapCC (gcc.cc.override {
|
||||
stripped = false;
|
||||
@ -20077,6 +20091,9 @@ with pkgs;
|
||||
cc-wrapper-libcxx-5 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_5.libcxxStdenv; };
|
||||
stdenv-inputs = callPackage ../test/stdenv-inputs { };
|
||||
|
||||
cc-multilib-gcc = callPackage ../test/cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
|
||||
cc-multilib-clang = callPackage ../test/cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
|
||||
|
||||
macOSSierraShared = callPackage ../test/macos-sierra-shared {};
|
||||
};
|
||||
|
||||
|
@ -112,6 +112,8 @@ let
|
||||
jobs.tests.cc-wrapper-clang-39.x86_64-darwin
|
||||
jobs.tests.cc-wrapper-libcxx-39.x86_64-linux
|
||||
jobs.tests.cc-wrapper-libcxx-39.x86_64-darwin
|
||||
jobs.tests.cc-multilib-gcc.x86_64-linux
|
||||
jobs.tests.cc-multilib-clang.x86_64-linux
|
||||
jobs.tests.stdenv-inputs.x86_64-linux
|
||||
jobs.tests.stdenv-inputs.x86_64-darwin
|
||||
jobs.tests.macOSSierraShared.x86_64-darwin
|
||||
|
Loading…
Reference in New Issue
Block a user