错误消息:
/var/tmp/portage/sys-devel/gcc-9.2.0-r2/work/gcc-9.2.0/gcc/d/runtime.cc:37:6: warning: type 'libcall_type' violates the C++ One Definition Rule [-Wodr]
37 | enum libcall_type
| ^
/var/tmp/portage/sys-devel/gcc-9.2.0-r2/work/gcc-9.2.0/gcc/rtl.h:4108:6: note: an enum with different value name is defined in another translation unit
4108 | enum libcall_type
| ^
during RTL pass: ira
/var/tmp/portage/sys-devel/gcc-9.2.0-r2/work/gcc-9.2.0/gcc/vec.h: In function 'reserve':
/var/tmp/portage/sys-devel/gcc-9.2.0-r2/work/gcc-9.2.0/gcc/vec.h:385: internal compiler error: in to_frequency, at profile-count.c:265
385 | }
|
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
make[4]: *** [/var/tmp/portage/sys-devel/gcc-9.2.0-r2/temp/ccTMcIub.mk:2: /var/tmp/portage/sys-devel/gcc-9.2.0-r2/temp/d21.v85pN6.ltrans0.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[3]: *** [/var/tmp/portage/sys-devel/gcc-9.2.0-r2/work/gcc-9.2.0/gcc/d/Make-lang.in:148: d21] Error 1
make[3]: *** Waiting for unfinished jobs....
rm gcc.pod gdc.pod gccgo.pod gfortran.pod
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-9.2.0-r2/work/build/gcc'
make[2]: *** [Makefile:4915: all-stagefeedback-gcc] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-9.2.0-r2/work/build'
make[1]: *** [Makefile:25729: stagefeedback-bubble] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-9.2.0-r2/work/build'
make: *** [Makefile:25749: profiledbootstrap] Error 2
具体功能:
int
profile_count::to_frequency (struct function *fun) const
{
if (!initialized_p ())
return BB_FREQ_MAX;
if (*this == profile_count::zero ())
return 0;
gcc_assert (REG_BR_PROB_BASE == BB_FREQ_MAX
&& fun->cfg->count_max.initialized_p ());
profile_probability prob = probability_in (fun->cfg->count_max);
if (!prob.initialized_p ())
return REG_BR_PROB_BASE;
return prob.to_reg_br_prob_base ();
}
我已经在使用 gcc 9.2 进行构建,而且我确实有一些较小的系统和内核,可能是缺少某些东西。除此之外,我想知道是否可以找到有关“内部编译器错误”问题的更好消息
答案1
这是一个 LTO+PGO 编译器错误:https://gcc.gnu.org/PR97295
Gentoo 在编译 gcc 时在 CXXFLAGS=-O3 设置上观察到类似的问题。这已经解决了https://bugs.gentoo.org/701786。