···6060 (old: rec {
6161 buildInputs = old.buildInputs ++ [ pkg-config ];
6262 # we need to reset this setting!
6363- NIX_CFLAGS_COMPILE="";
6363+ env = (old.env or { }) // { NIX_CFLAGS_COMPILE = ""; };
6464 configurePhase = ''
6565 # FIXME: Some tests require writing at $HOME
6666 HOME=$TMPDIR
+1-1
doc/stdenv/stdenv.chapter.md
···1329132913301330Adds 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.
1331133113321332-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`.
13321332+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`.
1333133313341334This needs to be turned off or fixed for errors similar to:
13351335
+1-1
pkgs/applications/audio/aacgain/default.nix
···3333 libtool
3434 ];
35353636- NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";
3636+ env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";
37373838 meta = with lib; {
3939 description = "ReplayGain for AAC files";
···6363 "-DWARNINGS_ARE_ERRORS=ON"
6464 ];
65656666- NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
6666+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
6767 # Needed with GCC 12 but breaks on darwin (with clang) or aarch64 (old gcc)
6868 "-Wno-error=mismatched-new-delete"
6969 "-Wno-error=use-after-free"
7070- ];
7070+ ]);
71717272 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
7373 # Normal CMake install phase on Darwin only installs the binary, the user is expected to use CPack to build a
···2626 # gcc-10. Otherwise build fails as:
2727 # ld: .libs/autodetection.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: multiple definition of
2828 # `gtkpod_app'; .libs/gtkpod_app_iface.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: first defined here
2929- NIX_CFLAGS_COMPILE = "-fcommon";
2929+ env.NIX_CFLAGS_COMPILE = "-fcommon";
30303131 enableParallelBuilding = true;
3232
+1-1
pkgs/applications/audio/guitarix/default.nix
···9797 "--install-roboto-font"
9898 ] ++ optional optimizationSupport "--optimization";
9999100100- NIX_CFLAGS_COMPILE = [ "-fpermissive" ];
100100+ env.NIX_CFLAGS_COMPILE = toString [ "-fpermissive" ];
101101102102 meta = with lib; {
103103 description = "A virtual guitar amplifier for Linux running with JACK";
+1-1
pkgs/applications/audio/jamin/default.nix
···1919 # gcc-10. Otherwise build fails as:
2020 # ld: jamin-preferences.o:/build/jamin-0.95.0/src/hdeq.h:64: multiple definition of
2121 # `l_notebook1'; jamin-callbacks.o:/build/jamin-0.95.0/src/hdeq.h:64: first defined here
2222- NIX_CFLAGS_COMPILE = "-fcommon";
2222+ env.NIX_CFLAGS_COMPILE = "-fcommon";
23232424 postInstall = ''
2525 wrapProgram $out/bin/jamin --set LADSPA_PATH ${ladspaPlugins}/lib/ladspa
+1-1
pkgs/applications/audio/klystrack/default.nix
···3131 # ld: libengine_gui.a(gui_menu.o):(.bss+0x0): multiple definition of
3232 # `menu_t'; objs.release/action.o:(.bss+0x20): first defined here
3333 # TODO: remove it for 1.7.7+ release as it was fixed upstream.
3434- NIX_CFLAGS_COMPILE = "-fcommon";
3434+ env.NIX_CFLAGS_COMPILE = "-fcommon";
35353636 buildFlags = [ "PREFIX=${placeholder "out"}" "CFG=release" ];
3737
···3030 # Without it doesn't find all of the boost libraries.
3131 BOOST_LIB_DIR = "${boost}/lib";
3232 # uses the deprecated get_generic_category() in boost_system
3333- NIX_CFLAGS_COMPILE = "-DBOOST_SYSTEM_ENABLE_DEPRECATED=1";
3333+ env.NIX_CFLAGS_COMPILE = "-DBOOST_SYSTEM_ENABLE_DEPRECATED=1";
34343535 LC_ALL = "en_US.UTF-8";
3636
+1-1
pkgs/applications/audio/tenacity/default.nix
···8282 --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH"
8383 '';
84848585- NIX_CFLAGS_COMPILE = "-D GIT_DESCRIBE=\"\"";
8585+ env.NIX_CFLAGS_COMPILE = "-D GIT_DESCRIBE=\"\"";
86868787 # tenacity only looks for ffmpeg at runtime, so we need to link it in manually
8888 NIX_LDFLAGS = toString [
+1-1
pkgs/applications/audio/transcode/default.nix
···2424 # gcc-10. Otherwise build fails as:
2525 # ld: tcextract-extract_pcm.o:/build/transcode-1.1.7/import/extract_pcm.c:36: multiple definition of
2626 # `audio'; tcextract-extract_ac3.o:/build/transcode-1.1.7/import/extract_ac3.c:337: first defined here
2727- NIX_CFLAGS_COMPILE = "-fcommon";
2727+ env.NIX_CFLAGS_COMPILE = "-fcommon";
28282929 meta = with lib; {
3030 description = "Suite of command line utilities for transcoding video and audio codecs, and for converting between different container formats";
+1-1
pkgs/applications/audio/ympd/default.nix
···2323 # ld: CMakeFiles/ympd.dir/src/mpd_client.c.o:(.bss+0x0): multiple definition of `mpd';
2424 # CMakeFiles/ympd.dir/src/ympd.c.o:(.bss+0x20): first defined here
2525 # Should be fixed by pending https://github.com/notandy/ympd/pull/191 (does not apply as is).
2626- NIX_CFLAGS_COMPILE = "-fcommon";
2626+ env.NIX_CFLAGS_COMPILE = "-fcommon";
27272828 nativeBuildInputs = [ cmake pkg-config ];
2929 buildInputs = [ libmpdclient openssl ];
···41414242 # Force optimization to fix:
4343 # warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O)
4444- NIX_CFLAGS_COMPILE = "-O3";
4444+ env.NIX_CFLAGS_COMPILE = "-O3";
45454646 # Remove pre-built y.tab.c to generate with nixpkgs bison
4747 preBuild = ''
+1-1
pkgs/applications/blockchains/cgminer/default.nix
···4444 # ld: cgminer-driver-modminer.o:/build/source/miner.h:285:
4545 # multiple definition of `bitforce_drv'; cgminer-cgminer.o:/build/source/miner.h:285:
4646 # first defined here
4747- NIX_CFLAGS_COMPILE = "-fcommon";
4747+ env.NIX_CFLAGS_COMPILE = "-fcommon";
48484949 meta = with lib; {
5050 description = "CPU/GPU miner in c for bitcoin";
···4141 ];
42424343 # G_APPLICATION_FLAGS_NONE is deprecated in GLib 2.73.3+.
4444- NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
4444+ env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
45454646 meta = with lib; {
4747 description = "GTK based greeter for greetd, to be run under cage or similar";
···2626 # `xsets'; vfs/spacefm-vfs-file-info.o:src/settings.h:123: first defined here
2727 # TODO: can be removed once https://github.com/IgnorantGuru/spacefm/pull/772
2828 # or equivalent is merged upstream.
2929- NIX_CFLAGS_COMPILE = "-fcommon";
2929+ env.NIX_CFLAGS_COMPILE = "-fcommon";
30303131 configureFlags = [
3232 "--with-bash-path=${pkgs.bash}/bin/bash"
···17171818 qmakeFlags = [ "PREFIX=${placeholder "out"}" ];
19192020- NIX_CFLAGS_COMPILE = "-I${graphicsmagick}/include/GraphicsMagick";
2020+ env.NIX_CFLAGS_COMPILE = "-I${graphicsmagick}/include/GraphicsMagick";
21212222 meta = with lib; {
2323 description = "A cross-platform image editor with a powerful features and a very friendly graphical user interface";
···1919 '';
20202121 # error: 'regparm' is not valid on this platform
2222- NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64)
2222+ env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64)
2323 "-D__STRICT_ANSI__";
24242525 meta = with lib; {
+1-1
pkgs/applications/misc/blender/default.nix
···132132 "-DOPTIX_ROOT_DIR=${optix}"
133133 ];
134134135135- NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
135135+ env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
136136137137 # Since some dependencies are built with gcc 6, we need gcc 6's
138138 # libstdc++ in our RPATH. Sigh.
+1-1
pkgs/applications/misc/cataract/build.nix
···3030 # avoid build failures like:
3131 # ld: stats.o:/build/cataract-675e647/src/stats.h:24: multiple definition of
3232 # `stats_images'; cgg.o:/build/cataract-675e647/src/stats.h:24: first defined here
3333- NIX_CFLAGS_COMPILE = "-fcommon";
3333+ env.NIX_CFLAGS_COMPILE = "-fcommon";
34343535 installPhase = ''
3636 mkdir $out/{bin,share} -p
···2222 # ld: gmtp-preferences.o:src/main.h:72: multiple definition of
2323 # `scrolledwindowMain'; gmtp-about.o:src/main.h:72: first defined here
2424 # TODO: can be removed when 1.4.0 is released.
2525- NIX_CFLAGS_COMPILE = "-fcommon";
2525+ env.NIX_CFLAGS_COMPILE = "-fcommon";
26262727 preFixup = ''
2828 gappsWrapperArgs+=(--add-flags "--datapath $out/share");
···115115 # Disable compiler warnings that clutter the build log.
116116 # It seems to be a known issue for Eigen:
117117 # http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
118118- NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes";
118118+ env.NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes";
119119120120 # prusa-slicer uses dlopen on `libudev.so` at runtime
121121 NIX_LDFLAGS = lib.optionalString withSystemd "-ludev";
+1-1
pkgs/applications/misc/pw-viz/default.nix
···49495050 # enables pipewire API deprecated in 0.3.64
5151 # fixes error caused by https://gitlab.freedesktop.org/pipewire/pipewire-rs/-/issues/55
5252- NIX_CFLAGS_COMPILE = [ "-DPW_ENABLE_DEPRECATED" ];
5252+ env.NIX_CFLAGS_COMPILE = toString [ "-DPW_ENABLE_DEPRECATED" ];
53535454 meta = with lib; {
5555 description = "A simple and elegant pipewire graph editor ";
···324324 # Don't spam warnings about unknown warning options. This is useful because
325325 # our Clang is always older than Chromium's and the build logs have a size
326326 # of approx. 25 MB without this option (and this saves e.g. 66 %).
327327- NIX_CFLAGS_COMPILE = "-Wno-unknown-warning-option";
327327+ env.NIX_CFLAGS_COMPILE = "-Wno-unknown-warning-option";
328328329329 buildPhase = let
330330 buildCommand = target: ''
···4545 # Workaround build failure on -fno-common toolchains:
4646 # ld: main.o:/build/dillo-3.0.5/dpid/dpid.h:64: multiple definition of `sock_set';
4747 # dpid.o:/build/dillo-3.0.5/dpid/dpid.h:64: first defined here
4848- NIX_CFLAGS_COMPILE = "-fcommon";
4848+ env.NIX_CFLAGS_COMPILE = "-fcommon";
49495050 meta = with lib; {
5151 description = "Fork of Dillo, a lightweight web browser";
···3131 ];
32323333 # TODO: Remove after the next release (0.8.4 should work without this):
3434- NIX_CFLAGS_COMPILE = [ "-I${harfbuzz.dev}/include/harfbuzz" ];
3434+ env.NIX_CFLAGS_COMPILE = toString [ "-I${harfbuzz.dev}/include/harfbuzz" ];
35353636 meta = with lib; {
3737 description = "Comprehensive suite for man in the middle attacks";
···8080 # guile warning
8181 GUILE_AUTO_COMPILE="0";
82828383- NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
8383+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
8484 # Needed with GCC 12 but breaks on darwin (with clang) or older gcc
8585 "-Wno-error=use-after-free"
8686- ];
8686+ ]);
87878888 # `make check` target does not define its prerequisites but expects them to
8989 # have already been built. The list of targets below was built through trial
+1-1
pkgs/applications/office/kmymoney/default.nix
···3030 ];
31313232 # Hidden dependency that wasn't included in CMakeLists.txt:
3333- NIX_CFLAGS_COMPILE = "-I${kitemmodels.dev}/include/KF5";
3333+ env.NIX_CFLAGS_COMPILE = "-I${kitemmodels.dev}/include/KF5";
34343535 nativeBuildInputs = [
3636 doxygen extra-cmake-modules graphviz kdoctools
···2626 })
2727 ];
28282929- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
2929+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
30303131 meta = with lib; {
3232 description = "Renders an image of the earth or other planets into the X root window";
···4848 xorg.libXxf86vm
4949 ];
50505151- NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE";
5151+ env.NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE";
52525353 meta = with lib; {
5454 description = "A fork of old GNOME Screensaver for purposes of providing an authentication prompt on wake";
+1-1
pkgs/desktops/cdesktopenv/default.nix
···5252 # Workaround build failure on -fno-common toolchains:
5353 # ld: raima/startup.o:/build/cde-2.3.2/lib/DtSearch/raima/dbtype.h:408: multiple definition of
5454 # `__SK__'; raima/alloc.o:/build/cde-2.3.2/lib/DtSearch/raima/dbtype.h:408: first defined here
5555- NIX_CFLAGS_COMPILE = "-fcommon";
5555+ env.NIX_CFLAGS_COMPILE = "-fcommon";
56565757 makeFlags = [
5858 "World"
···148148149149 # Default for release buildtype but passed manually because
150150 # we're using plain
151151- NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS";
151151+ env.NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS";
152152153153 postPatch = ''
154154 for f in gnome-settings-daemon/codegen.py plugins/power/gsd-power-constants-update.pl meson_post_install.py; do
···2424 xfconf
2525 ];
26262727- NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
2727+ env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
28282929 meta = with lib; {
3030 description = "A fast and lightweight picture-viewer for the Xfce desktop environment";
···16161717 # Add a workarounf for -fno-common tollchains like upstream gcc-10.
1818 # alan-3 is already fixed, but the backport is nontrivial.
1919- NIX_CFLAGS_COMPILE = "-fcommon";
1919+ env.NIX_CFLAGS_COMPILE = "-fcommon";
20202121 installPhase = ''
2222 mkdir -p $out/bin $out/share/alan2
+1-1
pkgs/development/compilers/bs-platform/ocaml.nix
···1010 # ld: libcamlrun.a(minor_gc.o):/build/ocaml/byterun/caml/major_gc.h:67: multiple definition of
1111 # `caml_major_ring'; libcamlrun.a(stacks.o):/build/ocaml/byterun/caml/major_gc.h:67: first defined here
1212 # Match -fcommon workaround in ocaml-4.06 itself.
1313- NIX_CFLAGS_COMPILE = "-fcommon";
1313+ env.NIX_CFLAGS_COMPILE = "-fcommon";
14141515 buildPhase = ''
1616 make -j9 world.opt
+1-1
pkgs/development/compilers/chez-racket/shared.nix
···29293030 enableParallelBuilding = true;
31313232- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
3232+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
33333434 meta = {
3535 description = "Fork of Chez Scheme for Racket";
+1-1
pkgs/development/compilers/chez/default.nix
···20202121 enableParallelBuilding = true;
22222323- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
2323+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
24242525 /*
2626 ** We patch out a very annoying 'feature' in ./configure, which
···4343 # -fcommon: workaround build failure on -fno-common toolchains:
4444 # ld: ./libgclp.a(user_match.o):(.bss+0x18): multiple definition of
4545 # `tf'; ./libpre_gcl.a(main.o):(.bss+0x326d90): first defined here
4646- NIX_CFLAGS_COMPILE = "-fgnu89-inline -fcommon";
4646+ env.NIX_CFLAGS_COMPILE = "-fgnu89-inline -fcommon";
47474848 meta = with lib; {
4949 description = "GNU Common Lisp compiler working via GCC";
···1919 # ld: ../common/ipp.o:(.bss+0x0): multiple definition of `lpath'; tglobals.o:(.bss+0x30): first defined here
2020 # TODO: remove the workaround once upstream releases version past:
2121 # https://sourceforge.net/p/unicon/unicon/ci/b1a65230233f3825d055aee913b4fdcf178a0eaf/
2222- NIX_CFLAGS_COMPILE = "-fcommon";
2222+ env.NIX_CFLAGS_COMPILE = "-fcommon";
23232424 configurePhase = ''
2525 case "$(uname -a | sed 's/ /_/g')" in
+1-1
pkgs/development/java-modules/jogl/default.nix
···3535 # Workaround build failure on -fno-common toolchains:
3636 # ld: ../obj/Bindingtest1p1Impl_JNI.o:(.bss+0x8): multiple definition of
3737 # `unsigned_size_t_1'; ../obj/TK_Surface_JNI.o:(.bss+0x8): first defined here
3838- NIX_CFLAGS_COMPILE = "-fcommon";
3838+ env.NIX_CFLAGS_COMPILE = "-fcommon";
39394040 buildPhase = ''
4141 cp -r ${gluegen-src} $NIX_BUILD_TOP/gluegen
···4141 "LIBDIR=${placeholder "out"}/lib"
4242 ];
43434444- NIX_CFLAGS_COMPILE = "-I${kissfft}/include/kissfft";
4444+ env.NIX_CFLAGS_COMPILE = "-I${kissfft}/include/kissfft";
45454646 meta = with lib; {
4747 description = "A C++ library of functions for DSP and Music Informatics purposes";
···194194 "-Dxattr=false"
195195 ];
196196197197- NIX_CFLAGS_COMPILE = toString [
197197+ env.NIX_CFLAGS_COMPILE = toString [
198198 "-Wno-error=nonnull"
199199 # Default for release buildtype but passed manually because
200200 # we're using plain
+15-13
pkgs/development/libraries/glibc/default.nix
···5050 # invocation does not work.
5151 hardeningDisable = [ "fortify" "pie" "stackprotector" ];
52525353- NIX_CFLAGS_COMPILE = lib.concatStringsSep " "
5454- (builtins.concatLists [
5555- (lib.optionals withGd gdCflags)
5656- # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
5757- # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
5858- (lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
5959- (lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
6060- # Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'"
6161- # New warning as of GCC 9
6262- # Same for musl: https://github.com/NixOS/nixpkgs/issues/78805
6363- "-Wno-error=missing-attributes"
6464- ])
6565- ]);
5353+ env = (previousAttrs.env or { }) // {
5454+ NIX_CFLAGS_COMPILE = (previousAttrs.env.NIX_CFLAGS_COMPILE or "") + lib.concatStringsSep " "
5555+ (builtins.concatLists [
5656+ (lib.optionals withGd gdCflags)
5757+ # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
5858+ # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
5959+ (lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
6060+ (lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
6161+ # Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'"
6262+ # New warning as of GCC 9
6363+ # Same for musl: https://github.com/NixOS/nixpkgs/issues/78805
6464+ "-Wno-error=missing-attributes"
6565+ ])
6666+ ]);
6767+ };
66686769 # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
6870 # any program we run, because the gcc will have been placed at a new
···1111 # ld: textdlg.o:(.bss+0x0): multiple definition of `someString';
1212 # configsettings.o:(.bss+0x0): first defined here
1313 # TODO: the workaround can be removed once nixpkgs updates to 1.6.0.
1414- NIX_CFLAGS_COMPILE = "-fcommon";
1414+ env.NIX_CFLAGS_COMPILE = "-fcommon";
15151616 preConfigure = ''
1717 substituteInPlace configure.in \
···2727 --replace "-Xlinker --version-script=$(VERSION_SCRIPT)" "-Xlinker"
2828 '';
29293030- NIX_CFLAGS_COMPILE = toString ([
3030+ env.NIX_CFLAGS_COMPILE = toString ([
3131 "-UDEFAULT_EGL_VENDOR_CONFIG_DIRS"
3232 # FHS paths are added so that non-NixOS applications can find vendor files.
3333 "-DDEFAULT_EGL_VENDOR_CONFIG_DIRS=\"${addOpenGLRunpath.driverLink}/share/glvnd/egl_vendor.d:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d\""
+1-1
pkgs/development/libraries/libicns/default.nix
···18181919 nativeBuildInputs = [ autoreconfHook ];
2020 buildInputs = [ libpng openjpeg ];
2121- NIX_CFLAGS_COMPILE = [ "-I${openjpeg.dev}/include/${openjpeg.incDir}" ];
2121+ env.NIX_CFLAGS_COMPILE = toString [ "-I${openjpeg.dev}/include/${openjpeg.incDir}" ];
22222323 meta = with lib; {
2424 description = "Library for manipulation of the Mac OS icns resource format";
+1-1
pkgs/development/libraries/libipfix/default.nix
···1313 # `ht_globals'; collector.o:/build/libipfix_110209/collector/../libmisc/misc.h:111: first defined here
1414 # TODO: drop the workaround when fix ix released:
1515 # https://sourceforge.net/p/libipfix/code/ci/a501612c6b8ac6f2df16b366f7a92211382bae6b/
1616- NIX_CFLAGS_COMPILE = "-fcommon";
1616+ env.NIX_CFLAGS_COMPILE = "-fcommon";
17171818 meta = with lib; {
1919 homepage = "https://libipfix.sourceforge.net/";
+1-2
pkgs/development/libraries/libiscsi/default.nix
···1414 nativeBuildInputs = [ autoreconfHook ];
15151616 # This problem is gone on libiscsi master.
1717- NIX_CFLAGS_COMPILE =
1818- lib.optional stdenv.hostPlatform.is32bit "-Wno-error=sign-compare";
1717+ env.NIX_CFLAGS_COMPILE = toString (lib.optional stdenv.hostPlatform.is32bit "-Wno-error=sign-compare");
19182019 meta = with lib; {
2120 description = "iscsi client library and utilities";
···11111212 # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin
1313 # upgrades to a newer SDK.
1414- NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
1414+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
15151616 patches = [
1717 (fetchpatch {
···1414 ];
15151616 # error: no member named 'finite' in the global namespace; did you mean simply 'finite'?
1717- NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dfinite=isfinite";
1717+ env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dfinite=isfinite";
18181919 meta = {
2020 homepage = "http://www.desy.de/~znagy/Site/NLOJet++.html";
···4848 # ld: CMakeFiles/prom.dir/src/prom_process_stat.c.o:(.bss+0x0): multiple definition of
4949 # `prom_process_start_time_seconds'; CMakeFiles/prom.dir/src/prom_collector.c.o:(.bss+0x0): first defined here
5050 # Should be fixed in 1.2.0 and later: https://github.com/digitalocean/prometheus-client-c/pull/25
5151- NIX_CFLAGS_COMPILE = "-fcommon";
5151+ env.NIX_CFLAGS_COMPILE = "-fcommon";
52525353 preConfigure = ''
5454 cd ${subdir}
···198198199199 enableParallelBuilding = true;
200200201201- NIX_CFLAGS_COMPILE = toString (
201201+ env.NIX_CFLAGS_COMPILE = toString (
202202 # with gcc7 the warnings blow the log over Hydra's limit
203203 [ "-Wno-expansion-to-defined" "-Wno-unused-local-typedefs" ]
204204 ++ lib.optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
···102102103103 # As zlib takes part in the stdenv building, we don't want references
104104 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
105105- NIX_CFLAGS_COMPILE = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc";
105105+ env.NIX_CFLAGS_COMPILE = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc";
106106107107 # We don't strip on static cross-compilation because of reports that native
108108 # stripping corrupted the target library; see commit 12e960f5 for the report.
···4444 nativeCheckInputs = [ docutils pytestCheckHook ];
45454646 LLVM = llvm;
4747- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${lib.getDev libcxx}/include/c++/v1";
4747+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${lib.getDev libcxx}/include/c++/v1";
48484949 # test suite is very cpu intensive, only run small subset to ensure package is working as expected
5050 pytestFlagsArray = [ "tests/test-sets.py" ];
+1-1
pkgs/development/python-modules/kivy/default.nix
···5959 # prefer pkg-config over hardcoded framework paths
6060 USE_OSX_FRAMEWORKS = 0;
6161 # work around python distutils compiling C++ with $CC (see issue #26709)
6262- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
6262+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
63636464 postPatch = lib.optionalString stdenv.isLinux ''
6565 substituteInPlace kivy/lib/mtdev.py \
···3030 # `_PyThreadState_Current'; src/_vmprof.o:src/vmprof_common.h:92: first defined here
3131 # TODO: can be removed once next release contains:
3232 # https://github.com/vmprof/vmprof-python/pull/203
3333- NIX_CFLAGS_COMPILE = "-fcommon";
3333+ env.NIX_CFLAGS_COMPILE = "-fcommon";
34343535 meta = with lib; {
3636 broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
···152152153153 # As binutils takes part in the stdenv building, we don't want references
154154 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
155155- NIX_CFLAGS_COMPILE =
155155+ env.NIX_CFLAGS_COMPILE =
156156 if hostPlatform.isDarwin
157157 then "-Wno-string-plus-int -Wno-deprecated-declarations"
158158 else "-static-libgcc";
+1-1
pkgs/development/tools/misc/binutils/default.nix
···169169170170 # As binutils takes part in the stdenv building, we don't want references
171171 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
172172- NIX_CFLAGS_COMPILE =
172172+ env.NIX_CFLAGS_COMPILE =
173173 if hostPlatform.isDarwin
174174 then "-Wno-string-plus-int -Wno-deprecated-declarations"
175175 else "-static-libgcc";
···1818 "--enable-frontends=conf,mconf,nconf"
1919 ];
20202121- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=format-security";
2121+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=format-security";
22222323 meta = with lib; {
2424 description = "Out of Linux tree packaging of the kconfig infrastructure";
···4242 # these libraries are only searched for at runtime so we need to force-link them
4343 NIX_LDFLAGS = "-lgvc -lmysqlclient -lecpg -lssl";
44444545- NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql";
4545+ env.NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql";
46464747 qtWrapperArgs = [
4848 ''--prefix PATH : ${lib.getBin graphviz}/bin''
···29293030 # The code needs an update for gcc-10:
3131 # https://github.com/hackndev/0verkill/issues/7
3232- NIX_CFLAGS_COMPILE = "-fcommon";
3232+ env.NIX_CFLAGS_COMPILE = "-fcommon";
3333 hardeningDisable = [ "all" ]; # Someday the upstream will update the code...
34343535 meta = with lib; {
···4848 # Workaround build failure on -fno-common toolchains like upstream
4949 # gcc-10. Otherwise build fails as:
5050 # ld: mad.o:(.bss+0x233800): multiple definition of `tile_dict'; camera.o:(.bss+0x140): first defined here
5151- NIX_CFLAGS_COMPILE = "-fcommon";
5151+ env.NIX_CFLAGS_COMPILE = "-fcommon";
52525353 NIX_LDFLAGS = "-lm";
5454
+1-1
pkgs/games/garden-of-coloured-lights/default.nix
···2121 # Workaround build failure on -fno-common toolchains:
2222 # ld: main.o:src/main.c:58: multiple definition of
2323 # `eclass'; eclass.o:src/eclass.c:21: first defined here
2424- NIX_CFLAGS_COMPILE = "-fcommon";
2424+ env.NIX_CFLAGS_COMPILE = "-fcommon";
25252626 meta = with lib; {
2727 description = "Old-school vertical shoot-em-up / bullet hell";
+1-1
pkgs/games/gargoyle/default.nix
···3939 # ld: build/linux.release/alan3/Location.o:(.bss+0x0): multiple definition of
4040 # `logFile'; build/linux.release/alan3/act.o:(.bss+0x0): first defined here
4141 # TODO: drop once updated to 2022.1 or later.
4242- NIX_CFLAGS_COMPILE = "-fcommon";
4242+ env.NIX_CFLAGS_COMPILE = "-fcommon";
43434444 buildPhase = jamenv + "jam -j$NIX_BUILD_CORES";
4545
···42424343 # when using SDL_compat instead of SDL_classic, SDL_mixer isn't correctly
4444 # detected, but there is no harm just specifying it
4545- NIX_CFLAGS_COMPILE = [
4545+ env.NIX_CFLAGS_COMPILE = toString [
4646 "-I${lib.getDev SDL_mixer}/include/SDL"
4747 ];
4848
···2828 ./cstddef.patch
2929 ];
30303131- NIX_CFLAGS_COMPILE = "-I${imagemagick6.dev}/include/ImageMagick";
3131+ env.NIX_CFLAGS_COMPILE = "-I${imagemagick6.dev}/include/ImageMagick";
32323333 meta = {
3434 description = "Really Slick Screensavers Port to GLX";
+1-1
pkgs/misc/screensavers/xscreensaver/default.nix
···3939 ];
40404141 # "marbling" has NEON code that mixes signed and unsigned vector types
4242- NIX_CFLAGS_COMPILE = lib.optional stdenv.hostPlatform.isAarch "-flax-vector-conversions";
4242+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch "-flax-vector-conversions";
43434444 postInstall = ''
4545 for bin in $out/bin/*; do
+1-1
pkgs/os-specific/bsd/freebsd/default.nix
···717717 flex byacc gencat rpcgen
718718 ];
719719 buildInputs = with self; [ include csu ];
720720- NIX_CFLAGS_COMPILE = "-B${self.csu}/lib";
720720+ env.NIX_CFLAGS_COMPILE = "-B${self.csu}/lib";
721721722722 makeFlags = [
723723 "STRIP=-s" # flag to install, not command
···7788 # Work around error from <stdio.h> on aarch64-darwin:
99 # error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
1010- NIX_CFLAGS_COMPILE = "-Wno-error=undef-prefix -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
1010+ env.NIX_CFLAGS_COMPILE = "-Wno-error=undef-prefix -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
11111212 # "spray" requires some files that aren't compiling correctly in xcbuild.
1313 # "rtadvd" seems to fail with some missing constants.
···102102 # gcc-10. Otherwise build fails as:
103103 # ld: acpi/xsdt.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: multiple definition of
104104 # `e820_types'; memory.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: first defined here
105105- NIX_CFLAGS_COMPILE="-fcommon";
105105+ env.NIX_CFLAGS_COMPILE = "-fcommon";
106106107107 makeFlags = [
108108 "BINDIR=$(out)/bin"
+1-1
pkgs/os-specific/linux/systemd/default.nix
···630630 --replace "SYSTEMD_CGROUP_AGENTS_PATH" "_SYSTEMD_CGROUP_AGENT_PATH"
631631 '';
632632633633- NIX_CFLAGS_COMPILE = toString ([
633633+ env.NIX_CFLAGS_COMPILE = toString ([
634634 # Can't say ${polkit.bin}/bin/pkttyagent here because that would
635635 # lead to a cyclic dependency.
636636 "-UPOLKIT_AGENT_BINARY_PATH"
···5151 # ld: ...-libprom-0.1.1/include/prom_collector_registry.h:37: multiple definition of
5252 # `PROM_COLLECTOR_REGISTRY_DEFAULT'; ...-libprom-0.1.1/include/prom_collector_registry.h:37: first defined here
5353 # Should be fixed in libprom-1.2.0 and later: https://github.com/digitalocean/prometheus-client-c/pull/25
5454- NIX_CFLAGS_COMPILE = "-fcommon";
5454+ env.NIX_CFLAGS_COMPILE = "-fcommon";
55555656 passthru.tests.coturn = nixosTests.coturn;
5757
+1-1
pkgs/servers/dict/libmaa.nix
···1212 buildInputs = [ libtool ];
1313 # configureFlags = [ "--datadir=/run/current-system/share/dictd" ];
14141515- NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation";
1515+ env.NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation";
16161717 meta = with lib; {
1818 description = "Dict protocol server and client";
···4848 "-DAPACHE_MODULE_DIR=${placeholder "out"}/modules"
4949 ];
50505151- NIX_CFLAGS_COMPILE = "-std=c99";
5151+ env.NIX_CFLAGS_COMPILE = "-std=c99";
52525353 meta = with lib; {
5454 description = "A server that implements tile caching to speed up access to WMS layers";
···6868 # gcc-10. Otherwise build fails as:
6969 # ld: .libs/hash_drv.o:/build/dspam-3.10.2/src/util.h:96: multiple definition of `verified_user';
7070 # .libs/libdspam.o:/build/dspam-3.10.2/src/util.h:96: first defined here
7171- NIX_CFLAGS_COMPILE = "-fcommon";
7171+ env.NIX_CFLAGS_COMPILE = "-fcommon";
72727373 # Lots of things are hardwired to paths like sysconfdir. That's why we install with both "prefix" and "DESTDIR"
7474 # and fix directory structure manually after that.
+1-1
pkgs/servers/mail/mlmmj/default.nix
···2020 # gcc-10. Otherwise build fails as:
2121 # ld: getlistdelim.o:/build/mlmmj-1.3.0/src/../include/mlmmj.h:84: multiple definition of
2222 # `subtype_strs'; mlmmj-send.o:/build/mlmmj-1.3.0/src/../include/mlmmj.h:84: first defined here
2323- NIX_CFLAGS_COMPILE = "-fcommon";
2323+ env.NIX_CFLAGS_COMPILE = "-fcommon";
24242525 postInstall = ''
2626 # grab all documentation files
···32323333 hardeningEnable = [ "pie" ];
34343535- NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [ "-std=c11" ];
3535+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-std=c11" ]);
36363737 # darwin currently lacks a pure `pgrep` which is extensively used here
3838 doCheck = !stdenv.isDarwin;
+1-1
pkgs/servers/openbgpd/default.nix
···3939 # gcc-10. Otherwise build fails as:
4040 # ld: bgpd-rde_peer.o:/build/source/src/bgpd/bgpd.h:133: multiple definition of `bgpd_process';
4141 # bgpd-bgpd.o:/build/source/src/bgpd/bgpd.h:133: first defined here
4242- NIX_CFLAGS_COMPILE = "-fcommon";
4242+ env.NIX_CFLAGS_COMPILE = "-fcommon";
43434444 meta = with lib; {
4545 description =
···113113114114 # Assumption: the first output* variable to be configured is
115115 # _overrideFirst outputDev "dev" "out"
116116- expectedMsg = "_assignFirst: could not find a non-empty variable to assign to outputDev. The following variables were all unset or empty: dev out.";
116116+ expectedMsg = "error: _assignFirst: could not find a non-empty variable to assign to outputDev.\n The following variables were all unset or empty:\n dev out";
117117 } ''
118118 grep -F "$expectedMsg" $result/testBuildFailure.log >/dev/null
119119 touch $out
+1-1
pkgs/test/stdenv/hooks.nix
···115115 name = "test-reproducible-builds";
116116 buildCommand = ''
117117 # can't be tested more precisely because the value of random-seed changes depending on the output
118118- [[ $NIX_CFLAGS_COMPILE =~ "-frandom-seed=" ]]
118118+ [[ $env.NIX_CFLAGS_COMPILE =~ "-frandom-seed=" ]]
119119 touch $out
120120 '';
121121 };
···19192020 makeFlags = [ "PREFIX=$(out)" ];
21212222- NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE";
2222+ env.NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE";
23232424 meta = {
2525 description = "A simple and lightweight volume icon that sits in your system tray";
···2121 '';
22222323 # work around a problem related to gtk3 updates
2424- NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
2424+ env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
25252626 postInstall = "";
2727
+1-1
pkgs/tools/backup/btar/default.nix
···2020 # gcc-10. Otherwise build fails as:
2121 # ld: listindex.o:/build/btar-1.1.1/loadindex.h:12: multiple definition of
2222 # `ptr'; main.o:/build/btar-1.1.1/loadindex.h:12: first defined here
2323- NIX_CFLAGS_COMPILE = "-fcommon";
2323+ env.NIX_CFLAGS_COMPILE = "-fcommon";
24242525 buildInputs = [ librsync ];
2626
···2727 '';
28282929 # Needed on gcc >= 6.
3030- NIX_CFLAGS_COMPILE = "-Wno-narrowing";
3030+ env.NIX_CFLAGS_COMPILE = "-Wno-narrowing";
31313232 meta = with lib; {
3333 description = "A tool for recording audio or data CD-Rs in disk-at-once (DAO) mode";
···2424 # gcc-10. Otherwise build fails as:
2525 # ld: CMakeFiles/rbal.dir/src/statsearchbl.cpp.o:(.bss+0x0):
2626 # multiple definition of `minrow'; CMakeFiles/rbal.dir/src/linban.c.o:(.bss+0xa3a): first defined here
2727- NIX_CFLAGS_COMPILE = "-fcommon";
2727+ env.NIX_CFLAGS_COMPILE = "-fcommon";
28282929 postPatch = ''
3030 rm cuneiform_src/Kern/hhh/tigerh/h/strings.h
+1-1
pkgs/tools/graphics/fim/default.nix
···3535 ++ optional jpegSupport libjpeg
3636 ++ optional pngSupport libpng;
37373838- NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-lSDL";
3838+ env.NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-lSDL";
39394040 meta = with lib; {
4141 description = "A lightweight, highly customizable and scriptable image viewer";
+1-1
pkgs/tools/graphics/hobbits/default.nix
···26262727 cmakeFlags = [ "-DUSE_SYSTEM_PFFFT=ON" ];
28282929- NIX_CFLAGS_COMPILE = lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing";
2929+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing";
30303131 meta = with lib; {
3232 description = "A multi-platform GUI for bit-based analysis, processing, and visualization";
+1-1
pkgs/tools/graphics/icoutils/default.nix
···15151616 # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin
1717 # upgrades to a newer SDK.
1818- NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
1818+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
19192020 patchPhase = ''
2121 patchShebangs extresso/extresso
+1-1
pkgs/tools/graphics/ifm/default.nix
···1616 # Workaround build failure on -fno-common toolchains:
1717 # ld: libvars.a(vars-freeze-lex.o):src/libvars/vars-freeze-lex.l:23:
1818 # multiple definition of `line_number'; ifm-main.o:src/ifm-main.c:46: first defined here
1919- NIX_CFLAGS_COMPILE = "-fcommon";
1919+ env.NIX_CFLAGS_COMPILE = "-fcommon";
20202121 enableParallelBuilding = false; # ifm-scan.l:16:10: fatal error: ifm-parse.h: No such file or directory
2222
···149149150150 NIX_LDFLAGS = optionalString selinuxSupport "-lsepol";
151151 FORCE_UNSAFE_CONFIGURE = optionalString stdenv.hostPlatform.isSunOS "1";
152152- NIX_CFLAGS_COMPILE = []
152152+ env.NIX_CFLAGS_COMPILE = toString ([]
153153 # Work around a bogus warning in conjunction with musl.
154154 ++ optional stdenv.hostPlatform.isMusl "-Wno-error"
155155- ++ optional stdenv.hostPlatform.isAndroid "-D__USE_FORTIFY_LEVEL=0";
155155+ ++ optional stdenv.hostPlatform.isAndroid "-D__USE_FORTIFY_LEVEL=0");
156156157157 # Works around a bug with 8.26:
158158 # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually). Stop.
+1-1
pkgs/tools/misc/edk2-uefi-shell/default.nix
···1414 ++ lib.optionals stdenv.cc.isClang [ llvmPackages.bintools llvmPackages.llvm ];
1515 strictDeps = true;
16161717- NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [ "-fno-pic" "-Qunused-arguments" ];
1717+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-fno-pic" "-Qunused-arguments" ]);
18181919 # Set explicitly to use Python 3 from nixpkgs. Otherwise, the build system will detect and try to
2020 # use `/usr/bin/python3` on Darwin when sandboxing is disabled.
+2-2
pkgs/tools/misc/fluent-bit/default.nix
···1919 cmakeFlags = [ "-DFLB_METRICS=ON" "-DFLB_HTTP_SERVER=ON" "-DFLB_OUT_PGSQL=ON" ];
20202121 # _FORTIFY_SOURCE requires compiling with optimization (-O)
2222- NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-O" ]
2222+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [ "-O" ]
2323 # Workaround build failure on -fno-common toolchains:
2424 # ld: /monkey/mk_tls.h:81: multiple definition of `mk_tls_server_timeout';
2525 # flb_config.c.o:include/monkey/mk_tls.h:81: first defined here
2626 # TODO: drop when upstream gets a fix for it:
2727 # https://github.com/fluent/fluent-bit/issues/5537
2828- ++ lib.optionals stdenv.isDarwin [ "-fcommon" ];
2828+ ++ lib.optionals stdenv.isDarwin [ "-fcommon" ]);
29293030 outputs = [ "out" "dev" ];
3131
+1-1
pkgs/tools/misc/fontforge/default.nix
···4646 '';
47474848 # do not use x87's 80-bit arithmetic, rouding errors result in very different font binaries
4949- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-msse2 -mfpmath=sse";
4949+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-msse2 -mfpmath=sse";
50505151 nativeBuildInputs = [ pkg-config cmake ];
5252 buildInputs = [
+1-1
pkgs/tools/misc/grub/2.0x.nix
···339339 separateDebugInfo = !xenSupport;
340340341341 # Work around a bug in the generated flex lexer (upstream flex bug?)
342342- NIX_CFLAGS_COMPILE = "-Wno-error";
342342+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
343343344344 preConfigure =
345345 '' for i in "tests/util/"*.in
···6666 nativeCheckInputs = [ which ]; # used for tests with checkFlags = [ "DEBUG=true" ];
6767 checkTarget = "tests";
68686969- NIX_CFLAGS_COMPILE = "-Wno-error";
6969+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
70707171 meta = with lib; {
7272 description = "Lightweight implementation of some Unix command line utilities";
···1616 # Workaround build failure on -fno-common toolchains like upstream
1717 # gcc-10. Otherwise build fails as:
1818 # ld: netmap.o:(.bss+0x20): multiple definition of `sizecheck'; iouyap.o:(.bss+0x20): first defined here
1919- NIX_CFLAGS_COMPILE = "-fcommon";
1919+ env.NIX_CFLAGS_COMPILE = "-fcommon";
20202121 installPhase = ''
2222 install -D -m555 iouyap $out/bin/iouyap;
+1-1
pkgs/tools/networking/jwhois/default.nix
···2121 # Work around error from <stdio.h> on aarch64-darwin:
2222 # error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
2323 # TODO: this should probably be fixed at a lower level than this?
2424- NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-Wno-undef-prefix";
2424+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-undef-prefix";
25252626 meta = {
2727 description = "A client for the WHOIS protocol allowing you to query the owner of a domain name";
+1-1
pkgs/tools/networking/libnids/default.nix
···1818 this is necessary for dsniff to compile; otherwise g_thread_init is a missing
1919 symbol when linking (?!?)
2020 */
2121- NIX_CFLAGS_COMPILE="-Dg_thread_init= ";
2121+ env.NIX_CFLAGS_COMPILE = "-Dg_thread_init= ";
22222323 meta = with lib; {
2424 description = "An E-component of Network Intrusion Detection System which emulates the IP stack of Linux 2.0.x";
+1-1
pkgs/tools/networking/lsh/default.nix
···3636 # ld: liblsh.a(unix_user.o):/build/lsh-2.0.4/src/server_userauth.h:108: multiple definition of
3737 # `server_userauth_none_preauth'; lshd.o:/build/lsh-2.0.4/src/server_userauth.h:108: first defined here
3838 # Should be present in upcoming 2.1 release.
3939- NIX_CFLAGS_COMPILE = "-std=gnu90 -fcommon";
3939+ env.NIX_CFLAGS_COMPILE = "-std=gnu90 -fcommon";
40404141 buildInputs = [ gperf guile gmp zlib liboop readline gnum4 pam libxcrypt ];
4242
+1-1
pkgs/tools/networking/ncftp/default.nix
···1717 # gcc-10. Otherwise build fails as:
1818 # ld: bookmark.o: (.bss+0x20): multiple definition of `gBm';
1919 # gpshare.o:(.bss+0x0): first defined here
2020- NIX_CFLAGS_COMPILE = "-fcommon";
2020+ env.NIX_CFLAGS_COMPILE = "-fcommon";
21212222 preConfigure = ''
2323 find -name Makefile.in | xargs sed -i '/^TMPDIR=/d'
···2020 # ld: CMakeFiles/oonf_dlep_proxy.dir/router/dlep_router_session.c.o:(.bss+0x0):
2121 # multiple definition of `LOG_DLEP_ROUTER'; CMakeFiles/oonf_dlep_proxy.dir/router/dlep_router.c.o:(.bss+0x0): first defined here
2222 # Can be removed once release with https://github.com/OLSR/OONF/pull/40 is out.
2323- NIX_CFLAGS_COMPILE = "-fcommon";
2323+ env.NIX_CFLAGS_COMPILE = "-fcommon";
24242525 cmakeFlags = [
2626 "-DOONF_NO_WERROR=yes"
···1212 # gcc-10. Otherwise build fails as:
1313 # ld: main.o:/build/tftp-hpa-5.2/tftp/main.c:98: multiple definition of
1414 # `toplevel'; tftp.o:/build/tftp-hpa-5.2/tftp/tftp.c:51: first defined here
1515- NIX_CFLAGS_COMPILE="-fcommon";
1515+ env.NIX_CFLAGS_COMPILE = "-fcommon";
16161717 meta = with lib; {
1818 description = "TFTP tools - a lot of fixes on top of BSD TFTP";
···3030 "BASHDIR=${placeholder "out"}/share/bash-completion/completions"
3131 ];
32323333- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-D_LINUX_SYSINFO_H=1";
3333+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-D_LINUX_SYSINFO_H=1";
34343535 # Won't build on i686 because the binary will be linked again in the
3636 # install phase without checking the dependencies. This will prevent