tools: libelf: fix headers to trigger -Wundef warnings
authorJo-Philipp Wich <jo@mein.io>
Fri, 30 Aug 2019 13:22:01 +0000 (15:22 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 4 Sep 2019 11:46:55 +0000 (13:46 +0200)
commit5aa1b9ad681455b5e164ea1c12f80a0b104bf3d5
tree462f0804f72e8486ea425c93866b227f67ea569b
parent2e490e7e46a4f6fbf66fa930a25c2991e24c0f83
tools: libelf: fix headers to trigger -Wundef warnings

When libelf from tools/ is used for building the kernel, compilation
aborts due to access to undefined defines since Kbuild adds -Wundef
to the compiler flags.

Patch the header files to use `#if defined(...)` instead of `#if ...`
to prevent such issues.

Ref: https://github.com/NixOS/nixpkgs/issues/59929
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f3ab336d7ceda929dc8dc4a8b09a9552dc6be0b1)
tools/libelf/patches/900-fix-undefined-macro-access.patch [new file with mode: 0644]