* ld.lld: error: relocation R_RISCV_HI20 cannot be used against symbol '.L.str.6'; recompile with -fPIC
@ 2023-09-14 6:13 kernel test robot
2023-09-14 17:41 ` Sami Tolvanen
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-09-14 6:13 UTC (permalink / raw)
To: Sami Tolvanen
Cc: llvm, oe-kbuild-all, linux-kernel, Palmer Dabbelt, Kees Cook
Hi Sami,
FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: aed8aee11130a954356200afa3f1b8753e8a9482
commit: 74f8fc31feb4b756814ec0720f48ccdc1175f774 riscv: Allow CONFIG_CFI_CLANG to be selected
date: 3 weeks ago
config: riscv-randconfig-r002-20230912 (https://download.01.org/0day-ci/archive/20230914/202309141433.6gzJPSYA-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230914/202309141433.6gzJPSYA-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/202309141433.6gzJPSYA-lkp@intel.com/
All errors (new ones prefixed by >>):
>> ld.lld: error: relocation R_RISCV_HI20 cannot be used against symbol '.L.str.6'; recompile with -fPIC
>>> defined in vmlinux.a(arch/riscv/errata/sifive/errata.o)
>>> referenced by errata.c:94 (arch/riscv/errata/sifive/errata.c:94)
>>> arch/riscv/errata/sifive/errata.o:(sifive_errata_patch_func) in archive vmlinux.a
--
>> ld.lld: error: relocation R_RISCV_LO12_I cannot be used against symbol '.L.str.6'; recompile with -fPIC
>>> defined in vmlinux.a(arch/riscv/errata/sifive/errata.o)
>>> referenced by errata.c:94 (arch/riscv/errata/sifive/errata.c:94)
>>> arch/riscv/errata/sifive/errata.o:(sifive_errata_patch_func) in archive vmlinux.a
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ld.lld: error: relocation R_RISCV_HI20 cannot be used against symbol '.L.str.6'; recompile with -fPIC
2023-09-14 6:13 ld.lld: error: relocation R_RISCV_HI20 cannot be used against symbol '.L.str.6'; recompile with -fPIC kernel test robot
@ 2023-09-14 17:41 ` Sami Tolvanen
0 siblings, 0 replies; 2+ messages in thread
From: Sami Tolvanen @ 2023-09-14 17:41 UTC (permalink / raw)
To: kernel test robot
Cc: llvm, oe-kbuild-all, linux-kernel, Palmer Dabbelt, Kees Cook
On Wed, Sep 13, 2023 at 11:14 PM kernel test robot <lkp@intel.com> wrote:
>
> Hi Sami,
>
> FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: aed8aee11130a954356200afa3f1b8753e8a9482
> commit: 74f8fc31feb4b756814ec0720f48ccdc1175f774 riscv: Allow CONFIG_CFI_CLANG to be selected
> date: 3 weeks ago
> config: riscv-randconfig-r002-20230912 (https://download.01.org/0day-ci/archive/20230914/202309141433.6gzJPSYA-lkp@intel.com/config)
> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230914/202309141433.6gzJPSYA-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/202309141433.6gzJPSYA-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> >> ld.lld: error: relocation R_RISCV_HI20 cannot be used against symbol '.L.str.6'; recompile with -fPIC
> >>> defined in vmlinux.a(arch/riscv/errata/sifive/errata.o)
> >>> referenced by errata.c:94 (arch/riscv/errata/sifive/errata.c:94)
> >>> arch/riscv/errata/sifive/errata.o:(sifive_errata_patch_func) in archive vmlinux.a
> --
> >> ld.lld: error: relocation R_RISCV_LO12_I cannot be used against symbol '.L.str.6'; recompile with -fPIC
> >>> defined in vmlinux.a(arch/riscv/errata/sifive/errata.o)
> >>> referenced by errata.c:94 (arch/riscv/errata/sifive/errata.c:94)
> >>> arch/riscv/errata/sifive/errata.o:(sifive_errata_patch_func) in archive vmlinux.a
This randconfig builds a fairly large 64-bit kernel with
CONFIG_CMODEL_MEDLOW=y. Switching to CMODEL_MEDANY fixed the linker
error for me, although the laterr BTFIDS step still fails:
BTFIDS vmlinux
WARN: resolve_btfids: unresolved symbol bpf_cpumask
FAILED elf_update(WRITE): no error
make[3]: *** [../scripts/Makefile.vmlinux:36: vmlinux] Error 255
64-bit defconfig with CFI+CMODEL_MEDLOW works just fine and I can also
reproduce the linker errors by building allyesconfig+CMODEL_MEDLOW
without CFI, for example, so I assume the build failure with this
config is expected. Is there anything we should do here?
Sami
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-14 17:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-14 6:13 ld.lld: error: relocation R_RISCV_HI20 cannot be used against symbol '.L.str.6'; recompile with -fPIC kernel test robot
2023-09-14 17:41 ` Sami Tolvanen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox