Archive for the ‘gcc’ Category

gcc precompiled headers weird behaviour with -c option

Sunday, March 28th, 2010

Short story

Use -fpch-preprocess option alongside with -c option in order to make precompiled headers work properly.

Update: I asked the same question on the gcc help mailing list and Ian Lance Taylor explained this strange behavior by my usage of distcc/ccache. These tools first preprocess the source that’s why this options is required.

Long story

I’m using gcc-4.4.1 on Linux and before trying precompiled headers in a really large project I decided to test them on a simple program. They “kinda work” but I was not happy with results and I was sure there was something wrong about my setup.
(more…)

glibc-2.7 makecontext issues on x86_64

Monday, December 28th, 2009

Looks like passing 64 bit values(e.g pointers) into makecontext is not working properly on x86_64. We are using makecontext for coroutines implementation and its proper working is vital for us.

I’ve been struggling with this bug for a couple of days and have finally found a solution for it. Actually the solution is trivial it was the actual process of spotting this bug which took so much time. By the way, this issue was resolved in the latest releases of glibc, so nothing to worry about if you are using gcc older than 4.2.4.
(more…)