-
Notifications
You must be signed in to change notification settings - Fork 301
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
ld: final link failed: File truncated #926
Comments
The "sibling call from callable instruction with modified stack frame" are only warning messages. See the note in the kernel documentation on those. This looks to be the real failure:
|
This is the output (warning big file): I looked a bit into the head64.o file:
CFLAGS: |
I can reproduce it with |
Does this occur when simply building a newish kernel and |
Because it is only reproducible with |
Ah, got it. FWIW, I get a slightly different build error when setting
So I guess the question is whether |
Uh, I started getting this as well yesterday (no idea what have changed in my environment) and it has nothing to do with -Os, this one is reproducible for me with just |
I've been looking at it a bit more and I have a picture of what is going on, but still have no idea who is at fault here. The difference between perf/size optimized objectfiles that breaks linking is the section alignment (sh_addralign).
ld does multiple passes, in both objectfile on first pass dot after It looks like in 4.18 this section has proper alignment even with |
No it is reproducible even on 4.15 |
This is really weird -- on older upstream kernels (v4.10, v4.11, etc.), copying RHEL-7 config + make olddefconfig + make localmodconfig and |
kpatch-build looks relay on the GCC -ffunction-sections flag. kpatch/kpatch-build/kpatch-build Line 704 in 7f550f0
using instead
it compile but i got kernel: 4.19.2 |
The answer is "targets", kpatch-build does
Yes, kpatch-build won't work without this flag as this is how we determine which functions are changed. |
posttests are triggered by bzImage target, which is added to default list as a default arch target in arch/x86/Makefile. |
So two different issues:
In both cases, these are general kernel build problems, not kpatch bugs. @sm00th , since you've been doing the detective work here, do you want to continue pursuing these upstream? Should kpatch check for (1) in kpatch-build and report that the configuration combination is not supported (yet)? |
|
The first issue seems to be a linker problem, I've managed to hack up a reproducer for it and bisect it down to a specific commit in ld, filed a bug here: https://sourceware.org/bugzilla/show_bug.cgi?id=23930
Since it is not kpatch's issue I see no reason to work around it, I think this issue is enough for those who might hit it. |
Proposed a patch for the second issue: https://lore.kernel.org/lkml/20181129135133.31369-1-asavkov@redhat.com/T/#u |
I'm getting a linker seg fault when running kpatch-build against a stock Fedora 28 kernel (4.19.8-200.fc28.x86_64)
|
Both issues should be resolved now, binutils fix is in 2.32, kernel patch is in kernels 5.2+. Is anyone willing to retest this or can we just close this issue? |
kernel: 4.19.1
kernel_config: https://gist.github.com/aliceinwire/72d090b6ff4ec8cc019882e553fbeacb
patch: https://gist.github.com/aliceinwire/9cc9d852f5a99450f035052474d85044
kpatch-build log: https://gist.github.com/aliceinwire/2a3910a958b8809b04c7baae516544c7
The text was updated successfully, but these errors were encountered: