Commit Graph

1002 Commits

Author SHA1 Message Date
Adam Joseph
425cac96bf gcc: create dummy crtstuff on S390 as well
This commit replicates the fix in
https://github.com/NixOS/nixpkgs/pull/258032 for S390 as well.

Co-authored-by: Artturi <Artturin@artturin.com>
2023-10-25 08:36:22 +00:00
Weijia Wang
0a8e3e0748 gcc: create dummy crtstuff on loongarch64 2023-10-22 09:48:16 +00:00
github-actions[bot]
0e9411554d
Merge master into staging-next 2023-10-11 12:01:09 +00:00
Alyssa Ross
69b9532a74
gcc: always inhibit libc in cross with same configs
It's not just gcc->clang cross compilation that produces different
platforms with equal configs — dynamic->static cross compilation can
have the same result (e.g. pkgsMusl.pkgsStatic).  So, remove the check
for LLVM, but keep the check that the configs match.

This fixes pkgsMusl.nix on x86_64-linux, which depends on
pkgsMusl.pkgsStatic.buildPackages.gccWithoutTargetLibc.cc.

Fixes: 926c920c12 ("gcc: tighten condition for inhibit_libc=true")
2023-10-10 10:58:44 +00:00
Fabián Heredia Montiel
7f16b623fc Merge remote-tracking branch 'origin/master' into staging-next 2023-10-08 00:18:22 -06:00
Artturin
fa54cb146a gcc: add fallback to condition
```
> pkgsMusl.nix
error: attribute 'useLLVM' missing

$ nix eval -f . pkgsMusl.pkgsStatic.stdenv.targetPlatform.useLLVM
error: attribute 'useLLVM' in selection path 'pkgsMusl.pkgsStatic.stdenv.targetPlatform.useLLVM' not found
```
2023-10-07 18:26:49 +03:00
Alyssa Ross
a838aa244f
Merge remote-tracking branch 'origin/master' into staging-next
The hash for pytensor is not correct, but that's also the case in
master, so a merge commit isn't the place to fix it.

Conflicts:
	pkgs/development/python-modules/faadelays/default.nix
	pkgs/development/python-modules/pytensor/default.nix
	pkgs/tools/admin/rset/default.nix
2023-10-05 08:02:48 +00:00
Artturi
c748544b2f
Merge pull request #241206 from amjoseph-nixpkgs/tighten-inhibit_libc-condition 2023-10-05 04:43:53 +03:00
github-actions[bot]
ab895db907
Merge staging-next into staging 2023-09-22 00:02:40 +00:00
Adam Joseph
ea61be413c gcc: set GFORTRAN_FOR_TARGET on cross-built native compilers
For a cross-built native compiler, i.e. build!=(host==target), the
bundled libgfortran needs a gfortran which can run on the
buildPlatform and emit code for the targetPlatform.  The compiler
which is built alongside gfortran in this configuration doesn't meet
that need: it runs on the hostPlatform.

This commit passes the necessary compiler via `GFORTRAN_FOR_TARGET`,
using `pkgsBuildTarget.gfortran`.
2023-09-21 09:24:56 +03:00
Artturi
2e705d027f
Merge pull request #250498 from amjoseph-nixpkgs/gcc/deduplicate/simplify2 2023-09-19 07:47:50 +03:00
github-actions[bot]
b4fdbf27f2
Merge master into staging-next 2023-09-09 06:01:15 +00:00
John Ericson
e829eca886
Merge pull request #253939 from angerman/angerman/ucrt64
Add ucrt64 mingw toolchain.
2023-09-08 22:40:14 -04:00
github-actions[bot]
a376e04925
Merge master into staging-next 2023-09-09 00:02:10 +00:00
Adam Joseph
aafab3b5b6 gcc: for cross compilers, don't build libgcc twice
Cross-compiled binaries currently end up with two different libgcc
outpaths in their closure.  This is harmless, but confusing.

The two libgccs are:

- One of them is the "first" targetPlatform libgcc, which is built
  by the "first" cross-compiler.  This "first libgcc" and "first
  compiler" are used to build the targetPlatform glibc.

- Once glibc is built, we *rebuild* the cross-compiler, since gcc
  can't enable most of its features unless you give it an
  already-compiled targetPlatform glibc.  When this "second"
  compiler is built, it also builds an extra copy of libgcc.

This commit discards the second, extra libgcc, and instead puts a
reference to the first (correct) libgcc into the "second compiler"
`.passthru.libgcc`, so that anybody expecting `stdenv.cc.cc.libgcc`
to exist will still find it there.

Closes #249680
2023-09-08 16:07:50 +03:00
Moritz Angermann
a81e3dcd75 treewide: replace libc == "msvcrt" with isMinGW
msvcrt is only one of the libcs in MinGW. We therefore
replace explictly testing for msvcrt with the isMinGW
predicate. This lays the foundation for ucrt64 support.
2023-09-08 10:56:08 +00:00
Artturi
161bf63234
Merge pull request #250496 from amjoseph-nixpkgs/simplify 2023-09-06 02:44:34 +03:00
Artturin
5c63f69ed2 gcc.patches: For gcc49 apply libsanitizer-no-cyclades-9 patch later
otherwise there is a conflict
2023-09-02 21:49:08 +03:00
Artturin
3d4e0708a0 gcc: move dll.a in lib64 to lib output too
same as c304c1e7d0
2023-08-29 01:04:15 +03:00
marius david
2eeb227d77 gcc: move dll to output 2023-08-27 21:40:34 +03:00
Adam Joseph
af319af225 gcc: unescapify backslash 2023-08-23 21:47:12 -07:00
Adam Joseph
80198b835b gcc: remove backticks-used-as-quotes (error prone) 2023-08-23 21:47:12 -07:00
Adam Joseph
040cf4248d gcc: simplify expression by applying workarounds more broadly
This commit simplifies our gcc expression by applying various
workarounds unconditionally, rather than only to exactly the
versions which applied them prior to the deduplication cleanup.

Unlike its predecessors https://github.com/NixOS/nixpkgs/pull/249707
and https://github.com/NixOS/nixpkgs/pull/250489 this commit *does*
affect eval.
2023-08-23 21:47:12 -07:00
Adam Joseph
6c8b8bc2f1 gcc: limit gcc12 isMips --disable-libsanitizer to abi=="gnu" 2023-08-23 14:32:50 -07:00
Sergei Trofimovich
a62c92ab9b gcc12: disable libsanitizer for mips64
Without the change build on mips64-unknown-linux-gnu fails as:

        $ nix-build -A buildPackages.gcc12 --argstr crossSystem mips64-linux

        In file included from ...-glibc-mips64-unknown-linux-gnu-2.37-8-dev/include/bits/stat.h:25,
                         from ...-glibc-mips64-unknown-linux-gnu-2.37-8-dev/include/fcntl.h:78,
                         from ../../../../gcc-12.3.0/libsanitizer/sanitizer_common/sanitizer_linux.cpp:55:
        ...-glibc-mips64-unknown-linux-gnu-2.37-8-dev/include/bits/struct_stat.h:190:8: error: redefinition of 'struct stat64'
          190 | struct stat64
              |        ^~~~~~
2023-08-23 14:30:54 -07:00
Adam Joseph
62c676ce6f gcc: patches: reorganize and simplify
This PR sorts the huge pile of patches and deduplicates it.  Unlike
its predecessors https://github.com/NixOS/nixpkgs/pull/249707 and
https://github.com/NixOS/nixpkgs/pull/250489 this commit *does*
affect eval.

Patches below are organized into three general categories:

1. Patches relevant to gcc>=12 on every platform
2. Patches relevant to gcc>=12 on specific platforms
3. Patches relevant only to gcc<12, sorted by the newest version to
   which they might be relevant
2023-08-21 02:18:57 -07:00
Adam Joseph
1b0ed9f81b gcc: patches: fix patch name 2023-08-20 23:43:45 -07:00
Adam Joseph
b955304456 gcc: patches: fix patch name 2023-08-20 23:43:19 -07:00
Adam Joseph
8221d5f4e7 gcc: resolve merge conflict from staging 2023-08-20 23:00:03 -07:00
Adam Joseph
8f225b515f gcc: match weird whack-a-mole per-version hash algorithm 2023-08-20 23:00:03 -07:00
Adam Joseph
de36365466 gcc: clean up version conditions 2023-08-20 23:00:03 -07:00
Adam Joseph
30171782b7 gcc: move version-map out of all-packages.nix, into pkgs/ 2023-08-20 23:00:02 -07:00
Adam Joseph
911452ccbd gcc: move patches attribute into patches/ subdirectory 2023-08-20 23:00:02 -07:00
Adam Joseph
95475034d5 gcc: if atLeast 4.8, use deduplicated version 2023-08-20 23:00:02 -07:00
Adam Joseph
beeb48d17a gcc: if atLeast 4.9, use deduplicated version 2023-08-20 23:00:02 -07:00
Adam Joseph
920df10ab7 gcc: if atLeast 6, use deduplicated version 2023-08-20 23:00:02 -07:00
Adam Joseph
33f7f2c5aa gcc: if atLeast 7, use deduplicated version 2023-08-20 23:00:01 -07:00
Adam Joseph
e7afebbc4c gcc: if atLeast 8, use deduplicated version 2023-08-20 23:00:01 -07:00
Adam Joseph
4116fc3e6f gcc: if atLeast 9, use deduplicated version 2023-08-20 23:00:01 -07:00
Adam Joseph
10ee71f582 gcc: if atLeast 10, use deduplicated version 2023-08-20 23:00:01 -07:00
Adam Joseph
72fe04286e gcc: if atLeast 11, use deduplicated version 2023-08-20 23:00:00 -07:00
Adam Joseph
e9ece66a80 gcc: if atLeast 12, use deduplicated version 2023-08-20 23:00:00 -07:00
Adam Joseph
93d63aaa05 gcc: if atLeast 13, use deduplicated version 2023-08-20 23:00:00 -07:00
Adam Joseph
9dc9872922 gcc: default.nix: parameterize by version 2023-08-20 23:00:00 -07:00
Adam Joseph
57a2dfe646 gcc: default.nix: replace ../ with ./ 2023-08-20 23:00:00 -07:00
Adam Joseph
671b761d05 gcc: cp ./13/default.nix ./default.nix 2023-08-20 22:59:59 -07:00
Adam Joseph
39b20be057 gcc: resolve merge conflict from staging 2023-08-20 22:59:20 -07:00
Adam Joseph
fa0fc88e0c gcc: match weird whack-a-mole per-version hash algorithm 2023-08-20 22:59:20 -07:00
Adam Joseph
869b639285 gcc: clean up version conditions 2023-08-20 22:59:20 -07:00
Adam Joseph
02198751fa gcc: move version-map out of all-packages.nix, into pkgs/ 2023-08-20 22:59:20 -07:00