Commit Graph

992 Commits

Author SHA1 Message Date
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
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
Artturi
c748544b2f
Merge pull request #241206 from amjoseph-nixpkgs/tighten-inhibit_libc-condition 2023-10-05 04:43:53 +03: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
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
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
Adam Joseph
7367bb691d gcc: move patches attribute into patches/ subdirectory 2023-08-20 22:59:19 -07:00
Adam Joseph
da87387073 gcc: if atLeast 4.8, use deduplicated version 2023-08-20 22:59:16 -07:00
Adam Joseph
8a4148a538 gcc: if atLeast 4.9, use deduplicated version 2023-08-20 22:59:16 -07:00
Adam Joseph
b505fb4711 gcc: if atLeast 6, use deduplicated version 2023-08-20 22:59:16 -07:00
Adam Joseph
b3d07e87d2 gcc: if atLeast 7, use deduplicated version 2023-08-20 22:59:15 -07:00
Adam Joseph
942d7ecf08 gcc: if atLeast 8, use deduplicated version 2023-08-20 22:59:15 -07:00
Adam Joseph
01902c7b45 gcc: if atLeast 9, use deduplicated version 2023-08-20 22:59:15 -07:00
Adam Joseph
c72e136046 gcc: if atLeast 10, use deduplicated version 2023-08-20 22:59:15 -07:00
Adam Joseph
8a822d6e5d gcc: if atLeast 11, use deduplicated version 2023-08-20 22:59:14 -07:00
Adam Joseph
dc3eb566d1 gcc: if atLeast 12, use deduplicated version 2023-08-20 22:59:14 -07:00