Skip to contentSkip to conversation

biarch compiler support for i386

PATCH In review H. Peter Anvin 2 participants 3 messages Apr 5, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 biarch compiler support for i386

This allows the i386 architecture to be built on a system with a biarch compiler that defaults to x86-64, merely by specifying ARCH=i386.

As previously discussed, this uses the equivalent logic to the ppc port.

-hpa

Index: linux-2.5/arch/i386/Makefile
===================================================================
RCS file: /home/hpa/kernel/bkcvs/linux-2.5/arch/i386/Makefile,v retrieving revision 1.75

arch/i386/Makefile +7 -0
diff -u -r1.75 Makefile
@@ -17,6 +17,13 @@
 #           Kianusch Sayah Karadji <[email protected]>
 #           Added support for GEODE CPU
 
+HAS_BIARCH      := $(call cc-option-yn, -m32)
+ifeq ($(HAS_BIARCH),y)
+AS              := $(AS) --32
+LD              := $(LD) -m elf_i386
+CC              := $(CC) -m32
+endif
+
 LDFLAGS		:= -m elf_i386
 OBJCOPYFLAGS	:= -O binary -R .note -R .comment -S
 LDFLAGS_vmlinux :=
#1 lore raw
Quoted 4 lines · H. Peter Anvin

This allows the i386 architecture to be built on a system with a biarch compiler that defaults to x86-64, merely by specifying ARCH=i386.

As previously discussed, this uses the equivalent logic to the ppc port.

Given that the same logic applies to various other ports maybe it should go into a common Makefile fragment?

#2 lore raw
Quoted 2 lines · Christoph Hellwig

Given that the same logic applies to various other ports maybe it should go into a common Makefile fragment?

Alas, the *details* are different for each architecture.

-hpa