tools/go: honor append build flags
PATCH 1/1 tools/go: honor append build flags
Make the go build use APPEND_{C/LD}FLAGS when necessary, just like other parts of the build.
---
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(-)
tools/golang/xenlight/Makefile +1 -1
@@ -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
Signature · 1 line
2.31.1
Quoted 10 lines · Roger Pau Monne
Make the go build use APPEND_{C/LD}FLAGS when necessary, just like other parts of the build.
Reported-by Ting-Wei Lan <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>---
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.
Quoted 21 lines
--- tools/golang/xenlight/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/golang/xenlight/Makefile +1
-1@@ -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: buildSignature · 1 line
2.31.1
Thanks,
NR
Quoted 30 lines · Nick Rosbrook
Quoted 10 lines · Roger Pau Monne
Make the go build use APPEND_{C/LD}FLAGS when necessary, just like other parts of the build.
Reported-by Ting-Wei Lan <[email protected]>Signed-off-by Roger Pau Monné <[email protected]>---
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.
Quoted 15 lines
--- tools/golang/xenlight/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/golang/xenlight/Makefile +1
-1@@ -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
Quoted 7 lines
Quoted 6 lines
tools/golang/xenlight/Makefile +0
-0.PHONY: install install: buildSignature · 1 line
2.31.1Acked-by Nick Rosbrook <[email protected]>
Ping?
Unless someone else has opinions I think this is ready to be committed. Can a committer please queue it up?
Thanks, Roger.
Roger Pau Monné writes ("Re: [PATCH] tools/go: honor append build flags"):
Quoted 2 lines
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.