public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: cross-compiling x86_64 kernel on i386 user-space fails
@ 2014-11-22  9:51 Chris Clayton
  2014-11-22 11:14 ` Borislav Petkov
  2014-11-23 20:24 ` [tip:x86/urgent] x86: Use $(OBJDUMP) instead of plain objdump tip-bot for Chris Clayton
  0 siblings, 2 replies; 8+ messages in thread
From: Chris Clayton @ 2014-11-22  9:51 UTC (permalink / raw)
  To: LKML

Hi,

Commit e6023367d779060fddc9a52d1f474085b2b36298 broke building an x86_64 kernel in an i386. The change added a call to
objdump but neglected to cater for cross-compiling.

The patch below fixes the problem for me. I see the commit is now in 3.14 and 3.17 -stable, so the patch needs to go
there too.

CC: Junjie Mao <eternal.n08@gmail.com>
CC: Kees Cook <keescook@chromium.org>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Chris Clayton <chris2553@googlemail.com>
---
--- linux/arch/x86/boot/compressed/Makefile~    2014-11-22 08:56:50.359706324 +0000
+++ linux/arch/x86/boot/compressed/Makefile     2014-11-22 09:04:06.615693435 +0000
@@ -76,7 +76,7 @@ suffix-$(CONFIG_KERNEL_XZ)    := xz
 suffix-$(CONFIG_KERNEL_LZO)    := lzo
 suffix-$(CONFIG_KERNEL_LZ4)    := lz4

-RUN_SIZE = $(shell objdump -h vmlinux | \
+RUN_SIZE = $(shell ${CROSS_COMPILE}objdump -h vmlinux | \
             perl $(srctree)/arch/x86/tools/calc_run_size.pl)
 quiet_cmd_mkpiggy = MKPIGGY $@
       cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false )


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]: cross-compiling x86_64 kernel on i386 user-space fails
  2014-11-22  9:51 [PATCH]: cross-compiling x86_64 kernel on i386 user-space fails Chris Clayton
@ 2014-11-22 11:14 ` Borislav Petkov
  2014-11-22 16:00   ` Kees Cook
  2014-11-23 19:27   ` Thomas Gleixner
  2014-11-23 20:24 ` [tip:x86/urgent] x86: Use $(OBJDUMP) instead of plain objdump tip-bot for Chris Clayton
  1 sibling, 2 replies; 8+ messages in thread
From: Borislav Petkov @ 2014-11-22 11:14 UTC (permalink / raw)
  To: Chris Clayton; +Cc: LKML, Junjie Mao, Kees Cook, x86-ml

On Sat, Nov 22, 2014 at 09:51:10AM +0000, Chris Clayton wrote:
> Hi,

Yeah, next time make sure you actually CC people :-)

I've added them to CC now.

> Commit e6023367d779060fddc9a52d1f474085b2b36298 broke building an x86_64 kernel in an i386. The change added a call to
> objdump but neglected to cater for cross-compiling.
> 
> The patch below fixes the problem for me. I see the commit is now in 3.14 and 3.17 -stable, so the patch needs to go
> there too.

CC: stable@vger.kernel.org

in the commit message should help there.


> CC: Junjie Mao <eternal.n08@gmail.com>
> CC: Kees Cook <keescook@chromium.org>
> CC: Thomas Gleixner <tglx@linutronix.de>
> CC: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Chris Clayton <chris2553@googlemail.com>

Acked-by: Borislav Petkov <bp@suse.de>

> ---
> --- linux/arch/x86/boot/compressed/Makefile~    2014-11-22 08:56:50.359706324 +0000
> +++ linux/arch/x86/boot/compressed/Makefile     2014-11-22 09:04:06.615693435 +0000
> @@ -76,7 +76,7 @@ suffix-$(CONFIG_KERNEL_XZ)    := xz
>  suffix-$(CONFIG_KERNEL_LZO)    := lzo
>  suffix-$(CONFIG_KERNEL_LZ4)    := lz4
> 
> -RUN_SIZE = $(shell objdump -h vmlinux | \
> +RUN_SIZE = $(shell ${CROSS_COMPILE}objdump -h vmlinux | \
>              perl $(srctree)/arch/x86/tools/calc_run_size.pl)
>  quiet_cmd_mkpiggy = MKPIGGY $@
>        cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false )
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]: cross-compiling x86_64 kernel on i386 user-space fails
  2014-11-22 11:14 ` Borislav Petkov
@ 2014-11-22 16:00   ` Kees Cook
  2014-11-23 19:27   ` Thomas Gleixner
  1 sibling, 0 replies; 8+ messages in thread
From: Kees Cook @ 2014-11-22 16:00 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Chris Clayton, LKML, Junjie Mao, x86-ml

On Sat, Nov 22, 2014 at 3:14 AM, Borislav Petkov <bp@alien8.de> wrote:
> On Sat, Nov 22, 2014 at 09:51:10AM +0000, Chris Clayton wrote:
>> Hi,
>
> Yeah, next time make sure you actually CC people :-)
>
> I've added them to CC now.
>
>> Commit e6023367d779060fddc9a52d1f474085b2b36298 broke building an x86_64 kernel in an i386. The change added a call to
>> objdump but neglected to cater for cross-compiling.
>>
>> The patch below fixes the problem for me. I see the commit is now in 3.14 and 3.17 -stable, so the patch needs to go
>> there too.

Good catch, thanks!

>
> CC: stable@vger.kernel.org
>
> in the commit message should help there.
>
>
>> CC: Junjie Mao <eternal.n08@gmail.com>
>> CC: Kees Cook <keescook@chromium.org>
>> CC: Thomas Gleixner <tglx@linutronix.de>
>> CC: Ingo Molnar <mingo@kernel.org>
>> Signed-off-by: Chris Clayton <chris2553@googlemail.com>
>
> Acked-by: Borislav Petkov <bp@suse.de>

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

>
>> ---
>> --- linux/arch/x86/boot/compressed/Makefile~    2014-11-22 08:56:50.359706324 +0000
>> +++ linux/arch/x86/boot/compressed/Makefile     2014-11-22 09:04:06.615693435 +0000
>> @@ -76,7 +76,7 @@ suffix-$(CONFIG_KERNEL_XZ)    := xz
>>  suffix-$(CONFIG_KERNEL_LZO)    := lzo
>>  suffix-$(CONFIG_KERNEL_LZ4)    := lz4
>>
>> -RUN_SIZE = $(shell objdump -h vmlinux | \
>> +RUN_SIZE = $(shell ${CROSS_COMPILE}objdump -h vmlinux | \
>>              perl $(srctree)/arch/x86/tools/calc_run_size.pl)
>>  quiet_cmd_mkpiggy = MKPIGGY $@
>>        cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false )
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>>
>
> --
> Regards/Gruss,
>     Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --



-- 
Kees Cook
Chrome OS Security

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]: cross-compiling x86_64 kernel on i386 user-space fails
  2014-11-22 11:14 ` Borislav Petkov
  2014-11-22 16:00   ` Kees Cook
@ 2014-11-23 19:27   ` Thomas Gleixner
  2014-11-23 19:57     ` Borislav Petkov
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Gleixner @ 2014-11-23 19:27 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Chris Clayton, LKML, Junjie Mao, Kees Cook, x86-ml

On Sat, 22 Nov 2014, Borislav Petkov wrote:

> On Sat, Nov 22, 2014 at 09:51:10AM +0000, Chris Clayton wrote:
> > Hi,
> 
> Yeah, next time make sure you actually CC people :-)
> 
> I've added them to CC now.
> 
> > Commit e6023367d779060fddc9a52d1f474085b2b36298 broke building an x86_64 kernel in an i386. The change added a call to
> > objdump but neglected to cater for cross-compiling.
> > 
> > The patch below fixes the problem for me. I see the commit is now in 3.14 and 3.17 -stable, so the patch needs to go
> > there too.

That's not a specific problem of building x86_64 on i386. The missing
cross compile prefix prevents any cross build of x86.

> CC: stable@vger.kernel.org
> 
> in the commit message should help there.
> 
> 
> > CC: Junjie Mao <eternal.n08@gmail.com>
> > CC: Kees Cook <keescook@chromium.org>
> > CC: Thomas Gleixner <tglx@linutronix.de>
> > CC: Ingo Molnar <mingo@kernel.org>
> > Signed-off-by: Chris Clayton <chris2553@googlemail.com>
> 
> Acked-by: Borislav Petkov <bp@suse.de>
> 
> > ---
> > --- linux/arch/x86/boot/compressed/Makefile~    2014-11-22 08:56:50.359706324 +0000
> > +++ linux/arch/x86/boot/compressed/Makefile     2014-11-22 09:04:06.615693435 +0000
> > @@ -76,7 +76,7 @@ suffix-$(CONFIG_KERNEL_XZ)    := xz
> >  suffix-$(CONFIG_KERNEL_LZO)    := lzo
> >  suffix-$(CONFIG_KERNEL_LZ4)    := lz4
> > 
> > -RUN_SIZE = $(shell objdump -h vmlinux | \
> > +RUN_SIZE = $(shell ${CROSS_COMPILE}objdump -h vmlinux | \

While that works, this wants to be:

+RUN_SIZE = $(shell $(OBJDUMP) -h vmlinux | \

I'll fix it up.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH]: cross-compiling x86_64 kernel on i386 user-space fails
  2014-11-23 19:27   ` Thomas Gleixner
@ 2014-11-23 19:57     ` Borislav Petkov
  0 siblings, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2014-11-23 19:57 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Chris Clayton, LKML, Junjie Mao, Kees Cook, x86-ml

On Sun, Nov 23, 2014 at 08:27:24PM +0100, Thomas Gleixner wrote:
> While that works, this wants to be:
> 
> +RUN_SIZE = $(shell $(OBJDUMP) -h vmlinux | \

Ah, true:

$ git grep OBJDUMP Makefile
Makefile:363:OBJDUMP            = $(CROSS_COMPILE)objdump
Makefile:420:export CPP AR NM STRIP OBJCOPY OBJDUMP
Makefile:1483:  $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [tip:x86/urgent] x86: Use $(OBJDUMP) instead of plain objdump
  2014-11-22  9:51 [PATCH]: cross-compiling x86_64 kernel on i386 user-space fails Chris Clayton
  2014-11-22 11:14 ` Borislav Petkov
@ 2014-11-23 20:24 ` tip-bot for Chris Clayton
  2014-12-01 20:48   ` Chris Clayton
  1 sibling, 1 reply; 8+ messages in thread
From: tip-bot for Chris Clayton @ 2014-11-23 20:24 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, eternal.n08, keescook, hpa, hpa, chris2553, tglx,
	mingo, bp

Commit-ID:  e2e68ae688b0a3766cd75aedf4ed4e39be402009
Gitweb:     http://git.kernel.org/tip/e2e68ae688b0a3766cd75aedf4ed4e39be402009
Author:     Chris Clayton <chris2553@googlemail.com>
AuthorDate: Sat, 22 Nov 2014 09:51:10 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sun, 23 Nov 2014 21:21:53 +0100

x86: Use $(OBJDUMP) instead of plain objdump

commit e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
broke the cross compile of x86. It added a objdump invocation, which
invokes the host native objdump and ignores an active cross tool
chain.

Use $(OBJDUMP) instead which takes the CROSS_COMPILE prefix into
account.

[ tglx: Massage changelog and use $(OBJDUMP) ]

Fixes: e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
Signed-off-by: Chris Clayton <chris2553@googlemail.com>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Junjie Mao <eternal.n08@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/54705C8E.1080400@googlemail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/boot/compressed/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index be1e07d..45abc36 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -76,7 +76,7 @@ suffix-$(CONFIG_KERNEL_XZ)	:= xz
 suffix-$(CONFIG_KERNEL_LZO) 	:= lzo
 suffix-$(CONFIG_KERNEL_LZ4) 	:= lz4
 
-RUN_SIZE = $(shell objdump -h vmlinux | \
+RUN_SIZE = $(shell $(OBJDUMP) -h vmlinux | \
 	     perl $(srctree)/arch/x86/tools/calc_run_size.pl)
 quiet_cmd_mkpiggy = MKPIGGY $@
       cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false )

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [tip:x86/urgent] x86: Use $(OBJDUMP) instead of plain objdump
  2014-11-23 20:24 ` [tip:x86/urgent] x86: Use $(OBJDUMP) instead of plain objdump tip-bot for Chris Clayton
@ 2014-12-01 20:48   ` Chris Clayton
  2014-12-01 21:13     ` Thomas Gleixner
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Clayton @ 2014-12-01 20:48 UTC (permalink / raw)
  To: linux-kernel, eternal.n08, keescook, hpa, hpa, tglx, bp, mingo,
	linux-tip-commits

Hi,

Is it planned to get this fix through in time for release of 3.18? It appears to have been in -next for a week.

Chris

On 11/23/14 20:24, tip-bot for Chris Clayton wrote:
> Commit-ID:  e2e68ae688b0a3766cd75aedf4ed4e39be402009
> Gitweb:     http://git.kernel.org/tip/e2e68ae688b0a3766cd75aedf4ed4e39be402009
> Author:     Chris Clayton <chris2553@googlemail.com>
> AuthorDate: Sat, 22 Nov 2014 09:51:10 +0000
> Committer:  Thomas Gleixner <tglx@linutronix.de>
> CommitDate: Sun, 23 Nov 2014 21:21:53 +0100
> 
> x86: Use $(OBJDUMP) instead of plain objdump
> 
> commit e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
> broke the cross compile of x86. It added a objdump invocation, which
> invokes the host native objdump and ignores an active cross tool
> chain.
> 
> Use $(OBJDUMP) instead which takes the CROSS_COMPILE prefix into
> account.
> 
> [ tglx: Massage changelog and use $(OBJDUMP) ]
> 
> Fixes: e6023367d779 'x86, kaslr: Prevent .bss from overlaping initrd'
> Signed-off-by: Chris Clayton <chris2553@googlemail.com>
> Acked-by: Kees Cook <keescook@chromium.org>
> Acked-by: Borislav Petkov <bp@suse.de>
> Cc: Junjie Mao <eternal.n08@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: H. Peter Anvin <hpa@linux.intel.com>
> Cc: stable@vger.kernel.org
> Link: http://lkml.kernel.org/r/54705C8E.1080400@googlemail.com
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
>  arch/x86/boot/compressed/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
> index be1e07d..45abc36 100644
> --- a/arch/x86/boot/compressed/Makefile
> +++ b/arch/x86/boot/compressed/Makefile
> @@ -76,7 +76,7 @@ suffix-$(CONFIG_KERNEL_XZ)	:= xz
>  suffix-$(CONFIG_KERNEL_LZO) 	:= lzo
>  suffix-$(CONFIG_KERNEL_LZ4) 	:= lz4
>  
> -RUN_SIZE = $(shell objdump -h vmlinux | \
> +RUN_SIZE = $(shell $(OBJDUMP) -h vmlinux | \
>  	     perl $(srctree)/arch/x86/tools/calc_run_size.pl)
>  quiet_cmd_mkpiggy = MKPIGGY $@
>        cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false )
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [tip:x86/urgent] x86: Use $(OBJDUMP) instead of plain objdump
  2014-12-01 20:48   ` Chris Clayton
@ 2014-12-01 21:13     ` Thomas Gleixner
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Gleixner @ 2014-12-01 21:13 UTC (permalink / raw)
  To: Chris Clayton
  Cc: linux-kernel, eternal.n08, keescook, hpa, hpa, bp, mingo,
	linux-tip-commits

On Mon, 1 Dec 2014, Chris Clayton wrote:
> Is it planned to get this fix through in time for release of 3.18?
> It appears to have been in -next for a week.

Yes. I missed it for rc7, but its scheduled for 3.18 final.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-01 21:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-22  9:51 [PATCH]: cross-compiling x86_64 kernel on i386 user-space fails Chris Clayton
2014-11-22 11:14 ` Borislav Petkov
2014-11-22 16:00   ` Kees Cook
2014-11-23 19:27   ` Thomas Gleixner
2014-11-23 19:57     ` Borislav Petkov
2014-11-23 20:24 ` [tip:x86/urgent] x86: Use $(OBJDUMP) instead of plain objdump tip-bot for Chris Clayton
2014-12-01 20:48   ` Chris Clayton
2014-12-01 21:13     ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox