From: Bin Meng Date: Sun, 27 Oct 2019 12:19:47 +0000 (-0700) Subject: tools: Avoid creating symbolic links for tools/version.h X-Git-Tag: v2020.01-rc1~2^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4d90f6cd9813cb513303a91d8b53e1ee027324bd;p=oweals%2Fu-boot.git tools: Avoid creating symbolic links for tools/version.h When building U-Boot host tools for Windows from Microsoft Azure Pipelines, the following errors were seen: HOSTCC tools/mkenvimage.o In file included from tools/mkenvimage.c:25: ./tools/version.h:1:1: error: expected identifier or ‘(’ before ‘.’ token 1 | ../include/version.h | ^ tools/mkenvimage.c: In function ‘main’: tools/mkenvimage.c:117:4: warning: implicit declaration of function ‘usage’ [-Wimplicit-function-declaration] 117 | usage(prg); | ^~~~~ tools/mkenvimage.c:120:35: error: ‘PLAIN_VERSION’ undeclared (first use in this function) 120 | printf("%s version %s\n", prg, PLAIN_VERSION); | ^~~~~~~~~~~~~ tools/mkenvimage.c:120:35: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [scripts/Makefile.host:114: tools/mkenvimage.o] Error 1 It turns out tools/version.h is a symbolic link and with Windows default settings it is unsupported hence the actual content of tools/version.h is not what file include/version.h has, but the the linked file path, which breaks the build. To fix this, remove the symbolic links for tools/version.h. Instead we perform a copy from include/version.h during the build. Signed-off-by: Bin Meng --- diff --git a/Makefile b/Makefile index cbacf1cfe2..e78b3179b1 100644 --- a/Makefile +++ b/Makefile @@ -1837,11 +1837,14 @@ checkarmreloc: u-boot false; \ fi -envtools: scripts_basic $(version_h) $(timestamp_h) +tools/version.h: include/version.h + $(call if_changed,copy) + +envtools: scripts_basic $(version_h) $(timestamp_h) tools/version.h $(Q)$(MAKE) $(build)=tools/env tools-only: export TOOLS_ONLY=y -tools-only: scripts_basic $(version_h) $(timestamp_h) +tools-only: scripts_basic $(version_h) $(timestamp_h) tools/version.h $(Q)$(MAKE) $(build)=tools tools-all: export HOST_TOOLS_ALL=y @@ -1869,7 +1872,7 @@ CLEAN_DIRS += $(MODVERDIR) \ $(foreach d, spl tpl, $(patsubst %,$d/%, \ $(filter-out include, $(shell ls -1 $d 2>/dev/null)))) -CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \ +CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h tools/version.h \ boot* u-boot* MLO* SPL System.map fit-dtb.blob* # Directories & files removed with 'make mrproper' diff --git a/tools/.gitignore b/tools/.gitignore index bd03d32f68..d0176a7283 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -31,4 +31,5 @@ /spl_size_limit /sunxi-spl-image-builder /ubsha1 +/version.h /xway-swap-bytes diff --git a/tools/version.h b/tools/version.h deleted file mode 120000 index bb576071e8..0000000000 --- a/tools/version.h +++ /dev/null @@ -1 +0,0 @@ -../include/version.h \ No newline at end of file