All of lore.kernel.org
 help / color / mirror / Atom feed
* IS_ENABLED() and non-available symbols
@ 2011-08-14 10:56 Rabin Vincent
  2011-08-14 16:55 ` Arnaud Lacombe
  0 siblings, 1 reply; 6+ messages in thread
From: Rabin Vincent @ 2011-08-14 10:56 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, LKML

I'm trying to use the new IS_ENABLED() stuff, but it appears that it
only works if the symbol being tested has its dependencies met, and
results in compiler errors if that is not the case.

For example, I've added code using IS_ENABLED(CONFIG_THUMB2_KERNEL) as
in the below patch.  My config is arch/arm/configs/omap2plus_defconfig
which doesn't satisfy the dependencies for CONFIG_THUMB2_KERNEL (defined
in arch/arm/Kconfig).

Compiling results in the following errors (and indeed the macro hasn't
been generated in include/generated/autoconfg.h).  If I modify my config
to satisfy the dependencies for CONFIG_THUMB2_KERNEL so that it is
selectable, the __enabled_CONFIG_THUMB2_KERNEL macro gets generated.

arch/arm/kernel/setup.c: In function 'c_show':
arch/arm/kernel/setup.c:1056: error: '__enabled_CONFIG_THUMB2_KERNEL'
undeclared (first use in this function)
arch/arm/kernel/setup.c:1056: error: (Each undeclared identifier is
reported only once
arch/arm/kernel/setup.c:1056: error: for each function it appears in.)
arch/arm/kernel/setup.c:1056: error:
'__enabled_CONFIG_THUMB2_KERNEL_MODULE' undeclared (first use in this
function)

Kernel is latest linus (v3.1-rc1-272-g73e0881).

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 70bca64..59aa480 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1053,6 +1053,9 @@ static int c_show(struct seq_file *m, void *v)
        seq_printf(m, "Serial\t\t: %08x%08x\n",
                   system_serial_high, system_serial_low);

+       if (IS_ENABLED(CONFIG_THUMB2_KERNEL))
+               printk("Thumb-2\n");
+
        return 0;
 }

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

end of thread, other threads:[~2011-08-15 19:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-14 10:56 IS_ENABLED() and non-available symbols Rabin Vincent
2011-08-14 16:55 ` Arnaud Lacombe
2011-08-14 17:02   ` Arnaud Lacombe
2011-08-15 10:55     ` Michal Marek
2011-08-15 14:52       ` Arnaud Lacombe
2011-08-15 19:04         ` Arnaud Lacombe

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.