kumquat-buildroot/package/dtc/0002-Fix-include-guards-for-older-kernel-u-boot-sources.patch

63 lines
1.7 KiB
Diff
Raw Normal View History

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>
2019-02-21 13:56:51 +01:00
From 086283ed7f1886de05407bc75dd4c070c78a6f50 Mon Sep 17 00:00:00 2001
package/dtc: fix include guards for older kernel/u-boot U-Boot has a copy of dtc in-tree. However, it has a bug in its build system which could result in both one of the in-tree dtc include files and the same host-installed include file to be #included. Normally, that wouldn't be a problem, because (a) the two include files are compatible, so it doesn't matter which one you include, and (b) the include guards are the same in both, so only one of them really does get included. However, upstream dtc has changed the include guards, removing the leading underscore. Therefore, now the header file does get included twice, which leads to multiple definitions like: /builds/buildroot.org/buildroot/output/host/include/libfdt.h:1790:19: error: redefinition of 'fdt_appendprop_cell' static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ In file included from tools/fdt_host.h:11:0, from tools/imagetool.h:24, from tools/atmelimage.c:8: tools/../include/libfdt.h:1656:19: note: previous definition of 'fdt_appendprop_cell' was here static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ To fix this, patch (host) dtc to accept the old include guard as well, which restores the old behaviour. This patch is probably not upstreamable, since it's really a hack to work around an issue in U-Boot. Note that it has been fixed upstream, but Buildroot supports building older versions of U-Boot as well. Note that the problem may still occur if you have libdtc-dev installed on the host. However, now there is a simple workaround: enable BR2_TARGET_UBOOT_NEEDS_DTC. Note that a similar problem also occurs with the beaglebone fork of the kernel. It's not clear if it has been fixed there. Signed-off-by: Lothar Felten <lothar.felten@gmail.com> [Arnout: rewrite commit message, rewrap patch commit message] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-10-08 13:51:46 +02:00
From: Lothar Felten <lothar.felten@gmail.com>
Date: Mon, 8 Oct 2018 13:29:44 +0200
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>
2019-02-21 13:56:51 +01:00
Subject: [PATCH] Fix include guards for older kernel/u-boot sources
package/dtc: fix include guards for older kernel/u-boot U-Boot has a copy of dtc in-tree. However, it has a bug in its build system which could result in both one of the in-tree dtc include files and the same host-installed include file to be #included. Normally, that wouldn't be a problem, because (a) the two include files are compatible, so it doesn't matter which one you include, and (b) the include guards are the same in both, so only one of them really does get included. However, upstream dtc has changed the include guards, removing the leading underscore. Therefore, now the header file does get included twice, which leads to multiple definitions like: /builds/buildroot.org/buildroot/output/host/include/libfdt.h:1790:19: error: redefinition of 'fdt_appendprop_cell' static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ In file included from tools/fdt_host.h:11:0, from tools/imagetool.h:24, from tools/atmelimage.c:8: tools/../include/libfdt.h:1656:19: note: previous definition of 'fdt_appendprop_cell' was here static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ To fix this, patch (host) dtc to accept the old include guard as well, which restores the old behaviour. This patch is probably not upstreamable, since it's really a hack to work around an issue in U-Boot. Note that it has been fixed upstream, but Buildroot supports building older versions of U-Boot as well. Note that the problem may still occur if you have libdtc-dev installed on the host. However, now there is a simple workaround: enable BR2_TARGET_UBOOT_NEEDS_DTC. Note that a similar problem also occurs with the beaglebone fork of the kernel. It's not clear if it has been fixed there. Signed-off-by: Lothar Felten <lothar.felten@gmail.com> [Arnout: rewrite commit message, rewrap patch commit message] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-10-08 13:51:46 +02:00
Linux kernels before 4.17 and U-Boot versions before 2018.07 use libfdt
include guards with leading underscores.
Those have been removed in dtc-1.4.7.
This patch handles both include guard types and allows the compilation
of older Linux kernel and u-boot sources.
Signed-off-by: Lothar Felten <lothar.felten@gmail.com>
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>
2019-02-21 13:56:51 +01:00
[ThomasDS: also update fdt.h which has the same issue, seen on U-Boot
2011.03]
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
package/dtc: fix include guards for older kernel/u-boot U-Boot has a copy of dtc in-tree. However, it has a bug in its build system which could result in both one of the in-tree dtc include files and the same host-installed include file to be #included. Normally, that wouldn't be a problem, because (a) the two include files are compatible, so it doesn't matter which one you include, and (b) the include guards are the same in both, so only one of them really does get included. However, upstream dtc has changed the include guards, removing the leading underscore. Therefore, now the header file does get included twice, which leads to multiple definitions like: /builds/buildroot.org/buildroot/output/host/include/libfdt.h:1790:19: error: redefinition of 'fdt_appendprop_cell' static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ In file included from tools/fdt_host.h:11:0, from tools/imagetool.h:24, from tools/atmelimage.c:8: tools/../include/libfdt.h:1656:19: note: previous definition of 'fdt_appendprop_cell' was here static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ To fix this, patch (host) dtc to accept the old include guard as well, which restores the old behaviour. This patch is probably not upstreamable, since it's really a hack to work around an issue in U-Boot. Note that it has been fixed upstream, but Buildroot supports building older versions of U-Boot as well. Note that the problem may still occur if you have libdtc-dev installed on the host. However, now there is a simple workaround: enable BR2_TARGET_UBOOT_NEEDS_DTC. Note that a similar problem also occurs with the beaglebone fork of the kernel. It's not clear if it has been fixed there. Signed-off-by: Lothar Felten <lothar.felten@gmail.com> [Arnout: rewrite commit message, rewrap patch commit message] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-10-08 13:51:46 +02:00
---
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>
2019-02-21 13:56:51 +01:00
libfdt/fdt.h | 4 ++++
package/dtc: fix include guards for older kernel/u-boot U-Boot has a copy of dtc in-tree. However, it has a bug in its build system which could result in both one of the in-tree dtc include files and the same host-installed include file to be #included. Normally, that wouldn't be a problem, because (a) the two include files are compatible, so it doesn't matter which one you include, and (b) the include guards are the same in both, so only one of them really does get included. However, upstream dtc has changed the include guards, removing the leading underscore. Therefore, now the header file does get included twice, which leads to multiple definitions like: /builds/buildroot.org/buildroot/output/host/include/libfdt.h:1790:19: error: redefinition of 'fdt_appendprop_cell' static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ In file included from tools/fdt_host.h:11:0, from tools/imagetool.h:24, from tools/atmelimage.c:8: tools/../include/libfdt.h:1656:19: note: previous definition of 'fdt_appendprop_cell' was here static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ To fix this, patch (host) dtc to accept the old include guard as well, which restores the old behaviour. This patch is probably not upstreamable, since it's really a hack to work around an issue in U-Boot. Note that it has been fixed upstream, but Buildroot supports building older versions of U-Boot as well. Note that the problem may still occur if you have libdtc-dev installed on the host. However, now there is a simple workaround: enable BR2_TARGET_UBOOT_NEEDS_DTC. Note that a similar problem also occurs with the beaglebone fork of the kernel. It's not clear if it has been fixed there. Signed-off-by: Lothar Felten <lothar.felten@gmail.com> [Arnout: rewrite commit message, rewrap patch commit message] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-10-08 13:51:46 +02:00
libfdt/libfdt.h | 4 ++++
libfdt/libfdt_env.h | 4 ++++
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>
2019-02-21 13:56:51 +01:00
3 files changed, 12 insertions(+)
package/dtc: fix include guards for older kernel/u-boot U-Boot has a copy of dtc in-tree. However, it has a bug in its build system which could result in both one of the in-tree dtc include files and the same host-installed include file to be #included. Normally, that wouldn't be a problem, because (a) the two include files are compatible, so it doesn't matter which one you include, and (b) the include guards are the same in both, so only one of them really does get included. However, upstream dtc has changed the include guards, removing the leading underscore. Therefore, now the header file does get included twice, which leads to multiple definitions like: /builds/buildroot.org/buildroot/output/host/include/libfdt.h:1790:19: error: redefinition of 'fdt_appendprop_cell' static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ In file included from tools/fdt_host.h:11:0, from tools/imagetool.h:24, from tools/atmelimage.c:8: tools/../include/libfdt.h:1656:19: note: previous definition of 'fdt_appendprop_cell' was here static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ To fix this, patch (host) dtc to accept the old include guard as well, which restores the old behaviour. This patch is probably not upstreamable, since it's really a hack to work around an issue in U-Boot. Note that it has been fixed upstream, but Buildroot supports building older versions of U-Boot as well. Note that the problem may still occur if you have libdtc-dev installed on the host. However, now there is a simple workaround: enable BR2_TARGET_UBOOT_NEEDS_DTC. Note that a similar problem also occurs with the beaglebone fork of the kernel. It's not clear if it has been fixed there. Signed-off-by: Lothar Felten <lothar.felten@gmail.com> [Arnout: rewrite commit message, rewrap patch commit message] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-10-08 13:51:46 +02:00
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>
2019-02-21 13:56:51 +01:00
diff --git a/libfdt/fdt.h b/libfdt/fdt.h
index 74961f9..2904f48 100644
--- a/libfdt/fdt.h
+++ b/libfdt/fdt.h
@@ -1,3 +1,7 @@
+#ifdef _FDT_H
+#warning "Please consider updating your kernel and/or u-boot version"
+#define FDT_H
+#endif
#ifndef FDT_H
#define FDT_H
/*
package/dtc: fix include guards for older kernel/u-boot U-Boot has a copy of dtc in-tree. However, it has a bug in its build system which could result in both one of the in-tree dtc include files and the same host-installed include file to be #included. Normally, that wouldn't be a problem, because (a) the two include files are compatible, so it doesn't matter which one you include, and (b) the include guards are the same in both, so only one of them really does get included. However, upstream dtc has changed the include guards, removing the leading underscore. Therefore, now the header file does get included twice, which leads to multiple definitions like: /builds/buildroot.org/buildroot/output/host/include/libfdt.h:1790:19: error: redefinition of 'fdt_appendprop_cell' static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ In file included from tools/fdt_host.h:11:0, from tools/imagetool.h:24, from tools/atmelimage.c:8: tools/../include/libfdt.h:1656:19: note: previous definition of 'fdt_appendprop_cell' was here static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ To fix this, patch (host) dtc to accept the old include guard as well, which restores the old behaviour. This patch is probably not upstreamable, since it's really a hack to work around an issue in U-Boot. Note that it has been fixed upstream, but Buildroot supports building older versions of U-Boot as well. Note that the problem may still occur if you have libdtc-dev installed on the host. However, now there is a simple workaround: enable BR2_TARGET_UBOOT_NEEDS_DTC. Note that a similar problem also occurs with the beaglebone fork of the kernel. It's not clear if it has been fixed there. Signed-off-by: Lothar Felten <lothar.felten@gmail.com> [Arnout: rewrite commit message, rewrap patch commit message] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-10-08 13:51:46 +02:00
diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
index 830b77e..bef4566 100644
--- a/libfdt/libfdt.h
+++ b/libfdt/libfdt.h
@@ -1,3 +1,7 @@
+#ifdef _LIBFDT_H
+#warning "Please consider updating your kernel and/or u-boot version"
+#define LIBFDT_H
+#endif
#ifndef LIBFDT_H
#define LIBFDT_H
/*
diff --git a/libfdt/libfdt_env.h b/libfdt/libfdt_env.h
index eb20538..6a61e6a 100644
--- a/libfdt/libfdt_env.h
+++ b/libfdt/libfdt_env.h
@@ -1,3 +1,7 @@
+#ifdef _LIBFDT_ENV_H
+#warning "Please consider updating your kernel and/or u-boot version"
+#define LIBFDT_ENV_H
+#endif
#ifndef LIBFDT_ENV_H
#define LIBFDT_ENV_H
/*
--
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>
2019-02-21 13:56:51 +01:00
2.19.2
package/dtc: fix include guards for older kernel/u-boot U-Boot has a copy of dtc in-tree. However, it has a bug in its build system which could result in both one of the in-tree dtc include files and the same host-installed include file to be #included. Normally, that wouldn't be a problem, because (a) the two include files are compatible, so it doesn't matter which one you include, and (b) the include guards are the same in both, so only one of them really does get included. However, upstream dtc has changed the include guards, removing the leading underscore. Therefore, now the header file does get included twice, which leads to multiple definitions like: /builds/buildroot.org/buildroot/output/host/include/libfdt.h:1790:19: error: redefinition of 'fdt_appendprop_cell' static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ In file included from tools/fdt_host.h:11:0, from tools/imagetool.h:24, from tools/atmelimage.c:8: tools/../include/libfdt.h:1656:19: note: previous definition of 'fdt_appendprop_cell' was here static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, ^~~~~~~~~~~~~~~~~~~ To fix this, patch (host) dtc to accept the old include guard as well, which restores the old behaviour. This patch is probably not upstreamable, since it's really a hack to work around an issue in U-Boot. Note that it has been fixed upstream, but Buildroot supports building older versions of U-Boot as well. Note that the problem may still occur if you have libdtc-dev installed on the host. However, now there is a simple workaround: enable BR2_TARGET_UBOOT_NEEDS_DTC. Note that a similar problem also occurs with the beaglebone fork of the kernel. It's not clear if it has been fixed there. Signed-off-by: Lothar Felten <lothar.felten@gmail.com> [Arnout: rewrite commit message, rewrap patch commit message] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-10-08 13:51:46 +02:00