How Do Acid and Base Loving Plants Get Enough PO4?
Fixation of phosphorous occurs when the chemical equations tip in favour of less soluble compounds. Plants are able to absorb Orthophosphate ions, such as H2PO4- and HPO42-.

Orthophosphate is most available to plants at pH values near neutrality. It is believed that in relatively acidic soils, orthophosphate ions are precipitated or sorbed by species of Al(III) and Fe(III). In alkaline soils, orthophosphate may react with calcium carbonate to form relatively insoluble hydroxyapatite:

3HPO42- + 5CaCo3(s) + 2H2O -> Ca5(PO4)3(OH)(s) +5HCO3- + OH-

Environmental Chemistry, Seventh Edition -Stanley E. Manahan
This does tend to make it more difficult for plants to obtain their phosphorous when it is stuck to something that they cannot absorb, but it is not hopeless. These equations are equilibria, so they can be made to go both directions by adding or removing reagents from each side.

The plants will pull from the left side of the equations by removing the orthophosphate ions. More will be released to maintain the equilibrium.
In acidic or basic environments, rainwater will serve as a base or acid to push the equations from the right.
Decaying organic matter releases orthophosphates that the plant can absorb.

In this way, plants living in acidic or basic environments would still obtain enough phosphorous.