3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs
Florian Klink 07c4056179 gnats: format hardened flag isn't supported
When invoking a simple Ada program with `gcc` from `gnats10`, the
following warnings are shown:

```
$ gcc -c conftest.adb
gnat1: warning: command-line option ‘-Wformat=1’ is valid for C/C++/ObjC/ObjC++ but not for Ada
gnat1: warning: command-line option ‘-Wformat-security’ is valid for C/C++/ObjC/ObjC++ but not for Ada
gnat1: warning: ‘-Werror=’ argument ‘-Werror=format-security’ is not valid for Ada
$ echo $?
0
```

This is only spammy when compiling Ada programs inside a Nix derivation,
but certain configure scripts (such as the ./configure script from the
gcc that's built by coreboot's `make crossgcc` command) fail entirely
when getting that warning output.

https://nixos.wiki/wiki/Coreboot currently suggests manually running

> NIX_HARDENING_ENABLE="${NIX_HARDENING_ENABLE/ format/}" make crossgcc

… but actually teaching the nixpkgs-provided cc wrapper that `format`
isn't supported as a hardening flag seems to be the more canonical way
to do this in nixpgks.

After this, Ada programs still compile:

```
$ gcc -c conftest.adb
$ echo $?
0
```

And the compiler output is empty.
2020-12-23 01:51:14 +01:00
..
applications Merge pull request #106454 from cpcloud/nomad-one-point-oh 2020-12-22 18:29:43 +01:00
build-support gnats: format hardened flag isn't supported 2020-12-23 01:51:14 +01:00
common-updater
data Merge pull request #107050 from romildo/upd.luna-icons 2020-12-22 18:44:33 +01:00
desktops gnome3.gnome-calendar: 3.38.1 -> 3.38.2 2020-12-17 19:56:03 +01:00
development Merge pull request #106535 from sternenseemann/ufonormalizer-0.5.2 2020-12-22 18:51:41 +01:00
games Merge pull request #107245 from lheckemann/manaplus 2020-12-22 16:12:15 +01:00
misc
os-specific Merge pull request #104197 from Chiiruno/dev/bcachefs 2020-12-22 11:09:43 -03:00
pkgs-lib
servers Merge pull request #105781 from phile314/rm_old_kafka 2020-12-22 10:03:08 +01:00
shells
stdenv
test buildRustCrateTests: Move to tests.buildRustCrate 2020-12-19 18:56:06 +00:00
tools Merge pull request #107384 from fabaff/lexicon 2020-12-22 18:40:16 +01:00
top-level Merge pull request #106454 from cpcloud/nomad-one-point-oh 2020-12-22 18:29:43 +01:00