2015-12-24 12:12:44

by Mickaël Salaün

[permalink] [raw]
Subject: [PATCH v3] um: Fix build error and kconfig for i386

Fix build error by generating elfcore.o only when ELF_CORE (depending on
COREDUMP) is selected:

arch/x86/um/built-in.o: In function `elf_core_write_extra_phdrs':
(.text+0x3e62): undefined reference to `dump_emit'
arch/x86/um/built-in.o: In function `elf_core_write_extra_data':
(.text+0x3eef): undefined reference to `dump_emit'

Fixes: 5d2acfc7b974 ("kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT")
Signed-off-by: Mickaël Salaün <[email protected]>
Cc: Jeff Dike <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Josh Triplett <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Michal Marek <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Linus Torvalds <[email protected]>
---
arch/x86/um/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile
index a8fecc226946..3ee2bb6b440b 100644
--- a/arch/x86/um/Makefile
+++ b/arch/x86/um/Makefile
@@ -17,7 +17,7 @@ obj-y = bug.o bugs_$(BITS).o delay.o fault.o ksyms.o ldt.o \
ifeq ($(CONFIG_X86_32),y)

obj-y += checksum_32.o
-obj-$(CONFIG_BINFMT_ELF) += elfcore.o
+obj-$(CONFIG_ELF_CORE) += elfcore.o

subarch-y = ../lib/string_32.o ../lib/atomic64_32.o ../lib/atomic64_cx8_32.o
subarch-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += ../lib/rwsem.o
--
2.6.4


2015-12-25 01:34:21

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH v3] um: Fix build error and kconfig for i386

On Thu, Dec 24, 2015 at 01:12:11PM +0100, Micka?l Sala?n wrote:
> Fix build error by generating elfcore.o only when ELF_CORE (depending on
> COREDUMP) is selected:
>
> arch/x86/um/built-in.o: In function `elf_core_write_extra_phdrs':
> (.text+0x3e62): undefined reference to `dump_emit'
> arch/x86/um/built-in.o: In function `elf_core_write_extra_data':
> (.text+0x3eef): undefined reference to `dump_emit'
>
> Fixes: 5d2acfc7b974 ("kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT")
> Signed-off-by: Micka?l Sala?n <[email protected]>
> Cc: Jeff Dike <[email protected]>
> Cc: Richard Weinberger <[email protected]>
> Cc: Josh Triplett <[email protected]>
> Cc: Paul E. McKenney <[email protected]>
> Cc: Michal Marek <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Cc: Linus Torvalds <[email protected]>

It looks like ELF_CORE depends on COREDUMP, but not on BINFMT_ELF.
Should it? What happens if you build this with ELF_CORE=y and
BINFMT_ELF=n? Does that configuration even make sense?

> arch/x86/um/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile
> index a8fecc226946..3ee2bb6b440b 100644
> --- a/arch/x86/um/Makefile
> +++ b/arch/x86/um/Makefile
> @@ -17,7 +17,7 @@ obj-y = bug.o bugs_$(BITS).o delay.o fault.o ksyms.o ldt.o \
> ifeq ($(CONFIG_X86_32),y)
>
> obj-y += checksum_32.o
> -obj-$(CONFIG_BINFMT_ELF) += elfcore.o
> +obj-$(CONFIG_ELF_CORE) += elfcore.o
>
> subarch-y = ../lib/string_32.o ../lib/atomic64_32.o ../lib/atomic64_cx8_32.o
> subarch-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += ../lib/rwsem.o
> --
> 2.6.4
>

2015-12-25 19:24:07

by Mickaël Salaün

[permalink] [raw]
Subject: Re: [PATCH v3] um: Fix build error and kconfig for i386


On 25/12/2015 02:34, Josh Triplett wrote:
> On Thu, Dec 24, 2015 at 01:12:11PM +0100, Micka?l Sala?n wrote:
>> Fix build error by generating elfcore.o only when ELF_CORE (depending on
>> COREDUMP) is selected:
>>
>> arch/x86/um/built-in.o: In function `elf_core_write_extra_phdrs':
>> (.text+0x3e62): undefined reference to `dump_emit'
>> arch/x86/um/built-in.o: In function `elf_core_write_extra_data':
>> (.text+0x3eef): undefined reference to `dump_emit'
>>
>> Fixes: 5d2acfc7b974 ("kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT")
>> Signed-off-by: Micka?l Sala?n <[email protected]>
>> Cc: Jeff Dike <[email protected]>
>> Cc: Richard Weinberger <[email protected]>
>> Cc: Josh Triplett <[email protected]>
>> Cc: Paul E. McKenney <[email protected]>
>> Cc: Michal Marek <[email protected]>
>> Cc: Andrew Morton <[email protected]>
>> Cc: Linus Torvalds <[email protected]>
>
> It looks like ELF_CORE depends on COREDUMP, but not on BINFMT_ELF.
> Should it? What happens if you build this with ELF_CORE=y and
> BINFMT_ELF=n? Does that configuration even make sense?

It build fine with ELF_CORE=y and BINFMT_ELF=n but does not seem useful. Nevertheless, it's the same for all architectures (cf. init/Kconfig): ELF_CORE only depends on COREDUMP.

Micka?l


Attachments:
signature.asc (455.00 B)
OpenPGP digital signature

2015-12-26 04:10:18

by Josh Triplett

[permalink] [raw]
Subject: Re: [PATCH v3] um: Fix build error and kconfig for i386

On Fri, Dec 25, 2015 at 07:45:41PM +0100, Micka?l Sala?n wrote:
>
> On 25/12/2015 02:34, Josh Triplett wrote:
> > On Thu, Dec 24, 2015 at 01:12:11PM +0100, Micka?l Sala?n wrote:
> >> Fix build error by generating elfcore.o only when ELF_CORE (depending on
> >> COREDUMP) is selected:
> >>
> >> arch/x86/um/built-in.o: In function `elf_core_write_extra_phdrs':
> >> (.text+0x3e62): undefined reference to `dump_emit'
> >> arch/x86/um/built-in.o: In function `elf_core_write_extra_data':
> >> (.text+0x3eef): undefined reference to `dump_emit'
> >>
> >> Fixes: 5d2acfc7b974 ("kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT")
> >> Signed-off-by: Micka?l Sala?n <[email protected]>
> >> Cc: Jeff Dike <[email protected]>
> >> Cc: Richard Weinberger <[email protected]>
> >> Cc: Josh Triplett <[email protected]>
> >> Cc: Paul E. McKenney <[email protected]>
> >> Cc: Michal Marek <[email protected]>
> >> Cc: Andrew Morton <[email protected]>
> >> Cc: Linus Torvalds <[email protected]>
> >
> > It looks like ELF_CORE depends on COREDUMP, but not on BINFMT_ELF.
> > Should it? What happens if you build this with ELF_CORE=y and
> > BINFMT_ELF=n? Does that configuration even make sense?
>
> It build fine with ELF_CORE=y and BINFMT_ELF=n but does not seem
> useful. Nevertheless, it's the same for all architectures (cf.
> init/Kconfig): ELF_CORE only depends on COREDUMP.

As long as that builds, then this patch doesn't introduce an
un-buildable Kconfig configuration, so it seems reasonable. Thanks
again for producing a new version.

Reviewed-by: Josh Triplett <[email protected]>