[lfs-support] Invalid instruction compiling kernel

Ken Moffat zarniwhoop at ntlworld.com
Mon Aug 1 17:07:58 PDT 2016

On Mon, Aug 01, 2016 at 03:51:05PM -0700, Paul Rogers wrote:
> Ken, I thought an invalid instruction of itself was pretty clear. Either
> 1) a misconfiguration of the compiler to generate code for a CPU with
>    more instructions than a Pentium /// has, or
> 2) trying to execute arbitrary garbage.

Yes, but also no: googling suggests a number of specific matches, of
which the only one for x86 seemed to be related to x86_64 - but it
had some extra words rather than just a plain 'Invalid Instruction'.

> When I'm building a new version I follow the book, using that kernel,
> i.e. 3.19.  I always keep that around, though later I may patch up.  I
>      did patch this up to 3.19.8, i.e. not beyond the bug-fix territory,
>      and that's what I was trying to recompile.

I know you think that your firewalling, coupled with the absence of
what I regard as modern desktop applications, will keep you safe.
But you need to understand that kernels which are not long-term
stable (officially, i.e. those initially maintained by Greg K-H at
kernel.org - I distrust those maintained by ubuntu which are not
official stable kernels) are only maintained for a few weeks.  If a
vulnerability later becomes known, they will vnot get fixed.

If you are running a server, uptime is important.  For my server I
currently use 4.4 kernels (on 7.9) and I only update those
irregularly.  Once my old box is in use as a test server I'll be
able to test the things I use and therefore I will hope to update my
server for every LFS release, still using 4.4 until there is a newer
long-term supported stable version.

[ snipping, because I can't find the threads I was thinking about ]
> I've never run into configfsf scripts before.  I'll have to get back to
> you on that.

They are specific to gmp, because its devs want to optimize for the
build machine.  They also get things wrong (e.g. Skylake 'pentium'
(the lowest-end of Skylake) doesn't have an instruction they assumed
was present - and perhaps some low-end modern CPUs might lie about
what they support (I got that from a fedora bug report, no idea if
it is true).
> William, not to be argumentative--I'm still feeling my way through this,
> trying to understand--but the compiler SAYS it's compiling code for a
> PentiumPro and only 387 floating-point.  This was the original Chapter 6
> version of gcc which compiled everything else from 6.17 on.  When I
> recompiled with -march=i686 explicitly yesterday, I got no better
> result.  I do NOT dismiss doing it once more as you suggest.

> Then it must be in spite of recompiling it explicitly for a base i686
> PPro with CFLAGS=-march=i686.  If that's not explicit enough for gmp...
> But that give me a search to try.

Again, in gmp rename the configfsf files to the corresponding config

Please note that recent versions of gcc delegate some processing to
gmp.  When I talked about building kgcc to compile a kernel, I
guess that extra action might be necessary (building pass-1 gcc for
a different prefix), but I've only ever built a different gcc for
the kernel on the same machine where I use it.

P.S. - you are not in my good books, I've just overbaked the loaf I
was baking because replying to you and looking for links distracted
me for too long (it was in a Dutch Oven in my oven, to preserve
moisture, so the smell won't escape until much later).  Fortunately,
I like well-baked crusty bread, but I was hoping for something softer
on this bake so I could decide if the recipe/time/temperature seemed
ok (210°C for wholemeal rye still _sounds_ too high to me, I usually
use 150°C for much longer).

ĸen, hoping it won't break my teeth!
`I shall take my mountains', said Lu-Tze. `The climate will be good
for them.'     -- Small Gods

More information about the lfs-support mailing list