I called Wizards of the Coast for an official answer, which I’ll summarize.
How Great Weapon Fighting works is that it lets the player who has the GWF fighting style and is using a melee weapon two-handed can reroll all of the damage associated with that weapon.
For example, some weapons that fall under this category are a greatsword or maul, flame tongue, frost brand, vorpal sword, and the sentient weapon Hazirawn from the Hoard of the Dragon Queen adventure. Even the extra damage coming from those weapons can be rerolled as per the Great Weapon Fighting fighting style.
The spells that also allow for this effect are elemental weapon and holy weapon. Specifically because they turn the weapon into a magical weapon that does additional weapon damage.
However, while all of these weapons and spells allow rerolls, what doesn’t allow rerolls are literally whatever isn’t coming from the weapon. Divine Smite, the half orc’s Brutal Critical trait (boo, I know, but I don’t think anyone really cares about that one), the rogue’s Sneak Attack feature, the hex spell, and the hunter’s mark spell are all features that have been under debate, and all of them don’t allow rerolls by the rules.
However, having said all of that, I stress that while at a table, the DM has the ultimate authority to allow or not allow this or that rule into the game. Hope I helped clarify how the rules worked to a degree.