On Thu, Nov 07, 2019 at 08:29:25PM +0530, dharani kumar wrote: > Hi, > > I am unable to build dtc-1.5.1. Please see the log below. > I am using arm-none-eabi-gcc cross compiler toolchain. What's the machine and environment that cross compiler is targeting? libfdt has minimal dependencies and should be buildable for many environments including strange and limited ones (like bootloaders and kernels). dtc, however requires a more conventional POSIX like environment. In fact it's not well tested on non-Linux environments, so there may well be problems there. The point is, that cross compiling dtc (as opposed to libfdt) seems like it might not be what you want to do. > I am using ubuntu machine to build. > > i modified the makefile to remove -werror flag. since i wanted to > suppress this " util.c:396:17: warning: format '%x' expects argument > of type 'unsigned int', but argument 2 has type 'uint32_t {aka long > unsigned int}' [-Wformat=]" as warning. That one's a bug in dtc - just no-one's noticed before. I just committed a fix for it to master. It does, however, suggest that int is not 32-bit in your target environment, which again suggests it's an unusual one where you might not be wanting to run dtc anyway. > And i also added --specs=nosys.specs to C flags. In order to suppress > few errors. Check this > https://stackoverflow.com/questions/19419782/exit-c-text0x18-undefined-reference-to-exit-when-using-arm-none-eabi-gcc No _exit() function? That really doesn't sound like a Unix-ish environment you could reasonably run dtc in. > But still the build fails. Kindly help. > > $make clean > $make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar [snip] > DEP fstree.c > In file included from /usr/include/newlib/dirent.h:7:0, > from fstree.c:8: > /usr/include/newlib/sys/dirent.h:10:2: error: #error "<dirent.h> not supported" > #error "<dirent.h> not supported" > ^~~~~ Again, looks like your target environment doesn't have things dtc needs. You might want "make libfdt" to build libfdt only, without dtc. > DEP flattree.c > DEP dtc.c > DEP data.c > DEP checks.c > CHK version_gen.h > UPD version_gen.h > DEP util.c > CHK version_gen.h > CC srcpos.o > CC util.o > util.c: In function 'utilfdt_print_data': > util.c:396:17: warning: format '%x' expects argument of type 'unsigned > int', but argument 2 has type 'uint32_t {aka long unsigned int}' > [-Wformat=] > printf("0x%08x%s", fdt32_to_cpu(cell[i]), > ^ > CC convert-dtsv0-lexer.lex.o > LD convert-dtsv0 > convert-dtsv0-lexer.lex.o: In function `yylex': > /home/janani/workspace/dtc-1.5.1/convert-dtsv0-lexer.l:106: undefined > reference to `fnmatch' > collect2: error: ld returned 1 exit status > Makefile:250: recipe for target 'convert-dtsv0' failed > make: *** [convert-dtsv0] Error 1 > > Regards, > Dharani kumar > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Attachment:
signature.asc
Description: PGP signature