All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] tools/libs: fix build rules to correctly deal with multiple public headers
@ 2020-10-19  7:19 Jan Beulich
  2020-10-19  7:21 ` [PATCH 1/2] tools/libs: fix header symlinking rule Jan Beulich
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jan Beulich @ 2020-10-19  7:19 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu

1: fix header symlinking rule
2: fix uninstall rule for header files

Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] tools/libs: fix header symlinking rule
  2020-10-19  7:19 [PATCH 0/2] tools/libs: fix build rules to correctly deal with multiple public headers Jan Beulich
@ 2020-10-19  7:21 ` Jan Beulich
  2020-10-19  7:21 ` [PATCH 2/2] tools/libs: fix uninstall rule for header files Jan Beulich
  2020-10-21 12:05 ` [PATCH 0/2] tools/libs: fix build rules to correctly deal with multiple public headers Jan Beulich
  2 siblings, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2020-10-19  7:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu

Unlike pattern rules, ordinary rules with multiple targets have their
commands executed once per target. Hence when $(LIBHEADERS) expands to
more than just one item, multiple identical commands would have been
issued, which have been observed to cause build failures relatively
frequently after libx{c,l} code was moved to tools/libs/{ctrl,light}/.
Use a static pattern rule instead.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I'm aware Jürgen has a series pending to entirely remove the rule in
question, but this being an isolated fix which ought to be easier to
review, I thought I'd still post it. Re-basing his series over this
change should be straightforward.
However, for the above reason I'm not bothering getting right the
theoretical case of headers in subdirs of the respective include/ being
mentioned in $(LIBHEADER).

--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -79,8 +79,8 @@ headers.chk: $(LIBHEADERSGLOB) $(AUTOINC
 libxen$(LIBNAME).map:
 	echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >$@
 
-$(LIBHEADERSGLOB): $(LIBHEADERS)
-	for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/include; done
+$(LIBHEADERSGLOB): $(XEN_ROOT)/tools/include/%.h: include/%.h
+	ln -sf $(CURDIR)/$< $(XEN_ROOT)/tools/include/
 
 lib$(LIB_FILE_NAME).a: $(LIB_OBJS)
 	$(AR) rc $@ $^



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] tools/libs: fix uninstall rule for header files
  2020-10-19  7:19 [PATCH 0/2] tools/libs: fix build rules to correctly deal with multiple public headers Jan Beulich
  2020-10-19  7:21 ` [PATCH 1/2] tools/libs: fix header symlinking rule Jan Beulich
@ 2020-10-19  7:21 ` Jan Beulich
  2020-10-29 13:47   ` Ping: " Jan Beulich
  2020-10-29 15:24   ` Bertrand Marquis
  2020-10-21 12:05 ` [PATCH 0/2] tools/libs: fix build rules to correctly deal with multiple public headers Jan Beulich
  2 siblings, 2 replies; 7+ messages in thread
From: Jan Beulich @ 2020-10-19  7:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu

This again was working right only as long as $(LIBHEADER) consisted of
just one entry.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
An alternative would be to use $(addprefix ) without any shell loop.

--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -107,7 +107,7 @@ install: build
 .PHONY: uninstall
 uninstall:
 	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
-	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done
+	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$$i; done
 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] tools/libs: fix build rules to correctly deal with multiple public headers
  2020-10-19  7:19 [PATCH 0/2] tools/libs: fix build rules to correctly deal with multiple public headers Jan Beulich
  2020-10-19  7:21 ` [PATCH 1/2] tools/libs: fix header symlinking rule Jan Beulich
  2020-10-19  7:21 ` [PATCH 2/2] tools/libs: fix uninstall rule for header files Jan Beulich
@ 2020-10-21 12:05 ` Jan Beulich
  2 siblings, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2020-10-21 12:05 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Wei Liu

On 19.10.2020 09:19, Jan Beulich wrote:
> 1: fix header symlinking rule
> 2: fix uninstall rule for header files

Actually I've noticed these issues were introduced relatively
recently only, in particular after 4.14. I've added

Fixes: bc44e2fb3199 ("tools: add a copy of library headers in tools/include")

to both of them, albeit with the above they won't need even
just considering of backport.

Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Ping: [PATCH 2/2] tools/libs: fix uninstall rule for header files
  2020-10-19  7:21 ` [PATCH 2/2] tools/libs: fix uninstall rule for header files Jan Beulich
@ 2020-10-29 13:47   ` Jan Beulich
  2020-10-29 15:24   ` Bertrand Marquis
  1 sibling, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2020-10-29 13:47 UTC (permalink / raw)
  To: Ian Jackson, Wei Liu; +Cc: xen-devel

On 19.10.2020 09:21, Jan Beulich wrote:
> This again was working right only as long as $(LIBHEADER) consisted of
> just one entry.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

While patch 1 has become irrelevant with Juergen's more complete
change, this one is still applicable afaict.

Jan

> ---
> An alternative would be to use $(addprefix ) without any shell loop.
> 
> --- a/tools/libs/libs.mk
> +++ b/tools/libs/libs.mk
> @@ -107,7 +107,7 @@ install: build
>  .PHONY: uninstall
>  uninstall:
>  	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
> -	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done
> +	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$$i; done
>  	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
>  	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
>  	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
> 
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] tools/libs: fix uninstall rule for header files
  2020-10-19  7:21 ` [PATCH 2/2] tools/libs: fix uninstall rule for header files Jan Beulich
  2020-10-29 13:47   ` Ping: " Jan Beulich
@ 2020-10-29 15:24   ` Bertrand Marquis
  2020-11-23 13:23     ` Ping²: " Jan Beulich
  1 sibling, 1 reply; 7+ messages in thread
From: Bertrand Marquis @ 2020-10-29 15:24 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Ian Jackson, Wei Liu



> On 19 Oct 2020, at 08:21, Jan Beulich <jbeulich@suse.com> wrote:
> 
> This again was working right only as long as $(LIBHEADER) consisted of
> just one entry.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

The change is obviously fixing a bug :-) and the double $ is required to protect from make.

Cheers
Bertrand


> ---
> An alternative would be to use $(addprefix ) without any shell loop.
> 
> --- a/tools/libs/libs.mk
> +++ b/tools/libs/libs.mk
> @@ -107,7 +107,7 @@ install: build
> .PHONY: uninstall
> uninstall:
> 	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
> -	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done
> +	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$$i; done
> 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
> 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
> 	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
> 
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Ping²: [PATCH 2/2] tools/libs: fix uninstall rule for header files
  2020-10-29 15:24   ` Bertrand Marquis
@ 2020-11-23 13:23     ` Jan Beulich
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2020-11-23 13:23 UTC (permalink / raw)
  To: Ian Jackson, Wei Liu; +Cc: xen-devel, Bertrand Marquis

On 29.10.2020 16:24, Bertrand Marquis wrote:
>> On 19 Oct 2020, at 08:21, Jan Beulich <jbeulich@suse.com> wrote:
>>
>> This again was working right only as long as $(LIBHEADER) consisted of
>> just one entry.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> 
> The change is obviously fixing a bug :-) and the double $ is required to protect from make.

I'll give it a day or two more to get an ack (or any negative
form of feedback), but I guess I'll go ahead and commit this
with just Bertrand's R-b otherwise.

Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-23 13:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19  7:19 [PATCH 0/2] tools/libs: fix build rules to correctly deal with multiple public headers Jan Beulich
2020-10-19  7:21 ` [PATCH 1/2] tools/libs: fix header symlinking rule Jan Beulich
2020-10-19  7:21 ` [PATCH 2/2] tools/libs: fix uninstall rule for header files Jan Beulich
2020-10-29 13:47   ` Ping: " Jan Beulich
2020-10-29 15:24   ` Bertrand Marquis
2020-11-23 13:23     ` Ping²: " Jan Beulich
2020-10-21 12:05 ` [PATCH 0/2] tools/libs: fix build rules to correctly deal with multiple public headers Jan Beulich

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.