From build log, e.g. :
g++ -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DHAVE_SYS_TIME_H -DHAVE_SIGNAL_H -I/usr/local/include/fxscintilla -I/usr/local/include/fox-1.6 -I/usr/include/fox-1.6 -I/usr/include/fxscintilla -fPIC -march=native -O2 -g0 -fno-strict-aliasing -fPIC -O0 -I./include -DWITH_FXSCINTILLA -DHAVE_FOX_1_6 -c scintilla_wrap.cpp
this is c++ code, should be compiled with CXXFLAGS
from my emerge --info:
CFLAGS="-march=native -O2 -g0"
This turns out not so easy to fix because the build system collects all the -I flags in CFLAGS as well.
(In reply to comment #1)
> This turns out not so easy to fix because the build system collects all the -I
> flags in CFLAGS as well.
If you have time you can just poke upstream about it ;)
Now filed this upstream with ruby itself since fxruby pointed out that this is a consequence of how mkmf.rb handles things.
This was actually a bug in dev-lang/ruby, and it has been fixed two years ago. Our current ruby:2.0, ruby:2.1, and ruby:2.2 all have this fix. This issue was not fixed in ruby:1.9 by upstream since that version was no longer actively maintained (and it currently declared end-of-life).