All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/x86/Makefile kbuild problem
@ 2011-01-24 10:35 Philippe Auphelle
  2011-02-10 14:35 ` Michal Marek
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Auphelle @ 2011-01-24 10:35 UTC (permalink / raw)
  To: linux-kbuild

Hi All,

Building an x86_64 external module from an x86 (32-bit) Linux 2.6.35,
I get a "stack protector enabled but no compiler support" error.
I'm by no way a kbuild (or even make) specialist, but it looks to me
like the problem is this:

The error is produced in arch/x86/Makefile, line 81.

Looking further, it looks like this code relies on $(biarch) being set
to the CC bitness parm (-m32 / -m64) to call the cc_has_sp detection
script (line 77).
Problem is, $(biarch) is only set (to -m32) when CONFIG_X86_32 is set
(line 20), but *not* when the else clause is taken (-m64 option is
directly set then in KBUILD_AFLAGS and KBUILD_CFLAGS then, (lines
49-50) ).
As a result, the detection scripts always fails.

replacing lines 49-50 by something like:
        biarch := $(call cc-option,-m64)
        KBUILD_AFLAGS += $(biarch)
        KBUILD_CFLAGS += $(biarch)

solves the problem.

I just checked with the latest 2.6.37, and arch/x86/Makefile hasn't
changed since 2.6.35 (at least not in that part of the file).

Questions are:
- Could someone more knowledgeable than me in that matter be kind
enough to confirm that this is truely the problem (and a valid
solution)?
and if so,
- Is this the right place to report it to get it eventually fixed?
(and if it ain't, where should it be?)

TIA! /Ph.

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

* Re: arch/x86/Makefile kbuild problem
  2011-01-24 10:35 arch/x86/Makefile kbuild problem Philippe Auphelle
@ 2011-02-10 14:35 ` Michal Marek
  2011-02-10 14:53   ` Philippe Auphelle
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Marek @ 2011-02-10 14:35 UTC (permalink / raw)
  To: Philippe Auphelle; +Cc: linux-kbuild

On 24.1.2011 11:35, Philippe Auphelle wrote:
> Hi All,
> 
> Building an x86_64 external module from an x86 (32-bit) Linux 2.6.35,
> I get a "stack protector enabled but no compiler support" error.
> I'm by no way a kbuild (or even make) specialist, but it looks to me
> like the problem is this:
> 
> The error is produced in arch/x86/Makefile, line 81.
> 
> Looking further, it looks like this code relies on $(biarch) being set
> to the CC bitness parm (-m32 / -m64) to call the cc_has_sp detection
> script (line 77).
> Problem is, $(biarch) is only set (to -m32) when CONFIG_X86_32 is set
> (line 20), but *not* when the else clause is taken (-m64 option is
> directly set then in KBUILD_AFLAGS and KBUILD_CFLAGS then, (lines
> 49-50) ).
> As a result, the detection scripts always fails.
> 
> replacing lines 49-50 by something like:
>         biarch := $(call cc-option,-m64)
>         KBUILD_AFLAGS += $(biarch)
>         KBUILD_CFLAGS += $(biarch)

I think you can omit the cc-option call and simply set biarch := -m64,
because the gcc x86_64 target always had the -m64 option.
> 
> solves the problem.
> 
> I just checked with the latest 2.6.37, and arch/x86/Makefile hasn't
> changed since 2.6.35 (at least not in that part of the file).
> 
> Questions are:
> - Could someone more knowledgeable than me in that matter be kind
> enough to confirm that this is truely the problem (and a valid
> solution)?
> and if so,
> - Is this the right place to report it to get it eventually fixed?
> (and if it ain't, where should it be?)

You should send a proper patch (refer to
Documentation/SubmittingPatches) to lkml and the people under the "X86
ARCHITECTURE (32-BIT AND 64-BIT)" entry in the MAINTAINERS file.

Michal

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

* Re: arch/x86/Makefile kbuild problem
  2011-02-10 14:35 ` Michal Marek
@ 2011-02-10 14:53   ` Philippe Auphelle
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Auphelle @ 2011-02-10 14:53 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild

> You should send a proper patch (refer to
> Documentation/SubmittingPatches) to lkml and the people under the "X86
> ARCHITECTURE (32-BIT AND 64-BIT)" entry in the MAINTAINERS file.

The reasons I didn't do it right away are
- Even though I checked carefully, I wasn't quite sure this couldn't
break something else
and
- I've never submitted a patch before,

So I thought it could be useful (and safer) to have someone double
checking this before.
Since you appear to have, I'll follow your advice (and hope for the best)...
Thanks for the tips! /Ph.

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

end of thread, other threads:[~2011-02-10 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 10:35 arch/x86/Makefile kbuild problem Philippe Auphelle
2011-02-10 14:35 ` Michal Marek
2011-02-10 14:53   ` Philippe Auphelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.