Commit Graph

41 Commits

Author SHA1 Message Date
Ben Siraphob
0f420e96c4 gcc, libgcc: fix cross-compilation for SH4
- Pass --with-multilib-list=m4,m4-nofpu for SH4 so the kernel can use
  -m4-nofpu. Move libraries out of !m4/ multilib subdirectory in
  postInstall before moveToOutput.
- Generate sysroot-suffix.h for SH4 in the standalone libgcc builder.
- Add linux-kernel.target = "vmlinux" and installTarget for SH4.

All changes scoped to isSh4 to avoid rebuilds on other platforms.
2026-04-20 13:02:20 -07:00
Luna Nova
e7fbed853b treewide: remove usages of obsolete pie hardening flag 2025-10-09 10:13:03 -07:00
Luna Nova
ccc56d1a79 gcc: build with --enable-default-pie configure option
Rather than implementing this at the wrapper level (which has been
attempted but not merged in # 252310 and # 205031), configuring GCC
directly with --enable-default-pie is simple and matches mainstream
distribution practices. Packages that cannot build with PIE can
explicitly pass -no-pie when needed, and mostly already do
due to the prevalence of GCCs built with this flag.

Requires followup to decide what to do with "pie" flag.
2025-09-13 10:15:36 -07:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Sergei Trofimovich
f54699d016 pkgsCross.loongarch64-linux.libgcc: update for gcc-14
Without the change the `pkgsCross.loongarch64-linux.stdenv` fails as:

    In file included from /build/source/libgcc/../gcc/config/loongarch/loongarch.h:53,
                     from ../../.././gcc/tm.h:53,
                     from /build/source/libgcc/fixed-bit.c:48:
    /build/source/libgcc/../gcc/config/loongarch/loongarch-driver.h:82:10: fatal error: loongarch-multilib.h: No such file or directory
       82 | #include "loongarch-multilib.h"
          |          ^~~~~~~~~~~~~~~~~~~~~~

This started happening in `nixpkgs` after `gcc` was update from `gcc-13`
to `gcc-14`. `gcc-14` added new auto-generated `loongarch-multilib.h` in

    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=227b18f5d7616d6d34ac44836a8679de9b43c857

That broke fragile `libgcc` derivation in `nixpkgs`: the derivation
sidesteps normal `gcc` build flow and relies on build details quite
heavily by explicitly listing `gcc/` dependencies of `libgcc/` sources.

This change forces `loongarch-multilib.h` build which is a new
dependency of `libgcc` on `loongarch64`.

Closes: https://github.com/NixOS/nixpkgs/issues/380901
2025-02-10 23:15:03 +00:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Maximilian Bosch
c76b79b7d2 libstdcxx5: remove
I observed this package to be a big red herring when people are searching
for the package they need if libstdc++ is missing: I observed this to
happen if you're either very new to packaging and don't know where it's
supposed to come from or if you package some binary program (or virtual
environment) and this library is missing.

The package is a subset of GCC 3.3 from 2005 and only needed for very
old proprietary software that cannot be recompiled where it's only
questionable if this is even appropriate to have in nixpkgs.

There's in fact one such package, unreal tournament 2004. As much as I
don't think that libstdcxx5 has a place in here, this also applies to
it. If people want to consume this, it should belong into an external
flake.

Until this happens, I'm sorry for https://www.youtube.com/watch?v=mXapt4GHt-s
2024-11-25 09:03:50 +01:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Adam Joseph
8df1400e1d libgcc: pass --disable-plugins
This is needed for gcc13 on many platforms due to errors like:

```
checking for library containing dlopen... (cached) none required
checking for -fPIC -shared... yes
configure: error:
   Building GCC with plugin support requires a host that supports
   -fPIC, -shared, -ldl and -rdynamic.
```
2023-12-07 09:11:37 +00:00
Adam Joseph
dfb2f189af libgcc: build arm-{isa,cpu}.h for all 32-bit arm, not just armv7
As reported here:

  https://github.com/NixOS/nixpkgs/pull/247900#issuecomment-1679258061
2023-08-15 19:10:23 -07:00
Adam Joseph
18c52d09bc libgcc: make needed architecture-specific targets if isArmv7 2023-08-14 15:08:59 -07:00
Adam Joseph
c0e4121ba5 libgcc: make needed architecture-specific targets if isM68k 2023-08-14 15:08:29 -07:00
Adam Joseph
17ce8682d6 libgcc: let-rename stdenvNoLibs to stdenv 2023-08-14 15:08:29 -07:00
Adam Joseph
8c37dae9ad libgcc: gccConfigureFlags: minimize, fix
This commit minimizes libgcc's gccConfigureFlags, and -- importantly
-- includes the three flags needed in order to prevent
`inhibit_libc` from becoming active.
2023-08-14 15:08:29 -07:00
Adam Joseph
fa0ebe80f1 libgcc: configureFlags: minimize
A lot of these flags were unnecessary.
2023-08-14 15:08:29 -07:00
Adam Joseph
da371c7c5a libgcc: use forceLibgccToBuildCrtStuff
This duplicates (by reference) the two-line adjustment to libgcc's
Makefile needed in order to get crtstuff to build without a full
build of gcc.
2023-08-14 15:08:28 -07:00
Adam Joseph
383d62d94c libgcc: add glibc as a buildInput
This is necessary in order to prevent gcc from switching on
`inhibit_libc`, which cripples the `libgcc_s.so` unwinder.
2023-08-14 15:08:28 -07:00
Adam Joseph
b5893e7046 libgcc: let-float gccConfigureFlags out of the derivation attrs 2023-08-14 15:08:28 -07:00
Adam Joseph
2ecf2d954b libgcc: use finalAttrs instead of rec 2023-08-14 15:08:28 -07:00
Adam Joseph
72fa5978fd libgcc: minor formatting adjustments 2023-08-14 15:08:27 -07:00
Adam Joseph
f445f64207 libgcc: (re)init at 12.3.0
This commit restores the pkgs/development/libraries/gcc/libgcc
package, which was deleted by commit 9818d120be.

We need to be able to build libgcc separately from gcc in order to
avoid a circular dependency.  Nixpkgs is unusual -- unlike any other
distribution, it cannot tolerate circular dependencies between
dynamically linked libraries.  Because of this, upstream is
extremely unsympathetic to the trouble that the glibc<->gcc circular
dependency causes for us; if we don't solve it ourselves it will not
be solved.
2023-08-14 15:08:27 -07:00
Sergei Trofimovich
9818d120be libgcc: remove unused package
`libgcc` is not usable as is and as a result no packages use it today.
`gcc.cc.libgcc` should provide the same library. But ideally it should
not be used at all as it's an implementation detail of `gcc` support
libraries.
2023-05-13 17:22:17 +01:00
Sergei Trofimovich
720dc7c27d libgcc: 11.3.0 -> 12.2.0
Disable gcov to fix the build.
2023-05-06 07:35:07 +01:00
Rick van Schijndel
9833d56c24 treewide: mark packages broken that never built on PLATFORM
Done with the help of https://github.com/Mindavi/nixpkgs-mark-broken
Tool is still WIP but this is one of the first results.

I manually audited the results and removed some results that were not valid.

Note that some of these packages maybe should have more constrained platforms set
instead of broken set, but I think not being perfectly correct is better than
just keep trying to build all these things and never succeeding.

Some observations:

- Some darwin builds require XCode tools
- aarch64-linux builds sometimes suffer from using gcc9
  - gcc9 is getting older and misses some new libraries/features
- Sometimes tools try to do system detection or expect some explicit settings for
  platforms that are not x86_64-linux
2022-12-13 21:40:12 +01:00
Felix Buehler
b83b349049 treewide: rename name to pname&version 2022-02-28 01:04:51 +01:00
Alyssa Ross
3f01b576af Merge remote-tracking branch 'nixpkgs/staging-next' into staging
Conflicts:
	nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
	nixos/doc/manual/release-notes/rl-2111.section.md
2021-10-28 16:07:38 +00:00
Romain ACCIARI
0017d42f1e libstdc++5: Fix build failure on missing libc-ldflags-before
Package does not build due to missing libc-ldflags-before file.
2021-10-25 15:20:49 +02:00
Yuka
921972d228 pkgsMusl.libgcc: fix build (#141993) 2021-10-17 22:36:03 +02:00
Sandro Jäckel
388a4ef423 treewide: convert all links git.archlinux.org to github.com/archlinux/svntogit-* 2021-07-14 03:35:21 +02:00
Ben Siraphob
36c91cea1d treewide: stdenv.lib -> lib 2021-01-27 13:08:40 +07:00
Ben Siraphob
66e44425c6 pkgs/development/libraries: stdenv.lib -> lib 2021-01-21 19:11:02 -08:00
Jörg Thalheim
96092dc936 stdenv: make -nostdinc work as intended
Right now we add glibc to search path also -nostdinc was provided,
which breaks projects providing their own gcc.
2020-07-23 08:39:46 +01:00
Michael Roitzsch
9b13828f79 libgcc: fix Darwin cross compile
late fallout from 1ac5398: the build variables were changed from infix to suffix notation
2020-06-15 17:32:33 +02:00
Michael Reilly
84cf00f980 treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
volth
46420bbaa3 treewide: name -> pname (easy cases) (#66585)
treewide replacement of

stdenv.mkDerivation rec {
  name = "*-${version}";
  version = "*";

to pname
2019-08-15 13:41:18 +01:00
c0bw3b
0498ccd076 Treewide: use HTTPS on GNU domains
HTTP -> HTTPS for :
- http://gnu.org/
- http://www.gnu.org/
- http://elpa.gnu.org/
- http://lists.gnu.org/
- http://gcc.gnu.org/
- http://ftp.gnu.org/ (except in fetchurl mirrors)
- http://bugs.gnu.org/
2018-12-02 15:51:59 +01:00
John Ericson
0828e2d8c3 treewide: Remove usage of remaining redundant platform compatability stuff
Want to get this out of here for 18.09, so it can be deprecated
thereafter.
2018-08-30 17:20:32 -04:00
Matthew Bauer
13c8acc3db Revert "Merge pull request #44767 from obsidiansystems/wrapper-env-var-path"
This reverts commit 89efc27f57, reversing
changes made to d0f11020ca.
2018-08-22 01:14:53 +02:00
John Ericson
5a2ef9b513 libgcc: Tool env vars no longer need to be made full paths 2018-08-08 17:16:16 -04:00
John Ericson
310cb76135 libgcc: Init at 7.3.0
This will be very useful for bootstrapping, eventually.
2018-07-25 01:24:38 -04:00
John Ericson
0f3a7982e7 libstdcxx5: Move around ahead of other GCC libs being added 2018-07-24 20:22:51 -04:00