Skip to contentSkip to conversation

tools/libxc: Fix use of zlib-options when building the domain builder

PATCH In review Andrew Cooper 4 participants 4 messages Feb 12, 2016 – Feb 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/libxc: Fix use of zlib-options when building the domain builder

c/s de0f8c7c changed the use of zlib-options, and moved it from being locally generated to coming from ./configure.

However, it neglected to modify the users of zlib-options. The curious use of $(call ...) was to select either the -D or -l options as appropriate, but c/s de0f8c7c broke this by loosing the grep.

Instead, use $(filter ...) to pick out either the -D or -l options. This fixes the build with Clang, which complains at passing '-llzma' when trying to compile xc_dom_bzimageloader.c to xc_dom_bzimageloader.o.

---
CC: Roger Pau Monne <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>

---
 tools/libxc/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/libxc/Makefile +3 -3
index 0a8614c..608404f 100644
@@ -226,10 +226,10 @@ else
 zlib-options = $(ZLIB)
 endif
 
-xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)
-xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D)
+xc_dom_bzimageloader.o: CFLAGS += $(filter -D%,$(zlib-options))
+xc_dom_bzimageloader.opic: CFLAGS += $(filter -D%,$(zlib-options))
 
-libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l)
+libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options))
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Andrew Cooper

c/s de0f8c7c changed the use of zlib-options, and moved it from being locally generated to coming from ./configure.

Wow, this is ancient commit.

Quoted 9 lines

However, it neglected to modify the users of zlib-options. The curious use of $(call ...) was to select either the -D or -l options as appropriate, but c/s de0f8c7c broke this by loosing the grep.

Instead, use $(filter ...) to pick out either the -D or -l options. This fixes the build with Clang, which complains at passing '-llzma' when trying to compile xc_dom_bzimageloader.c to xc_dom_bzimageloader.o.

Quoted 30 lines

---
CC: Roger Pau Monne <[email protected]>
CC: Ian Campbell <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>

---
 tools/libxc/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/libxc/Makefile +3 -3
index 0a8614c..608404f 100644
@@ -226,10 +226,10 @@ else
 zlib-options = $(ZLIB)
 endif
 
-xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)
-xc_dom_bzimageloader.opic: CFLAGS += $(call zlib-options,D)
+xc_dom_bzimageloader.o: CFLAGS += $(filter -D%,$(zlib-options))
+xc_dom_bzimageloader.opic: CFLAGS += $(filter -D%,$(zlib-options))
 
-libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(call zlib-options,l)
+libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options))
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
 	$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
 
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#2 lore raw
In reply to Andrew Cooper

El 12/2/16 a les 20:21, Andrew Cooper ha escrit:

Quoted 7 lines

c/s de0f8c7c changed the use of zlib-options, and moved it from being locally generated to coming from ./configure.

However, it neglected to modify the users of zlib-options. The curious use of $(call ...) was to select either the -D or -l options as appropriate, but c/s de0f8c7c broke this by loosing the grep.

Quoted 5 lines

Instead, use $(filter ...) to pick out either the -D or -l options. This fixes the build with Clang, which complains at passing '-llzma' when trying to compile xc_dom_bzimageloader.c to xc_dom_bzimageloader.o.

Wow, good catch, thanks.

Roger.

#3 lore raw

Roger Pau Monné writes ("Re: [PATCH] tools/libxc: Fix use of zlib-options when building the domain builder"):

Quoted 12 lines

El 12/2/16 a les 20:21, Andrew Cooper ha escrit:

Quoted 11 lines

c/s de0f8c7c changed the use of zlib-options, and moved it from being locally generated to coming from ./configure.

However, it neglected to modify the users of zlib-options. The curious use of $(call ...) was to select either the -D or -l options as appropriate, but c/s de0f8c7c broke this by loosing the grep.

Instead, use $(filter ...) to pick out either the -D or -l options. This fixes the build with Clang, which complains at passing '-llzma' when trying to compile xc_dom_bzimageloader.c to xc_dom_bzimageloader.o.

Quoted 5 lines
Quoted 1 line

Wow, good catch, thanks.