wednesday night / a site for sore eyes
choose one: a few recent posts; links to embarassing things; rss was for robots.

<< December 20, 2006 >>
time wrap

i greatly prefer working debuggers over non-working ones. at cfs, i learned a trick to get gdb to work a little better: build stuff with -O0. this was pretty simple while working on hula, since it was a single source tree, but i've had to fix a couple of nautilus bugs in the last week, and that has a huge stack, which i don't want to just build all of.

So, i set my CFLAGS in .bashrc and changed the flags in .rpmrc as well to include -O0. this way, i figure, i can still enjoy using rpms and all the downstream patches, and actually debug things in gdb.

so i built a bunch of things... gtk, nautilus, etc. and things were going well. a couple builds failed, complaining that LC_ALL was undefined. that's weird, src rpms should just build. so i made a couple of patches, but when it happened a third time, i went to check it out a little more closely.

turns out, <libintl.h> includes <locale.h> automatically... but only if optimization is on. since apparently i'm the only person who knows how to make gdb work, i'm the only one getting failed builds. that's simple enough; i'll just add a -include locale.h to my CFLAGS, and move on.

a few days go by, and something is failing to build because F_SETSIG is undefined. 30 seconds of research shows that you need to define _GNU_SOURCE to get that, but hmm the C file has that. let's see... <fcntl.h> is including <features.h>, which defines __USE_GNU if _GNU_SOURCE is defined... but still not working.

cutting to the chase, <locale.h> is pulling in <features.h> before _GNU_SOURCE is defined. that's easy, another option in CFLAGS.

but of course it's not quite that simple... now _GNU_SOURCE gets redefined in the source. oh well. i didn't really want to actually get anything done today, anyway.

* * *