All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hyeonggon Yoo <42.hyeyoo@gmail.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>,
	kernel test robot <lkp@intel.com>,
	kbuild-all@lists.01.org,
	 Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Nick Desaulniers <ndesaulniers@google.com>,
	 clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [linux-next:master 7012/7430] include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_183' declared with attribute error: unexpected size in kmalloc_index()
Date: Sat, 12 Jun 2021 09:31:51 +0900	[thread overview]
Message-ID: <CAB=+i9RJgjHP9RExixQx66hkWmEuK64nAaD+wH8SeDjxyMoFsw@mail.gmail.com> (raw)
In-Reply-To: <99de1f59-1e38-6410-86ff-0ea1f016c49f@kernel.org>

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

On Sat, Jun 12, 2021, 1:56 AM Nathan Chancellor <nathan@kernel.org> wrote:

> On 6/11/2021 1:58 AM, Hyeonggon Yoo wrote:> After playing with clang
> more a bit, I got to know that
> > compiletime_assert makes weird link error (undefined reference to
> > compiletime_assert_XXX), Not a compile error.
> >
> >
> > I think it's time to CC ClangBuiltLinux maintainers, who work on
> > clang/llvm build support.
> >
> > [+CC Nathan and Nick]
> >
> > I assumeed that compiletime_assert (in linux/compiler.h) will make
> > compiler error, but it makes no compile error, just makes weird link
> error.
> >
> > I'm not sure it it works well with clang, or somewhat buggy status?
>
> I am guessing this alone is why we were keyed into the thread so I am
> just going to respond to this.
>

Thank you for quick reply!

Unfortunately, this is a known issue with clang:
>
> https://github.com/ClangBuiltLinux/linux/issues/1173
>
> https://bugs.llvm.org/show_bug.cgi?id=16428



> As you noticed, building the full kernel will result in a link error but
> it would certainly be nicer if it were a compiler error. Something for
> us to improve indeed but I am not sure when we will be able to allocate
> resources for that.


I wanted to be sure if we can use compiletime_assert for clang. Then there
is room for improvement, but it seems okay.

Until then, you can build a full kernel to get the
> failing translation unit then use nm or readelf when building the single
> translation unit to see if there are any "__compiletime_assert" symbols.
>

Okay, then we should find symbol like that until improved.

It may confuse developer, but it seems okay for our code to support clang
as it meets minimal condition - build failure.

And I hope it become improved in future!

Thanks,
Hyeonggon

Cheers,
> Nathan
>

[-- Attachment #2: Type: text/html, Size: 3515 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Hyeonggon Yoo <42.hyeyoo@gmail.com>
To: kbuild-all@lists.01.org
Subject: Re: [linux-next:master 7012/7430] include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_183' declared with attribute error: unexpected size in kmalloc_index()
Date: Sat, 12 Jun 2021 09:31:51 +0900	[thread overview]
Message-ID: <CAB=+i9RJgjHP9RExixQx66hkWmEuK64nAaD+wH8SeDjxyMoFsw@mail.gmail.com> (raw)
In-Reply-To: <99de1f59-1e38-6410-86ff-0ea1f016c49f@kernel.org>

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

On Sat, Jun 12, 2021, 1:56 AM Nathan Chancellor <nathan@kernel.org> wrote:

> On 6/11/2021 1:58 AM, Hyeonggon Yoo wrote:> After playing with clang
> more a bit, I got to know that
> > compiletime_assert makes weird link error (undefined reference to
> > compiletime_assert_XXX), Not a compile error.
> >
> >
> > I think it's time to CC ClangBuiltLinux maintainers, who work on
> > clang/llvm build support.
> >
> > [+CC Nathan and Nick]
> >
> > I assumeed that compiletime_assert (in linux/compiler.h) will make
> > compiler error, but it makes no compile error, just makes weird link
> error.
> >
> > I'm not sure it it works well with clang, or somewhat buggy status?
>
> I am guessing this alone is why we were keyed into the thread so I am
> just going to respond to this.
>

Thank you for quick reply!

Unfortunately, this is a known issue with clang:
>
> https://github.com/ClangBuiltLinux/linux/issues/1173
>
> https://bugs.llvm.org/show_bug.cgi?id=16428



> As you noticed, building the full kernel will result in a link error but
> it would certainly be nicer if it were a compiler error. Something for
> us to improve indeed but I am not sure when we will be able to allocate
> resources for that.


I wanted to be sure if we can use compiletime_assert for clang. Then there
is room for improvement, but it seems okay.

Until then, you can build a full kernel to get the
> failing translation unit then use nm or readelf when building the single
> translation unit to see if there are any "__compiletime_assert" symbols.
>

Okay, then we should find symbol like that until improved.

It may confuse developer, but it seems okay for our code to support clang
as it meets minimal condition - build failure.

And I hope it become improved in future!

Thanks,
Hyeonggon

Cheers,
> Nathan
>

[-- Attachment #2: attachment.htm --]
[-- Type: text/html, Size: 3483 bytes --]

  reply	other threads:[~2021-06-12  0:32 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05  6:10 [linux-next:master 7012/7430] include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_183' declared with attribute error: unexpected size in kmalloc_index() kernel test robot
2021-06-05  6:10 ` kernel test robot
2021-06-06 11:08 ` Hyeonggon Yoo
2021-06-06 11:08   ` Hyeonggon Yoo
2021-06-07 11:40   ` Vlastimil Babka
2021-06-07 11:40     ` Vlastimil Babka
2021-06-07 12:25     ` Hyeonggon Yoo
2021-06-07 12:25       ` Hyeonggon Yoo
2021-06-07 15:27       ` Vlastimil Babka
2021-06-07 15:27         ` Vlastimil Babka
2021-06-07 15:49         ` Hyeonggon Yoo
2021-06-07 15:49           ` Hyeonggon Yoo
2021-06-08  7:57           ` Vlastimil Babka
2021-06-08  7:57             ` Vlastimil Babka
2021-06-08 17:05             ` Hyeonggon Yoo
2021-06-08 17:05               ` Hyeonggon Yoo
2021-06-08 17:27               ` Vlastimil Babka
2021-06-08 17:27                 ` Vlastimil Babka
2021-06-08 18:45                 ` Hyeonggon Yoo
2021-06-08 18:45                   ` Hyeonggon Yoo
2021-06-08 18:50                   ` Hyeonggon Yoo
2021-06-08 18:50                     ` Hyeonggon Yoo
2021-06-10  5:17                   ` Some logical errors on my words, but I still wonder Hyeonggon Yoo
2021-06-10  5:17                     ` Hyeonggon Yoo
2021-06-10 11:43                   ` [linux-next:master 7012/7430] include/linux/compiler_types.h:328:38: error: call to '__compiletime_assert_183' declared with attribute error: unexpected size in kmalloc_index() Vlastimil Babka
2021-06-10 11:43                     ` Vlastimil Babka
2021-06-11  8:58                     ` Hyeonggon Yoo
2021-06-11 10:27                       ` Vlastimil Babka
2021-06-11 11:56                         ` Hyeonggon Yoo
2021-06-11 23:59                           ` Vlastimil Babka
2021-06-11 23:59                             ` Vlastimil Babka
2021-06-12  0:19                             ` Hyeonggon Yoo
2021-06-12  0:19                               ` Hyeonggon Yoo
2021-06-14  9:26                               ` [PATCH FIX -next] " Vlastimil Babka
2021-06-14  9:26                                 ` Vlastimil Babka
2021-06-11 16:56                       ` Nathan Chancellor
2021-06-11 16:56                         ` Nathan Chancellor
2021-06-12  0:31                         ` Hyeonggon Yoo [this message]
2021-06-12  0:31                           ` Hyeonggon Yoo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB=+i9RJgjHP9RExixQx66hkWmEuK64nAaD+wH8SeDjxyMoFsw@mail.gmail.com' \
    --to=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.