From 83ebc1143fe193e101bd7d573374ac45e950cdaf Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 8 Jun 2024 00:28:33 +0100 Subject: [PATCH 1/2] libdc1394: disable trivialautovarinit --- pkgs/development/libraries/libdc1394/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/libdc1394/default.nix b/pkgs/development/libraries/libdc1394/default.nix index 9ca5581b3bff..afd53588a336 100644 --- a/pkgs/development/libraries/libdc1394/default.nix +++ b/pkgs/development/libraries/libdc1394/default.nix @@ -10,6 +10,11 @@ stdenv.mkDerivation rec { sha256 = "sha256-U3zreN087ycaGD9KF2GR0c7PhfAlUg5r03WLDhnmYJ8="; }; + hardeningDisable = [ + # "sorry, unimplemented: __builtin_clear_padding not supported for variable length aggregates" + "trivialautovarinit" + ]; + buildInputs = [ libusb1 ] ++ lib.optional stdenv.isLinux libraw1394 ++ lib.optional stdenv.isDarwin CoreServices; From f52a4c681050d2c42bd387a1b8b80dc104fd8603 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 8 Jun 2024 12:53:14 +0100 Subject: [PATCH 2/2] doc/stdenv: hardening flags: add example error for trivialautovarinit --- doc/stdenv/stdenv.chapter.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/stdenv/stdenv.chapter.md b/doc/stdenv/stdenv.chapter.md index be13528f6dc0..fb6d2c585880 100644 --- a/doc/stdenv/stdenv.chapter.md +++ b/doc/stdenv/stdenv.chapter.md @@ -1538,6 +1538,12 @@ Adds the `-ftrivial-auto-var-init=pattern` compiler option. This causes "trivial Use of this flag is controversial as it can prevent tools that detect uninitialized variable use (such as valgrind) from operating correctly. +This should be turned off or fixed for build errors such as: + +``` +sorry, unimplemented: __builtin_clear_padding not supported for variable length aggregates +``` + #### `stackclashprotection` {#stackclashprotection} This flag adds the `-fstack-clash-protection` compiler option, which causes growth of a program's stack to access each successive page in order. This should force the guard page to be accessed and cause an attempt to "jump over" this guard page to crash.