-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't create dynamic relocation R_PPC64_ADDR64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output #811
Comments
Thanks for the report (ignoring the section mismatches as we have bugs filed for some of them). What config and command did you use for us to reproduce? |
Nick, The kernel is based on today's Torvalds's master branch and the build is executed:
Note that I am on a Minskey node thus building the kernel natively with trunk Clang. |
Is this specific to the architecture, or LLD's issue? |
That seems like an LLD issue. There are many different types of relocations which are architecture specific, as specified by their ABI. They have a number to identify the type, in this case I assume (or this implies) PPC contributors to LLVM are not testing w/ LLD. |
I've filed https://llvm.org/pr44315 upstream. |
Thanks Nick! Hope PPC folks will address this soon.
…On Tue, Dec 17, 2019 at 2:17 Nick Desaulniers ***@***.***> wrote:
I've filed https://llvm.org/pr44315 upstream.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#811?email_source=notifications&email_token=AAHLBZZKH7B22E5C6NJQPUTQY6Z2LA5CNFSM4J2HIJ62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG7NWNA#issuecomment-566156084>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHLBZZJ2DLI26Z4M3A3IB3QY6Z2LANCNFSM4J2HIJ6Q>
.
|
Duplicate of #640 Fixed by https://reviews.llvm.org/rL369184 (I think this change is included in lld 9.0.0)
|
powerpc is also good.
|
I was taking about the native build case.
…On Sat, Dec 21, 2019 at 4:09 Fangrui Song ***@***.***> wrote:
powerpc is also good.
apt install u-boot-tools
make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-
CC=~/llvm/Release/bin/clang LD=~/llvm/Release/bin/ld.lld O=out/powerpc
zImage -j 30
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#811?email_source=notifications&email_token=AAHLBZ6A6SC7RGNMB2LECNLQZUJ7TA5CNFSM4J2HIJ62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHN3YDY#issuecomment-568048655>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHLBZ6TDES5RJDYEVK2OVTQZUJ7TANCNFSM4J2HIJ6Q>
.
|
|
@MaskRay could you repeat what you've done on Power? |
I am happy to provide the .config I used, but don't know how I can upload it. |
I believe you can just drag-and-drop your config to github comment if you add |
Can someone try to build the kernel with trunk Clang on POWER8 hardware, if the hardware matters? |
reproduces the errors reported above. |
Thanks Nathan for doing the cross compile test!
…On Sun, Dec 22, 2019 at 14:06 Nathan Chancellor ***@***.***> wrote:
$ make -j$(nproc) -s ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-gnu- CC=clang LD=ld.lld O=out.powerpc64le distclean ppc64le_defconfig zImage.epapr
reproduces the errors reported above.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#811?email_source=notifications&email_token=AAHLBZYVRLRZAAAXJX7LUKTQZ3YWRA5CNFSM4J2HIJ62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHPIZWA#issuecomment-568233176>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHLBZ5OEJEVB5IAXN7HYZDQZ3YWRANCNFSM4J2HIJ6Q>
.
|
I am able to reproduce with
(a) For a
(b) R_PPC64_ADDR64 in __mcount_loc sections.
This section is generated by % grep PPC64 scripts/recordmcount.c
case EM_PPC64: reltype = R_PPC64_ADDR64; break; Can anyone recommend some qemu-system-ppc64le command line? This patch works for me. --- i/arch/powerpc/Makefile
+++ w/arch/powerpc/Makefile
@@ -122,7 +122,7 @@ cflags-$(CONFIG_STACKPROTECTOR) += -mstack-protector-guard-reg=r2
endif
LDFLAGS_vmlinux-y := -Bstatic
-LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie
+LDFLAGS_vmlinux-$(CONFIG_RELOCATABLE) := -pie -z notext
LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y)
LDFLAGS_vmlinux += $(call ld-option,--orphan-handling=warn) |
Our CI has this one: https://travis-ci.com/ClangBuiltLinux/continuous-integration/jobs/267861149#L2761 Not sure if it will work because it is a generic ppc64le kernel, rather than powernv_defconfig. |
D71819 was committed to address problem 1 as I described above. It looks like it is difficult to get rid of text relocations, I will figure out the if condition with the narrowest scope that |
@MaskRay let us know when we can start testing the trunk on POWER8! |
@MaskRay doubling back to this because I am writing a mini test framework for us and I ran into this. I tested your |
I get as of today's linux master:
|
Are there any updates on this bug? The |
@nathanchance can you attach GDB and see where the kernel is? |
Yeah I can try to double back around to that on Thursday or Friday (my two days off this week). |
Well that was a lie... but hey, better late than never :)
Seems like we should send along @MaskRay 's patch and maybe mark |
From |
reported again here: https://gitlab.com/cki-project/pipeline-definition/-/merge_requests/1085 |
Do you know if there is a patch to fix this? Are the PPC folks aware of this? |
@paulmenzel Fangrui's diff above along with a recent version of clang should work. I do not think we have followed up with any of the PowerPC folks but it is probably worth involving them at this point. |
@MaskRay can you please send your above diff to LKML for review? Will we need to gate something on llvm/llvm-project@2fc704a? (ie. lld-12) |
Thank you. With that Makefile change,
Let’s see, if @MaskRay responds and is able to send the patch. |
Linux’ PPC maintainer Michael Ellerman replied to my message asking if the proposed fix was acceptable:
@MaskRay, could you do that? (Or write a summary, and I contact them with you in cc.) |
Here's what I applied to our local branch:
Basically, it's making explicit what binutils does implicitly. |
Didn't @mpe already accept |
Also @gwelymernans please strip off the google specific commit message tags, and send that upstream and cc @paulmenzel (you can run In future, @paulmenzel please please please cc clang-built-linux@googlegroups.com on questions related to LLVM. It's in the MAINTAINERS file and clangbuiltlinux.github.io if you forget. |
If binutils is configured with |
Done. |
@gwelymernans, thank you for sending the patch for review. (I am not part of cc:, but it’s fine, as besides |
The text was updated successfully, but these errors were encountered: