ERROR:××× cc1plus: all warnings being treated as errors ×××
运行时的gcc配置问题
方法一: 修改./hotspot/make/[you_os]/makefiles/gcc.make
修改配置文件./hotspot/make/linux/makefiles/gcc.make
,其中linux
是当前系统
jdk1.7在127行,jdk1.8在207行,找到WARNINGS_ARE_ERRORS
变量
将其 注释 或改为
WARNINGS_ARE_ERRORS = -Wno-error
或者
WARNINGS_ARE_ERRORS = -Wno-all
参考Ubuntu 14.04 LTS 下编译OpenJDK 8
方法二: 运行脚本中添加环境变量
export CFLAGS="-Wno-error"
export CXXFLAGS="-Wno-error"
然后再添加参数--with-extra-cflags --with-extra-cxxflags
bash ./configure --with-extra-cflags --with-extra-cxxflags --with-boot-jdk=/usr/lib/jvm/java-8-openjdk-amd64/ --enable-debug
若文章所述有错误,万分感谢各位指出