From cf004ae56ee8261c9e5070e83ee14fc21f8e58d6 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 6 Sep 2016 13:54:13 -0500 Subject: [PATCH] gcc: add --with-native-system-header-dir for clang gcc needs to be able find system headers. Without this, gcc fails to build because /usr/include is not available. Note: stdenv.libc should be available for all stdenv's, I think. --- pkgs/development/compilers/gcc/4.8/default.nix | 4 ++-- pkgs/development/compilers/gcc/4.9/default.nix | 4 ++-- pkgs/development/compilers/gcc/5/default.nix | 4 ++-- pkgs/development/compilers/gcc/6/default.nix | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index cf06fe9567e..1b9e4bf666c 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -357,8 +357,8 @@ stdenv.mkDerivation ({ ) ) } - ${if (stdenv ? glibc && cross == null) - then " --with-native-system-header-dir=${stdenv.glibc.dev}/include" + ${if cross == null + then " --with-native-system-header-dir=${getDev stdenv.libc}/include" else ""} ${if langAda then " --enable-libada" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""} diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index a746b7e12b3..71edda0937f 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -364,8 +364,8 @@ stdenv.mkDerivation ({ ) ) } - ${if (stdenv ? glibc && cross == null) - then " --with-native-system-header-dir=${stdenv.glibc.dev}/include" + ${if cross == null + then " --with-native-system-header-dir=${getDev stdenv.libc}/include" else ""} ${if langAda then " --enable-libada" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""} diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 6f8a32a7bfc..e84c677408c 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -362,8 +362,8 @@ stdenv.mkDerivation ({ ) ) } - ${if (stdenv ? glibc && cross == null) - then " --with-native-system-header-dir=${stdenv.glibc.dev}/include" + ${if cross == null + then " --with-native-system-header-dir=${getDev stdenv.libc}/include" else ""} ${if langAda then " --enable-libada" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""} diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 57172a2d9db..b33437ee868 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -360,8 +360,8 @@ stdenv.mkDerivation ({ ) ) } - ${if (stdenv ? glibc && cross == null) - then " --with-native-system-header-dir=${stdenv.glibc.dev}/include" + ${if cross == null + then " --with-native-system-header-dir=${getDev stdenv.libc}/include" else ""} ${if langAda then " --enable-libada" else ""} ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}