* [Qemu-devel] [PATCH] fdt: update embedded header file from upstream to fix compilation
@ 2013-05-07 12:36 Andre Przywara
2013-05-07 12:44 ` Peter Maydell
0 siblings, 1 reply; 5+ messages in thread
From: Andre Przywara @ 2013-05-07 12:36 UTC (permalink / raw)
To: aliguori; +Cc: jdl, kim.phillips, qemu-devel, hollisb, Andre Przywara
Upstream dtc.git introduced a change in libfdt_env.h, which breaks
compilation with QEMU's version of it:
CC arm-softmmu/device_tree.o
In file included from /usr/include/libfdt.h:55:0,
from /src/qemu.git/device_tree.c:28:
/usr/include/fdt.h:7:2: error: unknown type name 'fdt32_t'
...
The culprit is:
commit feafcd972cb744750a65728440c99526e6199a6d
Author: Kim Phillips <kim.phillips@freescale.com>
Date: Wed Nov 28 17:33:01 2012 -0600
dtc/libfdt: introduce fdt types for annotation by endian checkers
...
Pull the new definitions into QEMU's version of the file. This change
also works with older installed versions of dtc.
The upstream version got a "GPL or BSD" dual license header meanwhile.
I retained the original GPL license header from QEMU, only added
the original copyrights.
Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
---
include/libfdt_env.h | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/include/libfdt_env.h b/include/libfdt_env.h
index 3667d4c..aad54bb 100644
--- a/include/libfdt_env.h
+++ b/include/libfdt_env.h
@@ -1,4 +1,12 @@
+#ifndef _LIBFDT_ENV_H
+#define _LIBFDT_ENV_H
/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ * Copyright 2012 Kim Phillips, Freescale Semiconductor.
+ * Adaptation to QEMU: Copyright IBM Corp. 2008
+ * by Hollis Blanchard <hollisb@us.ibm.com>
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
@@ -11,16 +19,23 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
- * Copyright IBM Corp. 2008
- * Authors: Hollis Blanchard <hollisb@us.ibm.com>
*
*/
-#ifndef _LIBFDT_ENV_H
-#define _LIBFDT_ENV_H
-
#include "qemu/bswap.h"
+#ifdef __CHECKER__
+#define __force __attribute__((force))
+#define __bitwise __attribute__((bitwise))
+#else
+#define __force
+#define __bitwise
+#endif
+
+typedef uint16_t __bitwise fdt16_t;
+typedef uint32_t __bitwise fdt32_t;
+typedef uint64_t __bitwise fdt64_t;
+
#ifdef HOST_WORDS_BIGENDIAN
#define fdt32_to_cpu(x) (x)
#define cpu_to_fdt32(x) (x)
--
1.7.12.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] fdt: update embedded header file from upstream to fix compilation
2013-05-07 12:36 [Qemu-devel] [PATCH] fdt: update embedded header file from upstream to fix compilation Andre Przywara
@ 2013-05-07 12:44 ` Peter Maydell
2013-05-07 12:52 ` Andre Przywara
0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2013-05-07 12:44 UTC (permalink / raw)
To: Andre Przywara; +Cc: aliguori, kim.phillips, jdl, hollisb, qemu-devel
On 7 May 2013 13:36, Andre Przywara <andre.przywara@linaro.org> wrote:
> Upstream dtc.git introduced a change in libfdt_env.h, which breaks
> compilation with QEMU's version of it:
>
> CC arm-softmmu/device_tree.o
> In file included from /usr/include/libfdt.h:55:0,
> from /src/qemu.git/device_tree.c:28:
> /usr/include/fdt.h:7:2: error: unknown type name 'fdt32_t'
> ...
I'm not entirely sure I understand why we need change.
Have upstream really introduced a breaking change for
everybody who uses libfdt, or are we using it wrongly?
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] fdt: update embedded header file from upstream to fix compilation
2013-05-07 12:44 ` Peter Maydell
@ 2013-05-07 12:52 ` Andre Przywara
2013-05-07 13:24 ` Peter Maydell
0 siblings, 1 reply; 5+ messages in thread
From: Andre Przywara @ 2013-05-07 12:52 UTC (permalink / raw)
To: Peter Maydell; +Cc: aliguori, kim.phillips, jdl, hollisb, qemu-devel
On 05/07/2013 02:44 PM, Peter Maydell wrote:
> On 7 May 2013 13:36, Andre Przywara <andre.przywara@linaro.org> wrote:
>> Upstream dtc.git introduced a change in libfdt_env.h, which breaks
>> compilation with QEMU's version of it:
>>
>> CC arm-softmmu/device_tree.o
>> In file included from /usr/include/libfdt.h:55:0,
>> from /src/qemu.git/device_tree.c:28:
>> /usr/include/fdt.h:7:2: error: unknown type name 'fdt32_t'
>> ...
>
> I'm not entirely sure I understand why we need change.
> Have upstream really introduced a breaking change for
> everybody who uses libfdt, or are we using it wrongly?
Everybody who copies and changes a header from the original distribution
and uses this now instead of the installed version ;-)
libfdt (or better: dtc) seems to be quite out of date in the official
distribution packages. I just happened to have git HEAD installed manually.
Regards,
Andre.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] fdt: update embedded header file from upstream to fix compilation
2013-05-07 12:52 ` Andre Przywara
@ 2013-05-07 13:24 ` Peter Maydell
2013-05-07 14:00 ` Andre Przywara
0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2013-05-07 13:24 UTC (permalink / raw)
To: Andre Przywara; +Cc: aliguori, kim.phillips, jdl, hollisb, qemu-devel
On 7 May 2013 13:52, Andre Przywara <andre.przywara@linaro.org> wrote:
> On 05/07/2013 02:44 PM, Peter Maydell wrote:
>> I'm not entirely sure I understand why we need change.
>> Have upstream really introduced a breaking change for
>> everybody who uses libfdt, or are we using it wrongly?
>
>
> Everybody who copies and changes a header from the original distribution and
> uses this now instead of the installed version ;-)
Right, but the distro libfdt-dev package doesn't ship with
libfdt_env.h, so presumably the expectation is that users
of libfdt copy and adjust it, and so the set of things it
has to provide is part of the "public" interface?
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] fdt: update embedded header file from upstream to fix compilation
2013-05-07 13:24 ` Peter Maydell
@ 2013-05-07 14:00 ` Andre Przywara
0 siblings, 0 replies; 5+ messages in thread
From: Andre Przywara @ 2013-05-07 14:00 UTC (permalink / raw)
To: Peter Maydell; +Cc: aliguori, kim.phillips, jdl, hollisb, qemu-devel
On 05/07/2013 03:24 PM, Peter Maydell wrote:
> On 7 May 2013 13:52, Andre Przywara <andre.przywara@linaro.org> wrote:
>> On 05/07/2013 02:44 PM, Peter Maydell wrote:
>>> I'm not entirely sure I understand why we need change.
>>> Have upstream really introduced a breaking change for
>>> everybody who uses libfdt, or are we using it wrongly?
>>
>>
>> Everybody who copies and changes a header from the original distribution and
>> uses this now instead of the installed version ;-)
>
> Right, but the distro libfdt-dev package doesn't ship with
> libfdt_env.h, so presumably the expectation is that users
> of libfdt copy and adjust it, and so the set of things it
> has to provide is part of the "public" interface?
Seems to be true for the CentOS package for instance, but not for Wheezy:
http://packages.debian.org/wheezy/amd64/libfdt-dev/filelist
Also "make install" on the source distribution copies the file to
/usr/include. Even if I delete it, fdt.h still references fdt32_t, so I
get the same error again.
Regards,
Andre.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-07 14:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-07 12:36 [Qemu-devel] [PATCH] fdt: update embedded header file from upstream to fix compilation Andre Przywara
2013-05-07 12:44 ` Peter Maydell
2013-05-07 12:52 ` Andre Przywara
2013-05-07 13:24 ` Peter Maydell
2013-05-07 14:00 ` Andre Przywara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).