Kumba wrote:
> Thiemo Seufer wrote:
> >>The replacement is CONFIG_BUILD_ELF64=n (it adds -msym32 option) +
> >>CONFIG_BOOT_ELF32=y (it adds vmlinux.32 to "all" target). Not
> >>CONFIG_BUILD_ELF64=y.
> >>
> >>CONFIG_BUILD_ELF64=n enables -msym32 option, which means the kernel
> >>load address should be CKSEG0.
> >
> >This sounds wrong to me, since CONFIG_BUILD_ELF64=n will build a
> >ELF64 kernel (from compiler/linker POV). This tricks people into
> >believing they need no ELF64 capable toolchain for a 64bit kernel.
> >
> >IMO -msym32 should depend on:
> > ((Compiler can do -msym32)
> > && (load address is in ckseg0)
> > && CONFIG_64BIT)
> >
> >which obsoletes the whole CONFIG_BUILD_ELF* stuff.
> >
> >
> >Thiemo
>
> Going on this, I propose the following patch to fix our lovely SGI/Cobalt
> systems, and eliminate a confusing Kconfig option whose time is likely long
> since passed. The attached patch achieves the following:
>
> * Introduces a new flag for IP22, IP32, and Cobalt called
> 'kernel_loads_in_ckseg0'.
> * Introduces a new header, mem-layout.h, in
> include/asm-mips/mach-<platform>/ for this flag for these three systems,
> and a dummy entry for mach-generic, calling it in where appropriate.
> * Removes CONFIG_BUILD_ELF64 from Kconfig, Makefile, and several
> defconfigs, and replaces its few references in header files with
> 'kernel_loads_in_ckseg0', with appropriate flips in logic (except in
> stackframe.h).
> * Includes Frank's patch to eliminate the need for -mno-explicit-relocs.
[snip]
> diff -Naurp mipslinux/arch/mips/Makefile mipslinux.ckseg0/arch/mips/Makefile
> --- mipslinux/arch/mips/Makefile 2007-03-17 21:12:06.000000000 -0400
> +++ mipslinux.ckseg0/arch/mips/Makefile 2007-03-25 02:15:22.000000000
> -0400
> @@ -60,11 +60,6 @@ vmlinux-32 = vmlinux.32
> vmlinux-64 = vmlinux
>
> cflags-y += -mabi=64
> -ifdef CONFIG_BUILD_ELF64
> -cflags-y += $(call cc-option,-mno-explicit-relocs)
> -else
> -cflags-y += $(call cc-option,-msym32)
> -endif
> endif
AFAICS this loses -mno-explicit-relocs completely, but it is needed for
all non-ckseg0 CONFIG_64BIT builds.
Thiemo
|