From 412e823f295830c3ab54d6a35d5a603bd8ec58ea Mon Sep 17 00:00:00 2001 From: Matthew Justin Bauer Date: Tue, 12 Jun 2018 22:54:10 -0400 Subject: [PATCH] binutils: disable format hardening This fails for me: > compressed_output.cc:320:20: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] > gold_warning(_("not compressing section data: zlib error")); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ./system.h:40:20: note: expanded from macro '_' > # define _(String) gettext (String) > ^~~~~~~~~~~~~~~~ > compressed_output.cc:320:20: note: treat the string as an argument to avoid this > gold_warning(_("not compressing section data: zlib error")); > ^ > "%s", > ./system.h:40:20: note: expanded from macro '_' > # define _(String) gettext (String) ^ Disabling format hardening should hopefully be harmless here. If it's a problem we can also make it conditional. /cc @Ericson2314 --- pkgs/development/tools/misc/binutils/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index de316d0e5e7f..0b71c6719dc4 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -103,6 +103,8 @@ stdenv.mkDerivation rec { then "-Wno-string-plus-int -Wno-deprecated-declarations" else "-static-libgcc"; + hardeningDisable = [ "format" ]; + # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";