Re: [kbuild-all] Re: include/linux/smp.h:34:33: error: requested alignment '20' is not a positive power of 2

From: Chen, Rong A
Date: Mon Feb 14 2022 - 04:10:37 EST




On 2/14/2022 4:44 AM, Helge Deller wrote:
On 2/13/22 10:59, kernel test robot wrote:
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b81b1829e7e39f6cebdf6e4d5484eacbceda8554
commit: 5f6e0fe01b6b33894cf6f61b359ab5a6d2b7674e parisc: Fix compile failure when building 64-bit kernel natively
date: 6 months ago
config: parisc-randconfig-r004-20220213 (https://download.01.org/0day-ci/archive/20220213/202202131741.c6BPpfzd-lkp@xxxxxxxxx/config)
compiler: hppa64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f6e0fe01b6b33894cf6f61b359ab5a6d2b7674e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 5f6e0fe01b6b33894cf6f61b359ab5a6d2b7674e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc prepare

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

In file included from arch/parisc/include/asm/bitops.h:203,
from include/linux/bitops.h:32,
from include/linux/kernel.h:12,
from arch/parisc/include/asm/bug.h:5,
from include/linux/bug.h:5,
from include/linux/page-flags.h:10,
from kernel/bounds.c:10:
include/asm-generic/bitops/__fls.h: In function '__fls':
include/asm-generic/bitops/__fls.h:18:28: warning: left shift count >= width of type [-Wshift-count-overflow]
18 | if (!(word & (~0ul << 32))) {


This kind of build error usually happens if you use the 64-bit compiler
(hppa64-linux-gcc) to compile a kernel config for a 32-bit kernel.

Looking at the config:
config: parisc-randconfig-r004-20220213 (https://download.01.org/0day-ci/archive/20220213/202202131741.c6BPpfzd-lkp@xxxxxxxxx/config)
CONFIG_64BIT is set to Y, so that's correct here.

But this is how you call the compiler:
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc prepare

The "ARCH=parisc" is wrong in this case.
You need:
"ARCH=parisc64".
This is starting with Linux kernel 5.14.
Before "ARCH=parisc" worked for 32- and 64-bit kernels.

Can you adjust the call command?

Hi Helge,

Thanks for the feedback, we'll update it.

Best Regards,
Rong Chen