Skip to contentSkip to conversation

Makefile: Remove unnecessary -m64 compiler flag

PATCH New Wander Lairson Costa 1 participant 1 message Jan 10 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Remove unnecessary -m64 compiler flag

Remove the M64 variable and all related architecture-specific overrides from the Makefile. The -m64 flag is unnecessary because GCC defaults to generating code for the native architecture. On 64-bit systems it produces 64-bit binaries automatically, and on 32-bit systems the flag causes build failures.

This change fixes builds on i686 and 32-bit powerpc architectures, which were broken after commit 5bd4be43bc5b ("Makefile: Remove redhat-specific checks")removed the RPMCFLAGS conditional that previously allowed RPM builds to override the internal compiler flags. Rather than adding M64 overrides for each 32-bit architecture, removing the flag entirely is the cleaner solution since it provides no benefit on any platform.

---
 Makefile | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
Makefile +1 -6
index a7d7875..467fc84 100644
@@ -16,11 +16,7 @@ $(info GCC_VER=$(GCC_VER))
 
 USE_BPF := 1
 MTUNE	:= -mtune=generic
-M64	:= -m64
 
-ifeq ($(ARCH),aarch64)
-M64	:=
-endif
 ifeq ($(ARCH),i686)
 USE_BPF := 0
 endif
@@ -37,7 +33,6 @@ MTUNE := -mtune=powerpc
 endif
 ifeq ($(ARCH),riscv64)
 FCF_PROTECTION := "-fcf-protection=none"
-M64	:=
 MTUNE := -mtune=generic-ooo
 endif
 
@@ -63,7 +58,7 @@ OMIT_LEAF_FP := $(shell echo 'int main(void){return 0;}' | \
 		-o /dev/null 2>/dev/null && \
 		echo '-mno-omit-leaf-frame-pointer')
 
-MOPTS   :=  	$(strip $(MTUNE)) $(strip $(M64)) $(strip $(OMIT_LEAF_FP))
+MOPTS   :=  	$(strip $(MTUNE)) $(strip $(OMIT_LEAF_FP))
 
 WOPTS	:= 	-Wall -Werror=format-security
 
Signature · 1 line
2.52.0