Ticket #6306: gcc_x86_64.multilib.haiku.txt

File gcc_x86_64.multilib.haiku.txt, 2.4 KB (added by nmentley, 10 years ago)

patch for /haiku/haiku

Line 
1Index: build/jam/BuildSetup
2===================================================================
3--- build/jam/BuildSetup (revision 37496)
4+++ build/jam/BuildSetup (working copy)
5@@ -165,12 +165,15 @@
6 HAIKU_C++ ?= $(HAIKU_CC) ;
7 HAIKU_LINK = $(HAIKU_CC) ;
8 HAIKU_LINKFLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
9+HAIKU_BOOT_LINKFLAGS = ;
10
11 HAIKU_HDRS = [ FStandardHeaders ] ;
12 HAIKU_CCFLAGS = $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
13 HAIKU_C++FLAGS = $(HAIKU_GCC_BASE_FLAGS) -nostdinc ;
14 HAIKU_KERNEL_CCFLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
15 HAIKU_KERNEL_C++FLAGS = $(HAIKU_GCC_BASE_FLAGS) ;
16+HAIKU_BOOT_CCFLAGS = ;
17+HAIKU_BOOT_C++FLAGS = ;
18 HAIKU_DEFINES = __HAIKU__ ;
19 HAIKU_NO_WERROR ?= 0 ;
20
21@@ -246,11 +249,11 @@
22 }
23 case x86_64 :
24 {
25- HAIKU_DEFINES += __x86_64__ ;
26- HAIKU_BOOT_PLATFORM = bios_ia32 ;
27+ HAIKU_BOOT_PLATFORM = bios_x86_64 ;
28 HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 2880 ; # in kB
29 # offset in floppy image (>= sizeof(haiku_loader))
30 HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB
31+ HAIKU_NO_WERROR = 1 ;
32
33 # yasm is required for target arch x86_64
34 if ! $(HAIKU_YASM) {
35@@ -335,7 +338,6 @@
36 HAIKU_KERNEL_PIC_CCFLAGS = -fPIE ;
37 HAIKU_KERNEL_PIC_LINKFLAGS = -shared -fPIE ;
38 }
39-
40 case m68k :
41 {
42 # We don't want to have to handle emulating missing FPU opcodes for 040
43@@ -357,6 +359,15 @@
44 }
45 case x86_64 :
46 {
47+ HAIKU_KERNEL_PIC_LINKFLAGS += -z max-page-size=0x1000 ;
48+
49+ HAIKU_KERNEL_PIC_CCFLAGS += -mcmodel=large ;
50+ HAIKU_KERNEL_PIC_C++FLAGS += -mcmodel=large ;
51+
52+ HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;
53+ HAIKU_BOOT_CCFLAGS += -m32 ;
54+ HAIKU_BOOT_C++FLAGS += -m32 ;
55+
56 # Enable use of the gcc built-in atomic functions instead of atomic_*().
57 # The former are inlined and have thus less overhead.
58 HAIKU_DEFINES += B_USE_BUILTIN_ATOMIC_FUNCTIONS ;
59@@ -911,6 +922,7 @@
60 KERNEL_DEFINES
61
62 KERNEL_CCFLAGS KERNEL_C++FLAGS
63+ BOOT_CCFLAGS BOOT_C++FLAGS BOOT_LINKFLAGS
64 KERNEL_PIC_CCFLAGS KERNEL_PIC_LINKFLAGS
65 WARNING_CCFLAGS WARNING_C++FLAGS
66
67Index: build/scripts/build_cross_tools_gcc4
68===================================================================
69--- build/scripts/build_cross_tools_gcc4 (revision 37496)
70+++ build/scripts/build_cross_tools_gcc4 (working copy)
71@@ -27,6 +27,10 @@
72 export MAKE
73
74 case $haikuMachine in
75+x86_64-*)
76+ binutilsConfigureArgs="--enable-multilib"
77+ gccConfigureArgs="--enable-multilib"
78+ ;;
79 m68k-*)
80 binutilsConfigureArgs="--enable-multilib"
81 gccConfigureArgs="--enable-multilib"