208 |
208 |
209 # We can't do any ASLR'ing as the Go 6l linker has no understanding of the |
209 # We can't do any ASLR'ing as the Go 6l linker has no understanding of the |
210 # -z aslr=... option. So just override where needed in the .p5m files. |
210 # -z aslr=... option. So just override where needed in the .p5m files. |
211 ASLR_MODE = $(ASLR_DISABLE) |
211 ASLR_MODE = $(ASLR_DISABLE) |
212 |
212 |
|
213 # The timestamp is generated immediately once when the Makefile is evaluated to |
|
214 # ensure every package gets the same one. |
|
215 GOTS := $(shell date +"%Y%m%dT%H%M%SZ") |
|
216 |
213 # Make sure the source code and object files have identical timestamps so |
217 # Make sure the source code and object files have identical timestamps so |
214 # the Go compiler doesn't try to rebuild them. |
218 # the Go compiler doesn't try to rebuild them. |
215 PKG_MACROS += TIMESTAMP=$(shell date +"%Y%m%dT%H%M%SZ") |
219 PKG_MACROS += TIMESTAMP=$(GOTS) |
216 # Extra macros for packaging convenience. |
220 # Extra macros for packaging convenience. |
217 PKG_MACROS += COMPONENT_MAJOR_VERSION=$(COMPONENT_MAJOR_VERSION) |
221 PKG_MACROS += COMPONENT_MAJOR_VERSION=$(COMPONENT_MAJOR_VERSION) |
218 # COMPONENT_MAJOR_VERSION suitable for use in regular expressions. |
222 # COMPONENT_MAJOR_VERSION suitable for use in regular expressions. |
219 PKG_MACROS += COMPONENT_RE_MAJOR_VERSION=$(subst .,\\.,$(COMPONENT_MAJOR_VERSION)) |
223 PKG_MACROS += COMPONENT_RE_MAJOR_VERSION=$(subst .,\\.,$(COMPONENT_MAJOR_VERSION)) |
220 |
224 |
266 $(SUPP_ROOT)/src/$$(COMPONENT_IMPORT_SRC_$(1))/$$(COMPONENT_NAME_$(1))); |
270 $(SUPP_ROOT)/src/$$(COMPONENT_IMPORT_SRC_$(1))/$$(COMPONENT_NAME_$(1))); |
267 |
271 |
268 endef |
272 endef |
269 |
273 |
270 $(foreach suffix,$(SUPP_PACKAGES), $(eval $(call install-rules,$(suffix)))) |
274 $(foreach suffix,$(SUPP_PACKAGES), $(eval $(call install-rules,$(suffix)))) |
271 |
|
272 # XXX For now, the install of supplementary packages is intentionally disabled |
|
273 # as the result cannot be used as expected due to an unknown issue with the Go |
|
274 # compilers. |
|
275 # |
|
276 # Install supplementary packages (this cannot be done one-by-one); install |
275 # Install supplementary packages (this cannot be done one-by-one); install |
277 # tools/go/types first to avoid quirk with trimpath and dependencies. This is |
276 # tools/go/types first to avoid quirk with trimpath and dependencies. This is |
278 # technically a build and install, but go's build command won't "install" |
277 # technically a build and install, but go's build command won't "install" |
279 # results, it only verifies a target can be built and dumps it into a temporary |
278 # results, it only verifies a target can be built and dumps it into a temporary |
280 # directory. |
279 # directory. |
281 # |
280 # |
282 # The -trimpath option used here ensures that the paths recorded in the |
281 # The -trimpath option used here ensures that the paths recorded in the |
283 # pre-built packages are relative to the $(SUPP_ROOT) so that when a devleoper |
282 # pre-built packages do not contain the containing directory; the result is a |
284 # sets their GOPATH to that directory, things work as expected. |
283 # path that Go will evaluate relative to $GOPATH and so will pass the "stale" |
285 #COMPONENT_POST_INSTALL_ACTION += \ |
284 # object checks that Go performs at build time allowing reuse of the pre-built |
286 # ($(ENV) $(COMPONENT_INSTALL_ENV) go install \ |
285 # packages. |
287 # -asmflags -trimpath=$(SUPP_ROOT) -gcflags -trimpath=$(SUPP_ROOT) \ |
286 PROTO_ROOT= $(SUPP_ROOT) |
288 # "golang.org/x/tools/go/types"; \ |
287 COMPONENT_POST_INSTALL_ACTION += \ |
289 # $(ENV) $(COMPONENT_INSTALL_ENV) go install \ |
288 ($(ENV) $(COMPONENT_INSTALL_ENV) go install \ |
290 # -asmflags -trimpath=$(SUPP_ROOT) -gcflags -trimpath=$(SUPP_ROOT) \ |
289 -asmflags -trimpath=$(PROTO_ROOT) -gcflags -trimpath=$(PROTO_ROOT) \ |
291 # "golang.org/x/..."; \ |
290 "golang.org/x/tools/go/types"; \ |
292 # $(ENV) $(COMPONENT_INSTALL_ENV) go install \ |
291 $(ENV) $(COMPONENT_INSTALL_ENV) go install \ |
293 # -asmflags -trimpath=$(SUPP_ROOT) -gcflags -trimpath=$(SUPP_ROOT) \ |
292 -asmflags -trimpath=$(PROTO_ROOT) -gcflags -trimpath=$(PROTO_ROOT) \ |
294 # "github.com/golang/..."); |
293 "golang.org/x/..."; \ |
|
294 $(ENV) $(COMPONENT_INSTALL_ENV) go install \ |
|
295 -asmflags -trimpath=$(PROTO_ROOT) -gcflags -trimpath=$(PROTO_ROOT) \ |
|
296 "github.com/golang/..."); |
295 |
297 |
296 # Go's test suite is currently designed to be run from the build area. |
298 # Go's test suite is currently designed to be run from the build area. |
297 |
299 |
298 # Used during the build. |
300 # Used during the build. |
299 REQUIRED_PACKAGES += developer/gcc |
301 REQUIRED_PACKAGES += developer/gcc |