Merge pull request #127922 from roblabla/enable-btf

linux-kernel: Enable BTF
This commit is contained in:
Jörg Thalheim 2021-08-25 12:30:39 +01:00 committed by GitHub
commit 29766697ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -35,7 +35,12 @@ let
options = {
debug = {
DEBUG_INFO = if (features.debug or false) then yes else no;
# Necessary for BTF
DEBUG_INFO = mkMerge [
(whenOlder "5.2" (if (features.debug or false) then yes else no))
(whenAtLeast "5.2" yes)
];
DEBUG_INFO_BTF = whenAtLeast "5.2" yes;
DEBUG_KERNEL = yes;
DEBUG_DEVRES = no;
DYNAMIC_DEBUG = yes;

View File

@ -1,5 +1,5 @@
{ lib, buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl
, libelf, cpio, elfutils, zstd, gawk, python3Minimal
, libelf, cpio, elfutils, zstd, gawk, python3Minimal, zlib, pahole
, writeTextFile
}:
@ -316,10 +316,12 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat
++ optional (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf
# Removed util-linuxMinimal since it should not be a dependency.
++ optionals (lib.versionAtLeast version "4.16") [ bison flex ]
++ optional (lib.versionAtLeast version "5.2") cpio
++ optionals (lib.versionAtLeast version "5.2") [ cpio pahole ]
++ optional (lib.versionAtLeast version "5.8") elfutils
;
buildInputs = optional (lib.versionAtLeast version "5.2") zlib;
hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" "pie" ];
# Absolute paths for compilers avoid any PATH-clobbering issues.