Put one of those pistol bayonets on the Glock, you're good to go!
Unlike an underbarrel mounted shotgun that you'd use mainly for specialty rounds like door breachers, I don't get the point... If my AR works and still has ammo, the Glock is pointless. If my AR doesn't work or is out of ammo, I want my sidearm by itself, having an AR on top of it would only get in the way.