You could use a Boolean modifier. You'd have to take all those pieces and make them separate objects before you used it, but once you do use it, they will be stitched together in one mesh. A drawback is that it likes make a really messy mesh, but if you aren't worried about that, then you should be good.
The only other option I can think of would be to manually stitch the pieces to the gun itself one by one, which would probably be a real pain.
Out of curiosity, why do you want to stitch them all together?