Hi Nicolas,
On 18-12-2015 19:04, Nicolas Pitre wrote:
Hello toolchain gurus,
In the course of Linaro's kernel tinification project, the ability to compile the Linux kernel using LTO is a frequent requirement. However the kernel makes heavy usage of 'ld -r' with .o files resulting from LTO build of .c files as well as .o files resulting from pure assembly code.
This mix of LTO and non-LTO object files is not supported by upstream binutils unless a patch from H.J. Lu is applied. That patch has been available since 2013 and was last refreshed in his 2.25.51.0.4 branch last September. It is accessible here:
https://git.linaro.org/toolchain/binutils-gdb.git/commit/6da5456971
I've attached a very simple test case demonstrating the problem. With the binutils-lto-mixed.patch applied, this test case compiles to a working executable. Otherwise compilation fails at the 'ld -r' step.
One question and one request:
- What, if anything, has prevented this patch from being merged in the master branch upstream?
I am trying to find the original thread, if any, where H.J. Lu sent the initial patch to figure out why exactly it has not been already merged upstream.
However based on past iterations with GNU projects it can be due some reasons:
1. Limited review from code maintainers which do not cover full patch; 2. Lack of code review follow up from developers based on initial comments; 3. Some missing functionality or inherent design flaw. Sometimes it is something that only appear in a distinct configuration or platform.
- In the mean time, could we include this patch in the Linaro binutils package and releases?
And I enumerate the possible reasons to mainly discuss if it would be worthwhile to include it on linaro binutils branch. It is a large patch (it even adds a new elf special section), it has not been extensively tested in same way as the releases branches (does any distro include this patchset?), and based on ChangeLog it seems only H.J. Lu has been working on this (which in turn only he fully understand it).
I am not against integrate this patch in our release, however I would strongly prefer to have it merged first to avoid future update/rebase conflicts. If it is not a current option or if the time-frame won't allow I would like to understand what is preventing it to be included in master to check if the any issues with this patchset.
Maybe we can contact H.J. Lu to check what is preventing him to merge this branch and work to help him on this path.
Having this available in our toolchain releases would greatly simplify the LTO related work on the kernel. It was included in all binutils releases from H.J. Lu since 2013 and therefore has obtained significant exposure already.
Thanks.
Nicolas
linaro-toolchain mailing list linaro-toolchain@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-toolchain