diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 1f7c1bcbe5..09e7602601 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -304,28 +304,24 @@ if $(HAIKU_GCC_VERSION[1]) >= 4 { HAIKU_KERNEL_PIC_CCFLAGS = -fno-pic ; HAIKU_KERNEL_PIC_LINKFLAGS = ; -if $(HAIKU_ARCH) = ppc { - # Build a position independent PPC kernel. We need to be able to relocate - # the kernel, since the virtual address space layout at boot time is not - # fixed. - HAIKU_KERNEL_PIC_CCFLAGS = -fPIE ; - HAIKU_KERNEL_PIC_LINKFLAGS = -shared -fPIE ; -} -if $(HAIKU_ARCH) = m68k { - # We don't need a PIC kernel as it's always at the same place. - # it's actually needed to not use pic, else linking fails due to too large - # pc refs. - HAIKU_KERNEL_PIC_CCFLAGS = -fno-pic ; - HAIKU_KERNEL_PIC_LINKFLAGS = ; - # we don't want to have to handle emulating missing FPU opcodes for 040 and - # 060 in the kernel - HAIKU_KERNEL_CCFLAGS += -m68020-60 ; - HAIKU_KERNEL_C++FLAGS += -m68020-60 ; -} -if $(HAIKU_ARCH) = mipsel { - # TODO: verify correctness of this - HAIKU_KERNEL_PIC_CCFLAGS = -fno-pic ; - HAIKU_KERNEL_PIC_LINKFLAGS = ; + +switch $(HAIKU_ARCH) { + case ppc : + { + # Build a position independent PPC kernel. We need to be able to + # relocate the kernel, since the virtual address space layout at boot + # time is not fixed. + HAIKU_KERNEL_PIC_CCFLAGS = -fPIE ; + HAIKU_KERNEL_PIC_LINKFLAGS = -shared -fPIE ; + } + + case m68k : + { + # We don't want to have to handle emulating missing FPU opcodes for 040 + # and 060 in the kernel. + HAIKU_KERNEL_CCFLAGS += -m68020-60 ; + HAIKU_KERNEL_C++FLAGS += -m68020-60 ; + } } # If the environment variable HAIKU_INCLUDE_PATENTED_CODE is defined, we