All of lore.kernel.org
 help / color / mirror / Atom feed
* <instantiation>:2:2: error: out of range pc-relative fixup value
@ 2022-05-29  0:21 kernel test robot
  2022-05-30 11:01   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2022-05-29  0:21 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: llvm, kbuild-all, linux-kernel, Russell King (Oracle), Linus Walleij

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9d004b2f4fea97cde123e7f1939b80e77bf2e695
commit: 508074607c7b95b24f0adf633fdf606761bb7824 ARM: 9195/1: entry: avoid explicit literal loads
date:   9 days ago
config: arm-randconfig-r005-20220529 (https://download.01.org/0day-ci/archive/20220529/202205290805.1vZLAr36-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0fbe3f3f486e01448121f7931a4ca29fac1504ab)
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
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=508074607c7b95b24f0adf633fdf606761bb7824
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 508074607c7b95b24f0adf633fdf606761bb7824
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> <instantiation>:2:2: error: out of range pc-relative fixup value
    ldr tsk, =__current
    ^

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: <instantiation>:2:2: error: out of range pc-relative fixup value
  2022-05-29  0:21 <instantiation>:2:2: error: out of range pc-relative fixup value kernel test robot
@ 2022-05-30 11:01   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2022-05-30 11:01 UTC (permalink / raw)
  To: kernel test robot, Nathan Chancellor, Nick Desaulniers
  Cc: llvm, kbuild-all, Linux Kernel Mailing List,
	Russell King (Oracle),
	Linus Walleij

(cc Nathan and Nick)

On Sun, 29 May 2022 at 02:22, kernel test robot <lkp@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   9d004b2f4fea97cde123e7f1939b80e77bf2e695
> commit: 508074607c7b95b24f0adf633fdf606761bb7824 ARM: 9195/1: entry: avoid explicit literal loads
> date:   9 days ago
> config: arm-randconfig-r005-20220529 (https://download.01.org/0day-ci/archive/20220529/202205290805.1vZLAr36-lkp@intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0fbe3f3f486e01448121f7931a4ca29fac1504ab)
> 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
>         # install arm cross compiling tool for clang build
>         # apt-get install binutils-arm-linux-gnueabi
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=508074607c7b95b24f0adf633fdf606761bb7824
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 508074607c7b95b24f0adf633fdf606761bb7824
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> >> <instantiation>:2:2: error: out of range pc-relative fixup value
>     ldr tsk, =__current
>     ^
>

This log snippet is a bit terse. I managed to narrow this down to
arch/arm/kernel/entry-common.S but having a bit more context from the
build log would be useful here.

The commit in question reorganizes some variable loads from asm code
by switching to the ldr_va macro, which avoids literals in most cases,
but not when CONFIG_COMPILE_TEST=y as is the case here. (This is due
to the fact that allyesconfig produces a vmlinux image whose size
exceeds the 256 MB range of ARM group relocations used by ldr_va, and
so group relocations are not used in this case)

This means that those ldr_va macros evaluate to literal loads such as
the 'ldr tsk, =__current' reported above, and the literal pool entry
carrying the address of __current can no longer be emitted close
enough to the LDR instruction itself, due to the way those literal
loads have been slightly reshuffled by that commit.

This is easily fixed by putting a .ltorg directive in the appropriate
location (I'll send out the patch right away) but it does beg the
question whether or not we need to keep allyesconfig building, given
that it cannot actually boot on a real (or emulated) system.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: <instantiation>:2:2: error: out of range pc-relative fixup value
@ 2022-05-30 11:01   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2022-05-30 11:01 UTC (permalink / raw)
  To: kbuild-all

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

(cc Nathan and Nick)

On Sun, 29 May 2022 at 02:22, kernel test robot <lkp@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   9d004b2f4fea97cde123e7f1939b80e77bf2e695
> commit: 508074607c7b95b24f0adf633fdf606761bb7824 ARM: 9195/1: entry: avoid explicit literal loads
> date:   9 days ago
> config: arm-randconfig-r005-20220529 (https://download.01.org/0day-ci/archive/20220529/202205290805.1vZLAr36-lkp(a)intel.com/config)
> compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0fbe3f3f486e01448121f7931a4ca29fac1504ab)
> 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
>         # install arm cross compiling tool for clang build
>         # apt-get install binutils-arm-linux-gnueabi
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=508074607c7b95b24f0adf633fdf606761bb7824
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 508074607c7b95b24f0adf633fdf606761bb7824
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> >> <instantiation>:2:2: error: out of range pc-relative fixup value
>     ldr tsk, =__current
>     ^
>

This log snippet is a bit terse. I managed to narrow this down to
arch/arm/kernel/entry-common.S but having a bit more context from the
build log would be useful here.

The commit in question reorganizes some variable loads from asm code
by switching to the ldr_va macro, which avoids literals in most cases,
but not when CONFIG_COMPILE_TEST=y as is the case here. (This is due
to the fact that allyesconfig produces a vmlinux image whose size
exceeds the 256 MB range of ARM group relocations used by ldr_va, and
so group relocations are not used in this case)

This means that those ldr_va macros evaluate to literal loads such as
the 'ldr tsk, =__current' reported above, and the literal pool entry
carrying the address of __current can no longer be emitted close
enough to the LDR instruction itself, due to the way those literal
loads have been slightly reshuffled by that commit.

This is easily fixed by putting a .ltorg directive in the appropriate
location (I'll send out the patch right away) but it does beg the
question whether or not we need to keep allyesconfig building, given
that it cannot actually boot on a real (or emulated) system.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-30 11:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-29  0:21 <instantiation>:2:2: error: out of range pc-relative fixup value kernel test robot
2022-05-30 11:01 ` Ard Biesheuvel
2022-05-30 11:01   ` Ard Biesheuvel

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.