Fix compiler invocation for GHC >= 7.8
Fix compiler invocation for GHC >= 7.8

GHC 7.8 switched to dynamic linking being used for ghci, which requires
that .so file are being built for modules that are loaded for TH.

For this reason, GHC >= 7.8 has a -dynamic-too flag, which we now use.

However, -dynamic-too must not be enabled for profiling builds,
which is why this commit introduces a HFLAGS_NOPROF variable
(currently only containing -dynamic-too) that must be passed to
all GHC invocations that are not creating profiling output.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

Cherry-picked-from: 083776b
Signed-off-by: Klaus Aehlig <4ce51de36d9068cd7db2eec1151e0f3f95419008@google.com>
Reviewed-by: Petr Pudlak <9d19625f8ee825a2c398462ed335cbcf98f79c32@google.com>

grnet/snf-ganeti,onponomarev/ganeti,mbakke/ganeti,yiannist/ganeti,leshchevds/ganeti,yiannist/ganeti,andir/ganeti,ganeti/ganeti,bitemyapp/ganeti,ganeti/ganeti,mbakke/ganeti,ganeti/ganeti,mbakke/ganeti,leshchevds/ganeti,onponomarev/ganeti,bitemyapp/ganeti,yiannist/ganeti,grnet/snf-ganeti,andir/ganeti,leshchevds/ganeti,andir/ganeti