Describe the bug
The nixpkgs GCC compilers force -march based on the target triple, as seen here:
|
# Always add -march based on cpu in triple. Sometimes there is a |
GCC, however, errors out when -march flags conflict, at least for MIPS.
This is exceptionally important for the Linux kernel, which very much depends on being able to set these flags to compile for a specific machine at all. The machine I tried was the Nintendo 64, which forces -march=r4300.
Steps To Reproduce
Steps to reproduce the behavior:
- Obtain a MIPS cross toolchain:
nix shell nixpkgs#pkgsCross.mips64-linux-gnuabi64.stdenv.cc
- Compile a program manually with e.g.
-march=r4300:
$ mips64-unknown-linux-gnuabi64-gcc -march=r4300 aslrtest.c
cc1: error: ‘-mips64r2’ conflicts with the other architecture options, which specify a mips3 processor
Expected behavior
I would expect the compiler to use the user-specified -march.
Notify maintainers
Not quite sure who to ping for the Nixpkgs cross compiler infrastructure.
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
$ nix-shell -p nix-info --run "nix-info -m"
this path will be fetched (0.00 MiB download, 0.00 MiB unpacked):
/nix/store/g09jbj92l7j0wsvnch87z93mz9s8pz4i-nix-info
copying path '/nix/store/g09jbj92l7j0wsvnch87z93mz9s8pz4i-nix-info' from 'https://cache.nixos.org'...
- system: `"x86_64-linux"`
- host os: `Linux 6.7.4, Gentoo, noversion, nobuild`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.19.3`
- channels(root): `"nixpkgs"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
Add a 👍 reaction to issues you find important.
Describe the bug
The nixpkgs GCC compilers force
-marchbased on the target triple, as seen here:nixpkgs/pkgs/build-support/cc-wrapper/default.nix
Line 604 in 0b3c2c5
GCC, however, errors out when
-marchflags conflict, at least for MIPS.This is exceptionally important for the Linux kernel, which very much depends on being able to set these flags to compile for a specific machine at all. The machine I tried was the Nintendo 64, which forces
-march=r4300.Steps To Reproduce
Steps to reproduce the behavior:
-march=r4300:Expected behavior
I would expect the compiler to use the user-specified
-march.Notify maintainers
Not quite sure who to ping for the Nixpkgs cross compiler infrastructure.
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"and paste the result.Add a 👍 reaction to issues you find important.