···60 (old: rec {
61 buildInputs = old.buildInputs ++ [ pkg-config ];
62 # we need to reset this setting!
63- NIX_CFLAGS_COMPILE="";
64 configurePhase = ''
65 # FIXME: Some tests require writing at $HOME
66 HOME=$TMPDIR
···60 (old: rec {
61 buildInputs = old.buildInputs ++ [ pkg-config ];
62 # we need to reset this setting!
63+ env = (old.env or { }) // { NIX_CFLAGS_COMPILE = ""; };
64 configurePhase = ''
65 # FIXME: Some tests require writing at $HOME
66 HOME=$TMPDIR
+1-1
doc/stdenv/stdenv.chapter.md
···13291330Adds 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.
13311332-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`.
13331334This needs to be turned off or fixed for errors similar to:
1335
···13291330Adds 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.
13311332+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`.
13331334This needs to be turned off or fixed for errors similar to:
1335
+1-1
pkgs/applications/audio/aacgain/default.nix
···33 libtool
34 ];
3536- NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";
3738 meta = with lib; {
39 description = "ReplayGain for AAC files";
···33 libtool
34 ];
3536+ env.NIX_CFLAGS_COMPILE = "-Wno-error=narrowing";
3738 meta = with lib; {
39 description = "ReplayGain for AAC files";
+1-1
pkgs/applications/audio/adlplug/default.nix
···62 "-DADLplug_Jack=${if withJack then "ON" else "OFF"}"
63 ];
6465- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
66 # "fp.h" file not found
67 "-isystem ${CoreServices}/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers"
68 ]);
···62 "-DADLplug_Jack=${if withJack then "ON" else "OFF"}"
63 ];
6465+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
66 # "fp.h" file not found
67 "-isystem ${CoreServices}/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers"
68 ]);
···63 "-DWARNINGS_ARE_ERRORS=ON"
64 ];
6566- NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
67 # Needed with GCC 12 but breaks on darwin (with clang) or aarch64 (old gcc)
68 "-Wno-error=mismatched-new-delete"
69 "-Wno-error=use-after-free"
70- ];
7172 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
73 # Normal CMake install phase on Darwin only installs the binary, the user is expected to use CPack to build a
···63 "-DWARNINGS_ARE_ERRORS=ON"
64 ];
6566+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
67 # Needed with GCC 12 but breaks on darwin (with clang) or aarch64 (old gcc)
68 "-Wno-error=mismatched-new-delete"
69 "-Wno-error=use-after-free"
70+ ]);
7172 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
73 # Normal CMake install phase on Darwin only installs the binary, the user is expected to use CPack to build a
···26 # gcc-10. Otherwise build fails as:
27 # ld: .libs/autodetection.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: multiple definition of
28 # `gtkpod_app'; .libs/gtkpod_app_iface.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: first defined here
29- NIX_CFLAGS_COMPILE = "-fcommon";
3031 enableParallelBuilding = true;
32
···26 # gcc-10. Otherwise build fails as:
27 # ld: .libs/autodetection.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: multiple definition of
28 # `gtkpod_app'; .libs/gtkpod_app_iface.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: first defined here
29+ env.NIX_CFLAGS_COMPILE = "-fcommon";
3031 enableParallelBuilding = true;
32
+1-1
pkgs/applications/audio/guitarix/default.nix
···97 "--install-roboto-font"
98 ] ++ optional optimizationSupport "--optimization";
99100- NIX_CFLAGS_COMPILE = [ "-fpermissive" ];
101102 meta = with lib; {
103 description = "A virtual guitar amplifier for Linux running with JACK";
···97 "--install-roboto-font"
98 ] ++ optional optimizationSupport "--optimization";
99100+ env.NIX_CFLAGS_COMPILE = toString [ "-fpermissive" ];
101102 meta = with lib; {
103 description = "A virtual guitar amplifier for Linux running with JACK";
+1-1
pkgs/applications/audio/jamin/default.nix
···19 # gcc-10. Otherwise build fails as:
20 # ld: jamin-preferences.o:/build/jamin-0.95.0/src/hdeq.h:64: multiple definition of
21 # `l_notebook1'; jamin-callbacks.o:/build/jamin-0.95.0/src/hdeq.h:64: first defined here
22- NIX_CFLAGS_COMPILE = "-fcommon";
2324 postInstall = ''
25 wrapProgram $out/bin/jamin --set LADSPA_PATH ${ladspaPlugins}/lib/ladspa
···19 # gcc-10. Otherwise build fails as:
20 # ld: jamin-preferences.o:/build/jamin-0.95.0/src/hdeq.h:64: multiple definition of
21 # `l_notebook1'; jamin-callbacks.o:/build/jamin-0.95.0/src/hdeq.h:64: first defined here
22+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2324 postInstall = ''
25 wrapProgram $out/bin/jamin --set LADSPA_PATH ${ladspaPlugins}/lib/ladspa
+1-1
pkgs/applications/audio/klystrack/default.nix
···31 # ld: libengine_gui.a(gui_menu.o):(.bss+0x0): multiple definition of
32 # `menu_t'; objs.release/action.o:(.bss+0x20): first defined here
33 # TODO: remove it for 1.7.7+ release as it was fixed upstream.
34- NIX_CFLAGS_COMPILE = "-fcommon";
3536 buildFlags = [ "PREFIX=${placeholder "out"}" "CFG=release" ];
37
···31 # ld: libengine_gui.a(gui_menu.o):(.bss+0x0): multiple definition of
32 # `menu_t'; objs.release/action.o:(.bss+0x20): first defined here
33 # TODO: remove it for 1.7.7+ release as it was fixed upstream.
34+ env.NIX_CFLAGS_COMPILE = "-fcommon";
3536 buildFlags = [ "PREFIX=${placeholder "out"}" "CFG=release" ];
37
···30 # Without it doesn't find all of the boost libraries.
31 BOOST_LIB_DIR = "${boost}/lib";
32 # uses the deprecated get_generic_category() in boost_system
33- NIX_CFLAGS_COMPILE = "-DBOOST_SYSTEM_ENABLE_DEPRECATED=1";
3435 LC_ALL = "en_US.UTF-8";
36
···30 # Without it doesn't find all of the boost libraries.
31 BOOST_LIB_DIR = "${boost}/lib";
32 # uses the deprecated get_generic_category() in boost_system
33+ env.NIX_CFLAGS_COMPILE = "-DBOOST_SYSTEM_ENABLE_DEPRECATED=1";
3435 LC_ALL = "en_US.UTF-8";
36
+1-1
pkgs/applications/audio/tenacity/default.nix
···82 --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH"
83 '';
8485- NIX_CFLAGS_COMPILE = "-D GIT_DESCRIBE=\"\"";
8687 # tenacity only looks for ffmpeg at runtime, so we need to link it in manually
88 NIX_LDFLAGS = toString [
···82 --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH"
83 '';
8485+ env.NIX_CFLAGS_COMPILE = "-D GIT_DESCRIBE=\"\"";
8687 # tenacity only looks for ffmpeg at runtime, so we need to link it in manually
88 NIX_LDFLAGS = toString [
+1-1
pkgs/applications/audio/transcode/default.nix
···24 # gcc-10. Otherwise build fails as:
25 # ld: tcextract-extract_pcm.o:/build/transcode-1.1.7/import/extract_pcm.c:36: multiple definition of
26 # `audio'; tcextract-extract_ac3.o:/build/transcode-1.1.7/import/extract_ac3.c:337: first defined here
27- NIX_CFLAGS_COMPILE = "-fcommon";
2829 meta = with lib; {
30 description = "Suite of command line utilities for transcoding video and audio codecs, and for converting between different container formats";
···24 # gcc-10. Otherwise build fails as:
25 # ld: tcextract-extract_pcm.o:/build/transcode-1.1.7/import/extract_pcm.c:36: multiple definition of
26 # `audio'; tcextract-extract_ac3.o:/build/transcode-1.1.7/import/extract_ac3.c:337: first defined here
27+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2829 meta = with lib; {
30 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
···23 # ld: CMakeFiles/ympd.dir/src/mpd_client.c.o:(.bss+0x0): multiple definition of `mpd';
24 # CMakeFiles/ympd.dir/src/ympd.c.o:(.bss+0x20): first defined here
25 # Should be fixed by pending https://github.com/notandy/ympd/pull/191 (does not apply as is).
26- NIX_CFLAGS_COMPILE = "-fcommon";
2728 nativeBuildInputs = [ cmake pkg-config ];
29 buildInputs = [ libmpdclient openssl ];
···23 # ld: CMakeFiles/ympd.dir/src/mpd_client.c.o:(.bss+0x0): multiple definition of `mpd';
24 # CMakeFiles/ympd.dir/src/ympd.c.o:(.bss+0x20): first defined here
25 # Should be fixed by pending https://github.com/notandy/ympd/pull/191 (does not apply as is).
26+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2728 nativeBuildInputs = [ cmake pkg-config ];
29 buildInputs = [ libmpdclient openssl ];
···4142 # Force optimization to fix:
43 # warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O)
44- NIX_CFLAGS_COMPILE = "-O3";
4546 # Remove pre-built y.tab.c to generate with nixpkgs bison
47 preBuild = ''
···4142 # Force optimization to fix:
43 # warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O)
44+ env.NIX_CFLAGS_COMPILE = "-O3";
4546 # Remove pre-built y.tab.c to generate with nixpkgs bison
47 preBuild = ''
+1-1
pkgs/applications/blockchains/cgminer/default.nix
···44 # ld: cgminer-driver-modminer.o:/build/source/miner.h:285:
45 # multiple definition of `bitforce_drv'; cgminer-cgminer.o:/build/source/miner.h:285:
46 # first defined here
47- NIX_CFLAGS_COMPILE = "-fcommon";
4849 meta = with lib; {
50 description = "CPU/GPU miner in c for bitcoin";
···44 # ld: cgminer-driver-modminer.o:/build/source/miner.h:285:
45 # multiple definition of `bitforce_drv'; cgminer-cgminer.o:/build/source/miner.h:285:
46 # first defined here
47+ env.NIX_CFLAGS_COMPILE = "-fcommon";
4849 meta = with lib; {
50 description = "CPU/GPU miner in c for bitcoin";
···41 ];
4243 # G_APPLICATION_FLAGS_NONE is deprecated in GLib 2.73.3+.
44- NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
4546 meta = with lib; {
47 description = "GTK based greeter for greetd, to be run under cage or similar";
···41 ];
4243 # G_APPLICATION_FLAGS_NONE is deprecated in GLib 2.73.3+.
44+ env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
4546 meta = with lib; {
47 description = "GTK based greeter for greetd, to be run under cage or similar";
···1718 patches = [ ./gcc7.patch ];
1920- NIX_CFLAGS_COMPILE = [ "-Wno-narrowing" ];
2122 meta = with lib; {
23 description = "File editor/viewer/analyzer for executables";
···1718 patches = [ ./gcc7.patch ];
1920+ env.NIX_CFLAGS_COMPILE = toString [ "-Wno-narrowing" ];
2122 meta = with lib; {
23 description = "File editor/viewer/analyzer for executables";
+1-1
pkgs/applications/editors/nedit/default.nix
···16 # the linux config works fine on darwin too!
17 buildFlags = lib.optional (stdenv.isLinux || stdenv.isDarwin) "linux";
1819- NIX_CFLAGS_COMPILE="-DBUILD_UNTESTED_NEDIT -L${motif}/lib";
2021 installPhase = ''
22 mkdir -p $out/bin
···16 # the linux config works fine on darwin too!
17 buildFlags = lib.optional (stdenv.isLinux || stdenv.isDarwin) "linux";
1819+ env.NIX_CFLAGS_COMPILE = "-DBUILD_UNTESTED_NEDIT -L${motif}/lib";
2021 installPhase = ''
22 mkdir -p $out/bin
···1415 # Work around build failures on recent GTK.
16 # See http://ubuntuforums.org/showthread.php?p=10535837
17- NIX_CFLAGS_COMPILE = "-UGTK_DISABLE_DEPRECATED -UGSEAL_ENABLE";
1819 meta = with lib; {
20 homepage = "https://segaretro.org/Gens/GS";
···1415 # Work around build failures on recent GTK.
16 # See http://ubuntuforums.org/showthread.php?p=10535837
17+ env.NIX_CFLAGS_COMPILE = "-UGTK_DISABLE_DEPRECATED -UGSEAL_ENABLE";
1819 meta = with lib; {
20 homepage = "https://segaretro.org/Gens/GS";
···26 # `xsets'; vfs/spacefm-vfs-file-info.o:src/settings.h:123: first defined here
27 # TODO: can be removed once https://github.com/IgnorantGuru/spacefm/pull/772
28 # or equivalent is merged upstream.
29- NIX_CFLAGS_COMPILE = "-fcommon";
3031 configureFlags = [
32 "--with-bash-path=${pkgs.bash}/bin/bash"
···26 # `xsets'; vfs/spacefm-vfs-file-info.o:src/settings.h:123: first defined here
27 # TODO: can be removed once https://github.com/IgnorantGuru/spacefm/pull/772
28 # or equivalent is merged upstream.
29+ env.NIX_CFLAGS_COMPILE = "-fcommon";
3031 configureFlags = [
32 "--with-bash-path=${pkgs.bash}/bin/bash"
···1516 hardeningDisable = [ "format" ];
1718- NIX_CFLAGS_COMPILE = "-fcommon";
19 NIX_LDFLAGS = "-lm";
2021 meta = with lib; {
···1516 hardeningDisable = [ "format" ];
1718+ env.NIX_CFLAGS_COMPILE = "-fcommon";
19 NIX_LDFLAGS = "-lm";
2021 meta = with lib; {
+1-1
pkgs/applications/graphics/grafx2/default.nix
···19 # gcc-10. Otherwise build fails as:
20 # ld: ../obj/unix/tiles.o:/build/grafx2/src/global.h:306: multiple definition of
21 # `Main_selector'; ../obj/unix/main.o:/build/grafx2/src/global.h:306: first defined here
22- NIX_CFLAGS_COMPILE = "-fcommon";
2324 preInstall = '' mkdir -p "$out" '';
25
···19 # gcc-10. Otherwise build fails as:
20 # ld: ../obj/unix/tiles.o:/build/grafx2/src/global.h:306: multiple definition of
21 # `Main_selector'; ../obj/unix/main.o:/build/grafx2/src/global.h:306: first defined here
22+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2324 preInstall = '' mkdir -p "$out" '';
25
+1-1
pkgs/applications/graphics/hugin/default.nix
···75 # disable installation of the python scripting interface
76 cmakeFlags = [ "-DBUILD_HSI:BOOl=OFF" ];
7778- NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR";
7980 postInstall = ''
81 for p in $out/bin/*; do
···75 # disable installation of the python scripting interface
76 cmakeFlags = [ "-DBUILD_HSI:BOOl=OFF" ];
7778+ env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR";
7980 postInstall = ''
81 for p in $out/bin/*; do
+1-1
pkgs/applications/graphics/imgcat/default.nix
···19 sha256 = "sha256-EkVE6BgoA1lo4oqlNETTxLILIVvGXspFyXykxpmYk8M=";
20 };
2122- NIX_CFLAGS_COMPILE = "-Wno-error";
2324 meta = with lib; {
25 description = "It's like cat, but for images";
···19 sha256 = "sha256-EkVE6BgoA1lo4oqlNETTxLILIVvGXspFyXykxpmYk8M=";
20 };
2122+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
2324 meta = with lib; {
25 description = "It's like cat, but for images";
···25 # gcc-10. Otherwise build fails as:
26 # ld: src/util.o:(.bss+0x0): multiple definition of `progname'; /build/ccBZT2Za.o:(.bss+0x20): first defined here
27 # https://github.com/danielgtaylor/jpeg-archive/issues/119
28- NIX_CFLAGS_COMPILE = "-fcommon";
2930 makeFlags = [
31 "CC=${stdenv.cc.targetPrefix}cc"
···25 # gcc-10. Otherwise build fails as:
26 # ld: src/util.o:(.bss+0x0): multiple definition of `progname'; /build/ccBZT2Za.o:(.bss+0x20): first defined here
27 # https://github.com/danielgtaylor/jpeg-archive/issues/119
28+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2930 makeFlags = [
31 "CC=${stdenv.cc.targetPrefix}cc"
+2-2
pkgs/applications/graphics/krita/generic.nix
···33 xsimd
34 ];
3536- NIX_CFLAGS_COMPILE = [ "-I${ilmbase.dev}/include/OpenEXR" ]
37- ++ lib.optional stdenv.cc.isGNU "-Wno-deprecated-copy";
3839 # Krita runs custom python scripts in CMake with custom PYTHONPATH which krita determined in their CMake script.
40 # Patch the PYTHONPATH so python scripts can import sip successfully.
···33 xsimd
34 ];
3536+ env.NIX_CFLAGS_COMPILE = toString ([ "-I${ilmbase.dev}/include/OpenEXR" ]
37+ ++ lib.optional stdenv.cc.isGNU "-Wno-deprecated-copy");
3839 # Krita runs custom python scripts in CMake with custom PYTHONPATH which krita determined in their CMake script.
40 # Patch the PYTHONPATH so python scripts can import sip successfully.
···1718 qmakeFlags = [ "PREFIX=${placeholder "out"}" ];
1920- NIX_CFLAGS_COMPILE = "-I${graphicsmagick}/include/GraphicsMagick";
2122 meta = with lib; {
23 description = "A cross-platform image editor with a powerful features and a very friendly graphical user interface";
···1718 qmakeFlags = [ "PREFIX=${placeholder "out"}" ];
1920+ env.NIX_CFLAGS_COMPILE = "-I${graphicsmagick}/include/GraphicsMagick";
2122 meta = with lib; {
23 description = "A cross-platform image editor with a powerful features and a very friendly graphical user interface";
···19 '';
2021 # error: 'regparm' is not valid on this platform
22- NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64)
23 "-D__STRICT_ANSI__";
2425 meta = with lib; {
···19 '';
2021 # error: 'regparm' is not valid on this platform
22+ env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64)
23 "-D__STRICT_ANSI__";
2425 meta = with lib; {
+1-1
pkgs/applications/misc/blender/default.nix
···132 "-DOPTIX_ROOT_DIR=${optix}"
133 ];
134135- NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
136137 # Since some dependencies are built with gcc 6, we need gcc 6's
138 # libstdc++ in our RPATH. Sigh.
···132 "-DOPTIX_ROOT_DIR=${optix}"
133 ];
134135+ env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
136137 # Since some dependencies are built with gcc 6, we need gcc 6's
138 # libstdc++ in our RPATH. Sigh.
+1-1
pkgs/applications/misc/cataract/build.nix
···30 # avoid build failures like:
31 # ld: stats.o:/build/cataract-675e647/src/stats.h:24: multiple definition of
32 # `stats_images'; cgg.o:/build/cataract-675e647/src/stats.h:24: first defined here
33- NIX_CFLAGS_COMPILE = "-fcommon";
3435 installPhase = ''
36 mkdir $out/{bin,share} -p
···30 # avoid build failures like:
31 # ld: stats.o:/build/cataract-675e647/src/stats.h:24: multiple definition of
32 # `stats_images'; cgg.o:/build/cataract-675e647/src/stats.h:24: first defined here
33+ env.NIX_CFLAGS_COMPILE = "-fcommon";
3435 installPhase = ''
36 mkdir $out/{bin,share} -p
···22 # ld: gmtp-preferences.o:src/main.h:72: multiple definition of
23 # `scrolledwindowMain'; gmtp-about.o:src/main.h:72: first defined here
24 # TODO: can be removed when 1.4.0 is released.
25- NIX_CFLAGS_COMPILE = "-fcommon";
2627 preFixup = ''
28 gappsWrapperArgs+=(--add-flags "--datapath $out/share");
···22 # ld: gmtp-preferences.o:src/main.h:72: multiple definition of
23 # `scrolledwindowMain'; gmtp-about.o:src/main.h:72: first defined here
24 # TODO: can be removed when 1.4.0 is released.
25+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2627 preFixup = ''
28 gappsWrapperArgs+=(--add-flags "--datapath $out/share");
+1-1
pkgs/applications/misc/gpsbabel/default.nix
···6667 # Floating point behavior on i686 causes nmea.test failures. Preventing
68 # extended precision fixes this problem.
69- NIX_CFLAGS_COMPILE = lib.optional stdenv.isi686 "-ffloat-store";
7071 doCheck = true;
72
···6667 # Floating point behavior on i686 causes nmea.test failures. Preventing
68 # extended precision fixes this problem.
69+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-ffloat-store";
7071 doCheck = true;
72
···115 # Disable compiler warnings that clutter the build log.
116 # It seems to be a known issue for Eigen:
117 # http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
118- NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes";
119120 # prusa-slicer uses dlopen on `libudev.so` at runtime
121 NIX_LDFLAGS = lib.optionalString withSystemd "-ludev";
···115 # Disable compiler warnings that clutter the build log.
116 # It seems to be a known issue for Eigen:
117 # http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
118+ env.NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes";
119120 # prusa-slicer uses dlopen on `libudev.so` at runtime
121 NIX_LDFLAGS = lib.optionalString withSystemd "-ludev";
+1-1
pkgs/applications/misc/pw-viz/default.nix
···4950 # enables pipewire API deprecated in 0.3.64
51 # fixes error caused by https://gitlab.freedesktop.org/pipewire/pipewire-rs/-/issues/55
52- NIX_CFLAGS_COMPILE = [ "-DPW_ENABLE_DEPRECATED" ];
5354 meta = with lib; {
55 description = "A simple and elegant pipewire graph editor ";
···4950 # enables pipewire API deprecated in 0.3.64
51 # fixes error caused by https://gitlab.freedesktop.org/pipewire/pipewire-rs/-/issues/55
52+ env.NIX_CFLAGS_COMPILE = toString [ "-DPW_ENABLE_DEPRECATED" ];
5354 meta = with lib; {
55 description = "A simple and elegant pipewire graph editor ";
···19 mkdir locale
20 '';
2122- NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__";
2324 meta = with lib; {
25 homepage = "https://dushistov.github.io/sdcv/";
···19 mkdir locale
20 '';
2122+ env.NIX_CFLAGS_COMPILE = "-D__GNU_LIBRARY__";
2324 meta = with lib; {
25 homepage = "https://dushistov.github.io/sdcv/";
+1-1
pkgs/applications/misc/slade/default.nix
···56 "-DwxWidgets_LIBRARIES=${wxGTK}/lib"
57 ];
5859- NIX_CFLAGS_COMPILE = "-Wno-narrowing";
6061 meta = with lib; {
62 description = "Doom editor";
···56 "-DwxWidgets_LIBRARIES=${wxGTK}/lib"
57 ];
5859+ env.NIX_CFLAGS_COMPILE = "-Wno-narrowing";
6061 meta = with lib; {
62 description = "Doom editor";
+1-1
pkgs/applications/misc/slade/git.nix
···56 "-DwxWidgets_LIBRARIES=${wxGTK}/lib"
57 ];
5859- NIX_CFLAGS_COMPILE = "-Wno-narrowing";
6061 meta = with lib; {
62 description = "Doom editor";
···56 "-DwxWidgets_LIBRARIES=${wxGTK}/lib"
57 ];
5859+ env.NIX_CFLAGS_COMPILE = "-Wno-narrowing";
6061 meta = with lib; {
62 description = "Doom editor";
+1-1
pkgs/applications/misc/syncthingtray/default.nix
···41 # Hence we use a C definition with NIX_CFLAGS_COMPILE
42 ./use-nix-path-in-autostart.patch
43 ];
44- NIX_CFLAGS_COMPILE = "-DEXEC_NIX_PATH=\"${placeholder "out"}/bin/syncthingtray\"";
4546 buildInputs = [
47 qtbase
···41 # Hence we use a C definition with NIX_CFLAGS_COMPILE
42 ./use-nix-path-in-autostart.patch
43 ];
44+ env.NIX_CFLAGS_COMPILE = "-DEXEC_NIX_PATH=\"${placeholder "out"}/bin/syncthingtray\"";
4546 buildInputs = [
47 qtbase
+1-1
pkgs/applications/misc/synergy/default.nix
···100 ];
101102 # Silences many warnings
103- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-inconsistent-missing-override";
104105 cmakeFlags = lib.optional (!withGUI) "-DSYNERGY_BUILD_LEGACY_GUI=OFF"
106 # NSFilenamesPboardType is deprecated in 10.14+
···100 ];
101102 # Silences many warnings
103+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-inconsistent-missing-override";
104105 cmakeFlags = lib.optional (!withGUI) "-DSYNERGY_BUILD_LEGACY_GUI=OFF"
106 # NSFilenamesPboardType is deprecated in 10.14+
···324 # Don't spam warnings about unknown warning options. This is useful because
325 # our Clang is always older than Chromium's and the build logs have a size
326 # of approx. 25 MB without this option (and this saves e.g. 66 %).
327- NIX_CFLAGS_COMPILE = "-Wno-unknown-warning-option";
328329 buildPhase = let
330 buildCommand = target: ''
···324 # Don't spam warnings about unknown warning options. This is useful because
325 # our Clang is always older than Chromium's and the build logs have a size
326 # of approx. 25 MB without this option (and this saves e.g. 66 %).
327+ env.NIX_CFLAGS_COMPILE = "-Wno-unknown-warning-option";
328329 buildPhase = let
330 buildCommand = target: ''
···45 # Workaround build failure on -fno-common toolchains:
46 # ld: main.o:/build/dillo-3.0.5/dpid/dpid.h:64: multiple definition of `sock_set';
47 # dpid.o:/build/dillo-3.0.5/dpid/dpid.h:64: first defined here
48- NIX_CFLAGS_COMPILE = "-fcommon";
4950 meta = with lib; {
51 description = "Fork of Dillo, a lightweight web browser";
···45 # Workaround build failure on -fno-common toolchains:
46 # ld: main.o:/build/dillo-3.0.5/dpid/dpid.h:64: multiple definition of `sock_set';
47 # dpid.o:/build/dillo-3.0.5/dpid/dpid.h:64: first defined here
48+ env.NIX_CFLAGS_COMPILE = "-fcommon";
4950 meta = with lib; {
51 description = "Fork of Dillo, a lightweight web browser";
···31 ];
3233 # TODO: Remove after the next release (0.8.4 should work without this):
34- NIX_CFLAGS_COMPILE = [ "-I${harfbuzz.dev}/include/harfbuzz" ];
3536 meta = with lib; {
37 description = "Comprehensive suite for man in the middle attacks";
···31 ];
3233 # TODO: Remove after the next release (0.8.4 should work without this):
34+ env.NIX_CFLAGS_COMPILE = toString [ "-I${harfbuzz.dev}/include/harfbuzz" ];
3536 meta = with lib; {
37 description = "Comprehensive suite for man in the middle attacks";
···80 # guile warning
81 GUILE_AUTO_COMPILE="0";
8283- NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
84 # Needed with GCC 12 but breaks on darwin (with clang) or older gcc
85 "-Wno-error=use-after-free"
86- ];
8788 # `make check` target does not define its prerequisites but expects them to
89 # have already been built. The list of targets below was built through trial
···80 # guile warning
81 GUILE_AUTO_COMPILE="0";
8283+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
84 # Needed with GCC 12 but breaks on darwin (with clang) or older gcc
85 "-Wno-error=use-after-free"
86+ ]);
8788 # `make check` target does not define its prerequisites but expects them to
89 # have already been built. The list of targets below was built through trial
+1-1
pkgs/applications/office/kmymoney/default.nix
···30 ];
3132 # Hidden dependency that wasn't included in CMakeLists.txt:
33- NIX_CFLAGS_COMPILE = "-I${kitemmodels.dev}/include/KF5";
3435 nativeBuildInputs = [
36 doxygen extra-cmake-modules graphviz kdoctools
···30 ];
3132 # Hidden dependency that wasn't included in CMakeLists.txt:
33+ env.NIX_CFLAGS_COMPILE = "-I${kitemmodels.dev}/include/KF5";
3435 nativeBuildInputs = [
36 doxygen extra-cmake-modules graphviz kdoctools
···43 ];
4445 # To be able to find <Xft.h>
46- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-I${libXft.dev}/include/X11";
4748 # Binaries look for LuaFileSystem library (lfs.so) at runtime
49 postInstall = ''
···43 ];
4445 # To be able to find <Xft.h>
46+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-I${libXft.dev}/include/X11";
4748 # Binaries look for LuaFileSystem library (lfs.so) at runtime
49 postInstall = ''
···26 })
27 ];
2829- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
3031 meta = with lib; {
32 description = "Renders an image of the earth or other planets into the X root window";
···26 })
27 ];
2829+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
3031 meta = with lib; {
32 description = "Renders an image of the earth or other planets into the X root window";
···17 # Workaround build failure on -fno-common toolchains:
18 # ld: postscript.o:postscript.h:29: multiple definition of
19 # `postscript_params'; fped.o:postscript.h:29: first defined here
20- NIX_CFLAGS_COMPILE = "-fcommon";
2122 # This uses '/bin/bash', '/usr/local' and 'lex' by default
23 makeFlags = [
···17 # Workaround build failure on -fno-common toolchains:
18 # ld: postscript.o:postscript.h:29: multiple definition of
19 # `postscript_params'; fped.o:postscript.h:29: first defined here
20+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2122 # This uses '/bin/bash', '/usr/local' and 'lex' by default
23 makeFlags = [
···25 # Workaround build failure on -fno-common toolchains:
26 # ld: subtitles.o:src/coriander.h:110: multiple definition of
27 # `main_window'; main.o:src/coriander.h:110: first defined here
28- NIX_CFLAGS_COMPILE = "-fcommon";
2930 preConfigure = ''
31 cp ${automake}/share/automake-*/mkinstalldirs .
···25 # Workaround build failure on -fno-common toolchains:
26 # ld: subtitles.o:src/coriander.h:110: multiple definition of
27 # `main_window'; main.o:src/coriander.h:110: first defined here
28+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2930 preConfigure = ''
31 cp ${automake}/share/automake-*/mkinstalldirs .
+1-1
pkgs/applications/video/gnome-mplayer/default.nix
···26 # Workaround build failure on -fno-common toolchains:
27 # ld: mpris-interface.o:src/playlist.h:32: multiple definition of
28 # `plclose'; gui.o:src/playlist.h:32: first defined here
29- NIX_CFLAGS_COMPILE = "-fcommon";
3031 meta = with lib; {
32 description = "Gnome MPlayer, a simple GUI for MPlayer";
···26 # Workaround build failure on -fno-common toolchains:
27 # ld: mpris-interface.o:src/playlist.h:32: multiple definition of
28 # `plclose'; gui.o:src/playlist.h:32: first defined here
29+ env.NIX_CFLAGS_COMPILE = "-fcommon";
3031 meta = with lib; {
32 description = "Gnome MPlayer, a simple GUI for MPlayer";
···66 ];
6768 # src/ewmh/ewmh.cpp:67:28: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list
69- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-c++11-narrowing";
7071 installPhase = ''
72 runHook preInstall
···66 ];
6768 # src/ewmh/ewmh.cpp:67:28: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list
69+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-c++11-narrowing";
7071 installPhase = ''
72 runHook preInstall
···48 xorg.libXxf86vm
49 ];
5051- NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE";
5253 meta = with lib; {
54 description = "A fork of old GNOME Screensaver for purposes of providing an authentication prompt on wake";
···48 xorg.libXxf86vm
49 ];
5051+ env.NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE";
5253 meta = with lib; {
54 description = "A fork of old GNOME Screensaver for purposes of providing an authentication prompt on wake";
+1-1
pkgs/desktops/cdesktopenv/default.nix
···52 # Workaround build failure on -fno-common toolchains:
53 # ld: raima/startup.o:/build/cde-2.3.2/lib/DtSearch/raima/dbtype.h:408: multiple definition of
54 # `__SK__'; raima/alloc.o:/build/cde-2.3.2/lib/DtSearch/raima/dbtype.h:408: first defined here
55- NIX_CFLAGS_COMPILE = "-fcommon";
5657 makeFlags = [
58 "World"
···52 # Workaround build failure on -fno-common toolchains:
53 # ld: raima/startup.o:/build/cde-2.3.2/lib/DtSearch/raima/dbtype.h:408: multiple definition of
54 # `__SK__'; raima/alloc.o:/build/cde-2.3.2/lib/DtSearch/raima/dbtype.h:408: first defined here
55+ env.NIX_CFLAGS_COMPILE = "-fcommon";
5657 makeFlags = [
58 "World"
···148149 # Default for release buildtype but passed manually because
150 # we're using plain
151- NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS";
152153 postPatch = ''
154 for f in gnome-settings-daemon/codegen.py plugins/power/gsd-power-constants-update.pl meson_post_install.py; do
···148149 # Default for release buildtype but passed manually because
150 # we're using plain
151+ env.NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS";
152153 postPatch = ''
154 for f in gnome-settings-daemon/codegen.py plugins/power/gsd-power-constants-update.pl meson_post_install.py; do
···24 xfconf
25 ];
2627- NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
2829 meta = with lib; {
30 description = "A fast and lightweight picture-viewer for the Xfce desktop environment";
···24 xfconf
25 ];
2627+ env.NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
2829 meta = with lib; {
30 description = "A fast and lightweight picture-viewer for the Xfce desktop environment";
···1617 # Add a workarounf for -fno-common tollchains like upstream gcc-10.
18 # alan-3 is already fixed, but the backport is nontrivial.
19- NIX_CFLAGS_COMPILE = "-fcommon";
2021 installPhase = ''
22 mkdir -p $out/bin $out/share/alan2
···1617 # Add a workarounf for -fno-common tollchains like upstream gcc-10.
18 # alan-3 is already fixed, but the backport is nontrivial.
19+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2021 installPhase = ''
22 mkdir -p $out/bin $out/share/alan2
+1-1
pkgs/development/compilers/bs-platform/ocaml.nix
···10 # ld: libcamlrun.a(minor_gc.o):/build/ocaml/byterun/caml/major_gc.h:67: multiple definition of
11 # `caml_major_ring'; libcamlrun.a(stacks.o):/build/ocaml/byterun/caml/major_gc.h:67: first defined here
12 # Match -fcommon workaround in ocaml-4.06 itself.
13- NIX_CFLAGS_COMPILE = "-fcommon";
1415 buildPhase = ''
16 make -j9 world.opt
···10 # ld: libcamlrun.a(minor_gc.o):/build/ocaml/byterun/caml/major_gc.h:67: multiple definition of
11 # `caml_major_ring'; libcamlrun.a(stacks.o):/build/ocaml/byterun/caml/major_gc.h:67: first defined here
12 # Match -fcommon workaround in ocaml-4.06 itself.
13+ env.NIX_CFLAGS_COMPILE = "-fcommon";
1415 buildPhase = ''
16 make -j9 world.opt
+1-1
pkgs/development/compilers/chez-racket/shared.nix
···2930 enableParallelBuilding = true;
3132- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
3334 meta = {
35 description = "Fork of Chez Scheme for Racket";
···2930 enableParallelBuilding = true;
3132+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
3334 meta = {
35 description = "Fork of Chez Scheme for Racket";
+1-1
pkgs/development/compilers/chez/default.nix
···2021 enableParallelBuilding = true;
2223- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
2425 /*
26 ** We patch out a very annoying 'feature' in ./configure, which
···2021 enableParallelBuilding = true;
2223+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
2425 /*
26 ** We patch out a very annoying 'feature' in ./configure, which
···43 # -fcommon: workaround build failure on -fno-common toolchains:
44 # ld: ./libgclp.a(user_match.o):(.bss+0x18): multiple definition of
45 # `tf'; ./libpre_gcl.a(main.o):(.bss+0x326d90): first defined here
46- NIX_CFLAGS_COMPILE = "-fgnu89-inline -fcommon";
4748 meta = with lib; {
49 description = "GNU Common Lisp compiler working via GCC";
···43 # -fcommon: workaround build failure on -fno-common toolchains:
44 # ld: ./libgclp.a(user_match.o):(.bss+0x18): multiple definition of
45 # `tf'; ./libpre_gcl.a(main.o):(.bss+0x326d90): first defined here
46+ env.NIX_CFLAGS_COMPILE = "-fgnu89-inline -fcommon";
4748 meta = with lib; {
49 description = "GNU Common Lisp compiler working via GCC";
···7879 separateDebugInfo = true;
8081- NIX_CFLAGS_COMPILE = toString ([
82 # glibc 2.24 deprecated readdir_r so we need this
83 # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html
84 "-Wno-error=deprecated-declarations"
···7879 separateDebugInfo = true;
8081+ env.NIX_CFLAGS_COMPILE = toString ([
82 # glibc 2.24 deprecated readdir_r so we need this
83 # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html
84 "-Wno-error=deprecated-declarations"
+2-2
pkgs/development/compilers/openjdk/openjfx/15.nix
···31 JDK_HOME = ${openjdk11_headless.home}
32 '' + args.gradleProperties or "");
3334- NIX_CFLAGS_COMPILE = [
35 #avoids errors about deprecation of GTypeDebugFlags, GTimeVal, etc.
36 "-DGLIB_DISABLE_DEPRECATION_WARNINGS"
37···95 # -fcommon: gstreamer workaround for -fno-common toolchains:
96 # ld: gsttypefindelement.o:(.bss._gst_disable_registry_cache+0x0): multiple definition of
97 # `_gst_disable_registry_cache'; gst.o:(.bss._gst_disable_registry_cache+0x0): first defined here
98- NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS -fcommon";
99100 stripDebugList = [ "." ];
101
···31 JDK_HOME = ${openjdk11_headless.home}
32 '' + args.gradleProperties or "");
3334+ env.NIX_CFLAGS_COMPILE = toString [
35 #avoids errors about deprecation of GTypeDebugFlags, GTimeVal, etc.
36 "-DGLIB_DISABLE_DEPRECATION_WARNINGS"
37···95 # -fcommon: gstreamer workaround for -fno-common toolchains:
96 # ld: gsttypefindelement.o:(.bss._gst_disable_registry_cache+0x0): multiple definition of
97 # `_gst_disable_registry_cache'; gst.o:(.bss._gst_disable_registry_cache+0x0): first defined here
98+ env.NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS -fcommon";
99100 stripDebugList = [ "." ];
101
···17 # gcc-10. Otherwise build fails as:
18 # ld: libYap.a(pl-dtoa.o):/build/yap-6.3.3/H/pl-yap.h:230: multiple definition of `ATOM_';
19 # libYap.a(pl-buffer.o):/build/yap-6.3.3/H/pl-yap.h:230: first defined here
20- NIX_CFLAGS_COMPILE = "-fpermissive -fcommon";
2122 meta = {
23 # the linux 32 bit build fails.
···17 # gcc-10. Otherwise build fails as:
18 # ld: libYap.a(pl-dtoa.o):/build/yap-6.3.3/H/pl-yap.h:230: multiple definition of `ATOM_';
19 # libYap.a(pl-buffer.o):/build/yap-6.3.3/H/pl-yap.h:230: first defined here
20+ env.NIX_CFLAGS_COMPILE = "-fpermissive -fcommon";
2122 meta = {
23 # the linux 32 bit build fails.
···9 sha256 = "1bncxp5yxh9r1yrp04vvhfiva8livi1pwic7v8xj99q09zrwahvw";
10 };
1112- NIX_CFLAGS_COMPILE = "-Wno-error";
1314 meta = {
15 description = "Tool for AVR microcontrollers which can interface to many hardware in-system programmers";
···9 sha256 = "1bncxp5yxh9r1yrp04vvhfiva8livi1pwic7v8xj99q09zrwahvw";
10 };
1112+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
1314 meta = {
15 description = "Tool for AVR microcontrollers which can interface to many hardware in-system programmers";
···134135 # cc-rs insists on using -mabi=lp64 (soft-float) for riscv64,
136 # while we have a double-float toolchain
137- NIX_CFLAGS_COMPILE = lib.optionalString (with stdenv.hostPlatform; isRiscV && is64bit && lib.versionOlder version "91") "-mabi=lp64d";
138139 # https://github.com/NixOS/nixpkgs/issues/201254
140 NIX_LDFLAGS = if (with stdenv; isAarch64 && isLinux) then [ "-lgcc" ] else null;
···134135 # cc-rs insists on using -mabi=lp64 (soft-float) for riscv64,
136 # while we have a double-float toolchain
137+ env.NIX_CFLAGS_COMPILE = lib.optionalString (with stdenv.hostPlatform; isRiscV && is64bit && lib.versionOlder version "91") "-mabi=lp64d";
138139 # https://github.com/NixOS/nixpkgs/issues/201254
140 NIX_LDFLAGS = if (with stdenv; isAarch64 && isLinux) then [ "-lgcc" ] else null;
···19 # ld: ../common/ipp.o:(.bss+0x0): multiple definition of `lpath'; tglobals.o:(.bss+0x30): first defined here
20 # TODO: remove the workaround once upstream releases version past:
21 # https://sourceforge.net/p/unicon/unicon/ci/b1a65230233f3825d055aee913b4fdcf178a0eaf/
22- NIX_CFLAGS_COMPILE = "-fcommon";
2324 configurePhase = ''
25 case "$(uname -a | sed 's/ /_/g')" in
···19 # ld: ../common/ipp.o:(.bss+0x0): multiple definition of `lpath'; tglobals.o:(.bss+0x30): first defined here
20 # TODO: remove the workaround once upstream releases version past:
21 # https://sourceforge.net/p/unicon/unicon/ci/b1a65230233f3825d055aee913b4fdcf178a0eaf/
22+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2324 configurePhase = ''
25 case "$(uname -a | sed 's/ /_/g')" in
+1-1
pkgs/development/java-modules/jogl/default.nix
···35 # Workaround build failure on -fno-common toolchains:
36 # ld: ../obj/Bindingtest1p1Impl_JNI.o:(.bss+0x8): multiple definition of
37 # `unsigned_size_t_1'; ../obj/TK_Surface_JNI.o:(.bss+0x8): first defined here
38- NIX_CFLAGS_COMPILE = "-fcommon";
3940 buildPhase = ''
41 cp -r ${gluegen-src} $NIX_BUILD_TOP/gluegen
···35 # Workaround build failure on -fno-common toolchains:
36 # ld: ../obj/Bindingtest1p1Impl_JNI.o:(.bss+0x8): multiple definition of
37 # `unsigned_size_t_1'; ../obj/TK_Surface_JNI.o:(.bss+0x8): first defined here
38+ env.NIX_CFLAGS_COMPILE = "-fcommon";
3940 buildPhase = ''
41 cp -r ${gluegen-src} $NIX_BUILD_TOP/gluegen
···41 "LIBDIR=${placeholder "out"}/lib"
42 ];
4344- NIX_CFLAGS_COMPILE = "-I${kissfft}/include/kissfft";
4546 meta = with lib; {
47 description = "A C++ library of functions for DSP and Music Informatics purposes";
···41 "LIBDIR=${placeholder "out"}/lib"
42 ];
4344+ env.NIX_CFLAGS_COMPILE = "-I${kissfft}/include/kissfft";
4546 meta = with lib; {
47 description = "A C++ library of functions for DSP and Music Informatics purposes";
···29 # Do not build static libraries
30 cmakeFlags = [ "-DENABLE_STATIC=NO" ];
3132- NIX_CFLAGS_COMPILE = [
33 "-Wno-error=cast-function-type"
34 "-Wno-error=deprecated-declarations"
35 "-Wno-error=format-truncation"
···37 ] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
38 # Needed with GCC 12 but problematic with some old GCCs and probably clang
39 "-Wno-error=use-after-free"
40- ];
4142 propagatedBuildInputs = [ libantlr3c mbedtls_2 bctoolbox belr ];
43
···29 # Do not build static libraries
30 cmakeFlags = [ "-DENABLE_STATIC=NO" ];
3132+ env.NIX_CFLAGS_COMPILE = toString ([
33 "-Wno-error=cast-function-type"
34 "-Wno-error=deprecated-declarations"
35 "-Wno-error=format-truncation"
···37 ] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
38 # Needed with GCC 12 but problematic with some old GCCs and probably clang
39 "-Wno-error=use-after-free"
40+ ]);
4142 propagatedBuildInputs = [ libantlr3c mbedtls_2 bctoolbox belr ];
43
+2-2
pkgs/development/libraries/boringssl/default.nix
···30 export GOARCH=$(go env GOHOSTARCH)
31 '';
3233- NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
34 # Needed with GCC 12 but breaks on darwin (with clang)
35 "-Wno-error=stringop-overflow"
36- ];
3738 buildPhase = ''
39 ninjaBuildPhase
···30 export GOARCH=$(go env GOHOSTARCH)
31 '';
3233+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
34 # Needed with GCC 12 but breaks on darwin (with clang)
35 "-Wno-error=stringop-overflow"
36+ ]);
3738 buildPhase = ''
39 ninjaBuildPhase
+1-1
pkgs/development/libraries/bullet/default.nix
···47 "-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF"
48 ];
4950- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
51 "-Wno-error=argument-outside-range -Wno-error=c++11-narrowing";
5253 meta = with lib; {
···47 "-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF"
48 ];
4950+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
51 "-Wno-error=argument-outside-range -Wno-error=c++11-narrowing";
5253 meta = with lib; {
+1-1
pkgs/development/libraries/bzrtp/default.nix
···25 # Do not build static libraries
26 cmakeFlags = [ "-DENABLE_STATIC=NO" "-DCMAKE_C_FLAGS=-Wno-error=cast-function-type" ];
2728- NIX_CFLAGS_COMPILE = [
29 # Needed with GCC 12
30 "-Wno-error=stringop-overflow"
31 ];
···25 # Do not build static libraries
26 cmakeFlags = [ "-DENABLE_STATIC=NO" "-DCMAKE_C_FLAGS=-Wno-error=cast-function-type" ];
2728+ env.NIX_CFLAGS_COMPILE = toString [
29 # Needed with GCC 12
30 "-Wno-error=stringop-overflow"
31 ];
+1-1
pkgs/development/libraries/classads/default.nix
···18 ];
1920 # error: use of undeclared identifier 'finite'; did you mean 'isfinite'?
21- NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dfinite=isfinite";
2223 meta = {
24 homepage = "http://www.cs.wisc.edu/condor/classad/";
···18 ];
1920 # error: use of undeclared identifier 'finite'; did you mean 'isfinite'?
21+ env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dfinite=isfinite";
2223 meta = {
24 homepage = "http://www.cs.wisc.edu/condor/classad/";
+1-1
pkgs/development/libraries/clucene-core/2.x.nix
···47 # /build/clucene-core-2.3.3.4/build/bin/cl_test"
48 doCheck = false;
4950- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
5152 meta = with lib; {
53 description = "Core library for full-featured text search engine";
···47 # /build/clucene-core-2.3.3.4/build/bin/cl_test"
48 doCheck = false;
4950+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
5152 meta = with lib; {
53 description = "Core library for full-featured text search engine";
···115116 # TODO: Fix missing math symbols in gegl seamless clone.
117 # It only appears when we use packaged poly2tri-c instead of vendored one.
118- NIX_CFLAGS_COMPILE = "-lm";
119120 postPatch = ''
121 chmod +x tests/opencl/opencl_test.sh
···115116 # TODO: Fix missing math symbols in gegl seamless clone.
117 # It only appears when we use packaged poly2tri-c instead of vendored one.
118+ env.NIX_CFLAGS_COMPILE = "-lm";
119120 postPatch = ''
121 chmod +x tests/opencl/opencl_test.sh
···194 "-Dxattr=false"
195 ];
196197- NIX_CFLAGS_COMPILE = toString [
198 "-Wno-error=nonnull"
199 # Default for release buildtype but passed manually because
200 # we're using plain
···194 "-Dxattr=false"
195 ];
196197+ env.NIX_CFLAGS_COMPILE = toString [
198 "-Wno-error=nonnull"
199 # Default for release buildtype but passed manually because
200 # we're using plain
+15-13
pkgs/development/libraries/glibc/default.nix
···50 # invocation does not work.
51 hardeningDisable = [ "fortify" "pie" "stackprotector" ];
5253- NIX_CFLAGS_COMPILE = lib.concatStringsSep " "
54- (builtins.concatLists [
55- (lib.optionals withGd gdCflags)
56- # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
57- # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
58- (lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
59- (lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
60- # Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'"
61- # New warning as of GCC 9
62- # Same for musl: https://github.com/NixOS/nixpkgs/issues/78805
63- "-Wno-error=missing-attributes"
64- ])
65- ]);
006667 # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
68 # any program we run, because the gcc will have been placed at a new
···50 # invocation does not work.
51 hardeningDisable = [ "fortify" "pie" "stackprotector" ];
5253+ env = (previousAttrs.env or { }) // {
54+ NIX_CFLAGS_COMPILE = (previousAttrs.env.NIX_CFLAGS_COMPILE or "") + lib.concatStringsSep " "
55+ (builtins.concatLists [
56+ (lib.optionals withGd gdCflags)
57+ # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
58+ # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
59+ (lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
60+ (lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
61+ # Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'"
62+ # New warning as of GCC 9
63+ # Same for musl: https://github.com/NixOS/nixpkgs/issues/78805
64+ "-Wno-error=missing-attributes"
65+ ])
66+ ]);
67+ };
6869 # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
70 # any program we run, because the gcc will have been placed at a new
···40 substituteInPlace Makefile.am --replace stdc++ c++
41 '';
4243- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
44 "-D_XOPEN_SOURCE";
4546 # some packages want to link to the static tcmalloc_minimal
···40 substituteInPlace Makefile.am --replace stdc++ c++
41 '';
4243+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
44 "-D_XOPEN_SOURCE";
4546 # some packages want to link to the static tcmalloc_minimal
+1-1
pkgs/development/libraries/gpgme/default.nix
···104 # fit in the limit. https://github.com/NixOS/nix/pull/1085
105 ++ lib.optionals stdenv.isDarwin [ "--disable-gpg-test" ];
106107- NIX_CFLAGS_COMPILE = toString (
108 # qgpgme uses Q_ASSERT which retains build inputs at runtime unless
109 # debugging is disabled
110 lib.optional (qtbase != null) "-DQT_NO_DEBUG"
···104 # fit in the limit. https://github.com/NixOS/nix/pull/1085
105 ++ lib.optionals stdenv.isDarwin [ "--disable-gpg-test" ];
106107+ env.NIX_CFLAGS_COMPILE = toString (
108 # qgpgme uses Q_ASSERT which retains build inputs at runtime unless
109 # debugging is disabled
110 lib.optional (qtbase != null) "-DQT_NO_DEBUG"
···171172 # These are the defines that'd you'd get with --enable-debug=minimum (default).
173 # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
174- NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
175176 postPatch = ''
177 # See https://github.com/NixOS/nixpkgs/issues/132259
···171172 # These are the defines that'd you'd get with --enable-debug=minimum (default).
173 # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
174+ env.NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
175176 postPatch = ''
177 # See https://github.com/NixOS/nixpkgs/issues/132259
+1-1
pkgs/development/libraries/gtk/4.x.nix
···175176 # These are the defines that'd you'd get with --enable-debug=minimum (default).
177 # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
178- NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
179180 postPatch = ''
181 files=(
···175176 # These are the defines that'd you'd get with --enable-debug=minimum (default).
177 # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
178+ env.NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
179180 postPatch = ''
181 files=(
···11 # ld: textdlg.o:(.bss+0x0): multiple definition of `someString';
12 # configsettings.o:(.bss+0x0): first defined here
13 # TODO: the workaround can be removed once nixpkgs updates to 1.6.0.
14- NIX_CFLAGS_COMPILE = "-fcommon";
1516 preConfigure = ''
17 substituteInPlace configure.in \
···11 # ld: textdlg.o:(.bss+0x0): multiple definition of `someString';
12 # configsettings.o:(.bss+0x0): first defined here
13 # TODO: the workaround can be removed once nixpkgs updates to 1.6.0.
14+ env.NIX_CFLAGS_COMPILE = "-fcommon";
1516 preConfigure = ''
17 substituteInPlace configure.in \
···10 };
1112 # Darwin gets misdetected as Windows without this
13- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-D__unix";
1415 patches = [
16 (fetchpatch {
···10 };
1112 # Darwin gets misdetected as Windows without this
13+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-D__unix";
1415 patches = [
16 (fetchpatch {
···27 --replace "-Xlinker --version-script=$(VERSION_SCRIPT)" "-Xlinker"
28 '';
2930- NIX_CFLAGS_COMPILE = toString ([
31 "-UDEFAULT_EGL_VENDOR_CONFIG_DIRS"
32 # FHS paths are added so that non-NixOS applications can find vendor files.
33 "-DDEFAULT_EGL_VENDOR_CONFIG_DIRS=\"${addOpenGLRunpath.driverLink}/share/glvnd/egl_vendor.d:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d\""
···27 --replace "-Xlinker --version-script=$(VERSION_SCRIPT)" "-Xlinker"
28 '';
2930+ env.NIX_CFLAGS_COMPILE = toString ([
31 "-UDEFAULT_EGL_VENDOR_CONFIG_DIRS"
32 # FHS paths are added so that non-NixOS applications can find vendor files.
33 "-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
···1819 nativeBuildInputs = [ autoreconfHook ];
20 buildInputs = [ libpng openjpeg ];
21- NIX_CFLAGS_COMPILE = [ "-I${openjpeg.dev}/include/${openjpeg.incDir}" ];
2223 meta = with lib; {
24 description = "Library for manipulation of the Mac OS icns resource format";
···1819 nativeBuildInputs = [ autoreconfHook ];
20 buildInputs = [ libpng openjpeg ];
21+ env.NIX_CFLAGS_COMPILE = toString [ "-I${openjpeg.dev}/include/${openjpeg.incDir}" ];
2223 meta = with lib; {
24 description = "Library for manipulation of the Mac OS icns resource format";
+1-1
pkgs/development/libraries/libipfix/default.nix
···13 # `ht_globals'; collector.o:/build/libipfix_110209/collector/../libmisc/misc.h:111: first defined here
14 # TODO: drop the workaround when fix ix released:
15 # https://sourceforge.net/p/libipfix/code/ci/a501612c6b8ac6f2df16b366f7a92211382bae6b/
16- NIX_CFLAGS_COMPILE = "-fcommon";
1718 meta = with lib; {
19 homepage = "https://libipfix.sourceforge.net/";
···13 # `ht_globals'; collector.o:/build/libipfix_110209/collector/../libmisc/misc.h:111: first defined here
14 # TODO: drop the workaround when fix ix released:
15 # https://sourceforge.net/p/libipfix/code/ci/a501612c6b8ac6f2df16b366f7a92211382bae6b/
16+ env.NIX_CFLAGS_COMPILE = "-fcommon";
1718 meta = with lib; {
19 homepage = "https://libipfix.sourceforge.net/";
+1-2
pkgs/development/libraries/libiscsi/default.nix
···14 nativeBuildInputs = [ autoreconfHook ];
1516 # This problem is gone on libiscsi master.
17- NIX_CFLAGS_COMPILE =
18- lib.optional stdenv.hostPlatform.is32bit "-Wno-error=sign-compare";
1920 meta = with lib; {
21 description = "iscsi client library and utilities";
···14 nativeBuildInputs = [ autoreconfHook ];
1516 # This problem is gone on libiscsi master.
17+ env.NIX_CFLAGS_COMPILE = toString (lib.optional stdenv.hostPlatform.is32bit "-Wno-error=sign-compare");
01819 meta = with lib; {
20 description = "iscsi client library and utilities";
···18 "SYS=${stdenv.hostPlatform.uname.system}"
19 ];
2021- NIX_CFLAGS_COMPILE = "-Wno-error";
2223 meta = with lib; {
24 description = "Helper library to program the performance monitoring events";
···18 "SYS=${stdenv.hostPlatform.uname.system}"
19 ];
2021+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
2223 meta = with lib; {
24 description = "Helper library to program the performance monitoring events";
+1-1
pkgs/development/libraries/libpulsar/default.nix
···69 ++ defaultOptionals;
7071 # Needed for GCC on Linux
72- NIX_CFLAGS_COMPILE = [ "-Wno-error=return-type" ];
7374 cmakeFlags = [
75 "-DBUILD_TESTS=${enableCmakeFeature gtestSupport}"
···69 ++ defaultOptionals;
7071 # Needed for GCC on Linux
72+ env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=return-type" ];
7374 cmakeFlags = [
75 "-DBUILD_TESTS=${enableCmakeFeature gtestSupport}"
···1112 # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin
13 # upgrades to a newer SDK.
14- NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
1516 patches = [
17 (fetchpatch {
···1112 # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin
13 # upgrades to a newer SDK.
14+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
1516 patches = [
17 (fetchpatch {
···56 "-DMBGL_WITH_QT_HEADLESS=OFF"
57 ];
5859- NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
60 # Needed with GCC 12 but problematic with some old GCCs
61 "-Wno-error=use-after-free"
62- ];
6364 meta = with lib; {
65 description = "Open-source alternative to Mapbox GL Native";
···56 "-DMBGL_WITH_QT_HEADLESS=OFF"
57 ];
5859+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
60 # Needed with GCC 12 but problematic with some old GCCs
61 "-Wno-error=use-after-free"
62+ ]);
6364 meta = with lib; {
65 description = "Open-source alternative to Mapbox GL Native";
···14 ];
1516 # error: no member named 'finite' in the global namespace; did you mean simply 'finite'?
17- NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dfinite=isfinite";
1819 meta = {
20 homepage = "http://www.desy.de/~znagy/Site/NLOJet++.html";
···14 ];
1516 # error: no member named 'finite' in the global namespace; did you mean simply 'finite'?
17+ env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dfinite=isfinite";
1819 meta = {
20 homepage = "http://www.desy.de/~znagy/Site/NLOJet++.html";
+1-1
pkgs/development/libraries/pipewire/0.2.nix
···31 # Workaround build on gcc-10+ and clang11+:
32 # spa/plugins/bluez5/libspa-bluez5.so.p/bluez5-monitor.c.o:(.bss+0x0):
33 # multiple definition of `spa_a2dp_sink_factory'
34- NIX_CFLAGS_COMPILE = [ "-fcommon" ];
3536 mesonFlags = [
37 "-Ddocs=true"
···31 # Workaround build on gcc-10+ and clang11+:
32 # spa/plugins/bluez5/libspa-bluez5.so.p/bluez5-monitor.c.o:(.bss+0x0):
33 # multiple definition of `spa_a2dp_sink_factory'
34+ env.NIX_CFLAGS_COMPILE = toString [ "-fcommon" ];
3536 mesonFlags = [
37 "-Ddocs=true"
···17 buildInputs = [ curl zeromq czmq libsodium ];
1819 # https://github.com/kevinkreiser/prime_server/issues/95
20- NIX_CFLAGS_COMPILE = [ "-Wno-error=unused-variable" ];
2122 meta = with lib; {
23 description = "Non-blocking (web)server API for distributed computing and SOA based on zeromq";
···17 buildInputs = [ curl zeromq czmq libsodium ];
1819 # https://github.com/kevinkreiser/prime_server/issues/95
20+ env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=unused-variable" ];
2122 meta = with lib; {
23 description = "Non-blocking (web)server API for distributed computing and SOA based on zeromq";
···48 # ld: CMakeFiles/prom.dir/src/prom_process_stat.c.o:(.bss+0x0): multiple definition of
49 # `prom_process_start_time_seconds'; CMakeFiles/prom.dir/src/prom_collector.c.o:(.bss+0x0): first defined here
50 # Should be fixed in 1.2.0 and later: https://github.com/digitalocean/prometheus-client-c/pull/25
51- NIX_CFLAGS_COMPILE = "-fcommon";
5253 preConfigure = ''
54 cd ${subdir}
···48 # ld: CMakeFiles/prom.dir/src/prom_process_stat.c.o:(.bss+0x0): multiple definition of
49 # `prom_process_start_time_seconds'; CMakeFiles/prom.dir/src/prom_collector.c.o:(.bss+0x0): first defined here
50 # Should be fixed in 1.2.0 and later: https://github.com/digitalocean/prometheus-client-c/pull/25
51+ env.NIX_CFLAGS_COMPILE = "-fcommon";
5253 preConfigure = ''
54 cd ${subdir}
···198199 enableParallelBuilding = true;
200201- NIX_CFLAGS_COMPILE = toString (
202 # with gcc7 the warnings blow the log over Hydra's limit
203 [ "-Wno-expansion-to-defined" "-Wno-unused-local-typedefs" ]
204 ++ lib.optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
···198199 enableParallelBuilding = true;
200201+ env.NIX_CFLAGS_COMPILE = toString (
202 # with gcc7 the warnings blow the log over Hydra's limit
203 [ "-Wno-expansion-to-defined" "-Wno-unused-local-typedefs" ]
204 ++ lib.optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
···102103 # As zlib takes part in the stdenv building, we don't want references
104 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
105- NIX_CFLAGS_COMPILE = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc";
106107 # We don't strip on static cross-compilation because of reports that native
108 # stripping corrupted the target library; see commit 12e960f5 for the report.
···102103 # As zlib takes part in the stdenv building, we don't want references
104 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
105+ env.NIX_CFLAGS_COMPILE = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc";
106107 # We don't strip on static cross-compilation because of reports that native
108 # stripping corrupted the target library; see commit 12e960f5 for the report.
···44 nativeCheckInputs = [ docutils pytestCheckHook ];
4546 LLVM = llvm;
47- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${lib.getDev libcxx}/include/c++/v1";
4849 # test suite is very cpu intensive, only run small subset to ensure package is working as expected
50 pytestFlagsArray = [ "tests/test-sets.py" ];
···44 nativeCheckInputs = [ docutils pytestCheckHook ];
4546 LLVM = llvm;
47+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${lib.getDev libcxx}/include/c++/v1";
4849 # test suite is very cpu intensive, only run small subset to ensure package is working as expected
50 pytestFlagsArray = [ "tests/test-sets.py" ];
+1-1
pkgs/development/python-modules/kivy/default.nix
···59 # prefer pkg-config over hardcoded framework paths
60 USE_OSX_FRAMEWORKS = 0;
61 # work around python distutils compiling C++ with $CC (see issue #26709)
62- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
6364 postPatch = lib.optionalString stdenv.isLinux ''
65 substituteInPlace kivy/lib/mtdev.py \
···59 # prefer pkg-config over hardcoded framework paths
60 USE_OSX_FRAMEWORKS = 0;
61 # work around python distutils compiling C++ with $CC (see issue #26709)
62+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1";
6364 postPatch = lib.optionalString stdenv.isLinux ''
65 substituteInPlace kivy/lib/mtdev.py \
···30 # `_PyThreadState_Current'; src/_vmprof.o:src/vmprof_common.h:92: first defined here
31 # TODO: can be removed once next release contains:
32 # https://github.com/vmprof/vmprof-python/pull/203
33- NIX_CFLAGS_COMPILE = "-fcommon";
3435 meta = with lib; {
36 broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
···30 # `_PyThreadState_Current'; src/_vmprof.o:src/vmprof_common.h:92: first defined here
31 # TODO: can be removed once next release contains:
32 # https://github.com/vmprof/vmprof-python/pull/203
33+ env.NIX_CFLAGS_COMPILE = "-fcommon";
3435 meta = with lib; {
36 broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
···152153 # As binutils takes part in the stdenv building, we don't want references
154 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
155- NIX_CFLAGS_COMPILE =
156 if hostPlatform.isDarwin
157 then "-Wno-string-plus-int -Wno-deprecated-declarations"
158 else "-static-libgcc";
···152153 # As binutils takes part in the stdenv building, we don't want references
154 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
155+ env.NIX_CFLAGS_COMPILE =
156 if hostPlatform.isDarwin
157 then "-Wno-string-plus-int -Wno-deprecated-declarations"
158 else "-static-libgcc";
+1-1
pkgs/development/tools/misc/binutils/default.nix
···169170 # As binutils takes part in the stdenv building, we don't want references
171 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
172- NIX_CFLAGS_COMPILE =
173 if hostPlatform.isDarwin
174 then "-Wno-string-plus-int -Wno-deprecated-declarations"
175 else "-static-libgcc";
···169170 # As binutils takes part in the stdenv building, we don't want references
171 # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
172+ env.NIX_CFLAGS_COMPILE =
173 if hostPlatform.isDarwin
174 then "-Wno-string-plus-int -Wno-deprecated-declarations"
175 else "-static-libgcc";
···18 "--enable-frontends=conf,mconf,nconf"
19 ];
2021- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=format-security";
2223 meta = with lib; {
24 description = "Out of Linux tree packaging of the kconfig infrastructure";
···18 "--enable-frontends=conf,mconf,nconf"
19 ];
2021+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=format-security";
2223 meta = with lib; {
24 description = "Out of Linux tree packaging of the kconfig infrastructure";
+1-1
pkgs/development/tools/misc/rocgdb/default.nix
···40 ];
4142 # `-Wno-format-nonliteral` doesn't work
43- NIX_CFLAGS_COMPILE = "-Wno-error=format-security";
4445 passthru.updateScript = rocmUpdateScript {
46 name = finalAttrs.pname;
···40 ];
4142 # `-Wno-format-nonliteral` doesn't work
43+ env.NIX_CFLAGS_COMPILE = "-Wno-error=format-security";
4445 passthru.updateScript = rocmUpdateScript {
46 name = finalAttrs.pname;
···42 # these libraries are only searched for at runtime so we need to force-link them
43 NIX_LDFLAGS = "-lgvc -lmysqlclient -lecpg -lssl";
4445- NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql";
4647 qtWrapperArgs = [
48 ''--prefix PATH : ${lib.getBin graphviz}/bin''
···42 # these libraries are only searched for at runtime so we need to force-link them
43 NIX_LDFLAGS = "-lgvc -lmysqlclient -lecpg -lssl";
4445+ env.NIX_CFLAGS_COMPILE = "-L${libmysqlclient}/lib/mysql -I${libmysqlclient}/include/mysql";
4647 qtWrapperArgs = [
48 ''--prefix PATH : ${lib.getBin graphviz}/bin''
···2930 # The code needs an update for gcc-10:
31 # https://github.com/hackndev/0verkill/issues/7
32- NIX_CFLAGS_COMPILE = "-fcommon";
33 hardeningDisable = [ "all" ]; # Someday the upstream will update the code...
3435 meta = with lib; {
···2930 # The code needs an update for gcc-10:
31 # https://github.com/hackndev/0verkill/issues/7
32+ env.NIX_CFLAGS_COMPILE = "-fcommon";
33 hardeningDisable = [ "all" ]; # Someday the upstream will update the code...
3435 meta = with lib; {
···48 # Workaround build failure on -fno-common toolchains like upstream
49 # gcc-10. Otherwise build fails as:
50 # ld: mad.o:(.bss+0x233800): multiple definition of `tile_dict'; camera.o:(.bss+0x140): first defined here
51- NIX_CFLAGS_COMPILE = "-fcommon";
5253 NIX_LDFLAGS = "-lm";
54
···48 # Workaround build failure on -fno-common toolchains like upstream
49 # gcc-10. Otherwise build fails as:
50 # ld: mad.o:(.bss+0x233800): multiple definition of `tile_dict'; camera.o:(.bss+0x140): first defined here
51+ env.NIX_CFLAGS_COMPILE = "-fcommon";
5253 NIX_LDFLAGS = "-lm";
54
+1-1
pkgs/games/garden-of-coloured-lights/default.nix
···21 # Workaround build failure on -fno-common toolchains:
22 # ld: main.o:src/main.c:58: multiple definition of
23 # `eclass'; eclass.o:src/eclass.c:21: first defined here
24- NIX_CFLAGS_COMPILE = "-fcommon";
2526 meta = with lib; {
27 description = "Old-school vertical shoot-em-up / bullet hell";
···21 # Workaround build failure on -fno-common toolchains:
22 # ld: main.o:src/main.c:58: multiple definition of
23 # `eclass'; eclass.o:src/eclass.c:21: first defined here
24+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2526 meta = with lib; {
27 description = "Old-school vertical shoot-em-up / bullet hell";
+1-1
pkgs/games/gargoyle/default.nix
···39 # ld: build/linux.release/alan3/Location.o:(.bss+0x0): multiple definition of
40 # `logFile'; build/linux.release/alan3/act.o:(.bss+0x0): first defined here
41 # TODO: drop once updated to 2022.1 or later.
42- NIX_CFLAGS_COMPILE = "-fcommon";
4344 buildPhase = jamenv + "jam -j$NIX_BUILD_CORES";
45
···39 # ld: build/linux.release/alan3/Location.o:(.bss+0x0): multiple definition of
40 # `logFile'; build/linux.release/alan3/act.o:(.bss+0x0): first defined here
41 # TODO: drop once updated to 2022.1 or later.
42+ env.NIX_CFLAGS_COMPILE = "-fcommon";
4344 buildPhase = jamenv + "jam -j$NIX_BUILD_CORES";
45
···4243 # when using SDL_compat instead of SDL_classic, SDL_mixer isn't correctly
44 # detected, but there is no harm just specifying it
45- NIX_CFLAGS_COMPILE = [
46 "-I${lib.getDev SDL_mixer}/include/SDL"
47 ];
48
···4243 # when using SDL_compat instead of SDL_classic, SDL_mixer isn't correctly
44 # detected, but there is no harm just specifying it
45+ env.NIX_CFLAGS_COMPILE = toString [
46 "-I${lib.getDev SDL_mixer}/include/SDL"
47 ];
48
···28 ./cstddef.patch
29 ];
3031- NIX_CFLAGS_COMPILE = "-I${imagemagick6.dev}/include/ImageMagick";
3233 meta = {
34 description = "Really Slick Screensavers Port to GLX";
···28 ./cstddef.patch
29 ];
3031+ env.NIX_CFLAGS_COMPILE = "-I${imagemagick6.dev}/include/ImageMagick";
3233 meta = {
34 description = "Really Slick Screensavers Port to GLX";
+1-1
pkgs/misc/screensavers/xscreensaver/default.nix
···39 ];
4041 # "marbling" has NEON code that mixes signed and unsigned vector types
42- NIX_CFLAGS_COMPILE = lib.optional stdenv.hostPlatform.isAarch "-flax-vector-conversions";
4344 postInstall = ''
45 for bin in $out/bin/*; do
···39 ];
4041 # "marbling" has NEON code that mixes signed and unsigned vector types
42+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch "-flax-vector-conversions";
4344 postInstall = ''
45 for bin in $out/bin/*; do
+1-1
pkgs/os-specific/bsd/freebsd/default.nix
···717 flex byacc gencat rpcgen
718 ];
719 buildInputs = with self; [ include csu ];
720- NIX_CFLAGS_COMPILE = "-B${self.csu}/lib";
721722 makeFlags = [
723 "STRIP=-s" # flag to install, not command
···717 flex byacc gencat rpcgen
718 ];
719 buildInputs = with self; [ include csu ];
720+ env.NIX_CFLAGS_COMPILE = "-B${self.csu}/lib";
721722 makeFlags = [
723 "STRIP=-s" # flag to install, not command
···78 # Work around error from <stdio.h> on aarch64-darwin:
9 # error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
10- NIX_CFLAGS_COMPILE = "-Wno-error=undef-prefix -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
1112 # "spray" requires some files that aren't compiling correctly in xcbuild.
13 # "rtadvd" seems to fail with some missing constants.
···78 # Work around error from <stdio.h> on aarch64-darwin:
9 # error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
10+ env.NIX_CFLAGS_COMPILE = "-Wno-error=undef-prefix -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
1112 # "spray" requires some files that aren't compiling correctly in xcbuild.
13 # "rtadvd" seems to fail with some missing constants.
···38 '';
3940 # configure script is not finding the right path
41- NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ];
4243 installPhase = ''
44 make install SUBDIRS="lib daemon modules man" # all but samples
···38 '';
3940 # configure script is not finding the right path
41+ env.NIX_CFLAGS_COMPILE = toString [ "-I${libtirpc.dev}/include/tirpc" ];
4243 installPhase = ''
44 make install SUBDIRS="lib daemon modules man" # all but samples
···102 # gcc-10. Otherwise build fails as:
103 # ld: acpi/xsdt.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: multiple definition of
104 # `e820_types'; memory.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: first defined here
105- NIX_CFLAGS_COMPILE="-fcommon";
106107 makeFlags = [
108 "BINDIR=$(out)/bin"
···102 # gcc-10. Otherwise build fails as:
103 # ld: acpi/xsdt.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: multiple definition of
104 # `e820_types'; memory.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: first defined here
105+ env.NIX_CFLAGS_COMPILE = "-fcommon";
106107 makeFlags = [
108 "BINDIR=$(out)/bin"
+1-1
pkgs/os-specific/linux/systemd/default.nix
···630 --replace "SYSTEMD_CGROUP_AGENTS_PATH" "_SYSTEMD_CGROUP_AGENT_PATH"
631 '';
632633- NIX_CFLAGS_COMPILE = toString ([
634 # Can't say ${polkit.bin}/bin/pkttyagent here because that would
635 # lead to a cyclic dependency.
636 "-UPOLKIT_AGENT_BINARY_PATH"
···630 --replace "SYSTEMD_CGROUP_AGENTS_PATH" "_SYSTEMD_CGROUP_AGENT_PATH"
631 '';
632633+ env.NIX_CFLAGS_COMPILE = toString ([
634 # Can't say ${polkit.bin}/bin/pkttyagent here because that would
635 # lead to a cyclic dependency.
636 "-UPOLKIT_AGENT_BINARY_PATH"
···51 # ld: ...-libprom-0.1.1/include/prom_collector_registry.h:37: multiple definition of
52 # `PROM_COLLECTOR_REGISTRY_DEFAULT'; ...-libprom-0.1.1/include/prom_collector_registry.h:37: first defined here
53 # Should be fixed in libprom-1.2.0 and later: https://github.com/digitalocean/prometheus-client-c/pull/25
54- NIX_CFLAGS_COMPILE = "-fcommon";
5556 passthru.tests.coturn = nixosTests.coturn;
57
···51 # ld: ...-libprom-0.1.1/include/prom_collector_registry.h:37: multiple definition of
52 # `PROM_COLLECTOR_REGISTRY_DEFAULT'; ...-libprom-0.1.1/include/prom_collector_registry.h:37: first defined here
53 # Should be fixed in libprom-1.2.0 and later: https://github.com/digitalocean/prometheus-client-c/pull/25
54+ env.NIX_CFLAGS_COMPILE = "-fcommon";
5556 passthru.tests.coturn = nixosTests.coturn;
57
+1-1
pkgs/servers/dict/libmaa.nix
···12 buildInputs = [ libtool ];
13 # configureFlags = [ "--datadir=/run/current-system/share/dictd" ];
1415- NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation";
1617 meta = with lib; {
18 description = "Dict protocol server and client";
···12 buildInputs = [ libtool ];
13 # configureFlags = [ "--datadir=/run/current-system/share/dictd" ];
1415+ env.NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation";
1617 meta = with lib; {
18 description = "Dict protocol server and client";
···48 "-DAPACHE_MODULE_DIR=${placeholder "out"}/modules"
49 ];
5051- NIX_CFLAGS_COMPILE = "-std=c99";
5253 meta = with lib; {
54 description = "A server that implements tile caching to speed up access to WMS layers";
···48 "-DAPACHE_MODULE_DIR=${placeholder "out"}/modules"
49 ];
5051+ env.NIX_CFLAGS_COMPILE = "-std=c99";
5253 meta = with lib; {
54 description = "A server that implements tile caching to speed up access to WMS layers";
···68 # gcc-10. Otherwise build fails as:
69 # ld: .libs/hash_drv.o:/build/dspam-3.10.2/src/util.h:96: multiple definition of `verified_user';
70 # .libs/libdspam.o:/build/dspam-3.10.2/src/util.h:96: first defined here
71- NIX_CFLAGS_COMPILE = "-fcommon";
7273 # Lots of things are hardwired to paths like sysconfdir. That's why we install with both "prefix" and "DESTDIR"
74 # and fix directory structure manually after that.
···68 # gcc-10. Otherwise build fails as:
69 # ld: .libs/hash_drv.o:/build/dspam-3.10.2/src/util.h:96: multiple definition of `verified_user';
70 # .libs/libdspam.o:/build/dspam-3.10.2/src/util.h:96: first defined here
71+ env.NIX_CFLAGS_COMPILE = "-fcommon";
7273 # Lots of things are hardwired to paths like sysconfdir. That's why we install with both "prefix" and "DESTDIR"
74 # and fix directory structure manually after that.
+1-1
pkgs/servers/mail/mlmmj/default.nix
···20 # gcc-10. Otherwise build fails as:
21 # ld: getlistdelim.o:/build/mlmmj-1.3.0/src/../include/mlmmj.h:84: multiple definition of
22 # `subtype_strs'; mlmmj-send.o:/build/mlmmj-1.3.0/src/../include/mlmmj.h:84: first defined here
23- NIX_CFLAGS_COMPILE = "-fcommon";
2425 postInstall = ''
26 # grab all documentation files
···20 # gcc-10. Otherwise build fails as:
21 # ld: getlistdelim.o:/build/mlmmj-1.3.0/src/../include/mlmmj.h:84: multiple definition of
22 # `subtype_strs'; mlmmj-send.o:/build/mlmmj-1.3.0/src/../include/mlmmj.h:84: first defined here
23+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2425 postInstall = ''
26 # grab all documentation files
···3233 hardeningEnable = [ "pie" ];
3435- NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [ "-std=c11" ];
3637 # darwin currently lacks a pure `pgrep` which is extensively used here
38 doCheck = !stdenv.isDarwin;
···3233 hardeningEnable = [ "pie" ];
3435+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-std=c11" ]);
3637 # darwin currently lacks a pure `pgrep` which is extensively used here
38 doCheck = !stdenv.isDarwin;
+1-1
pkgs/servers/openbgpd/default.nix
···39 # gcc-10. Otherwise build fails as:
40 # ld: bgpd-rde_peer.o:/build/source/src/bgpd/bgpd.h:133: multiple definition of `bgpd_process';
41 # bgpd-bgpd.o:/build/source/src/bgpd/bgpd.h:133: first defined here
42- NIX_CFLAGS_COMPILE = "-fcommon";
4344 meta = with lib; {
45 description =
···39 # gcc-10. Otherwise build fails as:
40 # ld: bgpd-rde_peer.o:/build/source/src/bgpd/bgpd.h:133: multiple definition of `bgpd_process';
41 # bgpd-bgpd.o:/build/source/src/bgpd/bgpd.h:133: first defined here
42+ env.NIX_CFLAGS_COMPILE = "-fcommon";
4344 meta = with lib; {
45 description =
···3435 nativeBuildInputs = [ protobuf rustPlatform.bindgenHook pkg-config ];
3637- NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-faligned-allocation";
3839 meta = with lib; {
40 description = "Vector Search Engine for the next generation of AI applications";
···3435 nativeBuildInputs = [ protobuf rustPlatform.bindgenHook pkg-config ];
3637+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-faligned-allocation";
3839 meta = with lib; {
40 description = "Vector Search Engine for the next generation of AI applications";
+1-1
pkgs/servers/sip/freeswitch/default.nix
···123124 enableParallelBuilding = true;
125126- NIX_CFLAGS_COMPILE = "-Wno-error";
127128 # Using c++14 because of build error
129 # gsm_at.h:94:32: error: ISO C++17 does not allow dynamic exception specifications
···123124 enableParallelBuilding = true;
125126+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
127128 # Using c++14 because of build error
129 # gsm_at.h:94:32: error: ISO C++17 does not allow dynamic exception specifications
···113114 # Assumption: the first output* variable to be configured is
115 # _overrideFirst outputDev "dev" "out"
116- expectedMsg = "_assignFirst: could not find a non-empty variable to assign to outputDev. The following variables were all unset or empty: dev out.";
117 } ''
118 grep -F "$expectedMsg" $result/testBuildFailure.log >/dev/null
119 touch $out
···113114 # Assumption: the first output* variable to be configured is
115 # _overrideFirst outputDev "dev" "out"
116+ 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";
117 } ''
118 grep -F "$expectedMsg" $result/testBuildFailure.log >/dev/null
119 touch $out
+1-1
pkgs/test/stdenv/hooks.nix
···115 name = "test-reproducible-builds";
116 buildCommand = ''
117 # can't be tested more precisely because the value of random-seed changes depending on the output
118- [[ $NIX_CFLAGS_COMPILE =~ "-frandom-seed=" ]]
119 touch $out
120 '';
121 };
···115 name = "test-reproducible-builds";
116 buildCommand = ''
117 # can't be tested more precisely because the value of random-seed changes depending on the output
118+ [[ $env.NIX_CFLAGS_COMPILE =~ "-frandom-seed=" ]]
119 touch $out
120 '';
121 };
···156 ]);
157158 # error: 'import_cairo' defined but not used
159- NIX_CFLAGS_COMPILE = "-Wno-error=unused-function";
160161 setupPyBuildFlags = [
162 "--with-Xdummy"
···156 ]);
157158 # error: 'import_cairo' defined but not used
159+ env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-function";
160161 setupPyBuildFlags = [
162 "--with-Xdummy"
+1-1
pkgs/tools/admin/adtool/default.nix
···23 # gcc-10. Otherwise build fails as:
24 # ld: ../../src/lib/libactive_directory.a(active_directory.o):/build/adtool-1.3.3/src/lib/active_directory.h:31:
25 # multiple definition of `system_config_file'; adtool.o:/build/adtool-1.3.3/src/tools/../../src/lib/active_directory.h:31: first defined here
26- NIX_CFLAGS_COMPILE = "-fcommon";
2728 enableParallelBuilding = true;
29
···23 # gcc-10. Otherwise build fails as:
24 # ld: ../../src/lib/libactive_directory.a(active_directory.o):/build/adtool-1.3.3/src/lib/active_directory.h:31:
25 # multiple definition of `system_config_file'; adtool.o:/build/adtool-1.3.3/src/tools/../../src/lib/active_directory.h:31: first defined here
26+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2728 enableParallelBuilding = true;
29
···1920 makeFlags = [ "PREFIX=$(out)" ];
2122- NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE";
2324 meta = {
25 description = "A simple and lightweight volume icon that sits in your system tray";
···1920 makeFlags = [ "PREFIX=$(out)" ];
2122+ env.NIX_CFLAGS_COMPILE = "-D_POSIX_C_SOURCE";
2324 meta = {
25 description = "A simple and lightweight volume icon that sits in your system tray";
···21 '';
2223 # work around a problem related to gtk3 updates
24- NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
2526 postInstall = "";
27
···21 '';
2223 # work around a problem related to gtk3 updates
24+ env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
2526 postInstall = "";
27
+1-1
pkgs/tools/backup/btar/default.nix
···20 # gcc-10. Otherwise build fails as:
21 # ld: listindex.o:/build/btar-1.1.1/loadindex.h:12: multiple definition of
22 # `ptr'; main.o:/build/btar-1.1.1/loadindex.h:12: first defined here
23- NIX_CFLAGS_COMPILE = "-fcommon";
2425 buildInputs = [ librsync ];
26
···20 # gcc-10. Otherwise build fails as:
21 # ld: listindex.o:/build/btar-1.1.1/loadindex.h:12: multiple definition of
22 # `ptr'; main.o:/build/btar-1.1.1/loadindex.h:12: first defined here
23+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2425 buildInputs = [ librsync ];
26
+1-1
pkgs/tools/backup/zbackup/default.nix
···2223 # zbackup uses dynamic exception specifications which are not
24 # allowed in C++17
25- NIX_CFLAGS_COMPILE = [ "--std=c++14" ];
2627 buildInputs = [ zlib openssl protobuf lzo libunwind ];
28 nativeBuildInputs = [ cmake protobufc ];
···2223 # zbackup uses dynamic exception specifications which are not
24 # allowed in C++17
25+ env.NIX_CFLAGS_COMPILE = toString [ "--std=c++14" ];
2627 buildInputs = [ zlib openssl protobuf lzo libunwind ];
28 nativeBuildInputs = [ cmake protobufc ];
+1-1
pkgs/tools/cd-dvd/cdrdao/default.nix
···27 '';
2829 # Needed on gcc >= 6.
30- NIX_CFLAGS_COMPILE = "-Wno-narrowing";
3132 meta = with lib; {
33 description = "A tool for recording audio or data CD-Rs in disk-at-once (DAO) mode";
···27 '';
2829 # Needed on gcc >= 6.
30+ env.NIX_CFLAGS_COMPILE = "-Wno-narrowing";
3132 meta = with lib; {
33 description = "A tool for recording audio or data CD-Rs in disk-at-once (DAO) mode";
···24 # gcc-10. Otherwise build fails as:
25 # ld: CMakeFiles/rbal.dir/src/statsearchbl.cpp.o:(.bss+0x0):
26 # multiple definition of `minrow'; CMakeFiles/rbal.dir/src/linban.c.o:(.bss+0xa3a): first defined here
27- NIX_CFLAGS_COMPILE = "-fcommon";
2829 postPatch = ''
30 rm cuneiform_src/Kern/hhh/tigerh/h/strings.h
···24 # gcc-10. Otherwise build fails as:
25 # ld: CMakeFiles/rbal.dir/src/statsearchbl.cpp.o:(.bss+0x0):
26 # multiple definition of `minrow'; CMakeFiles/rbal.dir/src/linban.c.o:(.bss+0xa3a): first defined here
27+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2829 postPatch = ''
30 rm cuneiform_src/Kern/hhh/tigerh/h/strings.h
+1-1
pkgs/tools/graphics/fim/default.nix
···35 ++ optional jpegSupport libjpeg
36 ++ optional pngSupport libpng;
3738- NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-lSDL";
3940 meta = with lib; {
41 description = "A lightweight, highly customizable and scriptable image viewer";
···35 ++ optional jpegSupport libjpeg
36 ++ optional pngSupport libpng;
3738+ env.NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-lSDL";
3940 meta = with lib; {
41 description = "A lightweight, highly customizable and scriptable image viewer";
+1-1
pkgs/tools/graphics/hobbits/default.nix
···2627 cmakeFlags = [ "-DUSE_SYSTEM_PFFFT=ON" ];
2829- NIX_CFLAGS_COMPILE = lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing";
3031 meta = with lib; {
32 description = "A multi-platform GUI for bit-based analysis, processing, and visualization";
···2627 cmakeFlags = [ "-DUSE_SYSTEM_PFFFT=ON" ];
2829+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing";
3031 meta = with lib; {
32 description = "A multi-platform GUI for bit-based analysis, processing, and visualization";
+1-1
pkgs/tools/graphics/icoutils/default.nix
···1516 # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin
17 # upgrades to a newer SDK.
18- NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
1920 patchPhase = ''
21 patchShebangs extresso/extresso
···1516 # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin
17 # upgrades to a newer SDK.
18+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
1920 patchPhase = ''
21 patchShebangs extresso/extresso
+1-1
pkgs/tools/graphics/ifm/default.nix
···16 # Workaround build failure on -fno-common toolchains:
17 # ld: libvars.a(vars-freeze-lex.o):src/libvars/vars-freeze-lex.l:23:
18 # multiple definition of `line_number'; ifm-main.o:src/ifm-main.c:46: first defined here
19- NIX_CFLAGS_COMPILE = "-fcommon";
2021 enableParallelBuilding = false; # ifm-scan.l:16:10: fatal error: ifm-parse.h: No such file or directory
22
···16 # Workaround build failure on -fno-common toolchains:
17 # ld: libvars.a(vars-freeze-lex.o):src/libvars/vars-freeze-lex.l:23:
18 # multiple definition of `line_number'; ifm-main.o:src/ifm-main.c:46: first defined here
19+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2021 enableParallelBuilding = false; # ifm-scan.l:16:10: fatal error: ifm-parse.h: No such file or directory
22
···149150 NIX_LDFLAGS = optionalString selinuxSupport "-lsepol";
151 FORCE_UNSAFE_CONFIGURE = optionalString stdenv.hostPlatform.isSunOS "1";
152- NIX_CFLAGS_COMPILE = []
153 # Work around a bogus warning in conjunction with musl.
154 ++ optional stdenv.hostPlatform.isMusl "-Wno-error"
155- ++ optional stdenv.hostPlatform.isAndroid "-D__USE_FORTIFY_LEVEL=0";
156157 # Works around a bug with 8.26:
158 # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually). Stop.
···149150 NIX_LDFLAGS = optionalString selinuxSupport "-lsepol";
151 FORCE_UNSAFE_CONFIGURE = optionalString stdenv.hostPlatform.isSunOS "1";
152+ env.NIX_CFLAGS_COMPILE = toString ([]
153 # Work around a bogus warning in conjunction with musl.
154 ++ optional stdenv.hostPlatform.isMusl "-Wno-error"
155+ ++ optional stdenv.hostPlatform.isAndroid "-D__USE_FORTIFY_LEVEL=0");
156157 # Works around a bug with 8.26:
158 # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually). Stop.
+1-1
pkgs/tools/misc/edk2-uefi-shell/default.nix
···14 ++ lib.optionals stdenv.cc.isClang [ llvmPackages.bintools llvmPackages.llvm ];
15 strictDeps = true;
1617- NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [ "-fno-pic" "-Qunused-arguments" ];
1819 # Set explicitly to use Python 3 from nixpkgs. Otherwise, the build system will detect and try to
20 # use `/usr/bin/python3` on Darwin when sandboxing is disabled.
···14 ++ lib.optionals stdenv.cc.isClang [ llvmPackages.bintools llvmPackages.llvm ];
15 strictDeps = true;
1617+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-fno-pic" "-Qunused-arguments" ]);
1819 # Set explicitly to use Python 3 from nixpkgs. Otherwise, the build system will detect and try to
20 # use `/usr/bin/python3` on Darwin when sandboxing is disabled.
+2-2
pkgs/tools/misc/fluent-bit/default.nix
···19 cmakeFlags = [ "-DFLB_METRICS=ON" "-DFLB_HTTP_SERVER=ON" "-DFLB_OUT_PGSQL=ON" ];
2021 # _FORTIFY_SOURCE requires compiling with optimization (-O)
22- NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-O" ]
23 # Workaround build failure on -fno-common toolchains:
24 # ld: /monkey/mk_tls.h:81: multiple definition of `mk_tls_server_timeout';
25 # flb_config.c.o:include/monkey/mk_tls.h:81: first defined here
26 # TODO: drop when upstream gets a fix for it:
27 # https://github.com/fluent/fluent-bit/issues/5537
28- ++ lib.optionals stdenv.isDarwin [ "-fcommon" ];
2930 outputs = [ "out" "dev" ];
31
···19 cmakeFlags = [ "-DFLB_METRICS=ON" "-DFLB_HTTP_SERVER=ON" "-DFLB_OUT_PGSQL=ON" ];
2021 # _FORTIFY_SOURCE requires compiling with optimization (-O)
22+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [ "-O" ]
23 # Workaround build failure on -fno-common toolchains:
24 # ld: /monkey/mk_tls.h:81: multiple definition of `mk_tls_server_timeout';
25 # flb_config.c.o:include/monkey/mk_tls.h:81: first defined here
26 # TODO: drop when upstream gets a fix for it:
27 # https://github.com/fluent/fluent-bit/issues/5537
28+ ++ lib.optionals stdenv.isDarwin [ "-fcommon" ]);
2930 outputs = [ "out" "dev" ];
31
+1-1
pkgs/tools/misc/fontforge/default.nix
···46 '';
4748 # do not use x87's 80-bit arithmetic, rouding errors result in very different font binaries
49- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-msse2 -mfpmath=sse";
5051 nativeBuildInputs = [ pkg-config cmake ];
52 buildInputs = [
···46 '';
4748 # do not use x87's 80-bit arithmetic, rouding errors result in very different font binaries
49+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-msse2 -mfpmath=sse";
5051 nativeBuildInputs = [ pkg-config cmake ];
52 buildInputs = [
+1-1
pkgs/tools/misc/grub/2.0x.nix
···339 separateDebugInfo = !xenSupport;
340341 # Work around a bug in the generated flex lexer (upstream flex bug?)
342- NIX_CFLAGS_COMPILE = "-Wno-error";
343344 preConfigure =
345 '' for i in "tests/util/"*.in
···339 separateDebugInfo = !xenSupport;
340341 # Work around a bug in the generated flex lexer (upstream flex bug?)
342+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
343344 preConfigure =
345 '' for i in "tests/util/"*.in
+1-1
pkgs/tools/misc/grub/trusted.nix
···6263 hardeningDisable = [ "stackprotector" "pic" ];
6465- NIX_CFLAGS_COMPILE = "-Wno-error"; # generated code redefines yyfree
6667 preConfigure =
68 '' for i in "tests/util/"*.in
···6263 hardeningDisable = [ "stackprotector" "pic" ];
6465+ env.NIX_CFLAGS_COMPILE = "-Wno-error"; # generated code redefines yyfree
6667 preConfigure =
68 '' for i in "tests/util/"*.in
+1-1
pkgs/tools/misc/gtklp/default.nix
···34 # Workaround build failure on -fno-common toolchains:
35 # ld: libgtklp.a(libgtklp.o):libgtklp/libgtklp.h:83: multiple definition of `progressBar';
36 # file.o:libgtklp/libgtklp.h:83: first defined here
37- NIX_CFLAGS_COMPILE = "-fcommon";
3839 preConfigure = ''
40 substituteInPlace include/defaults.h --replace "netscape" "firefox"
···34 # Workaround build failure on -fno-common toolchains:
35 # ld: libgtklp.a(libgtklp.o):libgtklp/libgtklp.h:83: multiple definition of `progressBar';
36 # file.o:libgtklp/libgtklp.h:83: first defined here
37+ env.NIX_CFLAGS_COMPILE = "-fcommon";
3839 preConfigure = ''
40 substituteInPlace include/defaults.h --replace "netscape" "firefox"
+1-1
pkgs/tools/misc/ipxe/default.nix
···51 # not possible due to assembler code
52 hardeningDisable = [ "pic" "stackprotector" ];
5354- NIX_CFLAGS_COMPILE = "-Wno-error";
5556 makeFlags =
57 [ "ECHO_E_BIN_ECHO=echo" "ECHO_E_BIN_ECHO_E=echo" # No /bin/echo here.
···51 # not possible due to assembler code
52 hardeningDisable = [ "pic" "stackprotector" ];
5354+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
5556 makeFlags =
57 [ "ECHO_E_BIN_ECHO=echo" "ECHO_E_BIN_ECHO_E=echo" # No /bin/echo here.
···66 nativeCheckInputs = [ which ]; # used for tests with checkFlags = [ "DEBUG=true" ];
67 checkTarget = "tests";
6869- NIX_CFLAGS_COMPILE = "-Wno-error";
7071 meta = with lib; {
72 description = "Lightweight implementation of some Unix command line utilities";
···66 nativeCheckInputs = [ which ]; # used for tests with checkFlags = [ "DEBUG=true" ];
67 checkTarget = "tests";
6869+ env.NIX_CFLAGS_COMPILE = "-Wno-error";
7071 meta = with lib; {
72 description = "Lightweight implementation of some Unix command line utilities";
···16 # Workaround build failure on -fno-common toolchains like upstream
17 # gcc-10. Otherwise build fails as:
18 # ld: netmap.o:(.bss+0x20): multiple definition of `sizecheck'; iouyap.o:(.bss+0x20): first defined here
19- NIX_CFLAGS_COMPILE = "-fcommon";
2021 installPhase = ''
22 install -D -m555 iouyap $out/bin/iouyap;
···16 # Workaround build failure on -fno-common toolchains like upstream
17 # gcc-10. Otherwise build fails as:
18 # ld: netmap.o:(.bss+0x20): multiple definition of `sizecheck'; iouyap.o:(.bss+0x20): first defined here
19+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2021 installPhase = ''
22 install -D -m555 iouyap $out/bin/iouyap;
+1-1
pkgs/tools/networking/jwhois/default.nix
···21 # Work around error from <stdio.h> on aarch64-darwin:
22 # error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
23 # TODO: this should probably be fixed at a lower level than this?
24- NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-Wno-undef-prefix";
2526 meta = {
27 description = "A client for the WHOIS protocol allowing you to query the owner of a domain name";
···21 # Work around error from <stdio.h> on aarch64-darwin:
22 # error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
23 # TODO: this should probably be fixed at a lower level than this?
24+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-undef-prefix";
2526 meta = {
27 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
···18 this is necessary for dsniff to compile; otherwise g_thread_init is a missing
19 symbol when linking (?!?)
20 */
21- NIX_CFLAGS_COMPILE="-Dg_thread_init= ";
2223 meta = with lib; {
24 description = "An E-component of Network Intrusion Detection System which emulates the IP stack of Linux 2.0.x";
···18 this is necessary for dsniff to compile; otherwise g_thread_init is a missing
19 symbol when linking (?!?)
20 */
21+ env.NIX_CFLAGS_COMPILE = "-Dg_thread_init= ";
2223 meta = with lib; {
24 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
···36 # ld: liblsh.a(unix_user.o):/build/lsh-2.0.4/src/server_userauth.h:108: multiple definition of
37 # `server_userauth_none_preauth'; lshd.o:/build/lsh-2.0.4/src/server_userauth.h:108: first defined here
38 # Should be present in upcoming 2.1 release.
39- NIX_CFLAGS_COMPILE = "-std=gnu90 -fcommon";
4041 buildInputs = [ gperf guile gmp zlib liboop readline gnum4 pam libxcrypt ];
42
···36 # ld: liblsh.a(unix_user.o):/build/lsh-2.0.4/src/server_userauth.h:108: multiple definition of
37 # `server_userauth_none_preauth'; lshd.o:/build/lsh-2.0.4/src/server_userauth.h:108: first defined here
38 # Should be present in upcoming 2.1 release.
39+ env.NIX_CFLAGS_COMPILE = "-std=gnu90 -fcommon";
4041 buildInputs = [ gperf guile gmp zlib liboop readline gnum4 pam libxcrypt ];
42
+1-1
pkgs/tools/networking/ncftp/default.nix
···17 # gcc-10. Otherwise build fails as:
18 # ld: bookmark.o: (.bss+0x20): multiple definition of `gBm';
19 # gpshare.o:(.bss+0x0): first defined here
20- NIX_CFLAGS_COMPILE = "-fcommon";
2122 preConfigure = ''
23 find -name Makefile.in | xargs sed -i '/^TMPDIR=/d'
···17 # gcc-10. Otherwise build fails as:
18 # ld: bookmark.o: (.bss+0x20): multiple definition of `gBm';
19 # gpshare.o:(.bss+0x0): first defined here
20+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2122 preConfigure = ''
23 find -name Makefile.in | xargs sed -i '/^TMPDIR=/d'
···20 # ld: CMakeFiles/oonf_dlep_proxy.dir/router/dlep_router_session.c.o:(.bss+0x0):
21 # multiple definition of `LOG_DLEP_ROUTER'; CMakeFiles/oonf_dlep_proxy.dir/router/dlep_router.c.o:(.bss+0x0): first defined here
22 # Can be removed once release with https://github.com/OLSR/OONF/pull/40 is out.
23- NIX_CFLAGS_COMPILE = "-fcommon";
2425 cmakeFlags = [
26 "-DOONF_NO_WERROR=yes"
···20 # ld: CMakeFiles/oonf_dlep_proxy.dir/router/dlep_router_session.c.o:(.bss+0x0):
21 # multiple definition of `LOG_DLEP_ROUTER'; CMakeFiles/oonf_dlep_proxy.dir/router/dlep_router.c.o:(.bss+0x0): first defined here
22 # Can be removed once release with https://github.com/OLSR/OONF/pull/40 is out.
23+ env.NIX_CFLAGS_COMPILE = "-fcommon";
2425 cmakeFlags = [
26 "-DOONF_NO_WERROR=yes"
···14 mkdir -p "$out/bin" "$out/share/man/man1"
15 '';
1617- NIX_CFLAGS_COMPILE=" -Wno-error ";
1819 meta = with lib; {
20 description = "Attachment extractor for MIME messages";
···14 mkdir -p "$out/bin" "$out/share/man/man1"
15 '';
1617+ env.NIX_CFLAGS_COMPILE = " -Wno-error ";
1819 meta = with lib; {
20 description = "Attachment extractor for MIME messages";
+1-1
pkgs/tools/networking/sipsak/default.nix
···14 # gcc-10. Otherwise build fails as:
15 # ld: transport.o:/build/source/sipsak.h:323: multiple definition of
16 # `address'; auth.o:/build/source/sipsak.h:323: first defined here
17- NIX_CFLAGS_COMPILE = "-std=gnu89 -fcommon";
1819 src = fetchFromGitHub {
20 owner = "sipwise";
···14 # gcc-10. Otherwise build fails as:
15 # ld: transport.o:/build/source/sipsak.h:323: multiple definition of
16 # `address'; auth.o:/build/source/sipsak.h:323: first defined here
17+ env.NIX_CFLAGS_COMPILE = "-std=gnu89 -fcommon";
1819 src = fetchFromGitHub {
20 owner = "sipwise";
+2-2
pkgs/tools/networking/termscp/default.nix
···41 # Needed to get openssl-sys to use pkg-config.
42 OPENSSL_NO_VENDOR = 1;
4344- NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
45 "-framework" "AppKit"
46- ];
4748 # Requires network access
49 doCheck = false;
···41 # Needed to get openssl-sys to use pkg-config.
42 OPENSSL_NO_VENDOR = 1;
4344+ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
45 "-framework" "AppKit"
46+ ]);
4748 # Requires network access
49 doCheck = false;
+1-1
pkgs/tools/networking/tftp-hpa/default.nix
···12 # gcc-10. Otherwise build fails as:
13 # ld: main.o:/build/tftp-hpa-5.2/tftp/main.c:98: multiple definition of
14 # `toplevel'; tftp.o:/build/tftp-hpa-5.2/tftp/tftp.c:51: first defined here
15- NIX_CFLAGS_COMPILE="-fcommon";
1617 meta = with lib; {
18 description = "TFTP tools - a lot of fixes on top of BSD TFTP";
···12 # gcc-10. Otherwise build fails as:
13 # ld: main.o:/build/tftp-hpa-5.2/tftp/main.c:98: multiple definition of
14 # `toplevel'; tftp.o:/build/tftp-hpa-5.2/tftp/tftp.c:51: first defined here
15+ env.NIX_CFLAGS_COMPILE = "-fcommon";
1617 meta = with lib; {
18 description = "TFTP tools - a lot of fixes on top of BSD TFTP";
···30 "BASHDIR=${placeholder "out"}/share/bash-completion/completions"
31 ];
3233- NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-D_LINUX_SYSINFO_H=1";
3435 # Won't build on i686 because the binary will be linked again in the
36 # install phase without checking the dependencies. This will prevent
···30 "BASHDIR=${placeholder "out"}/share/bash-completion/completions"
31 ];
3233+ env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-D_LINUX_SYSINFO_H=1";
3435 # Won't build on i686 because the binary will be linked again in the
36 # install phase without checking the dependencies. This will prevent
+1-1
pkgs/tools/system/testdisk/default.nix
···4142 nativeBuildInputs = [ pkg-config ];
4344- NIX_CFLAGS_COMPILE="-Wno-unused";
4546 meta = with lib; {
47 homepage = "https://www.cgsecurity.org/wiki/Main_Page";
···4142 nativeBuildInputs = [ pkg-config ];
4344+ env.NIX_CFLAGS_COMPILE = "-Wno-unused";
4546 meta = with lib; {
47 homepage = "https://www.cgsecurity.org/wiki/Main_Page";