All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/go: honor append build flags
@ 2021-07-07  7:15 Roger Pau Monne
  2021-07-07 13:42 ` Nick Rosbrook
  0 siblings, 1 reply; 4+ messages in thread
From: Roger Pau Monne @ 2021-07-07  7:15 UTC (permalink / raw)
  To: xen-devel
  Cc: Roger Pau Monne, George Dunlap, Nick Rosbrook, Ian Jackson,
	Wei Liu, Ting-Wei Lan

Make the go build use APPEND_{C/LD}FLAGS when necessary, just like
other parts of the build.

Reported-by: Ting-Wei Lan <lantw44@gmail.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Note sure if it's the best way to add the appended flags, I'm not
familiar with the go build system. In any case this fixes the build
when required libraries (ie: yajl) are not part of the system search
path and instead passed in APPEND_{C/LD}FLAGS.
---
 tools/golang/xenlight/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile
index e394ef9b2b..64671f246c 100644
--- a/tools/golang/xenlight/Makefile
+++ b/tools/golang/xenlight/Makefile
@@ -27,7 +27,7 @@ GOXL_GEN_FILES = types.gen.go helpers.gen.go
 # so that it can find the actual library.
 .PHONY: build
 build: xenlight.go $(GOXL_GEN_FILES)
-	CGO_CFLAGS="$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog)" CGO_LDFLAGS="$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_libxenlight) -L$(XEN_libxentoollog)" $(GO) build -x
+	CGO_CFLAGS="$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog) $(APPEND_CFLAGS)" CGO_LDFLAGS="$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_libxenlight) -L$(XEN_libxentoollog) $(APPEND_LDFLAGS)" $(GO) build -x
 
 .PHONY: install
 install: build
-- 
2.31.1



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

* Re: [PATCH] tools/go: honor append build flags
  2021-07-07  7:15 [PATCH] tools/go: honor append build flags Roger Pau Monne
@ 2021-07-07 13:42 ` Nick Rosbrook
  2021-09-13 11:20   ` Roger Pau Monné
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Rosbrook @ 2021-07-07 13:42 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: xen-devel, George Dunlap, Nick Rosbrook, Ian Jackson, Wei Liu,
	Ting-Wei Lan

On Wed, Jul 07, 2021 at 09:15:31AM +0200, Roger Pau Monne wrote:
> Make the go build use APPEND_{C/LD}FLAGS when necessary, just like
> other parts of the build.
> 
> Reported-by: Ting-Wei Lan <lantw44@gmail.com>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Note sure if it's the best way to add the appended flags, I'm not
> familiar with the go build system. In any case this fixes the build
> when required libraries (ie: yajl) are not part of the system search
> path and instead passed in APPEND_{C/LD}FLAGS.

This is right. The CGO_{C,LD}FLAGS environment variables basically work
just like regular {C,LD}FLAGS.

> ---
>  tools/golang/xenlight/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile
> index e394ef9b2b..64671f246c 100644
> --- a/tools/golang/xenlight/Makefile
> +++ b/tools/golang/xenlight/Makefile
> @@ -27,7 +27,7 @@ GOXL_GEN_FILES = types.gen.go helpers.gen.go
>  # so that it can find the actual library.
>  .PHONY: build
>  build: xenlight.go $(GOXL_GEN_FILES)
> -	CGO_CFLAGS="$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog)" CGO_LDFLAGS="$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_libxenlight) -L$(XEN_libxentoollog)" $(GO) build -x
> +	CGO_CFLAGS="$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog) $(APPEND_CFLAGS)" CGO_LDFLAGS="$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_libxenlight) -L$(XEN_libxentoollog) $(APPEND_LDFLAGS)" $(GO) build -x
>  
>  .PHONY: install
>  install: build
> -- 
> 2.31.1
> 
> 
Acked-by: Nick Rosbrook <rosbrookn@ainfosec.com>

Thanks,
NR


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

* Re: [PATCH] tools/go: honor append build flags
  2021-07-07 13:42 ` Nick Rosbrook
@ 2021-09-13 11:20   ` Roger Pau Monné
  2021-09-13 12:39     ` Ian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Roger Pau Monné @ 2021-09-13 11:20 UTC (permalink / raw)
  To: Ian Jackson, Wei Liu
  Cc: xen-devel, George Dunlap, Nick Rosbrook, Nick Rosbrook, Ting-Wei Lan

On Wed, Jul 07, 2021 at 09:42:20AM -0400, Nick Rosbrook wrote:
> On Wed, Jul 07, 2021 at 09:15:31AM +0200, Roger Pau Monne wrote:
> > Make the go build use APPEND_{C/LD}FLAGS when necessary, just like
> > other parts of the build.
> > 
> > Reported-by: Ting-Wei Lan <lantw44@gmail.com>
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> > Note sure if it's the best way to add the appended flags, I'm not
> > familiar with the go build system. In any case this fixes the build
> > when required libraries (ie: yajl) are not part of the system search
> > path and instead passed in APPEND_{C/LD}FLAGS.
> 
> This is right. The CGO_{C,LD}FLAGS environment variables basically work
> just like regular {C,LD}FLAGS.
> 
> > ---
> >  tools/golang/xenlight/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/golang/xenlight/Makefile b/tools/golang/xenlight/Makefile
> > index e394ef9b2b..64671f246c 100644
> > --- a/tools/golang/xenlight/Makefile
> > +++ b/tools/golang/xenlight/Makefile
> > @@ -27,7 +27,7 @@ GOXL_GEN_FILES = types.gen.go helpers.gen.go
> >  # so that it can find the actual library.
> >  .PHONY: build
> >  build: xenlight.go $(GOXL_GEN_FILES)
> > -	CGO_CFLAGS="$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog)" CGO_LDFLAGS="$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_libxenlight) -L$(XEN_libxentoollog)" $(GO) build -x
> > +	CGO_CFLAGS="$(CFLAGS_libxenlight) $(CFLAGS_libxentoollog) $(APPEND_CFLAGS)" CGO_LDFLAGS="$(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -L$(XEN_libxenlight) -L$(XEN_libxentoollog) $(APPEND_LDFLAGS)" $(GO) build -x
> >  
> >  .PHONY: install
> >  install: build
> > -- 
> > 2.31.1
> > 
> > 
> Acked-by: Nick Rosbrook <rosbrookn@ainfosec.com>

Ping?

Unless someone else has opinions I think this is ready to be
committed. Can a committer please queue it up?

Thanks, Roger.


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

* Re: [PATCH] tools/go: honor append build flags
  2021-09-13 11:20   ` Roger Pau Monné
@ 2021-09-13 12:39     ` Ian Jackson
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2021-09-13 12:39 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Wei Liu, xen-devel, George Dunlap, Nick Rosbrook, Nick Rosbrook,
	Ting-Wei Lan

Roger Pau Monné writes ("Re: [PATCH] tools/go: honor append build flags"):
> Unless someone else has opinions I think this is ready to be
> committed. Can a committer please queue it up?

Thanks for the ping.  Committed, with my ack.

Thanks,
Ian.


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

end of thread, other threads:[~2021-09-13 12:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07  7:15 [PATCH] tools/go: honor append build flags Roger Pau Monne
2021-07-07 13:42 ` Nick Rosbrook
2021-09-13 11:20   ` Roger Pau Monné
2021-09-13 12:39     ` Ian Jackson

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.