Unverified Commit 42008a14 authored by Bernardo Meurer's avatar Bernardo Meurer Committed by GitHub
Browse files

Merge pull request #217206 from Artturin/stdenvimprovements1

parents 984655a3 3251013c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ See the `zlib` example:
    (old: rec {
      buildInputs = old.buildInputs ++ [ pkg-config ];
      # we need to reset this setting!
      NIX_CFLAGS_COMPILE="";
      env = (old.env or { }) // { NIX_CFLAGS_COMPILE = ""; };
      configurePhase = ''
        # FIXME: Some tests require writing at $HOME
        HOME=$TMPDIR
+1 −1
Original line number Diff line number Diff line
@@ -1329,7 +1329,7 @@ bin/blib.a(bios_console.o): In function `bios_handle_cup':

Adds the `-O2 -D_FORTIFY_SOURCE=2` compiler options. During code generation the compiler knows a great deal of information about buffer sizes (where possible), and attempts to replace insecure unlimited length buffer function calls with length-limited ones. This is especially useful for old, crufty code. Additionally, format strings in writable memory that contain `%n` are blocked. If an application depends on such a format string, it will need to be worked around.

Additionally, some warnings are enabled which might trigger build failures if compiler warnings are treated as errors in the package build. In this case, set `NIX_CFLAGS_COMPILE` to `-Wno-error=warning-type`.
Additionally, some warnings are enabled which might trigger build failures if compiler warnings are treated as errors in the package build. In this case, set `env.NIX_CFLAGS_COMPILE` to `-Wno-error=warning-type`.

This needs to be turned off or fixed for errors similar to:

+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
    libtool
  ];

  NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";
  env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";

  meta = with lib; {
    description = "ReplayGain for AAC files";
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
    "-DADLplug_Jack=${if withJack then "ON" else "OFF"}"
  ];

  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
    # "fp.h" file not found
    "-isystem ${CoreServices}/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers"
  ]);
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
    lv2 libX11 libGL libGLU mesa
  ];

  NIX_CFLAGS_COMPILE = [
  env.NIX_CFLAGS_COMPILE = toString [
    # Needed with GCC 12
    "-Wno-error=array-bounds"
    "-Wno-error=stringop-overflow"
Loading