Shrinking the kernel with link-time optimization
Shrinking the kernel with link-time optimization
Posted Jan 25, 2018 12:58 UTC (Thu) by mirabilos (subscriber, #84359)In reply to: Shrinking the kernel with link-time optimization by ncm
Parent article: Shrinking the kernel with link-time optimization
Look up my contributions, if you so desire… if you find them all, I know I personally *don’t* even know all places I’ve had my fingers in over the last decades.
It’s just, compilers isn’t what I do well. I’ve patched bootloaders, I’ve got fixes in all Linux libcs except musl (dalias does a great enough job for me to not find any bugs in musl so far), and I’ve been doing tons of other work, and I’m even now expanding to other stuff.
There’s just not enough hours in a day, considering I have a regular, boring $dayjob. Do you wish to sponsor me for a year so I can take a sabbatical and work only on OSS?
      Posted Jan 26, 2018 22:20 UTC (Fri)
                               by giraffedata (guest, #1954)
                              [Link] (3 responses)
       
ncm didn't say you don't contribute enough.  He said at most that it would be preferable for you to fix GCC (repeatedly, apparently) than to complain that it keeps breaking. (And that's not saying you should fix GCC).
 
And even that is based on some reading between the lines about the moral value of demanding versus contributing, and the idea that complaining about something is demanding that someone fix it.  I don't view complaining that way; for example, I complain about the weather all the time without meaning to criticize anyone or demand that someone fix it.  I complain about the presence of ads on Youtube the same way.
      
           
     
    
      Posted Jan 26, 2018 22:46 UTC (Fri)
                               by mirabilos (subscriber, #84359)
                              [Link] (2 responses)
       
I actually find the idea of using LTO to eliminate dead code, in the 
① I read “low-hanging fruits” in an LWN article today. One of these, 
Now, with both the footnote #1 and the first paragraph, let’s get to 
$ mksh -c 'typeset -i x=2; y=$((1 ? 20 : x+=2))' 
Basically, ?: binds more than +=, so this is '(1 ? 20 : x) += 2', 
GCC developers prefer isolated small test cases. Now, with LTO, 
On the other hand, a change in testsuite output between two different 
Oh, and: the Linux kernel does not have such a testsuite. Several GNU 
Food for thought? 
     
    
      Posted Feb 8, 2018 10:49 UTC (Thu)
                               by dharding (subscriber, #6509)
                              [Link] (1 responses)
       
     
    
      Posted Feb 8, 2018 20:03 UTC (Thu)
                               by mirabilos (subscriber, #84359)
                              [Link] 
       
And, yes, sorry, I don’t have even the beginning of an answer for you, 
     
    Shrinking the kernel with link-time optimization
      Shrinking the kernel with link-time optimization
      
GCC developers seem to be disinterested in LTO bugs, and for its antecessor
(-fwhole-program --combine) they outright said it won’t get fixed.
Linux kernel or elsewhere, great — I just wanted to point out that GCC
might, with its current bugs, history of bugs, and history of attitude
towards said bugs¹, be a tad too unreliable to do so without excessive
tests that point out miscompiled builds.
  for the GCC/LTO problem, would be to make building mksh part of the
  usual pre-release tests; mksh has a history of spotting compiler,
  toolchain, libc, etc. bugs via its testsuite.
something: isolating the issue is *hard*. The mksh testsuite is a
bunch of shell scripts together with flags and expected output, with
a Perl driver, ran through the shell compiled with the to-be-tested
compiler/toolchain/libc. That’s a few levels of indirection. The latest
LTO bug occurs in only one testcase: arith-ternary-prec-1, which is:
mksh: 1 ? 20 : x+=2: += requires lvalue
and a miscompiled shell silently accepts this. This is *very* hard
to isolate.
isolating gets even more complicated. I can accept that not having
a small isolated test case is not desirable.
versions of the same compiler, ceteris paribus (i.e. you try the same
version of the testsuite, shell, toolchain, libc, …), *does* indicate
a problem (not necessarily in the compiler, but it’s a prime suspect),
and in the time of “git bisect” it’s at least often possible, for someone
with enough beefy hardware to actually build GCC that often, to figure
out which compiler change introduced the breakage. (Then, it’s still a
matter of deciding whether the bug is actually in the compiler or else‐
where, but the GCC developers at least know their compiler, and each
other on the development team.)
distributions’ mksh package maintainers have come to me, independently,
with a testsuite failure report about the above test, and the advice
found after the first analysis (LTO is at fault, GCC miscompiled mksh)
made them compile mksh without LTO, preventing their users from getting
a faulty binary that might misbehave in other situations as well. Now,
the Linux kernel, not so much.
Shrinking the kernel with link-time optimization
      
Shrinking the kernel with link-time optimization
      
but someone with enough horsepower machine could certainly bisect this
between GCC 5 and 6 I think…
           