All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/x86//kernel/ftrace.c:35:3: error: #error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
@ 2017-04-16  1:20 kbuild test robot
  2017-04-17 13:33 ` Josh Poimboeuf
  0 siblings, 1 reply; 7+ messages in thread
From: kbuild test robot @ 2017-04-16  1:20 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: kbuild-all, linux-kernel, Ingo Molnar

[-- Attachment #1: Type: text/plain, Size: 1499 bytes --]

Hi Josh,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d5ff0814fda50f0306e102f39640cf5bb76af08e
commit: 3f135e57a4f76d24ae8d8a490314331f0ced40c5 x86/build: Mostly disable '-maccumulate-outgoing-args'
date:   2 weeks ago
config: x86_64-randconfig-s1-04160822 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
        git checkout 3f135e57a4f76d24ae8d8a490314331f0ced40c5
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> arch/x86//kernel/ftrace.c:35:3: error: #error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE

vim +35 arch/x86//kernel/ftrace.c

    29	#include <asm/ftrace.h>
    30	#include <asm/nops.h>
    31	
    32	#if defined(CONFIG_FUNCTION_GRAPH_TRACER) && \
    33		!defined(CC_USING_FENTRY) && \
    34		!defined(CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE)
  > 35	# error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
    36	#endif
    37	
    38	#ifdef CONFIG_DYNAMIC_FTRACE

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23457 bytes --]

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

* Re: arch/x86//kernel/ftrace.c:35:3: error: #error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
  2017-04-16  1:20 arch/x86//kernel/ftrace.c:35:3: error: #error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE kbuild test robot
@ 2017-04-17 13:33 ` Josh Poimboeuf
  2017-04-18 18:52   ` Andi Kleen
  0 siblings, 1 reply; 7+ messages in thread
From: Josh Poimboeuf @ 2017-04-17 13:33 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, linux-kernel, Ingo Molnar, Steven Rostedt

On Sun, Apr 16, 2017 at 09:20:50AM +0800, kbuild test robot wrote:
> Hi Josh,
> 
> FYI, the error/warning still remains.
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   d5ff0814fda50f0306e102f39640cf5bb76af08e
> commit: 3f135e57a4f76d24ae8d8a490314331f0ced40c5 x86/build: Mostly disable '-maccumulate-outgoing-args'
> date:   2 weeks ago
> config: x86_64-randconfig-s1-04160822 (attached as .config)
> compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
> reproduce:
>         git checkout 3f135e57a4f76d24ae8d8a490314331f0ced40c5
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
> >> arch/x86//kernel/ftrace.c:35:3: error: #error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE

Hi Fengguang,

The error is working as designed.  gcc < 4.6.0 doesn't have -mfentry, so
it fails the above check on x86.  Can you add a skip rule?  It should
skip building the following case:

  x86 && ((gcc < 4.6.0) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE

-- 
Josh

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

* Re: arch/x86//kernel/ftrace.c:35:3: error: #error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
  2017-04-17 13:33 ` Josh Poimboeuf
@ 2017-04-18 18:52   ` Andi Kleen
  2017-04-18 20:19     ` Josh Poimboeuf
  0 siblings, 1 reply; 7+ messages in thread
From: Andi Kleen @ 2017-04-18 18:52 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: kbuild test robot, kbuild-all, linux-kernel, Ingo Molnar, Steven Rostedt

Josh Poimboeuf <jpoimboe@redhat.com> writes:
>
> The error is working as designed.  gcc < 4.6.0 doesn't have -mfentry, so
> it fails the above check on x86.  Can you add a skip rule?  It should
> skip building the following case:
>
>   x86 && ((gcc < 4.6.0) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE))
> && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE

This will also break everyone's randconfig builds. The better way
would be to check this in the Makefile and disable one of the options

-Andi

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

* Re: arch/x86//kernel/ftrace.c:35:3: error: #error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
  2017-04-18 18:52   ` Andi Kleen
@ 2017-04-18 20:19     ` Josh Poimboeuf
  2017-04-18 20:25       ` Andi Kleen
  0 siblings, 1 reply; 7+ messages in thread
From: Josh Poimboeuf @ 2017-04-18 20:19 UTC (permalink / raw)
  To: Andi Kleen
  Cc: kbuild test robot, kbuild-all, linux-kernel, Ingo Molnar, Steven Rostedt

On Tue, Apr 18, 2017 at 11:52:41AM -0700, Andi Kleen wrote:
> Josh Poimboeuf <jpoimboe@redhat.com> writes:
> >
> > The error is working as designed.  gcc < 4.6.0 doesn't have -mfentry, so
> > it fails the above check on x86.  Can you add a skip rule?  It should
> > skip building the following case:
> >
> >   x86 && ((gcc < 4.6.0) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE))
> > && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
> 
> This will also break everyone's randconfig builds. The better way
> would be to check this in the Makefile and disable one of the options

I don't know how to disable a config option from the Makefile like that.
Any ideas?

BTW, I think it will only break randconfigs for old versions of gcc,
before 4.6.0.  The error message isn't quite right.  I just noticed the
FUNCTION_GRAPH_TRACER config has:

  depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE

which means that X86_32 and CC_OPTIMIZE_FOR_SIZE can never be set with
FUNCTION_GRAPH_TRACER.  So the error message could be simplified to:

  #error The following combination is not supported: (compiler missing -mfentry) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE

-- 
Josh

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

* Re: arch/x86//kernel/ftrace.c:35:3: error: #error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
  2017-04-18 20:19     ` Josh Poimboeuf
@ 2017-04-18 20:25       ` Andi Kleen
  2017-04-18 21:44         ` [PATCH] x86/build: convert function graph '-Os' error to warning Josh Poimboeuf
  0 siblings, 1 reply; 7+ messages in thread
From: Andi Kleen @ 2017-04-18 20:25 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Andi Kleen, kbuild test robot, kbuild-all, linux-kernel,
	Ingo Molnar, Steven Rostedt

On Tue, Apr 18, 2017 at 03:19:42PM -0500, Josh Poimboeuf wrote:
> On Tue, Apr 18, 2017 at 11:52:41AM -0700, Andi Kleen wrote:
> > Josh Poimboeuf <jpoimboe@redhat.com> writes:
> > >
> > > The error is working as designed.  gcc < 4.6.0 doesn't have -mfentry, so
> > > it fails the above check on x86.  Can you add a skip rule?  It should
> > > skip building the following case:
> > >
> > >   x86 && ((gcc < 4.6.0) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE))
> > > && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
> > 
> > This will also break everyone's randconfig builds. The better way
> > would be to check this in the Makefile and disable one of the options
> 
> I don't know how to disable a config option from the Makefile like that.

You just don't do something in the Makefile, e.g. don't set the -Os 

For an example see the LTO Makefile here

https://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc.git/tree/scripts/Makefile.lto?h=lto-411-1


-Andi

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

* [PATCH] x86/build: convert function graph '-Os' error to warning
  2017-04-18 20:25       ` Andi Kleen
@ 2017-04-18 21:44         ` Josh Poimboeuf
  2017-04-19  8:07           ` [tip:x86/urgent] " tip-bot for Josh Poimboeuf
  0 siblings, 1 reply; 7+ messages in thread
From: Josh Poimboeuf @ 2017-04-18 21:44 UTC (permalink / raw)
  To: Andi Kleen
  Cc: kbuild test robot, kbuild-all, linux-kernel, Ingo Molnar, Steven Rostedt

On Tue, Apr 18, 2017 at 01:25:19PM -0700, Andi Kleen wrote:
> On Tue, Apr 18, 2017 at 03:19:42PM -0500, Josh Poimboeuf wrote:
> > On Tue, Apr 18, 2017 at 11:52:41AM -0700, Andi Kleen wrote:
> > > Josh Poimboeuf <jpoimboe@redhat.com> writes:
> > > >
> > > > The error is working as designed.  gcc < 4.6.0 doesn't have -mfentry, so
> > > > it fails the above check on x86.  Can you add a skip rule?  It should
> > > > skip building the following case:
> > > >
> > > >   x86 && ((gcc < 4.6.0) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE))
> > > > && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
> > > 
> > > This will also break everyone's randconfig builds. The better way
> > > would be to check this in the Makefile and disable one of the options
> > 
> > I don't know how to disable a config option from the Makefile like that.
> 
> You just don't do something in the Makefile, e.g. don't set the -Os 
> 
> For an example see the LTO Makefile here
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc.git/tree/scripts/Makefile.lto?h=lto-411-1

This seems to work:

----

From: Josh Poimboeuf <jpoimboe@redhat.com>
Subject: [PATCH] x86/build: convert function graph '-Os' error to warning

For pre-4.6.0 versions of GCC, which don't have '-mfentry', the
'-maccumulate-outgoing-args' option is required for function graph
tracing in order to avoid GCC bug 42109.  However, GCC ignores
'-maccumulate-outgoing-args' when '-Os' is also set.

Currently we force a build error to prevent that scenario, but that
breaks randconfigs.  So change the error to a warning which also
disables CONFIG_CC_OPTIMIZE_FOR_SIZE.

Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 arch/x86/Makefile        | 8 ++++++++
 arch/x86/kernel/ftrace.c | 6 ------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 73604e1..4430dd4 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -154,6 +154,14 @@ ifdef CONFIG_FUNCTION_GRAPH_TRACER
   else
     ifeq ($(call cc-option-yn, -mfentry), n)
 	ACCUMULATE_OUTGOING_ARGS := 1
+
+	# GCC ignores '-maccumulate-outgoing-args' when used with '-Os'.
+	# If '-Os' is enabled, disable it and print a warning.
+        ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+          undefine CONFIG_CC_OPTIMIZE_FOR_SIZE
+	  $(warning Disabling CONFIG_CC_OPTIMIZE_FOR_SIZE.  Your compiler does not have -mfentry so you cannot optimize for size with CONFIG_FUNCTION_GRAPH_TRACER.)
+        endif
+
     endif
   endif
 endif
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 0e5ceac..5b71535 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -29,12 +29,6 @@
 #include <asm/ftrace.h>
 #include <asm/nops.h>
 
-#if defined(CONFIG_FUNCTION_GRAPH_TRACER) && \
-	!defined(CC_USING_FENTRY) && \
-	!defined(CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE)
-# error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
-#endif
-
 #ifdef CONFIG_DYNAMIC_FTRACE
 
 int ftrace_arch_code_modify_prepare(void)
-- 
2.7.4

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

* [tip:x86/urgent] x86/build: convert function graph '-Os' error to warning
  2017-04-18 21:44         ` [PATCH] x86/build: convert function graph '-Os' error to warning Josh Poimboeuf
@ 2017-04-19  8:07           ` tip-bot for Josh Poimboeuf
  0 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Josh Poimboeuf @ 2017-04-19  8:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, hpa, linux-kernel, tglx, rostedt, peterz, fengguang.wu,
	jpoimboe, torvalds, andi

Commit-ID:  a5859c6d7b6114fc0e52be40f7b0f5451c4aba93
Gitweb:     http://git.kernel.org/tip/a5859c6d7b6114fc0e52be40f7b0f5451c4aba93
Author:     Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Tue, 18 Apr 2017 16:44:29 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 19 Apr 2017 09:57:23 +0200

x86/build: convert function graph '-Os' error to warning

For pre-4.6.0 versions of GCC, which don't have '-mfentry', the
'-maccumulate-outgoing-args' option is required for function graph
tracing in order to avoid GCC bug 42109.

However, GCC ignores '-maccumulate-outgoing-args' when '-Os' is
also set.

Currently we force a build error to prevent that scenario, but that
breaks randconfigs.  So change the error to a warning which also
disables CONFIG_CC_OPTIMIZE_FOR_SIZE.

Reported-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kbuild test robot <fengguang.wu@intel.com>
Cc: kbuild-all@01.org
Link: http://lkml.kernel.org/r/20170418214429.o7fbwbmf4nqosezy@treble
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/Makefile        | 8 ++++++++
 arch/x86/kernel/ftrace.c | 6 ------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index a94a4d1..49d160b 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -154,6 +154,14 @@ ifdef CONFIG_FUNCTION_GRAPH_TRACER
   else
     ifeq ($(call cc-option-yn, -mfentry), n)
 	ACCUMULATE_OUTGOING_ARGS := 1
+
+	# GCC ignores '-maccumulate-outgoing-args' when used with '-Os'.
+	# If '-Os' is enabled, disable it and print a warning.
+        ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+          undefine CONFIG_CC_OPTIMIZE_FOR_SIZE
+	  $(warning Disabling CONFIG_CC_OPTIMIZE_FOR_SIZE.  Your compiler does not have -mfentry so you cannot optimize for size with CONFIG_FUNCTION_GRAPH_TRACER.)
+        endif
+
     endif
   endif
 endif
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 0e5ceac..5b71535 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -29,12 +29,6 @@
 #include <asm/ftrace.h>
 #include <asm/nops.h>
 
-#if defined(CONFIG_FUNCTION_GRAPH_TRACER) && \
-	!defined(CC_USING_FENTRY) && \
-	!defined(CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE)
-# error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE
-#endif
-
 #ifdef CONFIG_DYNAMIC_FTRACE
 
 int ftrace_arch_code_modify_prepare(void)

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

end of thread, other threads:[~2017-04-19  8:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-16  1:20 arch/x86//kernel/ftrace.c:35:3: error: #error The following combination is not supported: ((compiler missing -mfentry) || (CONFIG_X86_32 and !CONFIG_DYNAMIC_FTRACE)) && CONFIG_FUNCTION_GRAPH_TRACER && CONFIG_CC_OPTIMIZE_FOR_SIZE kbuild test robot
2017-04-17 13:33 ` Josh Poimboeuf
2017-04-18 18:52   ` Andi Kleen
2017-04-18 20:19     ` Josh Poimboeuf
2017-04-18 20:25       ` Andi Kleen
2017-04-18 21:44         ` [PATCH] x86/build: convert function graph '-Os' error to warning Josh Poimboeuf
2017-04-19  8:07           ` [tip:x86/urgent] " tip-bot for Josh Poimboeuf

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.