You can use the -os flag if you're using GCC to compile. You can find it here in the GCC flags page -
Optimize for size. -Os enables all -O2 optimizations that do not typically increase code size. It also performs further optimizations designed to reduce code size.
-Os disables the following optimization flags:
-falign-functions -falign-jumps -falign-loops
-falign-labels -freorder-blocks -freorder-blocks-and-partition
If you for some reason must have those flags, well, this isn't for you. In addition you're compromising performance for size
You could also use various methods of executable compression like upx, post compilation to make your executable size smaller. This is also a performance/size tradeoff (though fairly minimal), but can be used on top of whichever optimization you choose to use. The size reduction here can be rather dramatic.