linux-mips
[Top] [All Lists]

Re: [PATCH]: Remove CONFIG_BUILD_ELF64 entirely

To: Kumba <kumba@gentoo.org>
Subject: Re: [PATCH]: Remove CONFIG_BUILD_ELF64 entirely
From: Thiemo Seufer <ths@networkno.de>
Date: Sun, 25 Mar 2007 15:45:15 +0100
Cc: Linux MIPS List <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
In-reply-to: <46062400.8080307@gentoo.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <4603DA74.70707@gentoo.org> <20070324.002440.93023010.anemo@mba.ocn.ne.jp> <46049BAD.1010705@gentoo.org> <20070324.234727.25910303.anemo@mba.ocn.ne.jp> <20070324231602.GP2311@networkno.de> <46062400.8080307@gentoo.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.13 (2006-08-11)
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

<Prev in Thread] Current Thread [Next in Thread>