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)
committerRISCi_ATOM <bob@bobcall.me>
Fri, 13 Sep 2019 20:19:10 +0000 (16:19 -0400)
commite3c126fab0cf991fec844393d7d011c0bb5ee29f
treed07ee9a889228117dc80d87c918799006757f9b6
parent9100c1ad6b57ce78b4b9f75318491ea10f71a8d8
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]