Skip to content

ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC #1993

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
nathanchance opened this issue Feb 14, 2024 · 1 comment
Assignees
Labels
[ARCH] s390 This bug impacts ARCH=s390 [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 6.9 This bug was fixed in Linux 6.9 [TOOL] lld The issue is relevant to LLD linker

Comments

@nathanchance
Copy link
Member

When attempting to build ARCH=s390 defconfig with ld.lld (available after llvm/llvm-project@fe3406e) after applying the patches for #1991 and #1992, there are a series of errors due to the presence of R_390_64 relocations.

$ make -skj"$(nproc)" ARCH=s390 LLVM=1 OBJCOPY=s390x-linux-gnu-objcopy OBJDUMP=s390x-linux-gnu-objdump mrproper defconfig all
ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in vmlinux.a(init/do_mounts_initrd.o)
>>> referenced by do_mounts_initrd.c
>>>               init/do_mounts_initrd.o:(__mcount_loc+0x0) in archive vmlinux.a

ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in vmlinux.a(init/do_mounts_initrd.o)
>>> referenced by do_mounts_initrd.c
>>>               init/do_mounts_initrd.o:(__mcount_loc+0x8) in archive vmlinux.a

ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in vmlinux.a(init/do_mounts_initrd.o)
>>> referenced by do_mounts_initrd.c
>>>               init/do_mounts_initrd.o:(__mcount_loc+0x10) in archive vmlinux.a

ld.lld: error: relocation R_390_64 cannot be used against local symbol; recompile with -fPIC
>>> defined in vmlinux.a(init/do_mounts_initrd.o)
>>> referenced by do_mounts_initrd.c
>>>               init/do_mounts_initrd.o:(__mcount_loc+0x18) in archive vmlinux.a
...

Patch submitted and accepted: https://git.kernel.org/s390/c/55cce52f1cec914870a12e8e9f82659037648cb8

@nathanchance nathanchance added [BUG] linux A bug that should be fixed in the mainline kernel. [TOOL] lld The issue is relevant to LLD linker [PATCH] Accepted A submitted patch has been accepted upstream [ARCH] s390 This bug impacts ARCH=s390 labels Feb 14, 2024
@nathanchance nathanchance self-assigned this Feb 14, 2024
nathanchance added a commit to nathanchance/continuous-integration2 that referenced this issue Feb 21, 2024
…ee LLVM

With LLVM main, which has the necessary changes to ld.lld and
llvm-objcopy to support s390, and linux-next, which has the necessary
changes to the kernel to support these tools, ARCH=s390 builds cleanly
with LLVM=1. Cut builds that satisfy these conditions over to LLVM=1 so
that regressions with this working setup do not occur.

Link: llvm/llvm-project@fe3406e
Link: llvm/llvm-project@3c02cb7
Link: ClangBuiltLinux/linux#859
Link: ClangBuiltLinux/linux#1991
Link: ClangBuiltLinux/linux#1992
Link: ClangBuiltLinux/linux#1993
Link: ClangBuiltLinux/linux#1994
Link: ClangBuiltLinux/linux#1995
Link: ClangBuiltLinux/linux#1996
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [FIXED][LINUX] 6.9 This bug was fixed in Linux 6.9 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Mar 15, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
[ARCH] s390 This bug impacts ARCH=s390 [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 6.9 This bug was fixed in Linux 6.9 [TOOL] lld The issue is relevant to LLD linker
Projects
None yet
Development

No branches or pull requests

1 participant