All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 7/8] tools: Avoid creating symbolic links for tools/version.h
Date: Wed, 23 Oct 2019 20:11:51 -0700	[thread overview]
Message-ID: <1571886712-24514-8-git-send-email-bmeng.cn@gmail.com> (raw)
In-Reply-To: <1571886712-24514-1-git-send-email-bmeng.cn@gmail.com>

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 <bmeng.cn@gmail.com>

---

Changes in v2:
- new patch: tools: Avoid creating symbolic links for tools/version.h

 Makefile         | 9 ++++++---
 tools/.gitignore | 1 +
 tools/version.h  | 1 -
 3 files changed, 7 insertions(+), 4 deletions(-)
 delete mode 120000 tools/version.h

diff --git a/Makefile b/Makefile
index cbacf1c..e78b317 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 bd03d32..d0176a7 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 bb57607..0000000
--- a/tools/version.h
+++ /dev/null
@@ -1 +0,0 @@
-../include/version.h
\ No newline at end of file
-- 
2.7.4

  parent reply	other threads:[~2019-10-24  3:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24  3:11 [U-Boot] [PATCH v2 0/8] tools: Support building U-Boot host tools for Windows via MSYS2 Bin Meng
2019-10-24  3:11 ` [U-Boot] [PATCH v2 1/8] tools: image.h: Use portable uint32_t instead of linux-specific __be32 Bin Meng
2019-10-24  3:11 ` [U-Boot] [PATCH v2 2/8] tools: mtk_image.h: Use portable uintXX_t instead of linux-specific __leXX Bin Meng
2019-10-24  3:11 ` [U-Boot] [PATCH v2 3/8] tools: zynqmpbif: Use compiler builtin instead of linux-specific __swab32 Bin Meng
2019-10-24  3:11 ` [U-Boot] [PATCH v2 4/8] linux/types.h: Surround 'struct ustat' with __linux__ Bin Meng
2019-10-24  3:11 ` [U-Boot] [PATCH v2 5/8] doc: Add documentation for how to build U-Boot host tools Bin Meng
2019-10-24  3:11 ` [U-Boot] [PATCH v2 6/8] Add .gitattributes for line endings Bin Meng
2019-10-24  3:11 ` Bin Meng [this message]
2019-10-24  3:11 ` [U-Boot] [PATCH v2 8/8] Add Micirosoft Azure pipelines configuration Bin Meng
2019-10-24 15:01   ` Tom Rini
2019-10-24 15:10     ` Bin Meng
2019-10-24 15:31       ` Bin Meng
2019-10-24 15:38         ` Tom Rini
2019-10-25  5:52           ` Bin Meng
2019-10-26 12:12             ` Bin Meng
2019-10-26 12:32               ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1571886712-24514-8-git-send-email-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.