Skip to content

Commit

Permalink
gcc: use as(1) from binutils with LLVM bintools
Browse files Browse the repository at this point in the history
LLVM does not provide a drop-in replacement for as(1).

This makes it possible to build a GNU Fortran cross compiler from GNU
to LLVM — e.g. buildPackages.gfortran for
{ system = "aarch64-linux"; useLLVM = true; }
  • Loading branch information
alyssais authored and sternenseemann committed Jan 20, 2023
1 parent f5e63a0 commit 4ed0e1a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/10/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
, enableLTO ? !stdenv.hostPlatform.isStatic
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man)
, gmp, mpfr, libmpc, gettext, which, patchelf
, gmp, mpfr, libmpc, gettext, which, patchelf, binutils
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null
, gnatboot ? null
Expand Down Expand Up @@ -202,7 +202,7 @@ stdenv.mkDerivation ({
crossStageStatic libcCross threadsCross
version

gmp mpfr libmpc isl
binutils gmp mpfr libmpc isl

enableLTO
enableMultilib
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/11/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
, enableLTO ? !stdenv.hostPlatform.isStatic
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man)
, gmp, mpfr, libmpc, gettext, which, patchelf
, gmp, mpfr, libmpc, gettext, which, patchelf, binutils
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null
, gnatboot ? null
Expand Down Expand Up @@ -206,7 +206,7 @@ stdenv.mkDerivation ({
crossStageStatic libcCross threadsCross
version

gmp mpfr libmpc isl
binutils gmp mpfr libmpc isl

enableLTO
enableMultilib
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/12/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
, enableLTO ? !stdenv.hostPlatform.isStatic
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man)
, gmp, mpfr, libmpc, gettext, which, patchelf
, gmp, mpfr, libmpc, gettext, which, patchelf, binutils
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null
, libucontext ? null
Expand Down Expand Up @@ -250,7 +250,7 @@ stdenv.mkDerivation ({
crossStageStatic libcCross threadsCross
version

gmp mpfr libmpc isl
binutils gmp mpfr libmpc isl

enableLTO
enableMultilib
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/4.8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
, enableLTO ? !stdenv.hostPlatform.isStatic
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man); required for Java
, gmp, mpfr, libmpc, gettext, which, patchelf
, gmp, mpfr, libmpc, gettext, which, patchelf, binutils
, cloog ? null, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null, boehmgc ? null
, zip ? null, unzip ? null, pkg-config ? null
Expand Down Expand Up @@ -207,7 +207,7 @@ stdenv.mkDerivation ({
crossStageStatic libcCross threadsCross
version

gmp mpfr libmpc isl
binutils gmp mpfr libmpc isl
cloog

enableLTO
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/4.9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
, enableLTO ? !stdenv.hostPlatform.isStatic
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man); required for Java
, gmp, mpfr, libmpc, gettext, which, patchelf
, gmp, mpfr, libmpc, gettext, which, patchelf, binutils
, cloog ? null, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null, boehmgc ? null
, zip ? null, unzip ? null, pkg-config ? null
Expand Down Expand Up @@ -227,7 +227,7 @@ stdenv.mkDerivation ({
crossStageStatic libcCross threadsCross
version

gmp mpfr libmpc isl
binutils gmp mpfr libmpc isl
cloog

enableLTO
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
, texinfo ? null
, flex
, perl ? null # optional, for texi2pod (then pod2man); required for Java
, gmp, mpfr, libmpc, gettext, which, patchelf
, gmp, mpfr, libmpc, gettext, which, patchelf, binutils
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null, boehmgc ? null
, gnatboot ? null
Expand Down Expand Up @@ -238,7 +238,7 @@ stdenv.mkDerivation ({
crossStageStatic libcCross threadsCross
version

gmp mpfr libmpc isl
binutils gmp mpfr libmpc isl

enableLTO
enableMultilib
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
, enableLTO ? !stdenv.hostPlatform.isStatic
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man)
, gmp, mpfr, libmpc, gettext, which, patchelf
, gmp, mpfr, libmpc, gettext, which, patchelf, binutils
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null
, enableMultilib ? false
Expand Down Expand Up @@ -206,7 +206,7 @@ stdenv.mkDerivation ({
crossStageStatic libcCross threadsCross
version

gmp mpfr libmpc isl
binutils gmp mpfr libmpc isl

enableLTO
enableMultilib
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
, enableLTO ? !stdenv.hostPlatform.isStatic
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man)
, gmp, mpfr, libmpc, gettext, which, patchelf
, gmp, mpfr, libmpc, gettext, which, patchelf, binutils
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null
, enableMultilib ? false
Expand Down Expand Up @@ -188,7 +188,7 @@ stdenv.mkDerivation ({
crossStageStatic libcCross threadsCross
version

gmp mpfr libmpc isl
binutils gmp mpfr libmpc isl

enableLTO
enableMultilib
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
, enableLTO ? !stdenv.hostPlatform.isStatic
, texinfo ? null
, perl ? null # optional, for texi2pod (then pod2man)
, gmp, mpfr, libmpc, gettext, which, patchelf
, gmp, mpfr, libmpc, gettext, which, patchelf, binutils
, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null
, gnatboot ? null
Expand Down Expand Up @@ -201,7 +201,7 @@ stdenv.mkDerivation ({
crossStageStatic libcCross threadsCross
version

gmp mpfr libmpc isl
binutils gmp mpfr libmpc isl

enableLTO
enableMultilib
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/common/configure-flags.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
, threadsCross
, version

, gmp, mpfr, libmpc, isl
, binutils, gmp, mpfr, libmpc, isl
, cloog ? null

, enableLTO
Expand Down Expand Up @@ -51,7 +51,7 @@ let
crossConfigureFlags =
# Ensure that -print-prog-name is able to find the correct programs.
[
"--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-as=${if targetPackages.stdenv.cc.bintools.isLLVM then binutils else targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
"--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld"
]
++ (if crossStageStatic then [
Expand Down

0 comments on commit 4ed0e1a

Please sign in to comment.