From 8787699e4237821dda2de83bb9b574ad9fafabe7 Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Thu, 17 May 2018 23:24:31 +0200 Subject: [PATCH 1/2] elfutils: add patch that fixes compilation under gcc8 --- pkgs/development/tools/misc/elfutils/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix index e89aba67999ed..0a193077da5c3 100644 --- a/pkgs/development/tools/misc/elfutils/default.nix +++ b/pkgs/development/tools/misc/elfutils/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs }: +{ lib, stdenv, fetchurl, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs, fetchpatch }: # TODO: Look at the hardcoded paths to kernel, modules etc. stdenv.mkDerivation rec { @@ -10,7 +10,14 @@ stdenv.mkDerivation rec { sha256 = "0rp0r54z44is49c594qy7hr211nhb00aa5y7z74vsybbaxslg10z"; }; - patches = ./debug-info-from-env.patch; + patches = [ + ./debug-info-from-env.patch + (fetchpatch { + name = "0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch"; + url = http://git.openembedded.org/openembedded-core/plain/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch?id=49aae1d75ff1c6a9643c30a8cc5776a2ffa83dd3; + sha256 = "09y4x1yaqm84w7cy1sf57a6g8ah49b0349dsj2a81wy4flw8ih5j"; + }) + ]; hardeningDisable = [ "format" ]; From c16d9ecb8b76b966995a594c37e32cc428ddef93 Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Fri, 18 May 2018 15:26:36 +0200 Subject: [PATCH 2/2] elfutils: follow advice from @jtojnar --- pkgs/development/tools/misc/elfutils/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix index 0a193077da5c3..d8738bf62f9d1 100644 --- a/pkgs/development/tools/misc/elfutils/default.nix +++ b/pkgs/development/tools/misc/elfutils/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs, fetchpatch }: +{ lib, stdenv, fetchurl, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs }: # TODO: Look at the hardcoded paths to kernel, modules etc. stdenv.mkDerivation rec { @@ -12,12 +12,14 @@ stdenv.mkDerivation rec { patches = [ ./debug-info-from-env.patch - (fetchpatch { - name = "0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch"; + + /* For gcc8. Fixes -Werror=packed-not-aligned errors. + incorporated in upstream, so can probably be removed at next update */ + (fetchurl { url = http://git.openembedded.org/openembedded-core/plain/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch?id=49aae1d75ff1c6a9643c30a8cc5776a2ffa83dd3; - sha256 = "09y4x1yaqm84w7cy1sf57a6g8ah49b0349dsj2a81wy4flw8ih5j"; + sha256 = "11sg2dn3vjvgq2fb9n8pgw1ajvs3gliks7djg1794wxlfg0rvifb"; }) - ]; + ]; hardeningDisable = [ "format" ];