From 31bb7be11ad36dfec724529be69ebde416e5ac0a Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Sat, 10 Jul 2021 13:17:52 -0700 Subject: [PATCH] linuxManualConfig: don't mangle `--build-id` In order to have our linux builds be reproducible we patch the `Makefile` to use `--build-id=none` as opposed to the default `--build-id=sha1`. The way we've been doing this, however, caused the flag to be mangled, and being set to `--build-id=none=sha1`. While bfd seems to parse this normally, lld will loudly complain that the flag does not exist: ``` linux> LD .tmp_vmlinux.kallsyms1 linux> ld.lld: error: unknown --build-id style: none=sha1 ``` With this change the flag is now correctly set to `--build-id=none`. --- pkgs/os-specific/linux/kernel/manual-config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index f874762267a8..fda2881a8d2a 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -119,7 +119,7 @@ let # This way kernels can be bit-by-bit reproducible depending on settings # (e.g. MODULE_SIG and SECURITY_LOCKDOWN_LSM need to be disabled). # See also https://kernelnewbies.org/BuildId - sed -i Makefile -e 's|--build-id|--build-id=none|' + sed -i Makefile -e 's|--build-id=[^ ]*|--build-id=none|' patchShebangs scripts/ld-version.sh '';