Greg Steuck <[email protected]> wrote: > Matthias Kilian <[email protected]> writes: > > > still slacking around like hell, but I guess we need a new bootstrap > > for lang/ghc. If so, I'll try to enable USE_NOBTCFI, build a new > > bootstrap with it, and then use that for building the regular ghc > > package. > > Yeah, sounds about right. I have no illusions about GHC ever supporting > IBT considering their compilation model.
Why not? Intel and ARM with IBT/BTI have confused the public. Branch Target generally means "function entry point". A compiler just needs to put IBT instructions at every calculated branch target, ie. the start of every function that is reached by "calculating" the address. Popping the address off the stack, with a RET, is not considered "calculating". If they end up putting the instructions at non-calculated branch targets, that's OK too. A compiler could generate code that has endbr64 as every 2nd instruction, and it would still work. It would be non-optimal, and silly. But it would work. My point is there is nothing wrong with a compiler that inperfectly places a few endbr64 that are not absolutely required. So I think GHC could do easily adapt to a IBT world.
