76
76
# Disable cgo by default to make the binary statically linked.
77
77
CGO_ENABLED: =0
78
78
79
+ ifeq ($(GOARCH ) , arm64)
80
+ CC:=aarch64-linux-gnu-gcc
81
+ else
82
+ CC:=x86_64-linux-gnu-gcc
83
+ endif
84
+
79
85
# Set default Go architecture to AMD64.
80
86
GOARCH ?= amd64
81
87
@@ -181,7 +187,7 @@ output/linux_arm64/test/bin/%: $(PKG_SOURCES)
181
187
# In the future these targets should be deprecated.
182
188
./bin/log-counter : $(PKG_SOURCES )
183
189
ifeq ($(ENABLE_JOURNALD ) , 1)
184
- CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=$(GOARCH) go build \
190
+ CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=$(GOARCH) CC=$(CC) go build \
185
191
-o bin/log-counter \
186
192
-ldflags '-X $(PKG)/pkg/version.version=$(VERSION)' \
187
193
-tags "$(LINUX_BUILD_TAGS)" \
@@ -191,21 +197,21 @@ else
191
197
endif
192
198
193
199
./bin/node-problem-detector : $(PKG_SOURCES )
194
- CGO_ENABLED=$(CGO_ENABLED ) GOOS=linux GOARCH=$(GOARCH ) go build \
200
+ CGO_ENABLED=$(CGO_ENABLED ) GOOS=linux GOARCH=$(GOARCH ) CC= $( CC ) go build \
195
201
-o bin/node-problem-detector \
196
202
-ldflags ' -X $(PKG)/pkg/version.version=$(VERSION)' \
197
203
-tags " $( LINUX_BUILD_TAGS) " \
198
204
./cmd/nodeproblemdetector
199
205
200
206
./test/bin/problem-maker : $(PKG_SOURCES )
201
207
cd test && \
202
- CGO_ENABLED=$(CGO_ENABLED ) GOOS=linux GOARCH=$(GOARCH ) go build \
208
+ CGO_ENABLED=$(CGO_ENABLED ) GOOS=linux GOARCH=$(GOARCH ) CC= $( CC ) go build \
203
209
-o bin/problem-maker \
204
210
-tags " $( LINUX_BUILD_TAGS) " \
205
211
./e2e/problemmaker/problem_maker.go
206
212
207
213
./bin/health-checker : $(PKG_SOURCES )
208
- CGO_ENABLED=$(CGO_ENABLED ) GOOS=linux GOARCH=$(GOARCH ) go build \
214
+ CGO_ENABLED=$(CGO_ENABLED ) GOOS=linux GOARCH=$(GOARCH ) CC= $( CC ) go build \
209
215
-o bin/health-checker \
210
216
-ldflags ' -X $(PKG)/pkg/version.version=$(VERSION)' \
211
217
-tags " $( LINUX_BUILD_TAGS) " \
0 commit comments