Question about equipment

I'm working towards gearing up my characters and I'm questioning myself about something.

When you get a second class you can equip weapons from both classes. So for example I have a scholar/merchant. I can equip the magus glaive which increases elem atk but I can also equip the staff of wonders which also increases elem atk. My question is do they stack no matter what abilities I'm using from both classes or does the glaive only affect merchant abilities and the staff only scholar abilities?

Thanks for your help.