I think maybe you measured the space between flange and toilet wrong.
Did you measure to the center line of the flange or the edge? That 8" doesn't sound right.
The code is at least 15" from the center line to each side, and 24" from the front of the bowl to the nearest obstruction (wall shower etc.).
The description of what you want to do w/ the piping and stack is unclear.