I don't think you'd be ok federal law wise to build a pistol from a rifle, unless the barrel is 16 inches or longer... shorter than that and it would be considered a SBR and subject to the NFA tax and ream...
same thing if you add a stock to a standard pistol, without adding barrel length... it's a SBR...
I think this has to do with the reciever when manufactured.