In a pan, heat the butter and olive oil over a medium-high heat. Add the onions and cook for 10-12 minutes until they are softened and beginning to brown. Add the garlic, sugar and thyme and continue cooking over a medium heat for 30-35 minutes, stirring frequently. Sprinkle over the flour and stir until well blended. Stir in the stock and bring to boil. Skim off any foam that rises to the surface, then reduce heat and simmer gently for 45 minutes. Preheat grill, rub both sides of toasted French loaf with a garlic clove. Place soup bowls on a baking sheet and ¾ fill with soup. Float a piece of toast in each bowl and top with grated cheese. Grill until cheese has melted and serve.