Skip to content

Commit 4f9200e

Browse files
committed
Refine build process for arm architecture
This commit simplifies the Makefile by removing unnecessary conditions that were based on the architecture type. It mostly affects the CGOFLAG and BUILDFLAGS for 'arm' cases, streamlining the build process specifically for Linux OS and 'arm' architecture, and improving the cross-compilation process overall.
1 parent fe311cd commit 4f9200e

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

Makefile

+3-13
Original file line numberDiff line numberDiff line change
@@ -229,22 +229,12 @@ TEST_LOG_DIR = ${abspath ./test-logs}
229229

230230
# Set CGOFLAG and BUILDFLAGS as needed for the OS/ARCH.
231231
ifeq ("$(OS)","linux")
232-
# True if $ARCH == amd64 || $ARCH == arm64
233-
ifeq ("$(ARCH)","arm64")
234-
ifeq ($(IS_NATIVE_BUILD),"no")
235-
CGOFLAG += CC=aarch64-linux-gnu-gcc
236-
endif
237-
else ifeq ("$(ARCH)","arm")
232+
ifeq ("$(ARCH)","arm")
238233
CGOFLAG = CGO_ENABLED=1
239234

240-
# ARM builds need to specify the correct C compiler
241-
ifeq ($(IS_NATIVE_BUILD),"no")
242-
CC=arm-linux-gnueabihf-gcc
243-
endif
244-
245235
# Add -debugtramp=2 to work around 24 bit CALL/JMP instruction offset.
246-
BUILDFLAGS = $(ADDFLAGS) -ldflags '-w -s -debugtramp=2 $(KUBECTL_SETVERSION)' -trimpath -buildmode=pie
247-
endif
236+
BUILDFLAGS = $(ADDFLAGS) -ldflags '-w -s -debugtramp=2 $(KUBECTL_SETVERSION)' -trimpath
237+
endif # ARCH == arm
248238
endif # OS == linux
249239

250240
# Windows requires extra parameters to cross-compile with CGO.

0 commit comments

Comments
 (0)