[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cbb51942-1613-2d11-40bf-b2f5354c4eb1@intel.com>
Date: Tue, 23 Mar 2021 17:35:21 +0800
From: Rong Chen <rong.a.chen@...el.com>
To: Marc Kleine-Budde <mkl@...gutronix.de>,
Oliver Hartkopp <socketcan@...tkopp.net>
Cc: Patrick Menschel <menschel.p@...teo.de>,
kernel test robot <lkp@...el.com>, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org, linux-can <linux-can@...r.kernel.org>
Subject: Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error:
call to '__compiletime_assert_536' declared with attribute error:
BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(struct
canfd_frame, len) || offsetof(struct can_frame, data) != offsetof(struc...
On 3/23/21 4:59 PM, Rong Chen wrote:
>
>
> On 3/23/21 4:54 PM, Marc Kleine-Budde wrote:
>> On 23.03.2021 09:32:10, Oliver Hartkopp wrote:
>>> I wonder if the compiler configurations (gcc -v) or the options used at
>>> kernel build time are identical.
>> I tested several compilers and with my .config never triggered a
>> problem, but with Rong Chen it does. I'm trying to figure out which
>> option it is, stay tuned.
>>
>> Marc
>>
>
> Hi Marc, Oliver,
>
> We use the below cross compiler:
>
> https://download.01.org/0day-ci/cross-package/gcc-9.3.0-nolibc/x86_64-gcc-9.3.0-nolibc_arm-linux-gnueabi.tar.xz
>
>
> and here is the detail:
>
> $
> /home/nfs/0day/gcc-9.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc
> -v
> Using built-in specs.
> COLLECT_GCC=/home/nfs/0day/gcc-9.3.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc
>
> COLLECT_LTO_WRAPPER=/home/nfs/0day/gcc-9.3.0-nolibc/arm-linux-gnueabi/bin/../libexec/gcc/arm-linux-gnueabi/9.3.0/lto-wrapper
>
> Target: arm-linux-gnueabi
> Configured with: /tmp/build-crosstools-xh/gcc/gcc-9.3.0/configure
> --target=arm-linux-gnueabi --enable-targets=all
> --prefix=/tmp/build-crosstools-xh/cross --enable-languages=c
> --without-headers --disable-bootstrap --disable-nls --disable-threads
> --disable-shared --disable-libmudflap --disable-libssp
> --disable-libgomp --disable-decimal-float --disable-libquadmath
> --disable-libatomic --disable-libcc1 --disable-libmpx
> --enable-checking=release
> Thread model: single
> gcc version 9.3.0 (GCC)
>
> Best Regards,
> Rong Chen
>
There is a 3-party cross compiler can reproduce it:
http://cdn.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/x86_64-gcc-10.1.0-nolibc-arm-linux-gnueabi.tar.xz
$
/home/nfs/0day/gcc-10.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc
-v
Using built-in specs.
COLLECT_GCC=/home/nfs/0day/gcc-10.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/nfs/0day/gcc-10.1.0-nolibc/arm-linux-gnueabi/bin/../libexec/gcc/arm-linux-gnueabi/10.1.0/lto-wrapper
Target: arm-linux-gnueabi
Configured with: /home/arnd/git/gcc/configure --target=arm-linux-gnueabi
--enable-targets=all
--prefix=/home/arnd/cross/x86_64/gcc-10.1.0-nolibc/arm-linux-gnueabi
--enable-languages=c --without-headers --disable-bootstrap --disable-nls
--disable-threads --disable-shared --disable-libmudflap --disable-libssp
--disable-libgomp --disable-decimal-float --disable-libquadmath
--disable-libatomic --disable-libcc1 --disable-libmpx
--enable-checking=release
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.1.0 (GCC)
I reproduce with the below command and the config file is attached.
$ make
CROSS_COMPILE=/home/nfs/0day/gcc-10.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-
--jobs=16 ARCH=arm vmlinux
CALL scripts/atomic/check-atomics.sh
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC net/can/af_can.o
In file included from <command-line>:
net/can/af_can.c: In function 'can_init':
././include/linux/compiler_types.h:315:38: error: call to
'__compiletime_assert_511' declared with attribute error: BUILD_BUG_ON
failed: offsetof(struct can_frame, len) != offsetof(struct canfd_frame,
len) || offsetof(struct can_frame, data) != offsetof(struct canfd_frame,
data)
315 | _compiletime_assert(condition, msg, __compiletime_assert_,
__COUNTER__)
| ^
././include/linux/compiler_types.h:296:4: note: in definition of macro
'__compiletime_assert'
296 | prefix ## suffix(); \
| ^~~~~~
././include/linux/compiler_types.h:315:2: note: in expansion of macro
'_compiletime_assert'
315 | _compiletime_assert(condition, msg, __compiletime_assert_,
__COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro
'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond),
msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:50:2: note: in expansion of macro
'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
net/can/af_can.c:891:2: note: in expansion of macro 'BUILD_BUG_ON'
891 | BUILD_BUG_ON(offsetof(struct can_frame, len) !=
| ^~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:283: net/can/af_can.o] Error 1
make[1]: *** [scripts/Makefile.build:500: net/can] Error 2
make: *** [Makefile:1799: net] Error 2
make: *** Waiting for unfinished jobs....
Best Regards,
Rong Chen
View attachment "config" of type "text/plain" (156421 bytes)
Powered by blists - more mailing lists