Skip to content

Commit f93ccdd

Browse files
committed
makefile:use local gcc when native compiling
Signed-off-by: ningmingxiao <[email protected]>
1 parent 2bfc04a commit f93ccdd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,10 @@ ifeq ($(GOOS),darwin)
546546
# returns the architecture name converted from GOARCH to macOS's uname -m.
547547
to_uname_m = $(foreach arch,$(1),$(shell echo $(arch) | sed 's/amd64/x86_64/'))
548548
else ifeq ($(GOOS),linux)
549+
ifeq ($cross_compiling),true)
549550
# CC is required for cross-compiling on Linux.
550551
CC = $(call to_uname_m,$(GOARCH))-linux-gnu-gcc
552+
endif
551553
else ifeq ($(GOOS),windows)
552554
# artifact in zip format also provided for Windows.
553555
ARTIFACT_FILE_EXTENSIONS += .zip

0 commit comments

Comments
 (0)