Skip to content

Commit

Permalink
Merge pull request #127922 from roblabla/enable-btf
Browse files Browse the repository at this point in the history
linux-kernel: Enable BTF
  • Loading branch information
Mic92 authored Aug 25, 2021
2 parents d5cfd93 + 34150f8 commit 2976669
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pkgs/os-specific/linux/kernel/common-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions pkgs/os-specific/linux/kernel/manual-config.nix
Original file line number Diff line number Diff line change
@@ -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
}:

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 2976669

Please sign in to comment.