* [U-Boot] libfdt/fdt_ro.c build issues...
@ 2008-08-27 0:13 Wolfgang Denk
2008-08-27 2:04 ` Jerry Van Baren
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2008-08-27 0:13 UTC (permalink / raw)
To: u-boot
Dear Kumar,
there are build problems with libfdt/fdt_ro.c :
...
tools/fdt_ro.c: In function 'fdt_path_offset':
tools/fdt_ro.c:158: warning: implicit declaration of function 'fdt_getprop_namelen'
tools/fdt_ro.c:158: warning: assignment makes pointer from integer without a cast
tools/fdt_ro.c: At top level:
tools/fdt_ro.c:281: error: conflicting types for 'fdt_getprop_namelen'
tools/fdt_ro.c:158: error: previous implicit declaration of 'fdt_getprop_namelen' was here
...
...dor all boards.
If you have time, could you please have a look?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
[War] is instinctive. But the instinct can be fought. We're human
beings with the blood of a million savage years on our hands! But we
can stop it. We can admit that we're killers ... but we're not going
to kill today. That's all it takes! Knowing that we're not going to
kill today!
-- Kirk, "A Taste of Armageddon", stardate 3193.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] libfdt/fdt_ro.c build issues...
2008-08-27 0:13 [U-Boot] libfdt/fdt_ro.c build issues Wolfgang Denk
@ 2008-08-27 2:04 ` Jerry Van Baren
2008-08-27 7:42 ` Wolfgang Denk
2008-08-27 8:04 ` Wolfgang Denk
0 siblings, 2 replies; 8+ messages in thread
From: Jerry Van Baren @ 2008-08-27 2:04 UTC (permalink / raw)
To: u-boot
Wolfgang Denk wrote:
> Dear Kumar,
>
> there are build problems with libfdt/fdt_ro.c :
>
> ...
> tools/fdt_ro.c: In function 'fdt_path_offset':
> tools/fdt_ro.c:158: warning: implicit declaration of function 'fdt_getprop_namelen'
> tools/fdt_ro.c:158: warning: assignment makes pointer from integer without a cast
> tools/fdt_ro.c: At top level:
> tools/fdt_ro.c:281: error: conflicting types for 'fdt_getprop_namelen'
> tools/fdt_ro.c:158: error: previous implicit declaration of 'fdt_getprop_namelen' was here
> ...
>
> ...dor all boards.
>
> If you have time, could you please have a look?
>
> Best regards,
>
> Wolfgang Denk
??? I'm not seeing this, even with a fresh pull from the u-boot repository.
The function is declared in include/libfdt.h, properly in my copy.
libfdt/fdt_ro.c includes...
#ifndef USE_HOSTCC
#include <fdt.h>
#include <libfdt.h>
#else
#include "fdt_host.h"
#endif
and then fdt_host.h includes libfdt.h...
/* Make sure to include u-boot version of libfdt include files */
#include "../include/fdt.h"
#include "../include/libfdt.h"
#include "../include/fdt_support.h"
Best regards,
gvb
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] libfdt/fdt_ro.c build issues...
2008-08-27 2:04 ` Jerry Van Baren
@ 2008-08-27 7:42 ` Wolfgang Denk
2008-08-27 8:04 ` Wolfgang Denk
1 sibling, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2008-08-27 7:42 UTC (permalink / raw)
To: u-boot
Dear Jerry Van Baren,
In message <48B4B62E.5000301@gmail.com> you wrote:
> >
> > there are build problems with libfdt/fdt_ro.c :
> >
> > ...
> > tools/fdt_ro.c: In function 'fdt_path_offset':
> > tools/fdt_ro.c:158: warning: implicit declaration of function 'fdt_getprop_namelen'
> > tools/fdt_ro.c:158: warning: assignment makes pointer from integer without a cast
> > tools/fdt_ro.c: At top level:
> > tools/fdt_ro.c:281: error: conflicting types for 'fdt_getprop_namelen'
> > tools/fdt_ro.c:158: error: previous implicit declaration of 'fdt_getprop_namelen' was here
> > ...
...
> ??? I'm not seeing this, even with a fresh pull from the u-boot repository.
It seems it happens only for out-of-tree builds (which is my standard
mode of operation).
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
How many Unix hacks does it take to change a light bulb? Let's see,
can you use a shell script for that or does it need a C program?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] libfdt/fdt_ro.c build issues...
2008-08-27 2:04 ` Jerry Van Baren
2008-08-27 7:42 ` Wolfgang Denk
@ 2008-08-27 8:04 ` Wolfgang Denk
2008-08-27 11:42 ` JerryVanBaren
1 sibling, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2008-08-27 8:04 UTC (permalink / raw)
To: u-boot
Dear Jerry Van Baren,
In message <48B4B62E.5000301@gmail.com> you wrote:
>
> > ...
> > tools/fdt_ro.c: In function 'fdt_path_offset':
> > tools/fdt_ro.c:158: warning: implicit declaration of function 'fdt_getprop_namelen'
> > tools/fdt_ro.c:158: warning: assignment makes pointer from integer without a cast
> > tools/fdt_ro.c: At top level:
> > tools/fdt_ro.c:281: error: conflicting types for 'fdt_getprop_namelen'
> > tools/fdt_ro.c:158: error: previous implicit declaration of 'fdt_getprop_namelen' was here
> > ...
...
> ??? I'm not seeing this, even with a fresh pull from the u-boot repository.
>
> The function is declared in include/libfdt.h, properly in my copy.
The problem comes from tools/fdt_host.h which includes:
/* Make sure to include u-boot version of libfdt include files */
#include "../include/fdt.h"
#include "../include/libfdt.h"
#include "../include/fdt_support.h"
However, the actual compiler run looks like this:
make[1]: Entering directory `/home/wd/git/u-boot/work/tools'
ln -s /home/wd/git/u-boot/work/tools/../libfdt/fdt.c /work/wd/tmp-ppc/tools/fdt.c
ln -s /home/wd/git/u-boot/work/tools/../libfdt/fdt_ro.c /work/wd/tmp-ppc/tools/fdt_ro.c
gcc -g -Wall -idirafter /home/wd/git/u-boot/work/include -idirafter /work/wd/tmp-ppc/include2 -idirafter /work/wd/tmp-ppc/include -DTEXT_BASE=0xFFFA0000 -DUSE_HOSTCC -O -c -o /work/wd/tmp-ppc/tools/fdt_ro.o /work/wd/tmp-ppc/tools/fdt_ro.c
and causes this:
...
# 1 "/work/wd/tmp-ppc/tools/fdt_host.h" 1
# 24 "/work/wd/tmp-ppc/tools/fdt_host.h"
# 1 "/usr/local/include/../include/fdt.h" 1 3
...
# 25 "/work/wd/tmp-ppc/tools/fdt_host.h" 2
# 1 "/usr/local/include/../include/libfdt.h" 1 3
# 54 "/usr/local/include/../include/libfdt.h" 3
...
i. e. it includes the WRONG versions of the header files - not these
from the U-Boot code, but from the host system.
The problem is the "-idirafter":
`-idirafter DIR'
Search DIR for header files, but do it _after_ all directories
specified with `-I' and the standard system directories have been
exhausted. DIR is treated as a system include directory.
Hm... not sure how to fix this.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Probably the best operating system in the world is the [operating
system] made for the PDP-11 by Bell Laboratories."
- Ted Nelson, October 1977
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] libfdt/fdt_ro.c build issues...
2008-08-27 8:04 ` Wolfgang Denk
@ 2008-08-27 11:42 ` JerryVanBaren
2008-09-06 21:21 ` Wolfgang Denk
0 siblings, 1 reply; 8+ messages in thread
From: JerryVanBaren @ 2008-08-27 11:42 UTC (permalink / raw)
To: u-boot
Wolfgang Denk wrote:
> Dear Jerry Van Baren,
>
> In message <48B4B62E.5000301@gmail.com> you wrote:
>>> ...
>>> tools/fdt_ro.c: In function 'fdt_path_offset':
>>> tools/fdt_ro.c:158: warning: implicit declaration of function 'fdt_getprop_namelen'
>>> tools/fdt_ro.c:158: warning: assignment makes pointer from integer without a cast
>>> tools/fdt_ro.c: At top level:
>>> tools/fdt_ro.c:281: error: conflicting types for 'fdt_getprop_namelen'
>>> tools/fdt_ro.c:158: error: previous implicit declaration of 'fdt_getprop_namelen' was here
>>> ...
> ...
>
>> ??? I'm not seeing this, even with a fresh pull from the u-boot repository.
>>
>> The function is declared in include/libfdt.h, properly in my copy.
(from your previous email):
> It seems it happens only for out-of-tree builds (which is my standard
> mode of operation).
Yes, after I hit "send" and thought about the "../include", I had a bad
feeling that that was the problem.
> The problem comes from tools/fdt_host.h which includes:
>
> /* Make sure to include u-boot version of libfdt include files */
> #include "../include/fdt.h"
> #include "../include/libfdt.h"
> #include "../include/fdt_support.h"
There has to be a better way than the USE_HOSTCC / #include "fdt_host.h"
(with a "up & over" relative path) mechanism. Unfortunately, I don't
have any good ideas at the moment.
What we really need is $(obj)include instead of "../include", but that
is crossing the make $(obj) and the C preprocessor. We could do it by
running sed on fdt_host.h, but that wouldn't be a better way, just ugly.
[snip]
> Hm... not sure how to fix this.
Ditto. :-(
> Best regards,
>
> Wolfgang Denk
...thinking...
gvb
(...but don't expect much this weekend, it is Labor Day weekend in the
USofA, the traditional last "hurrah" of summer).
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] libfdt/fdt_ro.c build issues...
2008-08-27 11:42 ` JerryVanBaren
@ 2008-09-06 21:21 ` Wolfgang Denk
2008-09-08 4:10 ` [U-Boot] [PATCH] Fix out-of-tree tools/fdt build Jerry Van Baren
0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2008-09-06 21:21 UTC (permalink / raw)
To: u-boot
Dear JerryVanBaren,
In message <48B53DB8.5040904@ge.com> you wrote:
>
> ...thinking...
> gvb
> (...but don't expect much this weekend, it is Labor Day weekend in the
> USofA, the traditional last "hurrah" of summer).
Any clever ideas yet? [I didn't find a god solution yet.]
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is your destiny. - Darth Vader
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] Fix out-of-tree tools/fdt build
2008-09-06 21:21 ` Wolfgang Denk
@ 2008-09-08 4:10 ` Jerry Van Baren
2008-09-08 4:28 ` Jerry Van Baren
0 siblings, 1 reply; 8+ messages in thread
From: Jerry Van Baren @ 2008-09-08 4:10 UTC (permalink / raw)
To: u-boot
The fdt header files must come from the u-boot versions when building
the tools (we must use the same definitions in the tools as in the
u-boot image). To ensure this, generate the "fdt_host.h" file in the
Makefile to use the full path to the u-boot fdt header files.
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
---
This is *NOT* a final answer. I'm still getting a build error that I
cannot figure out so I figured I would appeal to the Wisdom of the List.
In this patch, I'm auto-generating the fdt_host.h header to specifically
include the u-boot fdt headers (as opposed to the host's headers).
There may be better way(s) of doing this and there are the aforementioned
errors to fix. Treat this as a challenge for improvements. ;-)
Thanks,
gvb
Makefile | 1 +
include/image.h | 4 ++++
tools/Makefile | 36 ++++++++++++++++++++++++++----------
tools/fdt_host.h | 28 ----------------------------
tools/mkimage.h | 2 +-
5 files changed, 32 insertions(+), 39 deletions(-)
delete mode 100644 tools/fdt_host.h
diff --git a/Makefile b/Makefile
index 8d82ef5..be08685 100644
--- a/Makefile
+++ b/Makefile
@@ -3152,6 +3152,7 @@ clean:
@rm -f $(obj)nand_spl/{u-boot-spl,u-boot-spl.map,System.map}
@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl-2k.bin,ipl-4k.bin,ipl.map}
@rm -f $(obj)api_examples/demo $(VERSION_FILE)
+ @rm -f $(SRCTREE)/tools/fdt_host.h
@find $(OBJTREE) -type f \
\( -name 'core' -o -name '*.bak' -o -name '*~' \
-o -name '*.o' -o -name '*.a' \) -print \
diff --git a/include/image.h b/include/image.h
index 9be806e..f28e9fc 100644
--- a/include/image.h
+++ b/include/image.h
@@ -55,9 +55,13 @@
#endif
#if defined(CONFIG_FIT)
+#ifndef USE_HOSTCC
#include <fdt.h>
#include <libfdt.h>
#include <fdt_support.h>
+#else
+#include <fdt_host.h>
+#endif
#define CONFIG_MD5 /* FIT images need MD5 support */
#endif
diff --git a/tools/Makefile b/tools/Makefile
index 21ea1c2..5ab5456 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -124,9 +124,11 @@ BINS := $(addprefix $(obj),$(BIN_FILES))
CPPFLAGS = -idirafter $(SRCTREE)/include \
-idirafter $(OBJTREE)/include2 \
-idirafter $(OBJTREE)/include \
+ -idirafter $(OBJTREE)/tools \
-DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC
CFLAGS = $(HOST_CFLAGS) $(CPPFLAGS) -O
+
# No -pedantic switch to avoid libfdt compilation warnings
FIT_CFLAGS = -Wall $(CPPFLAGS) -O
@@ -190,10 +192,10 @@ $(obj)md5.o: $(obj)md5.c
$(obj)sha1.o: $(obj)sha1.c
$(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)image.o: $(obj)image.c
+$(obj)image.o: $(obj)image.c $(obj)fdt_host.h
$(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)mkimage.o: $(src)mkimage.c
+$(obj)mkimage.o: $(src)mkimage.c $(obj)fdt_host.h
$(CC) -g $(FIT_CFLAGS) -c -o $@ $<
$(obj)ncb.o: $(src)ncb.c
@@ -208,19 +210,19 @@ $(obj)inca-swap-bytes.o: $(src)inca-swap-bytes.c
$(obj)mpc86x_clk.o: $(src)mpc86x_clk.c
$(CC) -g $(CFLAGS) -c -o $@ $<
-$(obj)fdt.o: $(obj)fdt.c
+$(obj)fdt.o: $(obj)fdt.c $(obj)fdt_host.h
$(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_ro.o: $(obj)fdt_ro.c
+$(obj)fdt_ro.o: $(obj)fdt_ro.c $(obj)fdt_host.h
$(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_rw.o: $(obj)fdt_rw.c
+$(obj)fdt_rw.o: $(obj)fdt_rw.c $(obj)fdt_host.h
$(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_strerror.o: $(obj)fdt_strerror.c
+$(obj)fdt_strerror.o: $(obj)fdt_strerror.c $(obj)fdt_host.h
$(CC) -g $(FIT_CFLAGS) -c -o $@ $<
-$(obj)fdt_wip.o: $(obj)fdt_wip.c
+$(obj)fdt_wip.o: $(obj)fdt_wip.c $(obj)fdt_host.h
$(CC) -g $(FIT_CFLAGS) -c -o $@ $<
subdirs:
@@ -266,9 +268,6 @@ $(obj)image.c:
if [ ! -f $(obj)mkimage.h ] ; then \
ln -s $(src)../tools/mkimage.h $(obj)mkimage.h; \
fi
- if [ ! -f $(obj)fdt_host.h ] ; then \
- ln -s $(src)../tools/fdt_host.h $(obj)fdt_host.h; \
- fi
$(obj)fdt.c: $(obj)libfdt_internal.h
@rm -f $(obj)fdt.c
@@ -297,6 +296,23 @@ $(obj)libfdt_internal.h:
$(LOGO_H): $(obj)bmp_logo $(LOGO_BMP)
$(obj)./bmp_logo $(LOGO_BMP) >$@
+#
+# fdt_host.h has to point to the u-boot version of the libfdt headers
+#
+$(obj)fdt_host.h:
+ echo "Auto-generating fdt_host.h"
+ @echo "/* AUTO GENERATED, do not edit manually */" > $@
+ @echo "" >> $@
+ @echo "#ifndef __FDT_HOST_H__" >> $@
+ @echo "#define __FDT_HOST_H__" >> $@
+ @echo "" >> $@
+ @echo "/* Include u-boot, *not* the host, version of libfdt include files */" >> $@
+ @echo "#include \"$(SRCTREE)/include/fdt.h\"" >> $@
+ @echo "#include \"$(SRCTREE)/include/libfdt.h\"" >> $@
+ @echo "#include \"$(SRCTREE)/include/fdt_support.h\"" >> $@
+ @echo "" >> $@
+ @echo "#endif /* __FDT_HOST_H__ */" >> $@
+
#########################################################################
# defines $(obj).depend target
diff --git a/tools/fdt_host.h b/tools/fdt_host.h
deleted file mode 100644
index 085013e..0000000
--- a/tools/fdt_host.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * (C) Copyright 2008 Semihalf
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef __FDT_HOST_H__
-#define __FDT_HOST_H__
-
-/* Make sure to include u-boot version of libfdt include files */
-#include "../include/fdt.h"
-#include "../include/libfdt.h"
-#include "../include/fdt_support.h"
-
-#endif /* __FDT_HOST_H__ */
diff --git a/tools/mkimage.h b/tools/mkimage.h
index a2d5248..be94a02 100644
--- a/tools/mkimage.h
+++ b/tools/mkimage.h
@@ -33,7 +33,7 @@
#include <time.h>
#include <unistd.h>
#include <sha1.h>
-#include "fdt_host.h"
+#include <fdt_host.h>
#define MKIMAGE_DEBUG
--
1.5.6.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] Fix out-of-tree tools/fdt build
2008-09-08 4:10 ` [U-Boot] [PATCH] Fix out-of-tree tools/fdt build Jerry Van Baren
@ 2008-09-08 4:28 ` Jerry Van Baren
0 siblings, 0 replies; 8+ messages in thread
From: Jerry Van Baren @ 2008-09-08 4:28 UTC (permalink / raw)
To: u-boot
Jerry Van Baren wrote:
> The fdt header files must come from the u-boot versions when building
> the tools (we must use the same definitions in the tools as in the
> u-boot image). To ensure this, generate the "fdt_host.h" file in the
> Makefile to use the full path to the u-boot fdt header files.
>
> Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
> ---
>
> This is *NOT* a final answer. I'm still getting a build error that I
> cannot figure out so I figured I would appeal to the Wisdom of the List.
>
> In this patch, I'm auto-generating the fdt_host.h header to specifically
> include the u-boot fdt headers (as opposed to the host's headers).
> There may be better way(s) of doing this and there are the aforementioned
> errors to fix. Treat this as a challenge for improvements. ;-)
>
> Thanks,
> gvb
>
> Makefile | 1 +
> include/image.h | 4 ++++
> tools/Makefile | 36 ++++++++++++++++++++++++++----------
> tools/fdt_host.h | 28 ----------------------------
> tools/mkimage.h | 2 +-
> 5 files changed, 32 insertions(+), 39 deletions(-)
> delete mode 100644 tools/fdt_host.h
>
> diff --git a/Makefile b/Makefile
> index 8d82ef5..be08685 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3152,6 +3152,7 @@ clean:
> @rm -f $(obj)nand_spl/{u-boot-spl,u-boot-spl.map,System.map}
> @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl-2k.bin,ipl-4k.bin,ipl.map}
> @rm -f $(obj)api_examples/demo $(VERSION_FILE)
> + @rm -f $(SRCTREE)/tools/fdt_host.h
Arrgh, this should have been:
@rm -f $(obj)fdt_host.h
(missed that change as my technique evolved). This doesn't affect the
aforementioned errors to be fixed or the challenge for improvements.
gvb
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-09-08 4:28 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-27 0:13 [U-Boot] libfdt/fdt_ro.c build issues Wolfgang Denk
2008-08-27 2:04 ` Jerry Van Baren
2008-08-27 7:42 ` Wolfgang Denk
2008-08-27 8:04 ` Wolfgang Denk
2008-08-27 11:42 ` JerryVanBaren
2008-09-06 21:21 ` Wolfgang Denk
2008-09-08 4:10 ` [U-Boot] [PATCH] Fix out-of-tree tools/fdt build Jerry Van Baren
2008-09-08 4:28 ` Jerry Van Baren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox