include: crash_dump.h: Add elf.h header
PATCH 1/1 include: crash_dump.h: Add elf.h header
Building an ARM target we get the following warnings:
CC arch/arm/kernel/setup.o
In file included from arch/arm/kernel/setup.c:39:arch/arm/include/asm/elf.h:102:1: warning: "vmcore_elf64_check_arch" redefined In file included from arch/arm/kernel/setup.c:24:include/linux/crash_dump.h:30:1: warning: this is the location of the previous definition
Quoting Russell King:
"linux/crash_dump.h makes no attempt to include asm/elf.h, but it depends on stuff in asm/elf.h to determine how stuff inside this file is defined at parse time.
So, if asm/elf.h is included after linux/crash_dump.h or not at all, you get a different result from the situation where asm/elf.h is included before."
So add elf.h header to crash_dump.h to avoid this problem.
---
The original discussion about this can be found at:
http://www.spinics.net/lists/arm-kernel/msg154113.html
include/linux/crash_dump.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/linux/crash_dump.h +1 -0
@@ -5,6 +5,7 @@#include <linux/kexec.h> #include <linux/device.h> #include <linux/proc_fs.h> +#include <linux/elf.h> #define ELFCORE_ADDR_MAX (-1ULL)#define ELFCORE_ADDR_ERR (-2ULL)
Signature · 1 line
1.7.1
Andrew Morton
maintainerQuoted 33 lines · On Wed, 4 Jan 2012 10:04:26 -0200 Fabio Estevam <[email protected]> wrote:
Building an ARM target we get the following warnings:
CC
arch/arm/kernel/setup.o
In file included fromarch/arm/kernel/setup.c:39:arch/arm/include/asm/elf.h:102:1: warning: "vmcore_elf64_check_arch" redefined In file included fromarch/arm/kernel/setup.c:24:include/linux/crash_dump.h:30:1: warning: this is the location of the previous definitionQuoting Russell King:
"
linux/crash_dump.hmakes no attempt to includeasm/elf.h, but it depends on stuff inasm/elf.hto determine how stuff inside this file is defined at parse time.So, if
asm/elf.his included afterlinux/crash_dump.hor not at all, you get a different result from the situation whereasm/elf.his included before."So add
elf.hheader tocrash_dump.hto avoid this problem.Signed-off-by Fabio Estevam <[email protected]>---
The original discussion about this can be found at:
http://www.spinics.net/lists/arm-kernel/msg154113.htmlinclude/linux/crash_dump.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)include/linux/crash_dump.h +0
-0
include/linux/crash_dump.h line 11
Quoted 7 lines
include/linux/crash_dump.h +1
-0@@ -5,6 +5,7 @@#include <linux/kexec.h> #include <linux/device.h> #include <linux/proc_fs.h> +#include <linux/elf.h> #define ELFCORE_ADDR_MAX (-1ULL)#define ELFCORE_ADDR_ERR (-2ULL)
The patch is the right thing to do, however I'm rather concerned about the potential for introducing build breakage so late in 3.2.
Can we leave this unfixed in 3.2 and fix it in 3.2.1? Or put a #include elf.h into arch/arm/kernel/setup.c for 3.2?
Quoted 5 lines · Andrew Morton
The patch is the right thing to do, however I'm rather concerned about the potential for introducing build breakage so late in 3.2.
Can we leave this unfixed in 3.2 and fix it in 3.2.1? Or put a #include
elf.hintoarch/arm/kernel/setup.cfor 3.2?
arch/arm/kernel/setup.c doesn't need either of these includes. The reason I didn't want to just remove the include and magic the error away is because of the obvious fragility of the current situation, which really needs solving.
As this is the only report of this breakage, I'm inclined to go with your first suggestion: leave it unfixed in 3.2 and fix it in -stable once it's been in visible for a bit.