Commit Graph

29 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
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
Felix Buehler
b83b349049 treewide: rename name to pname&version 2022-02-28 01:04:51 +01:00
Yuka
921972d228 pkgsMusl.libgcc: fix build (#141993) 2021-10-17 22:36:03 +02:00
Ben Siraphob
36c91cea1d treewide: stdenv.lib -> lib 2021-01-27 13:08:40 +07: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
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