File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -597,7 +597,14 @@ ifeq ($(GOOS),darwin)
597597to_uname_m = $(foreach arch,$(1 ) ,$(shell echo $(arch ) | sed 's/amd64/x86_64/') )
598598else ifeq ($(GOOS),linux)
599599# CC is required for cross-compiling on Linux.
600- CC = $(call to_uname_m,$(GOARCH ) ) -linux-gnu-gcc
600+ # On Debian, Ubuntu, and related distributions, compilers are named like x86_64-linux-gnu-gcc
601+ # On Fedora, RHEL, and related distributions, the equivalent is x86_64-redhat-linux-gcc
602+ CC ?= $(shell \
603+ if command -v $(call to_uname_m,$(GOARCH ) ) -linux-gnu-gcc >/dev/null 2>&1; then \
604+ echo $(call to_uname_m,$(GOARCH ) ) -linux-gnu-gcc; \
605+ elif command -v $(call to_uname_m,$(GOARCH ) ) -redhat-linux-gcc >/dev/null 2>&1; then \
606+ echo $(call to_uname_m,$(GOARCH ) ) -redhat-linux-gcc; \
607+ fi)
601608else ifeq ($(GOOS),windows)
602609# artifact in zip format also provided for Windows.
603610ARTIFACT_FILE_EXTENSIONS += .zip
You can’t perform that action at this time.
0 commit comments