Melt the butter in a large heavy saucepan and slowly brown the onions. This should take about 1 hour and the onions will become super soft and greatly reduced in quantity. Add the garlic after 45 minutes.
Stir in the flour and cook for 1 minute. Add the stock, salt and pepper then stir until boiling then simmer for 20-30 minutes.
Preheat the oven to 200 degrees C.
Mix the Gruyere with the mustard and pepper. Spread this on the bread slices and place them on the bottom of an earthenware tureen or baking dish.
Pour over the soup. The bread will rise to the top. Place in the oven until well browned and bubbling.