package/dtc: additional fix of include guards for older u-boot
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Thu, 21 Feb 2019 12:56:51 +0000 (13:56 +0100)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Thu, 21 Feb 2019 22:50:59 +0000 (23:50 +0100)
commit4c24006b0e403d786c1a2d7bcb4127440cc13b32
tree1369cc11057c2c626420d6a63843dc63c4feb7cc
parentda304a832b9a0f5f5ef62c244f67e5f5ae39748e
package/dtc: additional fix of include guards for older u-boot

With recent dtc but old u-boot, compilation issues occur related to libfdt.
These problems really are u-boot issue since it does not properly set
include paths so that its own headers are included. Nevertheless, since the
u-boot version is typically decided by users and stuck at some version
provided by a SoC or board vendor, it is not feasible to fix those old
versions.

Instead, already several fixes were made in the past, in Buildroot.
See commits:

c7ffd8a75d5 "package/dtc: fix include guards for older kernel/u-boot"
f437bf547ca "uboot: fix build for older uboot source trees"
bf733342324 "uboot: fix build when libfdt-devel is installed system-wide"
0bf80e4bcd5 "uboot: ensure host includes are searched before system default
                includes"
b15a7a62d3f "uboot: revert "uboot: use local libfdt.h""
baae5156ce3 "uboot: use local fdt headers"
3a6573ccee2 "uboot: use local libfdt.h"

Commit c7ffd8a75d55e24d793106eabbb80964ab91081f fixes the problem caused by
dtc having changed their include guards from _FOO_H to FOO_H (leading
underscore removed). Old u-boot would still use _FOO_H, which (combined with
host-dtc headers that use FOO_H) would cause the inclusion of two different
copies of the same nominal include file, e.g. libfdt.h or libfdt_env.h,
causing 'error: redefinition of xxx' compilation issues.
The fix sets the 'new' include guard when the 'old' one is detected,
preventing a second inclusion of the same nominal file.

For some u-boot versions, however, this change not only needs to be made in
libfdt.h and libfdt_env.h, but also in 'fdt.h'.

Update the dtc patch to do just that.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/dtc/0002-Fix-include-guards-for-older-kernel-u-boot-sources.patch