All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
@ 2017-05-03 12:18 Geert Uytterhoeven
  2017-05-03 12:32 ` Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2017-05-03 12:18 UTC (permalink / raw)
  To: David S . Miller, Florian Westphal, Pablo Neira Ayuso, Jozsef Kadlecsik
  Cc: Arnd Bergmann, netfilter-devel, coreteam, netdev, linux-kernel,
	Geert Uytterhoeven

If gcc (e.g. 4.1.2) decides not to inline total_extension_size(), the
build will fail with:

    net/built-in.o: In function `nf_conntrack_init_start':
    (.text+0x9baf6): undefined reference to `__compiletime_assert_1893'

or

    ERROR: "__compiletime_assert_1893" [net/netfilter/nf_conntrack.ko] undefined!

Fix this by forcing inlining of total_extension_size().

Fixes: b3a5db109e0670d6 ("netfilter: conntrack: use u8 for extension sizes again")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 net/netfilter/nf_conntrack_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index f9245dbfe4356da6..3c8f1ed2f5558fe0 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1853,7 +1853,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_set_hashsize);
 module_param_call(hashsize, nf_conntrack_set_hashsize, param_get_uint,
 		  &nf_conntrack_htable_size, 0600);
 
-static unsigned int total_extension_size(void)
+static __always_inline unsigned int total_extension_size(void)
 {
 	/* remember to add new extensions below */
 	BUILD_BUG_ON(NF_CT_EXT_NUM > 9);
-- 
2.7.4

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

* Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
  2017-05-03 12:18 [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure Geert Uytterhoeven
@ 2017-05-03 12:32 ` Arnd Bergmann
  2017-05-03 12:47     ` Geert Uytterhoeven
  2017-05-03 12:38 ` Florian Westphal
  2017-05-03 13:55 ` David Miller
  2 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2017-05-03 12:32 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: David S . Miller, Florian Westphal, Pablo Neira Ayuso,
	Jozsef Kadlecsik, netfilter-devel, coreteam, Networking,
	Linux Kernel Mailing List

On Wed, May 3, 2017 at 2:18 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> If gcc (e.g. 4.1.2) decides not to inline total_extension_size(), the
> build will fail with:
>
>     net/built-in.o: In function `nf_conntrack_init_start':
>     (.text+0x9baf6): undefined reference to `__compiletime_assert_1893'
>
> or
>
>     ERROR: "__compiletime_assert_1893" [net/netfilter/nf_conntrack.ko] undefined!
>
> Fix this by forcing inlining of total_extension_size().
>
> Fixes: b3a5db109e0670d6 ("netfilter: conntrack: use u8 for extension sizes again")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

I saw this as well when I tried building with "gcc-7 -Og", and came to the same
conclusion.

Acked-by: Arnd Bergmann <arnd@arndb.de>

With -Og, there were a couple of other instances of BUILD_BUG_ON() failing
to see a compile-time constant, presumably as it fails to inline any functions
that are not explicitly marked inline.

       Arnd

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

* Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
  2017-05-03 12:18 [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure Geert Uytterhoeven
  2017-05-03 12:32 ` Arnd Bergmann
@ 2017-05-03 12:38 ` Florian Westphal
  2017-05-03 13:55 ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: Florian Westphal @ 2017-05-03 12:38 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: David S . Miller, Florian Westphal, Pablo Neira Ayuso,
	Jozsef Kadlecsik, Arnd Bergmann, netfilter-devel, coreteam,
	netdev, linux-kernel

Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> If gcc (e.g. 4.1.2) decides not to inline total_extension_size(), the
> build will fail with:
> 
>     net/built-in.o: In function `nf_conntrack_init_start':
>     (.text+0x9baf6): undefined reference to `__compiletime_assert_1893'
> 
> or
> 
>     ERROR: "__compiletime_assert_1893" [net/netfilter/nf_conntrack.ko] undefined!
> 
> Fix this by forcing inlining of total_extension_size().

Sorry about that, thanks for the fix Geert.

Acked-by: Florian Westphal <fw@strlen.de>

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

* Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
  2017-05-03 12:32 ` Arnd Bergmann
@ 2017-05-03 12:47     ` Geert Uytterhoeven
  0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2017-05-03 12:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: David S . Miller, Florian Westphal, Pablo Neira Ayuso,
	Jozsef Kadlecsik, netfilter-devel, coreteam, Networking,
	Linux Kernel Mailing List

Hi Arnd,

On Wed, May 3, 2017 at 2:32 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wed, May 3, 2017 at 2:18 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> If gcc (e.g. 4.1.2) decides not to inline total_extension_size(), the
>> build will fail with:
>>
>>     net/built-in.o: In function `nf_conntrack_init_start':
>>     (.text+0x9baf6): undefined reference to `__compiletime_assert_1893'
>>
>> or
>>
>>     ERROR: "__compiletime_assert_1893" [net/netfilter/nf_conntrack.ko] undefined!
>>
>> Fix this by forcing inlining of total_extension_size().
>>
>> Fixes: b3a5db109e0670d6 ("netfilter: conntrack: use u8 for extension sizes again")
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> I saw this as well when I tried building with "gcc-7 -Og", and came to the same
> conclusion.

Good^H^H^H^HBad to see it not only happens with ancient compilers ;-)

> Acked-by: Arnd Bergmann <arnd@arndb.de>

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
@ 2017-05-03 12:47     ` Geert Uytterhoeven
  0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2017-05-03 12:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: David S . Miller, Florian Westphal, Pablo Neira Ayuso,
	Jozsef Kadlecsik, netfilter-devel, coreteam, Networking,
	Linux Kernel Mailing List

Hi Arnd,

On Wed, May 3, 2017 at 2:32 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Wed, May 3, 2017 at 2:18 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> If gcc (e.g. 4.1.2) decides not to inline total_extension_size(), the
>> build will fail with:
>>
>>     net/built-in.o: In function `nf_conntrack_init_start':
>>     (.text+0x9baf6): undefined reference to `__compiletime_assert_1893'
>>
>> or
>>
>>     ERROR: "__compiletime_assert_1893" [net/netfilter/nf_conntrack.ko] undefined!
>>
>> Fix this by forcing inlining of total_extension_size().
>>
>> Fixes: b3a5db109e0670d6 ("netfilter: conntrack: use u8 for extension sizes again")
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> I saw this as well when I tried building with "gcc-7 -Og", and came to the same
> conclusion.

Good^H^H^H^HBad to see it not only happens with ancient compilers ;-)

> Acked-by: Arnd Bergmann <arnd@arndb.de>

Thanks!

Gr{oetje,eeting}s,

                        Geert

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

* Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
  2017-05-03 12:47     ` Geert Uytterhoeven
  (?)
@ 2017-05-03 12:56     ` Arnd Bergmann
  -1 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2017-05-03 12:56 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: David S . Miller, Florian Westphal, Pablo Neira Ayuso,
	Jozsef Kadlecsik, netfilter-devel, coreteam, Networking,
	Linux Kernel Mailing List

On Wed, May 3, 2017 at 2:47 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Arnd,
>
> On Wed, May 3, 2017 at 2:32 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Wed, May 3, 2017 at 2:18 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>>> If gcc (e.g. 4.1.2) decides not to inline total_extension_size(), the
>>> build will fail with:
>>>
>>>     net/built-in.o: In function `nf_conntrack_init_start':
>>>     (.text+0x9baf6): undefined reference to `__compiletime_assert_1893'
>>>
>>> or
>>>
>>>     ERROR: "__compiletime_assert_1893" [net/netfilter/nf_conntrack.ko] undefined!
>>>
>>> Fix this by forcing inlining of total_extension_size().
>>>
>>> Fixes: b3a5db109e0670d6 ("netfilter: conntrack: use u8 for extension sizes again")
>>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>
>> I saw this as well when I tried building with "gcc-7 -Og", and came to the same
>> conclusion.
>
> Good^H^H^H^HBad to see it not only happens with ancient compilers ;-)

Right now we don't see it on newer compilers (I assume gcc-4.3 or up) as we
always build with either -O2 or -Os optimizations. I was playing with -Og the
other day to get faster builds, but that causes many build failures
and additional
warnings as the result of missing out on optimizations that we have come
to rely on.

It might be worth getting -Og to build if the compile time is
drastically faster, but
we probably have to completely do away with BUILD_BUG_ON() and similar
checks in that configuration, which in turn makes the build output less
valuable.

       Arnd

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

* Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
  2017-05-03 12:18 [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure Geert Uytterhoeven
  2017-05-03 12:32 ` Arnd Bergmann
  2017-05-03 12:38 ` Florian Westphal
@ 2017-05-03 13:55 ` David Miller
  2017-05-03 14:10   ` Pablo Neira Ayuso
  2 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2017-05-03 13:55 UTC (permalink / raw)
  To: geert
  Cc: fw, pablo, kadlec, arnd, netfilter-devel, coreteam, netdev, linux-kernel

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed,  3 May 2017 14:18:43 +0200

> If gcc (e.g. 4.1.2) decides not to inline total_extension_size(), the
> build will fail with:
> 
>     net/built-in.o: In function `nf_conntrack_init_start':
>     (.text+0x9baf6): undefined reference to `__compiletime_assert_1893'
> 
> or
> 
>     ERROR: "__compiletime_assert_1893" [net/netfilter/nf_conntrack.ko] undefined!
> 
> Fix this by forcing inlining of total_extension_size().
> 
> Fixes: b3a5db109e0670d6 ("netfilter: conntrack: use u8 for extension sizes again")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Pablo, I'm going to apply this directly to my tree to fix this build
failure, I hope you don't mind.

Thanks.

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

* Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
  2017-05-03 13:55 ` David Miller
@ 2017-05-03 14:10   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 8+ messages in thread
From: Pablo Neira Ayuso @ 2017-05-03 14:10 UTC (permalink / raw)
  To: David Miller
  Cc: geert, fw, kadlec, arnd, netfilter-devel, coreteam, netdev, linux-kernel

On Wed, May 03, 2017 at 09:55:16AM -0400, David Miller wrote:
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Date: Wed,  3 May 2017 14:18:43 +0200
> 
> > If gcc (e.g. 4.1.2) decides not to inline total_extension_size(), the
> > build will fail with:
> > 
> >     net/built-in.o: In function `nf_conntrack_init_start':
> >     (.text+0x9baf6): undefined reference to `__compiletime_assert_1893'
> > 
> > or
> > 
> >     ERROR: "__compiletime_assert_1893" [net/netfilter/nf_conntrack.ko] undefined!
> > 
> > Fix this by forcing inlining of total_extension_size().
> > 
> > Fixes: b3a5db109e0670d6 ("netfilter: conntrack: use u8 for extension sizes again")
> > Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> 
> Pablo, I'm going to apply this directly to my tree to fix this build
> failure, I hope you don't mind.

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

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

end of thread, other threads:[~2017-05-03 14:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03 12:18 [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure Geert Uytterhoeven
2017-05-03 12:32 ` Arnd Bergmann
2017-05-03 12:47   ` Geert Uytterhoeven
2017-05-03 12:47     ` Geert Uytterhoeven
2017-05-03 12:56     ` Arnd Bergmann
2017-05-03 12:38 ` Florian Westphal
2017-05-03 13:55 ` David Miller
2017-05-03 14:10   ` Pablo Neira Ayuso

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.