Backported from trunk (rev #9927):
make sure that DEFS is not inherited between executions