Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1634938 > unrolled thread

[PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure

Started byGeert Uytterhoeven <geert@linux-m68k.org>
First post2017-05-03 14:20 +0200
Last post2017-05-03 16:20 +0200
Articles 7 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure Geert Uytterhoeven <geert@linux-m68k.org> - 2017-05-03 14:20 +0200
    Re: [PATCH] netfilter: conntrack: Force inlining of build check to  prevent build failure Arnd Bergmann <arnd@arndb.de> - 2017-05-03 14:40 +0200
      Re: [PATCH] netfilter: conntrack: Force inlining of build check to  prevent build failure Geert Uytterhoeven <geert@linux-m68k.org> - 2017-05-03 14:50 +0200
        Re: [PATCH] netfilter: conntrack: Force inlining of build check to  prevent build failure Arnd Bergmann <arnd@arndb.de> - 2017-05-03 15:00 +0200
    Re: [PATCH] netfilter: conntrack: Force inlining of build check to  prevent build failure Florian Westphal <fw@strlen.de> - 2017-05-03 14:40 +0200
    Re: [PATCH] netfilter: conntrack: Force inlining of build check to  prevent build failure David Miller <davem@davemloft.net> - 2017-05-03 16:00 +0200
      Re: [PATCH] netfilter: conntrack: Force inlining of build check to  prevent build failure Pablo Neira Ayuso <pablo@netfilter.org> - 2017-05-03 16:20 +0200

#1634938 — [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2017-05-03 14:20 +0200
Subject[PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
Message-ID<tD1qa-5fK-19@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1634951 — Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure

FromArnd Bergmann <arnd@arndb.de>
Date2017-05-03 14:40 +0200
SubjectRe: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
Message-ID<tD1Jv-5or-3@gated-at.bofh.it>
In reply to#1634938
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

[toc] | [prev] | [next] | [standalone]


#1634959 — Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2017-05-03 14:50 +0200
SubjectRe: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
Message-ID<tD1Tc-5s5-13@gated-at.bofh.it>
In reply to#1634951
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

[toc] | [prev] | [next] | [standalone]


#1634965 — Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure

FromArnd Bergmann <arnd@arndb.de>
Date2017-05-03 15:00 +0200
SubjectRe: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
Message-ID<tD22S-5vI-9@gated-at.bofh.it>
In reply to#1634959
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

[toc] | [prev] | [next] | [standalone]


#1634953 — Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure

FromFlorian Westphal <fw@strlen.de>
Date2017-05-03 14:40 +0200
SubjectRe: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
Message-ID<tD1Jv-5or-7@gated-at.bofh.it>
In reply to#1634938
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>

[toc] | [prev] | [next] | [standalone]


#1634995 — Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure

FromDavid Miller <davem@davemloft.net>
Date2017-05-03 16:00 +0200
SubjectRe: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
Message-ID<tD2YX-6a8-33@gated-at.bofh.it>
In reply to#1634938
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.

[toc] | [prev] | [next] | [standalone]


#1635014 — Re: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure

FromPablo Neira Ayuso <pablo@netfilter.org>
Date2017-05-03 16:20 +0200
SubjectRe: [PATCH] netfilter: conntrack: Force inlining of build check to prevent build failure
Message-ID<tD3ii-6wt-27@gated-at.bofh.it>
In reply to#1634995
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>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web