patches from Kamal Mostafa <kamal@whence.com> for rules and gcc 4.6.3 issues