I read it on several sites that precompiled headers and address space layout randomization is incompatible. What makes them incompatible? What would it take to fix it?
My question is OS independent I heard this is a problem on linux with grsecurity and on newer windows versions. (And I don't know what else has ASLR.)
Precompiled headers are not incompatible with ASLR.
The particular technique used to implement precompiled headers that was used by older versions of the Visual C++ compiler was broken by ASLR. There is an article on the Visual C++ Team Blog with details on the problem and an explanation of how it was fixed. There is a hotpatch available for Visual C++ 2008 SP1 and the problem is not present in Visual C++ 2010.
There may have been a similar problem on Linux, I don't really know. I'm no expert on Linux, Linux security, or GCC.