cloudflare / cloudflare/cloudflared

Makefile does not detect TARGET_ARCH correctly on FreeBSD

Open
#285 7 comments 0 reactions 1 assignee Claimed by @Michael9127 View on GitHub
Dominant language
Go
Stars
15.6k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

On FreeBSD 12.2 amd64 the Makefile does not correctly detect TARGET_ARCH correctly (`uname -m` returns `amd64` not `x86_64`) which results in the Makefile failing with the error: `Makefile:37: *** This system's architecture amd64 isn't supported. Stop.`

It is fairly easy to get round this by setting GOARCH manually (eg. `GOARCH=amd64 gmake`) however the following minor patch fixes this.

```patch
diff --git a/Makefile b/Makefile
index 2d545cd..48eaf1b 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,8 @@ ifneq ($(GOARCH),)
TARGET_ARCH ?= $(GOARCH)
else ifeq ($(LOCAL_ARCH),x86_64)
TARGET_ARCH ?= amd64
+else ifeq ($(LOCAL_ARCH),amd64)
+ TARGET_ARCH ?= amd64
else ifeq ($(LOCAL_ARCH),i686)
TARGET_ARCH ?= amd64
else ifeq ($(shell echo $(LOCAL_ARCH) | head -c 5),armv8)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.