public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [ebiggers:libcrypto-pending 38/50] crypto/sha1.c:23:15: error: static assertion failed due to requirement 'sizeof(struct sha1_ctx) == sizeof(struct sha1_state)': sizeof(struct sha1_ctx) == sizeof(struct sha1_state)
@ 2026-03-21  9:55 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-03-21  9:55 UTC (permalink / raw)
  To: Eric Biggers; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git libcrypto-pending
head:   68eff526dd94e97b9b25a9c01865062bc99264b0
commit: 06e5e9868540eb7be8630b1466d1571b52f3c82f [38/50] lib/crypto: sha1: Explicitly specify alignment of sha1_ctx::buf
config: i386-randconfig-013-20260321 (https://download.01.org/0day-ci/archive/20260321/202603211729.eY5qHyS4-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260321/202603211729.eY5qHyS4-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603211729.eY5qHyS4-lkp@intel.com/

All errors (new ones prefixed by >>):

>> crypto/sha1.c:23:15: error: static assertion failed due to requirement 'sizeof(struct sha1_ctx) == sizeof(struct sha1_state)': sizeof(struct sha1_ctx) == sizeof(struct sha1_state)
      23 | static_assert(sizeof(struct sha1_ctx) == sizeof(struct sha1_state));
         |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                                  ^~~~
   include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   crypto/sha1.c:23:39: note: expression evaluates to '96 == 92'
      23 | static_assert(sizeof(struct sha1_ctx) == sizeof(struct sha1_state));
         |               ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                                  ^~~~
   include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
>> crypto/sha1.c:26:15: error: static assertion failed due to requirement '__builtin_offsetof(struct sha1_ctx, buf) == __builtin_offsetof(struct sha1_state, buffer)': offsetof(struct sha1_ctx, buf) == offsetof(struct sha1_state, buffer)
      26 | static_assert(offsetof(struct sha1_ctx, buf) == offsetof(struct sha1_state, buffer));
         | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/stddef.h:16:32: note: expanded from macro 'offsetof'
      16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
         |                                 ^
   include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   crypto/sha1.c:26:46: note: expression evaluates to '32 == 28'
      26 | static_assert(offsetof(struct sha1_ctx, buf) == offsetof(struct sha1_state, buffer));
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                                        ^~~~
   2 errors generated.


vim +23 crypto/sha1.c

8bc79ab67d78e2 Eric Biggers 2025-07-12  14  
b10a74abcfc5c6 Eric Biggers 2025-07-12  15  /*
b10a74abcfc5c6 Eric Biggers 2025-07-12  16   * Export and import functions.  crypto_shash wants a particular format that
b10a74abcfc5c6 Eric Biggers 2025-07-12  17   * matches that used by some legacy drivers.  It currently is the same as the
b10a74abcfc5c6 Eric Biggers 2025-07-12  18   * library SHA context, except the value in bytecount must be block-aligned and
b10a74abcfc5c6 Eric Biggers 2025-07-12  19   * the remainder must be stored in an extra u8 appended to the struct.
b10a74abcfc5c6 Eric Biggers 2025-07-12  20   */
b10a74abcfc5c6 Eric Biggers 2025-07-12  21  
b10a74abcfc5c6 Eric Biggers 2025-07-12  22  #define SHA1_SHASH_STATE_SIZE (sizeof(struct sha1_ctx) + 1)
b10a74abcfc5c6 Eric Biggers 2025-07-12 @23  static_assert(sizeof(struct sha1_ctx) == sizeof(struct sha1_state));
b10a74abcfc5c6 Eric Biggers 2025-07-12  24  static_assert(offsetof(struct sha1_ctx, state) == offsetof(struct sha1_state, state));
b10a74abcfc5c6 Eric Biggers 2025-07-12  25  static_assert(offsetof(struct sha1_ctx, bytecount) == offsetof(struct sha1_state, count));
b10a74abcfc5c6 Eric Biggers 2025-07-12 @26  static_assert(offsetof(struct sha1_ctx, buf) == offsetof(struct sha1_state, buffer));
b10a74abcfc5c6 Eric Biggers 2025-07-12  27  

:::::: The code at line 23 was first introduced by commit
:::::: b10a74abcfc5c61afc63a567c457038be57eeb6e crypto: sha1 - Use same state format as legacy drivers

:::::: TO: Eric Biggers <ebiggers@kernel.org>
:::::: CC: Eric Biggers <ebiggers@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-21  9:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-21  9:55 [ebiggers:libcrypto-pending 38/50] crypto/sha1.c:23:15: error: static assertion failed due to requirement 'sizeof(struct sha1_ctx) == sizeof(struct sha1_state)': sizeof(struct sha1_ctx) == sizeof(struct sha1_state) kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox