You receive this bug because this package does not respect my '-O' system's CFLAGS x86_64-pc-linux-gnu-gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DJSON_GENERATOR -fPIC -march=native -O3 -g0 -pipe -fno-strict-aliasing -fPIC -Wall -O0 -ggdb -c generator.c Please also drop -ggdb
Also note that it looks like the following line ext/json/ext/parser/extconf.rb:unless $CFLAGS.gsub!(/ -O[\dsz]?/, ' -O3') gives stange result when used with -Ofast (it results in -O3fast, which prevents compilation with error cc1: error: invalid option argument ‘-O3fast’)
Fixed in json 1.7.7-r1. I've dropped all the CFLAGS hoopla except -Wall.