Skip to contentSkip to conversation

Build fixes

PATCH In review Andrew Cooper 2 participants 5 messages Sep 14, 2020

lore
Share & tools
lore
#0 lore raw

cover Build fixes

As demonstrated by Gitlab CI.

Still pending is the xenstat fix, and a newly discovered randconfig issue.

Andrew Cooper (2):
tools/libs/vchan: Don't run the headers check
tools/Makefile: Drop the use of $(file ...)

 tools/Rules.mk            | 52 +++++++++++++++++++++++++----------------------
 tools/libs/vchan/Makefile |  2 ++
 2 files changed, 30 insertions(+), 24 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/2 tools/libs/vchan: Don't run the headers check

There was never a headers check previously, and CentOS 6 can't cope with the anonymous union in struct libxenvchan.

cc1: warnings being treated as errors
... tools/include/libxenvchan.h:75: error: declaration does not declare anything make[6]: *** [headers.chk] Error 1

Fixes 8ab2429f12 ("tools: split libxenvchan into new tools/libs/vchan directory")

---
CC: Juergen Gross <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>

---
 tools/libs/vchan/Makefile | 2 ++
 1 file changed, 2 insertions(+)
tools/libs/vchan/Makefile +2 -0
index 87ff608f45..5e18d5b196 100644
@@ -8,6 +8,8 @@ LIBHEADER := libxenvchan.h
 SRCS-y += init.c
 SRCS-y += io.c
 
+NO_HEADERS_CHK := y
+
 include $(XEN_ROOT)/tools/libs/libs.mk
 
 $(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_libxenvchan)/include
Signature · 1 line
2.11.0
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] tools/libs/vchan: Don't run the headers check

Quoted 9 lines · Andrew Cooper

There was never a headers check previously, and CentOS 6 can't cope with the anonymous union in struct libxenvchan.

cc1: warnings being treated as errors
... tools/include/libxenvchan.h:75: error: declaration does not declare anything make[6]: *** [headers.chk] Error 1

Fixes 8ab2429f12 ("tools: split libxenvchan into new tools/libs/vchan directory")
#3 lore raw

PATCH 2/2 tools/Makefile: Drop the use of $(file ...)

In reply to Andrew Cooper

It is only available in make 4.0 and later, and not for example in CentOS 7.

Rewrite the logic to use echo and shell redirection, using a single capture group to avoid having 12 different processes in quick succession each appending one line to the file.

Fixes 52dbd6f07cea7a ("tools: generate pkg-config files from make variables")

---
CC: Juergen Gross <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>

---
 tools/Rules.mk | 52 ++++++++++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 24 deletions(-)
tools/Rules.mk +28 -24
index 4fd91fa444..a71abb2e4f 100644
@@ -186,29 +186,33 @@ $(PKG_CONFIG_DIR):
 	mkdir -p $(PKG_CONFIG_DIR)
 
 $(PKG_CONFIG_DIR)/%.pc: Makefile $(XEN_ROOT)/tools/Rules.mk $(PKG_CONFIG_DIR)
-	$(file >$@,prefix=$(PKG_CONFIG_PREFIX))
-	$(file >>$@,includedir=$(PKG_CONFIG_INCDIR))
-	$(file >>$@,libdir=$(PKG_CONFIG_LIBDIR))
-	$(foreach var,$(PKG_CONFIG_VARS),$(file >>$@,$(var)))
-	$(file >>$@,)
-	$(file >>$@,Name: $(PKG_CONFIG_NAME))
-	$(file >>$@,Description: $(PKG_CONFIG_DESC))
-	$(file >>$@,Version: $(PKG_CONFIG_VERSION))
-	$(file >>$@,Cflags: -I$${includedir} $(CFLAGS_xeninclude))
-	$(file >>$@,Libs: -L$${libdir} $(PKG_CONFIG_USELIBS) -l$(PKG_CONFIG_LIB))
-	$(file >>$@,Libs.private: $(PKG_CONFIG_LIBSPRIV))
-	$(file >>$@,Requires.private: $(PKG_CONFIG_REQPRIV))
+	{ \
+	echo "prefix=$(PKG_CONFIG_PREFIX)"; \
+	echo "includedir=$(PKG_CONFIG_INCDIR)"; \
+	echo "libdir=$(PKG_CONFIG_LIBDIR)"; \
+	$(foreach var,$(PKG_CONFIG_VARS),echo $(var);) \
+	echo ""; \
+	echo "Name: $(PKG_CONFIG_NAME)"; \
+	echo "Description: $(PKG_CONFIG_DESC)"; \
+	echo "Version: $(PKG_CONFIG_VERSION)"; \
+	echo "Cflags: -I\$${includedir} $(CFLAGS_xeninclude)"; \
+	echo "Libs: -L\$${libdir} $(PKG_CONFIG_USELIBS) -l$(PKG_CONFIG_LIB)"; \
+	echo "Libs.private: $(PKG_CONFIG_LIBSPRIV)"; \
+	echo "Requires.private: $(PKG_CONFIG_REQPRIV)"; \
+	} > $@
 
 %.pc: Makefile $(XEN_ROOT)/tools/Rules.mk
-	$(file >$@,prefix=$(PKG_CONFIG_PREFIX))
-	$(file >>$@,includedir=$(PKG_CONFIG_INCDIR))
-	$(file >>$@,libdir=$(PKG_CONFIG_LIBDIR))
-	$(foreach var,$(PKG_CONFIG_VARS),$(file >>$@,$(var)))
-	$(file >>$@,)
-	$(file >>$@,Name: $(PKG_CONFIG_NAME))
-	$(file >>$@,Description: $(PKG_CONFIG_DESC))
-	$(file >>$@,Version: $(PKG_CONFIG_VERSION))
-	$(file >>$@,Cflags: -I$${includedir})
-	$(file >>$@,Libs: -L$${libdir} -l$(PKG_CONFIG_LIB))
-	$(file >>$@,Libs.private: $(PKG_CONFIG_LIBSPRIV))
-	$(file >>$@,Requires.private: $(PKG_CONFIG_REQPRIV))
+	{ \
+	echo "prefix=$(PKG_CONFIG_PREFIX)"; \
+	echo "includedir=$(PKG_CONFIG_INCDIR)"; \
+	echo "libdir=$(PKG_CONFIG_LIBDIR)"; \
+	$(foreach var,$(PKG_CONFIG_VARS),echo $(var);) \
+	echo ""; \
+	echo "Name: $(PKG_CONFIG_NAME)"; \
+	echo "Description: $(PKG_CONFIG_DESC)"; \
+	echo "Version: $(PKG_CONFIG_VERSION)"; \
+	echo "Cflags: -I\$${includedir}"; \
+	echo "Libs: -L\$${libdir} -l$(PKG_CONFIG_LIB)"; \
+	echo "Libs.private: $(PKG_CONFIG_LIBSPRIV)"; \
+	echo "Requires.private: $(PKG_CONFIG_REQPRIV)"; \
+	} > $@
Signature · 1 line
2.11.0
Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] tools/Makefile: Drop the use of $(file ...)

Quoted 8 lines · Andrew Cooper

It is only available in make 4.0 and later, and not for example in CentOS 7.

Rewrite the logic to use echo and shell redirection, using a single capture group to avoid having 12 different processes in quick succession each appending one line to the file.

Fixes 52dbd6f07cea7a ("tools: generate pkg-config files from make variables")