Having the same source for power supply and positive input for a single-supply buffer amplifier
The op-amp can't do anything useful in this configuration. You need to give it more supply voltage than the desired output voltage, even though it's "rail to rail". 

If you ask it to output 8V or even 11V with a 12V supply, it may be able to do that, provided the load is not too much for the op-amp to supply. In this case, that might be 10mA or so. 

I don't know exactly why you're only getting 4V at the output, but I suspect it's because the load is something like a couple hundred ohms or equivalent, so the output current is limiting at 20-30mA. 

Even if you put a lighter load on there, my first comment applies- this circuit can not do anything useful without some changes (more supply voltage compared to desired output voltage).