Skip to content

Commit

Permalink
Detect ARM arch with variant when building (istio#15668)
Browse files Browse the repository at this point in the history
* detect arm architecture

* remove hardcoded value

* only normalize arm with variant
  • Loading branch information
aliariff authored and istio-testing committed Jul 27, 2019
1 parent 7376339 commit 00a1d12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ endif
LOCAL_ARCH := $(shell uname -m)
ifeq ($(LOCAL_ARCH),x86_64)
GOARCH_LOCAL := amd64
else ifeq ($(shell echo $(LOCAL_ARCH) | head -c 5),armv8)
GOARCH_LOCAL := arm64
else ifeq ($(shell echo $(LOCAL_ARCH) | head -c 4),armv)
GOARCH_LOCAL := arm
else
GOARCH_LOCAL := $(LOCAL_ARCH)
endif
Expand Down Expand Up @@ -355,11 +359,11 @@ DEBUG_LDFLAGS='-extldflags "-static"'
# $(3): The value for LDFLAGS
define genTargetsForNativeAndDocker
$(ISTIO_OUT)/$(1):
STATIC=0 GOOS=$(GOOS) GOARCH=amd64 LDFLAGS=$(3) bin/gobuild.sh $(ISTIO_OUT)/$(1) $(2)
STATIC=0 GOOS=$(GOOS) GOARCH=$(GOARCH) LDFLAGS=$(3) bin/gobuild.sh $(ISTIO_OUT)/$(1) $(2)

.PHONY: $(1)
$(1):
STATIC=0 GOOS=$(GOOS) GOARCH=amd64 LDFLAGS=$(3) bin/gobuild.sh $(ISTIO_OUT)/$(1) $(2)
STATIC=0 GOOS=$(GOOS) GOARCH=$(GOARCH) LDFLAGS=$(3) bin/gobuild.sh $(ISTIO_OUT)/$(1) $(2)

ifneq ($(ISTIO_OUT),$(ISTIO_OUT_LINUX))
$(ISTIO_OUT_LINUX)/$(1):
Expand Down

0 comments on commit 00a1d12

Please sign in to comment.