All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Rosbrook <rosbrookn@gmail.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	George Dunlap <george.dunlap@citrix.com>,
	Nick Rosbrook <rosbrookn@ainfosec.com>,
	Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>,
	Ting-Wei Lan <lantw44@gmail.com>
Subject: Re: [PATCH] tools/go: honor append build flags
Date: Wed, 7 Jul 2021 09:42:20 -0400	[thread overview]
Message-ID: <YOWvPLcQywmEIPdI@FED-nrosbr-BE.crux.rad.ainfosec.com> (raw)
In-Reply-To: <20210707071531.69001-1-roger.pau@citrix.com>

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


  reply	other threads:[~2021-07-07 13:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  7:15 [PATCH] tools/go: honor append build flags Roger Pau Monne
2021-07-07 13:42 ` Nick Rosbrook [this message]
2021-09-13 11:20   ` Roger Pau Monné
2021-09-13 12:39     ` Ian Jackson

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=YOWvPLcQywmEIPdI@FED-nrosbr-BE.crux.rad.ainfosec.com \
    --to=rosbrookn@gmail.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=lantw44@gmail.com \
    --cc=roger.pau@citrix.com \
    --cc=rosbrookn@ainfosec.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.